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

Months' names are not in proper grammar form

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7
    • core-libs

      FULL PRODUCT VERSION :
      java version "1.7.0_04"
      Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
      Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Wersja 6.1.7601] x64

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      System locale is set to Polish

      A DESCRIPTION OF THE PROBLEM :
      In Polish grammar month in date string should have proper form:
      24 lipca 2012

      However SimpleDateFormat use base form of month name:
      24 lipiec 2012
      which is not proper form according to Polish grammar. Moreover this issue breaks interoperability with systems that use correct form because date string could not be parsed.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Format date using MMMM placeholder (See attached source code for sample)


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      24 lipca 2012
      ACTUAL -
      24 lipiec 2012

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.text.DateFormatSymbols;
      import java.text.SimpleDateFormat;
      import java.util.GregorianCalendar;
      import java.util.Locale;


      public class Program {

      /**
      * @param args
      */
      public static void main(String[] args) {
      GregorianCalendar date = new GregorianCalendar(2012, 06, 24, 16, 43, 06);

      Locale loc = new Locale("pl", "PL", "Traditional");

      DateFormatSymbols symbols = new DateFormatSymbols(loc);

      SimpleDateFormat format = new SimpleDateFormat("d MMMM yyyy", symbols);

      System.out.println(format.format(date.getTime()));

      }

      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Set month names in proper form using DateFormatSymbols

      SUPPORT :
      YES

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: