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

Values from getFirstDayOfWeek() are inconsistent with CLDR

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 10
    • 9
    • core-libs
    • b30
    • Verified

      Sample code for getting first day data in Java:

      for(Locale target:Calendar.getInstance().getAvailableLocales()){
          Calendar cal = Calendar.getInstance(target);
          int javaResult = cal.getFirstDayOfWeek();
              }

      Comparing to CLDR result in supplemntalData.xml, there are 5 locales are different:
      Locale is: bs-BA, Country is: BA
      --First day of week in JAVA is: 1
      --First day of week in CLDR is: mon(2)
      --------------
      Locale is: uz-AF, Country is: AF
      --First day of week in JAVA is: 1
      --First day of week in CLDR is: sat(7)
      --------------
      Locale is: az-AZ, Country is: AZ
      --First day of week in JAVA is: 1
      --First day of week in CLDR is: mon(2)
      --------------
      Locale is: shi-MA, Country is: MA
      --First day of week in JAVA is: 1
      --First day of week in CLDR is: sat(7)
      --------------
      Locale is: uz-UZ, Country is: UZ
      --First day of week in JAVA is: 1
      --First day of week in CLDR is: mon(2)
      --------------

      Supplemental data:
      <firstDay day="mon" territories="
      001
      AD AI AL AM AN AT AX AZ
      BA BE BG BM BN BY
      CH CL CM CR CY CZ
      DE DK
      EC EE ES
      FI FJ FO FR
      GB GE GF GP GR
      HR HU
      IS IT
      KG KZ
      LB LI LK LT LU LV
      MC MD ME MK MN MQ MY
      NL NO
      PL PT
      RE RO RS RU
      SE SI SK SM
      TJ TM TR
      UA UY UZ
      VA VN
      XK"
      />
                <firstDay day="fri" territories="BD MV" />
                <firstDay day="sat" territories="AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY" />
                <firstDay day="sun" territories="
      AG AR AS AU
      BR BS BT BW BZ
      CA CN CO
      DM DO
      ET
      GT GU
      HK HN
      ID IE IL IN
      JM JP
      KE KH KR
      LA
      MH MM MO MT MX MZ
      NI NP NZ
      PA PE PH PK PR PY
      SA SG SV
      TH TN TT TW
      UM US
      VE VI
      WS
      YE
      ZA ZW"
                />

            rgoel Rachna Goel (Inactive)
            yliu Johnny Liu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: