1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

LibJS: Do not override hour, minute, and second format field lengths

This was an oversight in e42d954743.

These fields should always follow the locale preference in the CLDR.
Overriding these fields would permit formats like "h:mm:ss" to result in
strings like "1:2:3" instead of "1:02:03".
This commit is contained in:
Timothy Flynn 2021-12-07 08:45:55 -05:00 committed by Linus Groh
parent 9f7c727720
commit 26f9666191
2 changed files with 7 additions and 2 deletions

View file

@ -666,6 +666,11 @@ Optional<Unicode::CalendarPattern> basic_format_matcher(Unicode::CalendarPattern
best_format_field = option_field;
break;
case Unicode::CalendarPattern::Field::Hour:
case Unicode::CalendarPattern::Field::Minute:
case Unicode::CalendarPattern::Field::Second:
break;
default:
if (best_format_field.has_value() && option_field.has_value())
best_format_field = option_field;