diff --git a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateDateTimeFormatData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateDateTimeFormatData.cpp index 9eb5fb687a..8481023696 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateDateTimeFormatData.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateDateTimeFormatData.cpp @@ -575,9 +575,9 @@ static ErrorOr parse_hour_cycles(DeprecatedString core_path, CLDR& cldr) auto const& time_data_object = supplemental_object.get_object("timeData"sv).value(); auto parse_hour_cycle = [](StringView hour_cycle) -> Optional { - if (hour_cycle == "h"sv) + if (hour_cycle.is_one_of("h"sv, "hb"sv, "hB"sv)) return Locale::HourCycle::H12; - if (hour_cycle == "H"sv) + if (hour_cycle.is_one_of("H"sv, "Hb"sv, "HB"sv)) return Locale::HourCycle::H23; if (hour_cycle == "K"sv) return Locale::HourCycle::H11; diff --git a/Userland/Libraries/LibJS/Tests/builtins/Intl/DateTimeFormat/DateTimeFormat.prototype.resolvedOptions.js b/Userland/Libraries/LibJS/Tests/builtins/Intl/DateTimeFormat/DateTimeFormat.prototype.resolvedOptions.js index 68b8136552..d17b5592b4 100644 --- a/Userland/Libraries/LibJS/Tests/builtins/Intl/DateTimeFormat/DateTimeFormat.prototype.resolvedOptions.js +++ b/Userland/Libraries/LibJS/Tests/builtins/Intl/DateTimeFormat/DateTimeFormat.prototype.resolvedOptions.js @@ -109,6 +109,18 @@ describe("correct behavior", () => { const ja3 = Intl.DateTimeFormat("ja", { hour: "numeric", hour12: false }); expect(ja3.resolvedOptions().hourCycle).toBe("h23"); expect(ja3.resolvedOptions().hour12).toBeFalse(); + + const fr1 = Intl.DateTimeFormat("fr", { hour: "numeric" }); + expect(fr1.resolvedOptions().hourCycle).toBe("h23"); + expect(fr1.resolvedOptions().hour12).toBeFalse(); + + const fr2 = Intl.DateTimeFormat("fr", { hour: "numeric", hour12: true }); + expect(fr2.resolvedOptions().hourCycle).toBe("h12"); + expect(fr2.resolvedOptions().hour12).toBeTrue(); + + const fr3 = Intl.DateTimeFormat("fr", { hour: "numeric", hour12: false }); + expect(fr3.resolvedOptions().hourCycle).toBe("h23"); + expect(fr3.resolvedOptions().hour12).toBeFalse(); }); test("timeZone", () => {