diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | java/util/Calendar.java | 32 | ||||
-rw-r--r-- | resource/java/util/iso4217.properties | 2 | ||||
-rw-r--r-- | resource/java/util/weeks.properties | 80 |
4 files changed, 120 insertions, 4 deletions
@@ -1,5 +1,15 @@ 2008-07-07 Andrew John Hughes <gnu_andrew@member.fsf.org> + * java/util/Calendar.java: + (Calendar(TimeZone,Locale)): Use weeks.properties + instead of LocaleInformation bundles. + * resource/java/util/iso4217.properties: + Updated with new supplementgen header. + * resource/java/util/weeks.properties: + New resource file. + +2008-07-07 Andrew John Hughes <gnu_andrew@member.fsf.org> + * resource/gnu/java/locale/LocaleInformation.properties, * resource/gnu/java/locale/LocaleInformation_aa.properties, * resource/gnu/java/locale/LocaleInformation_af.properties, diff --git a/java/util/Calendar.java b/java/util/Calendar.java index 4f4314c5c..0449e126d 100644 --- a/java/util/Calendar.java +++ b/java/util/Calendar.java @@ -487,6 +487,28 @@ public abstract class Calendar } /** + * The set of properties for obtaining the minimum number of days in + * the first week. + */ + private static transient final Properties properties; + + /** + * Reads in the properties. + */ + static + { + properties = new Properties(); + try + { + properties.load(Calendar.class.getResourceAsStream("weeks.properties")); + } + catch (IOException exception) + { + System.out.println("Failed to load weeks resource: " + exception); + } + } + + /** * Constructs a new Calendar with the default time zone and the default * locale. */ @@ -507,9 +529,13 @@ public abstract class Calendar lenient = true; String[] days = { "", "sun", "mon", "tue", "wed", "thu", "fri", "sat" }; - ResourceBundle rb = getBundle(locale); - String min = (String) rb.getObject("minNumberOfDaysInFirstWeek"); - String first = (String) rb.getObject("firstDayOfWeek"); + String country = locale.getCountry(); + String min = properties.getProperty("minDays." + country); + if (min == null) + min = properties.getProperty("minDays.DEFAULT"); + String first = properties.getProperty("firstDay." + country); + if (first == null) + first = properties.getProperty("firstDay.DEFAULT"); try { if (min != null) diff --git a/resource/java/util/iso4217.properties b/resource/java/util/iso4217.properties index 1998bcb51..bc1c7582d 100644 --- a/resource/java/util/iso4217.properties +++ b/resource/java/util/iso4217.properties @@ -1,4 +1,4 @@ -# This document is automatically generated by gnu.currencygen +# This document is automatically generated by gnu.supplementgen AD.currency=EUR,ESP,FRF,ADP AD.fractionDigits=0 diff --git a/resource/java/util/weeks.properties b/resource/java/util/weeks.properties new file mode 100644 index 000000000..a2547f497 --- /dev/null +++ b/resource/java/util/weeks.properties @@ -0,0 +1,80 @@ +# This document is automatically generated by gnu.supplementgen + +firstDay.AF=sat +firstDay.AS=sun +firstDay.AZ=sun +firstDay.BH=sat +firstDay.BW=sun +firstDay.CA=sun +firstDay.CN=sun +firstDay.DEFAULT=mon +firstDay.DJ=sat +firstDay.DZ=sat +firstDay.EG=sat +firstDay.ER=sat +firstDay.ET=sat +firstDay.FO=sun +firstDay.GE=sun +firstDay.GL=sun +firstDay.GU=sun +firstDay.HK=sun +firstDay.IE=sun +firstDay.IL=sun +firstDay.IQ=sat +firstDay.IR=sat +firstDay.IS=sun +firstDay.JM=sun +firstDay.JO=sat +firstDay.JP=sun +firstDay.KE=sat +firstDay.KG=sun +firstDay.KR=sun +firstDay.KW=sat +firstDay.LA=sun +firstDay.LY=sat +firstDay.MA=sat +firstDay.MH=sun +firstDay.MN=sun +firstDay.MO=sun +firstDay.MP=sun +firstDay.MT=sun +firstDay.MV=fri +firstDay.NZ=sun +firstDay.OM=sat +firstDay.PH=sun +firstDay.PK=sun +firstDay.QA=sat +firstDay.SA=sat +firstDay.SD=sat +firstDay.SG=sun +firstDay.SO=sat +firstDay.SY=sun +firstDay.TH=sun +firstDay.TN=sat +firstDay.TT=sun +firstDay.TW=sun +firstDay.UM=sun +firstDay.US=sun +firstDay.UZ=sun +firstDay.VI=sun +firstDay.YE=sat +firstDay.ZW=sun +minDays.AT=4 +minDays.BE=4 +minDays.CA=4 +minDays.CH=4 +minDays.DE=4 +minDays.DEFAULT=1 +minDays.DK=4 +minDays.FI=4 +minDays.FR=4 +minDays.IT=4 +minDays.LI=4 +minDays.LT=4 +minDays.LU=4 +minDays.MC=4 +minDays.MT=4 +minDays.NL=4 +minDays.NO=4 +minDays.SE=4 +minDays.SK=4 |