-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
None
-
None
-
generic
-
generic
on es_US locale:
dayPeriod value with abbreviated type fallback incorrect. For example: the input data is: testYear = "1996";testMonth = "2";testDay = "8";testHour = "11";testMinute = "45";testSecond = "8";
Test LocalDateTime with Short format. There is no abbreviated dayPeriod type in es_US.xml file, so should fallback to es_419.xml as CLDR defined and get the result 'a.m.', but actually Java return 'AM' which is wide type in es_US.xml file.
Test:
LocalDateTime ldt = LocalDateTime.of(1996, 2, 8, 11, 45);
String tag2 = "es-US";
Locale target2 = Locale.forLanguageTag(tag2);
DateTimeFormatter formatter1 = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT);
System.out.println(formatter1.withLocale(target2).format(ldt));
dayPeriod value with abbreviated type fallback incorrect. For example: the input data is: testYear = "1996";testMonth = "2";testDay = "8";testHour = "11";testMinute = "45";testSecond = "8";
Test LocalDateTime with Short format. There is no abbreviated dayPeriod type in es_US.xml file, so should fallback to es_419.xml as CLDR defined and get the result 'a.m.', but actually Java return 'AM' which is wide type in es_US.xml file.
Test:
LocalDateTime ldt = LocalDateTime.of(1996, 2, 8, 11, 45);
String tag2 = "es-US";
Locale target2 = Locale.forLanguageTag(tag2);
DateTimeFormatter formatter1 = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT);
System.out.println(formatter1.withLocale(target2).format(ldt));
- duplicates
-
JDK-8185485 Java can't return exact dayPeriod value on some locales.
- Open