-
Bug
-
Resolution: Duplicate
-
P4
-
6u22
-
x86
-
windows_xp
FULL PRODUCT VERSION :
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600] SP3
A DESCRIPTION OF THE PROBLEM :
Calendar.getFirstDayOfWeek() returns 2 (Monday) instead of 1 (Sunday) for the pt_BR Locale.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Any call of getFirstDayOfWeek with a Calendar object just created with the pt_BR locate presents the problem.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
First day is 1
ACTUAL -
First day is 2
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.Calendar;
import java.util.Locale;
public class TestCal
{
public static void main(String[] args)
{
Calendar cal = Calendar.getInstance(new Locale("pt", "BR"));
System.out.println("First day is " + cal.getFirstDayOfWeek());
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
use cal.getFirstDayOfWeek(1) every time that the pt_BR locale is used.
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600] SP3
A DESCRIPTION OF THE PROBLEM :
Calendar.getFirstDayOfWeek() returns 2 (Monday) instead of 1 (Sunday) for the pt_BR Locale.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Any call of getFirstDayOfWeek with a Calendar object just created with the pt_BR locate presents the problem.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
First day is 1
ACTUAL -
First day is 2
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.Calendar;
import java.util.Locale;
public class TestCal
{
public static void main(String[] args)
{
Calendar cal = Calendar.getInstance(new Locale("pt", "BR"));
System.out.println("First day is " + cal.getFirstDayOfWeek());
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
use cal.getFirstDayOfWeek(1) every time that the pt_BR locale is used.
- duplicates
-
JDK-8013836 getFirstDayOfWeek reports wrong day for pt-BR locale
- Closed