Summary
Add java.time.format.DateTimeFormatter localizedBy(locale) to reflect "ca", "nu", "tz", and/or "rg" Unicode extensions
Problem
JEP 314 introduces additional Unicode extensions, such as "tz" time zone extension. To utilize this extension, a new method, localizedBy(Locale), needs to be introduced in java.time.format.DateTimeFormatter class. There has been the method "withLocale(Locale)" which applies text and/or pattern localization to the formatter, but the effect is independent of other withXXXX() method invocations, such as withZone(). Modifying withLocale() to recognize Unicode extensions would break that assumption. Thus the localizedBy(Locale) is needed to override the locale defaults.
Solution
Introduce a new method, localizedBy(Locale), that reflects the elements in the specified locale, and overrides the locale defaults in the formatter. Also, added some clarifications to java.time.format.DecimalStyle.of(), java.time.format.DateTimeFormatterBuilder.getLocalizedDateTimePattern() and java.util.Calendar.getInstance() methods.
Specification
http://cr.openjdk.java.net/~naoto/8191349/specdiff.04/overview-summary.html
- csr of
-
JDK-8191349 Add java.time.format.DateTimeFormatter localizedBy(locale) method to reflect Unicode extensions
- Resolved