Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-14134

Incorrect month names in rich:calendar for some locales

    Details

      Description

      There are several forms of month names in some languages. E.g., in Russian, the preffered name for January in context of formatted date is "января" (e.g., "1 января 2016"), while standalone name is "Январь". Since JDK 8, DateFormatSymbols#getMonths returns month names in formatting form (see http://www.oracle.com/technetwork/java/javase/8-compatibility-guide-2156366.html).
      CalendarRendererBase#getLocaleOptions uses DateFormatSymbols#getMonths to retreive month names for rich:calendar. Therefore, in JDK 8 for some locales (e.g., "ru", "pl" etc) rich:calendar displays month names in incorrect form (formatting instead of standalone).

      Possible solutions
      1. Compatibility Guide for JDK 8 suggest to use Calendar API.
      2. https://bugs.openjdk.java.net/browse/JDK-8071742

      Masayoshi Okutsu added a comment - 2015-01-28 22:37
      ...
      If you need to support both 7 and 8 with stand-alone month names, SimpleDateFormat("MMMM").format() will produces stand-alone month names. Otherwise, I'd suggest Calendar.getDisplayName be used instead of DateFormatSymbols. In Java 7, you could catch IllegalArgumentException with the STANDALONE constants and fall back to their corresponding Java 7 constants, though.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dfilippov Daniel Filippov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: