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

java.time.format.TextStyle.FULL_STANDALONE does not work well while formatting months.

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_66"
      Java(TM) SE Runtime Environment (build 1.8.0_66-b18)
      Java HotSpot(TM) 64-Bit Server VM (build 25.66-b18, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 10 x64

      A DESCRIPTION OF THE PROBLEM :
      java.time.format.TextStyle.FULL_STANDALONE does not work well while formatting months.

      For example:
      System.out.println(Month.of(3).getDisplayName(TextStyle.FULL_STANDALONE, Locale.ENGLISH));

      Output is "3", but it should be "March".

      It works well, when java.time.format.TextStyle.FULL is used:
      System.out.println(Month.of(3).getDisplayName(TextStyle.FULL, Locale.ENGLISH));

      Output is "March".

      I think that java.time.format.TextStyle.FULL_STANDALONE works well for languages, where the output should be different, for example Czech:

      System.out.println(Month.of(3).getDisplayName(TextStyle.FULL_STANDALONE, new Locale("cs")));

      Output is "březen", that is OK.

      System.out.println(Month.of(3).getDisplayName(TextStyle.FULL, new Locale("cs")));

      Output is "března", that is OK too.


      REPRODUCIBILITY :
      This bug can be reproduced always.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fsamreen Fisba Samreen (Inactive)
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: