diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp index cff3f7cde4..08f77486ea 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp @@ -322,8 +322,13 @@ ThrowCompletionOr initialize_date_time_format(GlobalObject& glo // f. If dateTimeformat.[[HourCycle]] is "h11" or "h12", then if ((hour_cycle == Unicode::HourCycle::H11) || (hour_cycle == Unicode::HourCycle::H12)) { // i. Let pattern be bestFormat.[[pattern12]]. - if (best_format->pattern12.has_value()) + if (best_format->pattern12.has_value()) { pattern = best_format->pattern12.release_value(); + } else { + // Non-standard, LibUnicode only provides [[pattern12]] when [[pattern]] has a day + // period. Other implementations provide [[pattern12]] as a copy of [[pattern]]. + pattern = move(best_format->pattern); + } // ii. Let rangePatterns be bestFormat.[[rangePatterns12]]. }