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:
Timothy Flynn 2021-12-06 12:09:39 -05:00 committed by Linus Groh
parent 78252d7777
commit 80ea6e664d

View file

@ -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;