-
Type:
Sub-task
-
Resolution: Delivered
-
Priority:
P4
-
Affects Version/s: 15
-
Component/s: core-libs
-
generic
-
generic
-
Verified
`java.time.format.DateTimeFormatter.localizedBy(Locale)` method now honors the default locale values, such as `Chronology`and/or `DecimalStyle` of the specified locale argument.
For example, in previous JDK releases:
```
jshell> DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL)
.localizedBy(Locale.forLanguageTag("fa"))
.format(LocalDate.now())
$3 ==> "جمعه 1 مهٔ 2020"
```
the numbers are in Arabic (Western) numerals.
In JDK 15:
```
jshell> DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL)
.localizedBy(Locale.forLanguageTag("fa"))
.format(LocalDate.now())
$3 ==> "جمعه ۱ مهٔ ۲۰۲۰"
```
the numbers are in Extended Arabic-Indic numerals because it is the default numbering system for the Farsi locale.
For example, in previous JDK releases:
```
jshell> DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL)
.localizedBy(Locale.forLanguageTag("fa"))
.format(LocalDate.now())
$3 ==> "جمعه 1 مهٔ 2020"
```
the numbers are in Arabic (Western) numerals.
In JDK 15:
```
jshell> DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL)
.localizedBy(Locale.forLanguageTag("fa"))
.format(LocalDate.now())
$3 ==> "جمعه ۱ مهٔ ۲۰۲۰"
```
the numbers are in Extended Arabic-Indic numerals because it is the default numbering system for the Farsi locale.