mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 04:27:12 +02:00
LibUnicode: Do not set day period format length for {ampm} segments
TR-35 does define lengths for {ampm}, but they are unused by ECMA-402.
To the contrary, defining the day_period length for this segment will
prevent BasicFormatMatcher from ever selecting a pattern that contains
this segment. Instead, ECMA-402 will only use the short length for
{ampm} segments.
This commit is contained in:
committed by
Linus Groh
parent
78252d7777
commit
80ea6e664d
Notes:
sideshowbarker
2024-07-17 23:05:31 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/80ea6e664d3 Pull-request: https://github.com/SerenityOS/serenity/pull/11184
@@ -368,13 +368,6 @@ static Optional<CalendarPatternIndexType> parse_date_time_pattern(String pattern
|
||||
else if (all_of(segment, is_any_of("ab"sv))) {
|
||||
builder.append("{ampm}");
|
||||
hour12 = true;
|
||||
|
||||
if (segment.length() == 4)
|
||||
format.day_period = CalendarPatternStyle::Long;
|
||||
else if (segment.length() == 5)
|
||||
format.day_period = CalendarPatternStyle::Narrow;
|
||||
else
|
||||
format.day_period = CalendarPatternStyle::Short;
|
||||
} else if (all_of(segment, is_char('B'))) {
|
||||
builder.append("{dayPeriod}");
|
||||
hour12 = true;
|
||||
|
||||
Reference in New Issue
Block a user