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

DateFormat is invalid for Slovenian locale

    Details

    • Subcomponent:
    • Resolved In Build:
      tiger
    • CPU:
      x86
    • OS:
      windows_2000
    • Verification:
      Verified

      Description



      Name: rmT116609 Date: 01/23/2003


      FULL PRODUCT VERSION :
      java version "1.4.1_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
      Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

      FULL OPERATING SYSTEM VERSION : Microsoft Windows 2000
      [Version 5.00.2195], Service Pack III


      A DESCRIPTION OF THE PROBLEM :
      When using Slovenian locale with DateFormat, the date gets
      imporperly formated.

      Instead of dd.mm.yyyy (same as german), the output is yy.mm.dd.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      import java.text.DateFormat;
      import java.util.Locale;

      Locale si = new Locale("sl", "si");
      DateFormat df = DateFormat.getDateInstance
      (DateFormat.MEDIUM, si);

      System.out.println(df.format(new Date()));


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Expected: 13.8.2002
      Actual: 2002.8.13

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.text.DateFormat;
      import java.util.Locale;

      Locale si = new Locale("sl", "si");
      DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM, si);

      System.out.println(df.format(new Date()));

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

      CUSTOMER WORKAROUND :
      import java.text.DateFormat;
      import java.util.Locale;

      public DateFormat getDateInstance(Locale loc) {
        if(loc.getLanguage().equals("sl")) {
          loc = new Locale("de");
        }
        return(DateFormat.getDateInstance(DateFormat.MEDIUM,
      loc));
      }
      (Review ID: 160704)
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              kcolfersunw Kieran Colfer (Inactive)
              Reporter:
              rmandalasunw Ranjith Mandala (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: