Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8173423

Wrong display name for supplemental Japanese era

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 9
    • 9
    • core-libs
    • 9
    • b155
    • generic
    • generic
    • Verified

    Backports

      Description

        If a supplemental new era is specified with the system property "jdk.calendar.japanese.supplemental.era", the display name is incorrect in the formatted string. The following code snippet demonstrates the issue (" -Djdk.calendar.japanese.supplemental.era="name=NewEra,abbr=N.E.,since=1546300800000"" is given on invocation):

        --
                        LocalDate ldHeisei = LocalDate.of(2018, Month.JANUARY, 1);
                        LocalDate ldNewEra = LocalDate.of(2019, Month.JANUARY, 1); // first day of NewEra
                        DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL)
                                .withChronology(JapaneseChronology.INSTANCE)
                                .withZone(ZoneId.systemDefault());
                        System.out.println(dtf.format(ldHeisei));
                        System.out.println(dtf.format(ldNewEra));
        --

        The output is:

        --
        Monday, January 1, 30 Heisei
        Tuesday, January 1, 1 3
        --

        The last "3" should display as "NewEra."

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: