Selaa lähdekoodia

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.
Timothy Flynn 3 vuotta sitten
vanhempi
commit
80ea6e664d

+ 0 - 7
Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp

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