Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8244245 localizedBy() should override localized values with default values
  3. JDK-8244555

Release Note: localizedBy() Overrides Localized Values With Default Values

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: P4
    • Resolution: Delivered
    • Affects Version/s: 15
    • Fix Version/s: 15
    • Component/s: core-libs
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      `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.

        Attachments

          Activity

            People

            Assignee:
            naoto Naoto Sato
            Reporter:
            naoto Naoto Sato
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: