JDK-4842276 : DateFormat MEDIUM/SMALL for Danish locale is wrong
  • Type: Bug
  • Component: globalization
  • Sub-Component: translation
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2003-04-03
  • Updated: 2004-03-28
  • Resolved: 2004-02-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b39Fixed
Related Reports
Relates :  
Description

Name: mt103760			Date: 04/03/2003


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

FULL OPERATING SYSTEM VERSION : Windows XP Professional


A DESCRIPTION OF THE PROBLEM :
The Locale for Denmark is wrong.

The locale for Denmark outputs 17-02-2001 or 17-02-01, resp.
for DateFormat.MEDIUM and DateFormat.SMALL.

This is wrong. It is also in conflict with the international
standard for dates (see http://www.cl.cam.ac.uk/~mgk25/iso-time.html).

The Danish Stardard is, basically, the same as the international
standard (yyyy-mm-dd), but the traditional national format is
different:

The short and classic Danish short date format is 17/2-2001 or
17/2-01. The format 17.02.2001 can also be used, however.

This is according to the Danish official language dictionary
(Retsskrivningsordbogen) 2. ed. 1996, page 654f.

I can send you a copy by fax if you want.



STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the code included below

EXPECTED VERSUS ACTUAL BEHAVIOR :
MEDIUM  dd/mm-yyyy
SMALL   dd/mm-yy
(see above)

REPRODUCIBILITY :
This bug can be reproduced always.

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

class DateBug
{
  public static void main(String[] args) {
    Locale dk = new Locale("da", "DK");
    DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM, dk);
    System.out.println(df.format(new Date()));
    // format is     dd-mm-yyyy
    // it should be  dd/mm-yyyy
    // the first format conflicts with international date standard
    // same problem with DateFormat.SMALL
  }
}

---------- END SOURCE ----------
(Review ID: 179388) 
======================================================================

Verified with Tiger b41, it now returns the date value in the following format:
"yyyy-MM-dd", // medium date pattern
"yy-MM-dd", // short date pattern

###@###.### 2004-03-09

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta2 FIXED IN: tiger-beta INTEGRATED IN: tiger-b39 tiger-beta2 VERIFIED IN: tiger-beta2
14-06-2004

PUBLIC COMMENTS medium date pattern changed to: yyyy-MM-dd short date pattern changed to: yy-MM-dd
10-06-2004

EVALUATION Locale Data bugs will have to be fixed in tiger. ###@###.### 2003-04-03 ###@###.### 2003-10-17 As far as I can see from all my sources, Windows, Solaris and ICU all have the format as dd-MM-yyyy and dd-MM-yy. Which is the more correct format then for danish, the international standard or the classic danish format? Could you send on a copy of the relevant section in the Retsskrivningsordbogen just to confirm this as well? (in english if at all possible, my danish is a little bit rusty) ###@###.### 2003-11-03 ******** l10n evaluation template - begin *********** Evaluation : As far as I can see from the copy of the Retskrivningsordbogen I found online at http://anubis.dkuug.dk/cultreg/registrations/narrative/da_DK,_4.3.html, the date format should be yyyy-MM-dd (which matches the ISO-8601 date standard as well), so I'm changing it to that. sccsdiff info (e.g. sccs diffs -r1.30 1.31 Activator_fr.java): sccs diffs LocaleElements_da.java ------- LocaleElements_da.java ------- 124,125c124,125 < "dd-MM-yyyy", // medium date pattern < "dd-MM-yy", // short date pattern --- > "yyyy-MM-dd", // medium date pattern > "yy-MM-dd", // short date pattern List file(s) to be delivered : src/share/classes/sun/text/resources/LocaleElements_da.java Target Build : Tiger-beta Additional Info : ******** l10n evaluation template - end*********** The following files have been integrated: src/share/classes/sun/text/resources/LocaleElements_da.java test/java/text/Format/Bug4842276.java ###@###.### 2004-02-18
18-02-2004