Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8202088 Japanese new era implementation
  3. JDK-8203360

Release Note: Japanese New Era Implementation

    XMLWordPrintable

Details

    • generic
    • generic
    • Verified

    Backports

      Description

        The placeholder "NewEra" has been replaced with "Reiwa." Refer to the release note for JDK-8205432.

        Japanese calendars, both in `java.time.chrono` and `java.util` packages support the upcoming Japanese new era, which will be in effect from May 1st, 2019. At the moment, the name of the era is not yet known, placeholder names ("元号" for Japanese, "NewEra" for other languages) are provided for its display names. The placeholder names will be replaced with the legitimate era name in a future update, thus applications should not depend on those placeholder names. Use integer values to refer to the new era instead. For example:

        `java.time.chrono.JapaneseEra.of(3).getDisplayName(TextStyle.FULL, Locale.US)`

        or
        ```
        new java.util.Calendar.Builder()
            .setCalendarType("japanese")
            .setFields(Calendar.ERA, 5,
                Calendar.YEAR, 1,
                Calendar.MONTH, Calendar.MAY,
                Calendar.DAY_OF_MONTH, 1)
            .build()
            .getDisplayName(Calendar.ERA, Calendar.LONG, Locale.US)
        ```
        will output "NewEra"

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: