*/
package com.ibm.icu.impl;
+import java.util.Locale;
import java.util.Map;
import java.util.MissingResourceException;
import java.util.TreeMap;
/**
* Calendar utilities.
- *
+ *
* Date/time format service classes in com.ibm.icu.text packages
* sometimes need to access calendar internal APIs. But calendar
* classes are in com.ibm.icu.util package, so the package local
public static String getCalendarType(ULocale loc) {
String calType = loc.getKeywordValue(CALKEY);
if (calType != null) {
- return calType;
+ // Convert to lower case, because getKeywordValue does not
+ // canonicalize keyword value.
+ return calType.toLowerCase(Locale.ROOT);
}
// Canonicalize, so grandfathered variant will be transformed to keywords
errln("non civil calc type generated - " + thisCalcType);
}
+ islamicLoc = new ULocale("ar_SA@calendar=ISLAMIC-UMALQURA");
+ is_cal = new IslamicCalendar(islamicLoc);
+ thisCalcType = is_cal.getType();
+ if (!"islamic-umalqura".equalsIgnoreCase(thisCalcType)) {
+ errln("non umalqura calc type generated - " + thisCalcType);
+ }
+
+ islamicLoc = new ULocale("ar_SA@calendar=ISLAMIC-CIVIL");
+ is_cal = new IslamicCalendar(islamicLoc);
+ thisCalcType = is_cal.getType();
+ if (!"islamic-civil".equalsIgnoreCase(thisCalcType)) {
+ errln("non civil calc type generated - " + thisCalcType);
+ }
+
islamicLoc = new ULocale("ar_SA@calendar=islamic-tbla");
is_cal = new IslamicCalendar(islamicLoc);
thisCalcType = is_cal.getType();