JDK-4527203 : In Ukraine, Hungary first day of week is Monday but not Sunday
  • Type: Bug
  • Component: globalization
  • Sub-Component: translation
  • Affected Version: 1.3.1
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2001-11-14
  • Updated: 2002-08-07
  • Resolved: 2002-07-24
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
1.4.1 rcFixed
Related Reports
Relates :  
Relates :  
Relates :  
Description

Name: nt126004			Date: 11/14/2001


java version "1.3.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)

In Ukraine first day of week is Monday but not Sunday

By defaults in the calendar object obtained with locale ua_UA getFirstDayOfWeek
() function return SUNDAY as a first week day.
The code below illustrates this problem.

====================================

import java.util.Locale;
import java.util.Calendar;

public class Test {
	public static void main(String[] args) {
		
		Locale locale = new Locale("ua", "UA");
		System.out.println("Locale: '" + locale + "'");
		System.out.println("SUNDAY: " + String.valueOf
(Calendar.SUNDAY));
		System.out.println("MONDAY: " + String.valueOf
(Calendar.MONDAY));
                Calendar calend = Calendar.getInstance(locale);
		System.out.println("Default first week day: " + String.valueOf
(calend.getFirstDayOfWeek()));
	}

}


The console input produced:

Locale: 'ua_UA'
SUNDAY: 1
MONDAY: 2
Default first week day: 1
(Review ID: 135526) 
======================================================================

Name: nt126004			Date: 01/31/2002


FULL PRODUCT VERSION :
java version "1.3.1"

FULL OPERATING SYSTEM VERSION :
 Windows 2000 EN, SP2
 Windows 98 SE



A DESCRIPTION OF THE PROBLEM :
I tried to use a GregorianCalendar with my Locale. There is
a problem: the first day of a week in Hungary is MONDAY,
but in the SUN files that is specified SUNDAY.
This is a not-a-big problem for US people, but for me,
that's a bug.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1, Make a new Calendar, with locale (hu,HU)
2, Test the first day of week
3, In Hungary, the first day of a week is Monday, not Sunday

EXPECTED VERSUS ACTUAL BEHAVIOR :
The firstday should be Calendar.MONDAY, not
Calendar.SUNDAY

This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.util.*;

...

Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("ECT"), new Local
("hu","HU"));

int firstday = cal.getFirstDayOfWeek();

 if (firstday == Calendar.MONDAY)
  System.out.println("The first day is MONDAY");

 if (firstday == Calendar.SUNDAY)
  System.out.println("The first day is SUNDAY");

...
---------- END SOURCE ----------

CUSTOMER WORKAROUND :
Well, you cannot use hungarian locale for a Calendar,
you should use:
de, CH.
It works, but it isn't the ultimate soultion
(Review ID: 138321)
======================================================================


Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: hopper-rc FIXED IN: hopper-rc INTEGRATED IN: hopper-rc VERIFIED IN: hopper-rc
14-06-2004

EVALUATION Kieran, Please evaluate this for hopper. thx! ###@###.### 2002-05-01 ###@###.### 2002-05-08 I can confirm that our ukranian source is wrong on this account, but according to my usual source (http://oss.software.ibm.com/cgi-bin/icu/lx/en/?_=hu_HU&) the first day of the week for Hungary is sunday. I can't change this unless you supply me with the relevant standards you are working from to prove your case. I'll fix ukranian in the meantime. ###@###.### 2002-07-08 ******** l10n evaluation template - begin *********** Evaluation : According to ISO 8601: "A week starts with Monday (day 1) and ends with Sunday (day 7).", and ISO 8601 has been adopted as European Standard EN 28601 and is therefore now a valid standard in all EU countries and all conflicting national standards have been changed accordingly. AFAIK therefore all of our locales (european ones at least) should have monday as the start of the week. Unfortunately, as ISO don't like people to see their "open" standards for free, I can't confirm this in the official document, but have to go by several summary pages of the spec which I've found on the web. Looking at the rest of the european files, the first element in DateTimeElements should be set to "2" for the first day of the week to be Monday, not "1" as the customer suggests. sccsdiff info (e.g. sccs diffs -r1.30 1.31 Activator_fr.java): sccs diffs LocaleElements_hu_HU.java ------- LocaleElements_hu_HU.java ------- 44a45,49 > }, > { "DateTimeElements", > new String[] { > "2", // first day of week > "1" // min days in first week sccs diffs LocaleElements_uk_UA.java ------- LocaleElements_uk_UA.java ------- 44a45,49 > }, > { "DateTimeElements", > new String[] { > "2", // first day of week > "1" // min days in first week List file(s) to be delivered : src/share/classes/sun/text/resources/LocaleElements_hu_HU.java src/share/classes/sun/text/resources/LocaleElements_uk_UA.java Target Build : Hopper-rc Additional Info : I found the quotes for the ISO 8601 info at the following sites: http://home.t-online.de/home/PeterJHaas/DateTime/wnden.htm http://www.tondering.dk/claus/cal/node6.html#SECTION00660000000 http://www.cl.cam.ac.uk/~mgk25/iso-time.html#date (paragraph starting "In commercial and industrial applications") ******** l10n evaluation template - end***********
11-06-2004