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

RFE: context sensitive months - see bug 4207993 (1999)

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.4.2
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_2000

      Description



      Name: gm110360 Date: 05/26/2004


      A DESCRIPTION OF THE REQUEST :
      PLease see associated log quoted in title.
      I realise that this is an i18n issue, but it shows in java.text and didnt seem to fit in any other category.

      in Russian and other slavic languages the long month name's ending is modified when a number is shown before it
      eg
      May май 23 мая 2004 г.

      I dont know if this will correctly show on your screen due to encodings but it looks like this:
      May Man (n is backwards) 23 mar 2004 r. (r is backwards)

      Some months such as August also acquire an additional letter when preceeded by a number.

      When SimpleDateFormat is passed the "correct" month name contained in a String, it fails to parse into a date object. When requesting a string formatted in Russian from a Date object the incorrect month name is used. The original bug raised in 1999 was passed as a RFE, this is however still not working in 1.4.2 (EN), so when can we expect this to be fixed?

      thanks

      JUSTIFICATION :
      The date is not correctly rendered in Russian and other slavic languages and a perfectly correct "long" date typed in by a user is not correctly parsed and causes a parseexception.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      i would ideally like to see the correct month names used, or alternatively that setLenient() would tolerate the modified/extended month endings.
      ACTUAL -
      The same word is used for the month, regardless of the date construction. This looks wrong in Russian.

      March and August are good examples of additional letters being appended to the month name when the month is preceeded by a day number, but almost all russian month names modify their spelling when preceeded by a number indicating the day as this indicates the genitive case (the month "possesses" the day)

      ---------- BEGIN SOURCE ----------
      System.out.println ("special case - converting Russian");
      SimpleDateFormat russDateFormatter= (SimpleDateFormat) DateFormat.getDateTimeInstance(SimpleDateFormat.LONG, SimpleDateFormat.MEDIUM, new Locale ("ru", "RU"));
      String rDate = russDateFormatter.format (new Date());
      System.out.println (" to russian date " + rDate);
      try {
         System.out.println (russDateFormatter.parse (rDate).toString());
         System.out.println ("converted back OK");
      }catch (ParseException pe) {
         System.out.println ("russ Date parse exception");
      }

      // note that the month spelling is always the infinitive one, not the genitive
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      none, we're sending it out wrong at the moment.
      (Incident Review ID: 275120)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                peytoia Yuka Kamiya (Inactive)
                Reporter:
                gmanwanisunw Girish Manwani (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: