mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 21:12:08 +02:00
LibJS+LibUnicode: Generate a set of default DateTimeFormat patterns
This isn't called out in TR-35, but before ICU even looks at CLDR data, it adds a hard-coded set of default patterns to each locale's calendar. It has done this since 2006 when its DateTimeFormat feature was first created. Several test262 tests depend on this, which under ECMA-402, falls into "implementation defined" behavior. For compatibility, we can do the same in LibUnicode.
This commit is contained in:
committed by
Linus Groh
parent
8150d71821
commit
ae2acc8cdf
Notes:
sideshowbarker
2024-07-17 08:38:23 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/ae2acc8cdf Pull-request: https://github.com/SerenityOS/serenity/pull/14655 Reviewed-by: https://github.com/linusg ✅
@@ -431,7 +431,7 @@ Optional<Unicode::CalendarPattern> basic_format_matcher(Unicode::CalendarPattern
|
||||
best_format->for_each_calendar_field_zipped_with(options, [&](auto& best_format_field, auto const& option_field, auto field_type) {
|
||||
switch (field_type) {
|
||||
case Unicode::CalendarPattern::Field::FractionalSecondDigits:
|
||||
if (best_format->second.has_value() && option_field.has_value())
|
||||
if ((best_format_field.has_value() || best_format->second.has_value()) && option_field.has_value())
|
||||
best_format_field = option_field;
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user