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

[DatePicker] Define list of countries that use week numbers

    Details

      Description

      The default value for the DatePicker.showWeekNumbers property is currently defined in controls.properties, and can be set by translators for the ten languages which are supported in JDK. This is not a good solution, however, since the value should be defined by country instead of by language. For example, en_GB uses ISO week numbers, but en_US does not.

      Since there is no mechanism in place at this time to define properties per country, the easiest way seems to be to just have a list of countries as one property in controls.properties, together with a comment that this list should not be translated. The list would contain the ISO 3166-1 country codes for countries that use ISO-6501 week numbers normally, such as in printed calendars (aka agendas, organizers, daytimers, etc). This usage is most prevalent in the EU, though not necessarily in all EU member states. Some countries use non-ISO standards for week numbers -- these may be added to the list at a later time if DatePicker and the JSR-310 API start supporting these standards.

      I have not found a definitive list of countries using ISO week numbers, but the following (somewhat out-of-date) web page provides a good start: http://www.pjh2.de/datetime/weeknumber/wnd.php?l=en

      The initial list in controls.properties is:
      DatePicker.showWeekNumbers=AT AX BE CH CZ DE DK EE ES EU FI FO FR GB GL GR IE IM IS IT LI LU LV NL NO PL PT SE SJ

      Requests for changes to this list should be filed as bugs and linked to this issue.

      Note also that developers can override resources by providing their own file com/sun/javafx/scene/control/skin/resources/controls_xx.properties (or controls_xx_YY.properties) on the classpath. Here xx represents the language and YY the country. For example, a file called controls_ru_RU.properties could contain the line "DatePicker.showWeekNumbers=RU" to enable ISO week numbers in the Russia locale.

        Attachments

          Activity

            People

            • Assignee:
              leifs Leif Samuelsson (Inactive)
              Reporter:
              leifs Leif Samuelsson (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:
                Imported: