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

Improper retrieval of display names for AmPmMarkers for TextStyle.SHORT.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None

      Description

      on es_US locale:
      dayPeriod value with abbreviated type fallback incorrect. For example: the input data is: testYear = "1996";testMonth = "2";testDay = "8";testHour = "11";testMinute = "45";testSecond = "8";
      Test LocalDateTime with Short format. There is no abbreviated dayPeriod type in es_US.xml file, so should fallback to es_419.xml as CLDR defined and get the result 'a.m.', but actually Java return 'AM' which is wide type in es_US.xml file.

      Test:

              LocalDateTime ldt = LocalDateTime.of(1996, 2, 8, 11, 45);
              String tag2 = "es-US";
              Locale target2 = Locale.forLanguageTag(tag2);
               DateTimeFormatter formatter1 = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT);
               System.out.println(formatter1.withLocale(target2).format(ldt));




        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rgoel Rachna Goel (Inactive)
              Reporter:
              rgoel Rachna Goel (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: