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

Calendar.getFirstDayOfWeek() returns Monday instead of Sunday for pt_BR

XMLWordPrintable

      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.

            yhuang Yong Huang (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: