From: <rb...@us...> - 2018-06-16 06:29:24
|
Revision: 15323 http://sourceforge.net/p/htmlunit/code/15323 Author: rbri Date: 2018-06-16 06:29:17 +0000 (Sat, 16 Jun 2018) Log Message: ----------- ff60 support (wip) Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormat.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormat.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormat.java 2018-06-16 06:09:12 UTC (rev 15322) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormat.java 2018-06-16 06:29:17 UTC (rev 15323) @@ -50,8 +50,8 @@ @JsxClass public class DateTimeFormat extends SimpleScriptable { - private static Map<String, String> FF_45_FORMATS_ = new HashMap<>(); private static Map<String, String> FF_52_FORMATS_ = new HashMap<>(); + private static Map<String, String> FF_60_FORMATS_ = new HashMap<>(); private static Map<String, String> CHROME_FORMATS_ = new HashMap<>(); private static Map<String, String> IE_FORMATS_ = new HashMap<>(); @@ -72,84 +72,85 @@ final String yyyyDotDot = "\u200EYYYY\u200E.\u200EMM\u200E.\u200Edd\u200E."; final String rightToLeft = "\u200Fdd\u200F/\u200FMM\u200F/\u200FYYYY"; - FF_45_FORMATS_.put("", mmSlash); - FF_45_FORMATS_.put("ar", "dd\u200F/MM\u200F/YYYY"); - FF_45_FORMATS_.put("ar-SA", "d\u200F/M\u200F/YYYY هـ"); - FF_45_FORMATS_.put("ban", ddDot); - FF_45_FORMATS_.put("be", ddDot); - FF_45_FORMATS_.put("bg", ddDot + "\u200E \u0433."); - FF_45_FORMATS_.put("ca", ddSlash); - FF_45_FORMATS_.put("cs", ddDotBlank); - FF_45_FORMATS_.put("da", ddSlash); - FF_45_FORMATS_.put("de", ddDot); - FF_45_FORMATS_.put("el", ddSlash); - FF_45_FORMATS_.put("en-NZ", ddSlash); - FF_45_FORMATS_.put("en-PA", ddSlash); - FF_45_FORMATS_.put("en-PR", ddSlash); - FF_45_FORMATS_.put("en-AU", ddSlash); - FF_45_FORMATS_.put("en-GB", ddSlash); - FF_45_FORMATS_.put("en-IE", ddSlash); - FF_45_FORMATS_.put("en-IN", ddSlash); - FF_45_FORMATS_.put("en-MT", ddSlash); - FF_45_FORMATS_.put("en-SG", ddSlash); - FF_45_FORMATS_.put("en-ZA", yyyySlash); - FF_45_FORMATS_.put("es", ddSlash); - FF_45_FORMATS_.put("es-CL", ddDash); - FF_45_FORMATS_.put("es-PA", mmSlash); - FF_45_FORMATS_.put("es-PR", mmSlash); - FF_45_FORMATS_.put("es-US", mmSlash); - FF_45_FORMATS_.put("et", ddDot); - FF_45_FORMATS_.put("fi", ddDot); - FF_45_FORMATS_.put("fr", ddSlash); - FF_45_FORMATS_.put("fr-CA", yyyyDash); - FF_45_FORMATS_.put("ga", yyyyDash); - FF_45_FORMATS_.put("hi", ddSlash); - FF_45_FORMATS_.put("hr", ddDotBlankDot); - FF_45_FORMATS_.put("hu", yyyyDotBlankDot); - FF_45_FORMATS_.put("id", ddSlash); - FF_45_FORMATS_.put("in", ddSlash); - FF_45_FORMATS_.put("is", ddDot); - FF_45_FORMATS_.put("it", ddSlash); - FF_45_FORMATS_.put("iw", ddDot); - FF_45_FORMATS_.put("ja", yyyySlash); - FF_45_FORMATS_.put("ko", yyyyDotBlankDot); - FF_45_FORMATS_.put("lt", yyyyDash); - FF_45_FORMATS_.put("lv", ddDotDot); - FF_45_FORMATS_.put("mk", ddDot); - FF_45_FORMATS_.put("ms", ddSlash); - FF_45_FORMATS_.put("mt", yyyyDash); - FF_45_FORMATS_.put("nl", ddDash); - FF_45_FORMATS_.put("pl", ddDot); - FF_45_FORMATS_.put("pt", ddSlash); - FF_45_FORMATS_.put("ro", ddDot); - FF_45_FORMATS_.put("ru", ddDot); - FF_45_FORMATS_.put("sk", ddDot); - FF_45_FORMATS_.put("sl", ddDotBlank); - FF_45_FORMATS_.put("sq", ddSlash); - FF_45_FORMATS_.put("sr", ddDotBlankDot); - FF_45_FORMATS_.put("sv", yyyyDash); - FF_45_FORMATS_.put("th", ddSlash); - FF_45_FORMATS_.put("tr", ddDot); - FF_45_FORMATS_.put("uk", ddDot); - FF_45_FORMATS_.put("vi", ddSlash); - FF_45_FORMATS_.put("zh", yyyySlash); - FF_45_FORMATS_.put("zh-HK", ddSlash); - FF_45_FORMATS_.put("zh-SG", "\u200EYYYY\u200E\u5E74\u200EMM\u200E\u6708\u200Edd\u200E\u65E5"); + final Map<String, String> commonFormats = new HashMap<>(); + commonFormats.put("", mmSlash); + commonFormats.put("ar", "dd\u200F/MM\u200F/YYYY"); + commonFormats.put("ar-SA", "d\u200F/M\u200F/YYYY هـ"); + commonFormats.put("ban", ddDot); + commonFormats.put("be", ddDot); + commonFormats.put("bg", ddDot + "\u200E \u0433."); + commonFormats.put("ca", ddSlash); + commonFormats.put("cs", ddDotBlank); + commonFormats.put("da", ddSlash); + commonFormats.put("de", ddDot); + commonFormats.put("el", ddSlash); + commonFormats.put("en-NZ", ddSlash); + commonFormats.put("en-PA", ddSlash); + commonFormats.put("en-PR", ddSlash); + commonFormats.put("en-AU", ddSlash); + commonFormats.put("en-GB", ddSlash); + commonFormats.put("en-IE", ddSlash); + commonFormats.put("en-IN", ddSlash); + commonFormats.put("en-MT", ddSlash); + commonFormats.put("en-SG", ddSlash); + commonFormats.put("en-ZA", yyyySlash); + commonFormats.put("es", ddSlash); + commonFormats.put("es-CL", ddDash); + commonFormats.put("es-PA", mmSlash); + commonFormats.put("es-PR", mmSlash); + commonFormats.put("es-US", mmSlash); + commonFormats.put("et", ddDot); + commonFormats.put("fi", ddDot); + commonFormats.put("fr", ddSlash); + commonFormats.put("fr-CA", yyyyDash); + commonFormats.put("ga", yyyyDash); + commonFormats.put("hi", ddSlash); + commonFormats.put("hr", ddDotBlankDot); + commonFormats.put("hu", yyyyDotBlankDot); + commonFormats.put("id", ddSlash); + commonFormats.put("in", ddSlash); + commonFormats.put("is", ddDot); + commonFormats.put("it", ddSlash); + commonFormats.put("iw", ddDot); + commonFormats.put("ja", yyyySlash); + commonFormats.put("ko", yyyyDotBlankDot); + commonFormats.put("lt", yyyyDash); + commonFormats.put("lv", ddDotDot); + commonFormats.put("mk", ddDot); + commonFormats.put("ms", ddSlash); + commonFormats.put("mt", yyyyDash); + commonFormats.put("nl", ddDash); + commonFormats.put("pl", ddDot); + commonFormats.put("pt", ddSlash); + commonFormats.put("ro", ddDot); + commonFormats.put("ru", ddDot); + commonFormats.put("sk", ddDot); + commonFormats.put("sl", ddDotBlank); + commonFormats.put("sq", ddSlash); + commonFormats.put("sr", ddDotBlankDot); + commonFormats.put("sv", yyyyDash); + commonFormats.put("th", ddSlash); + commonFormats.put("tr", ddDot); + commonFormats.put("uk", ddDot); + commonFormats.put("vi", ddSlash); + commonFormats.put("zh", yyyySlash); + commonFormats.put("zh-HK", ddSlash); + commonFormats.put("zh-SG", "\u200EYYYY\u200E\u5E74\u200EMM\u200E\u6708\u200Edd\u200E\u65E5"); - CHROME_FORMATS_.putAll(FF_45_FORMATS_); - IE_FORMATS_.putAll(FF_45_FORMATS_); + CHROME_FORMATS_.putAll(commonFormats); + IE_FORMATS_.putAll(commonFormats); - FF_45_FORMATS_.put("en-CA", yyyyDash); - FF_45_FORMATS_.put("en-PH", ddSlash); - FF_45_FORMATS_.put("es-US", ddSlash); - FF_45_FORMATS_.put("ga", ddSlash); - FF_45_FORMATS_.put("hr", ddDotDot); - FF_45_FORMATS_.put("ja-JP-u-ca-japanese", "yy/MM/dd"); - FF_45_FORMATS_.put("sk", ddDotBlank); - FF_45_FORMATS_.put("sr", ddDotDot); - FF_45_FORMATS_.put("sq", ddDot); + commonFormats.put("en-CA", yyyyDash); + commonFormats.put("en-PH", ddSlash); + commonFormats.put("es-US", ddSlash); + commonFormats.put("ga", ddSlash); + commonFormats.put("hr", ddDotDot); + commonFormats.put("ja-JP-u-ca-japanese", "yy/MM/dd"); + commonFormats.put("sk", ddDotBlank); + commonFormats.put("sr", ddDotDot); + commonFormats.put("sq", ddDot); - FF_52_FORMATS_.putAll(FF_45_FORMATS_); + FF_52_FORMATS_.putAll(commonFormats); FF_52_FORMATS_.put("fr", ddSlash); FF_52_FORMATS_.put("hr", ddDotBlankDot); FF_52_FORMATS_.put("fr-CH", ddDot); @@ -157,6 +158,8 @@ FF_52_FORMATS_.put("mt", ddSlash); FF_52_FORMATS_.put("nl-BE", ddSlash); + FF_60_FORMATS_.putAll(commonFormats); + CHROME_FORMATS_.put("be", yyyyDash); CHROME_FORMATS_.put("en-CA", yyyyDash); CHROME_FORMATS_.put("en-IE", ddSlash); @@ -248,10 +251,10 @@ formats = IE_FORMATS_; } else if (!browserVersion.isFirefox52()) { - formats = FF_45_FORMATS_; + formats = FF_52_FORMATS_; } else { - formats = FF_52_FORMATS_; + formats = FF_60_FORMATS_; } String locale = ""; |