diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index 27fdf6d626..f11ee957a5 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -11,7 +11,8 @@ Bug Fixes: * Updated to IANA time zone data 2020a * Put base option back on ResBundle * Fixed a few tools and dependencies so that ilib works on node v14 -* Fixed a bug which a default script for ky should be Cyrl instead of Arabic +* Fixed a default timezone in `my-MM` to `Asia/Yangon` +* Fixed a bug which a default script for `ky` should be `Cyrl` instead of `Arabic` Build 009 ------- diff --git a/js/build.xml b/js/build.xml index 4cc4be2614..370df34e70 100644 --- a/js/build.xml +++ b/js/build.xml @@ -53,8 +53,8 @@ limitations under the License. - - + + diff --git a/js/data/locale/my/dateformats.json b/js/data/locale/my/dateformats.json index d58c81f758..c7372d3327 100644 --- a/js/data/locale/my/dateformats.json +++ b/js/data/locale/my/dateformats.json @@ -68,31 +68,31 @@ "h": "h", "m": "mm", "s": "ss", - "ah": "B h", - "hm": "B h:mm", + "ah": "a h", + "hm": "a h:mm", "ms": "mm:ss", - "ahm": "hB h:mm", - "hms": "B h:mm:ss", - "hmz": "z B h:mm", - "ahmz": "z hB h:mm", - "ahms": "hB h:mm:ss", - "hmsz": "z B h:mm:ss", - "ahmsz": "z hB h:mm:ss" + "ahm": "a h:mm", + "hms": "a h:mm:ss", + "hmz": "z a h:mm", + "ahmz": "z a h:mm", + "ahms": "a h:mm:ss", + "hmsz": "z a h:mm:ss", + "ahmsz": "z a h:mm:ss" }, "24": { "h": "HH", "m": "mm", "s": "ss", "ah": "HH", - "hm": "B H:mm", + "hm": "H:mm", "ms": "mm:ss", - "ahm": "B H:mm", - "hms": "B HH:mm:ss", - "hmz": "z B H:mm", - "ahmz": "z B H:mm", - "ahms": "B HH:mm:ss", - "hmsz": "z B HH:mm:ss", - "ahmsz": "z B HH:mm:ss" + "ahm": "H:mm", + "hms": "HH:mm:ss", + "hmz": "z H:mm", + "ahmz": "z H:mm", + "ahms": "HH:mm:ss", + "hmsz": "z HH:mm:ss", + "ahmsz": "z HH:mm:ss" } }, "range": { @@ -152,4 +152,4 @@ } } } -} \ No newline at end of file +} diff --git a/js/data/locale/und/MM/timezone.jf b/js/data/locale/und/MM/timezone.jf index 49943b650c..130cfa14b5 100644 --- a/js/data/locale/und/MM/timezone.jf +++ b/js/data/locale/und/MM/timezone.jf @@ -1 +1 @@ -{"timezone": "Asia/Rangoon"} +{"timezone": "Asia/Yangon"} diff --git a/js/test/date/testDayOfWeek.js b/js/test/date/testDayOfWeek.js index 75f33e8212..e5d595f743 100644 --- a/js/test/date/testDayOfWeek.js +++ b/js/test/date/testDayOfWeek.js @@ -2049,6 +2049,16 @@ module.exports.testweekdata = { test.equal(info.getWeekEndEnd(), 0); test.done(); }, + testWeekData_my_MM: function(test) { + test.expect(4); + var info = new LocaleInfo("my-MM"); + test.ok(info !== null); + + test.equal(info.getFirstDayOfWeek(), 0); + test.equal(info.getWeekEndStart(), 6); + test.equal(info.getWeekEndEnd(), 0); + test.done(); + }, testWeekData_ne_NP: function(test) { test.expect(4); var info = new LocaleInfo("ne-NP"); diff --git a/js/test/date/testMeridiems.js b/js/test/date/testMeridiems.js index 3b0119e044..dfd97c6fcb 100644 --- a/js/test/date/testMeridiems.js +++ b/js/test/date/testMeridiems.js @@ -2058,6 +2058,16 @@ module.exports.testmeridiems = { test.equal(fmt[0].name, "पूर्वाह्न"); test.equal(fmt[1].name, "अपराह्न"); + test.done(); + }, + testMeridiem_my_MM: function(test) { + test.expect(3); + var fmt = DateFmt.getMeridiemsRange({locale:"my-MM"}); + test.ok(fmt !== null); + + test.equal(fmt[0].name, 'နံနက်'); + test.equal(fmt[1].name, 'ညနေ'); + test.done(); } } \ No newline at end of file diff --git a/js/test/date/testMonthTranslation.js b/js/test/date/testMonthTranslation.js index 144a986503..9357f1b775 100644 --- a/js/test/date/testMonthTranslation.js +++ b/js/test/date/testMonthTranslation.js @@ -7690,6 +7690,51 @@ module.exports.testmonthtranslation = { test.equal(value[10], "नोभेम्बर"); test.equal(value[11], "डिसेम्बर"); + test.done(); + }, + testMonthTranslate_my_MM: function(test) { + test.expect(24); + + // full, long: MMMM + // medium: MMM + // short: MM + + var value = [], i; + var fmt = new DateFmt({locale:"my-MM", date:"m", length: "full", useNative:false, timezone:"local"}) + for (i=0; i < 12; i++) { + value[i] = fmt.format(DateFactory({month:i+1, type:"gregorian"})); + } + test.equal(value[0], "ဇန်နဝါရီ"); + test.equal(value[1], "ဖေဖော်ဝါရီ"); + test.equal(value[2], "မတ်"); + test.equal(value[3], "ဧပြီ"); + test.equal(value[4], "မေ"); + test.equal(value[5], "ဇွန်"); + test.equal(value[6], "ဇူလိုင်"); + test.equal(value[7], "ဩဂုတ်"); + test.equal(value[8], "စက်တင်ဘာ"); + test.equal(value[9], "အောက်တိုဘာ"); + test.equal(value[10], "နိုဝင်ဘာ"); + test.equal(value[11], "ဒီဇင်ဘာ"); + + var fmt = new DateFmt({locale:"my-MM", date:"m", length: "medium", useNative:false, timezone:"local"}) + for (i=0; i < 12; i++) { + value[i] = fmt.format(DateFactory({month:i+1, type:"gregorian"})); + } + + test.equal(value[0], "ဇန်"); + test.equal(value[1], "ဖေ"); + test.equal(value[2], "မတ်"); + test.equal(value[3], "ဧ"); + test.equal(value[4], "မေ"); + test.equal(value[5], "ဇွန်"); + test.equal(value[6], "ဇူ"); + test.equal(value[7], "ဩ"); + test.equal(value[8], "စက်"); + test.equal(value[9], "အောက်"); + test.equal(value[10], "နို"); + test.equal(value[11], "ဒီ"); + test.done(); } } diff --git a/js/test/date/testSuite.html b/js/test/date/testSuite.html index 7ce652766d..3aa3e5948c 100644 --- a/js/test/date/testSuite.html +++ b/js/test/date/testSuite.html @@ -97,6 +97,7 @@ + @@ -132,4 +133,4 @@

date Test Suite

nodeunit.run(module.exports); - \ No newline at end of file + diff --git a/js/test/date/testSuiteFiles.js b/js/test/date/testSuiteFiles.js index bbba5893c1..09539e5700 100644 --- a/js/test/date/testSuiteFiles.js +++ b/js/test/date/testSuiteFiles.js @@ -85,6 +85,7 @@ module.exports.files = [ "testdatefmt_mn_Cyrl_MN.js", "testdatefmt_mr_IN.js", "testdatefmt_ms_MY.js", + "testdatefmt_my_MM.js", "testdatefmt_nb_NO.js", "testdatefmt_ne_NP.js", "testdatefmt_nl_NL.js", diff --git a/js/test/date/testWeekdayTranslation.js b/js/test/date/testWeekdayTranslation.js index 005876b15b..fb4c9670f9 100644 --- a/js/test/date/testWeekdayTranslation.js +++ b/js/test/date/testWeekdayTranslation.js @@ -11855,6 +11855,77 @@ module.exports.testWeekdayTranslation = { test.equal(value[5], "शु"); test.equal(value[6], "श"); + test.done(); + }, + testWeekdayTranslationFull_my_MM: function(test) { + // full -> wide + test.expect(7); + var fmt, value = [], i; + fmt = new DateFmt({locale:"my-MM", date:"w", length: "full", useNative:false, timezone:"local"}) + for (i=0; i < 7; i++) { + value[i] = fmt.format(DateFactory({year: 2015, month: 8, day:i+2, type:"gregorian"})); + } + test.equal(value[0], "တနင်္ဂနွေ"); + test.equal(value[1], "တနင်္လာ"); + test.equal(value[2], "အင်္ဂါ"); + test.equal(value[3], "ဗုဒ္ဓဟူး"); + test.equal(value[4], "ကြာသပတေး"); + test.equal(value[5], "သောကြာ"); + test.equal(value[6], "စနေ"); + test.done(); + }, + testWeekdayTranslationLong_my_MM: function(test) { + // long -> abbreviate + test.expect(7); + var fmt, value = [], i; + fmt = new DateFmt({locale:"my-MM", date:"w", length: "long", useNative:false, timezone:"local"}) + for (i=0; i < 7; i++) { + value[i] = fmt.format(DateFactory({year: 2015, month: 8, day:i+2, type:"gregorian"})); + } + test.equal(value[0], "တနင်္ဂနွေ"); + test.equal(value[1], "တနင်္လာ"); + test.equal(value[2], "အင်္ဂါ"); + test.equal(value[3], "ဗုဒ္ဓဟူး"); + test.equal(value[4], "ကြာသပတေး"); + test.equal(value[5], "သောကြာ"); + test.equal(value[6], "စနေ"); + + test.done(); + }, + testWeekdayTranslationMedium_my_MM: function(test) { + // medium -> short + test.expect(7); + var fmt, value = [], i; + fmt = new DateFmt({locale:"my-MM", date:"w", length: "medium", useNative:false, timezone:"local"}) + for (i=0; i < 7; i++) { + value[i] = fmt.format(DateFactory({year: 2015, month: 8, day:i+2, type:"gregorian"})); + } + test.equal(value[0], "တနင်္ဂနွေ"); + test.equal(value[1], "တနင်္လာ"); + test.equal(value[2], "အင်္ဂါ"); + test.equal(value[3], "ဗုဒ္ဓဟူး"); + test.equal(value[4], "ကြာသပတေး"); + test.equal(value[5], "သောကြာ"); + test.equal(value[6], "စနေ"); + + test.done(); + }, + testWeekdayTranslationShort_my_MM: function(test) { + // short: narrow + test.expect(7); + var fmt, value = [], i; + fmt = new DateFmt({locale:"my-MM", date:"w", length: "short", useNative:false, timezone:"local"}) + for (i=0; i < 7; i++) { + value[i] = fmt.format(DateFactory({year: 2015, month: 8, day:i+2, type:"gregorian"})); + } + test.equal(value[0], "တ"); + test.equal(value[1], "တ"); + test.equal(value[2], "အ"); + test.equal(value[3], "ဗ"); + test.equal(value[4], "က"); + test.equal(value[5], "သ"); + test.equal(value[6], "စ"); + test.done(); } } \ No newline at end of file diff --git a/js/test/date/testcalendar.js b/js/test/date/testcalendar.js index c7c3bc69a3..4d0fce8eb2 100644 --- a/js/test/date/testcalendar.js +++ b/js/test/date/testcalendar.js @@ -23,7 +23,7 @@ if (typeof(LocaleInfo) === "undefined") { module.exports.testcalendar = { testDefaultCalendar_GregorianCaseAll: function(test) { - test.expect(202); + test.expect(203); var localeList = ["ar-AE","ar-BH","ar-DJ","ar-DZ","ar-EG","ar-IQ","ar-JO","ar-KW","ar-LB","ar-LY","ar-MA","ar-MR", "ar-OM","ar-QA","ar-SA","ar-SD","ar-SY","ar-TN","ar-YE","as-IN","az-Latn-AZ","be-BY","bg-BG","bn-IN","bs-Latn-BA,bs-Latn-ME", @@ -34,7 +34,7 @@ module.exports.testcalendar = { "es-PY","es-SV","es-US","es-UY","es-VE","eu-ES","fi-FI","fr-BE","fr-BF","fr-BJ","fr-CA","fr-CD","fr-CF","fr-CG","fr-CH","fr-CI", "fr-CM","fr-GQ","fr-DJ","fr-DZ","fr-FR","fr-GA","fr-GN","fr-LB","fr-LU","fr-ML","fr-RW","fr-SN","fr-TG","ga-IE","gl-ES","gu-IN", "he-IL","hi-IN","hi-SG","hr-HR","hr-ME","hu-HU","hy-AM","id-ID","is-IS","it-CH","it-IT","ja-JP","ka-GE","kk-Cyrl-KZ","km-KH","kn-IN", - "ko-KR","ku-Arab-IQ","ky-KG","lo-LA","lt-LT","lv-LV","mk-MK","ml-IN","mn-Cyrl-MN","mr-IN","ms-MY","ms-SG","nb-NO","ne-NP","nl-BE","nl-NL","pa-IN", + "ko-KR","ku-Arab-IQ","ky-KG","lo-LA","lt-LT","lv-LV","mk-MK","ml-IN","mn-Cyrl-MN","mr-IN","ms-MY","ms-SG","my-MM","nb-NO","ne-NP","nl-BE","nl-NL","pa-IN", "pa-PK","pl-PL","pt-AO","pt-BR","pt-GQ","pt-CV","pt-PT","ro-RO","ru-BY","ru-GE","ru-KG","ru-KZ","ru-RU","ru-UA","si-LK", "sk-SK","sl-SI","sq-AL","sq-ME","sr-Latn-ME","sr-Latn-RS","sv-FI","sv-SE","sw-KE","ta-IN","ta-SG","te-IN","tr-AM","tr-AZ", "tr-CY","tr-TR","uk-UA","ur-IN","ur-PK","uz-Cyrl-UZ","uz-Latn-UZ","vi-VN","zh-Hans-CN","zh-Hans-SG","zh-Hant-HK", diff --git a/js/test/date/testclock.js b/js/test/date/testclock.js index 3af65c92b8..3dbce967ec 100644 --- a/js/test/date/testclock.js +++ b/js/test/date/testclock.js @@ -1848,6 +1848,15 @@ module.exports.testclock = { test.equal(info.getClock(), 24); + test.done(); + }, + testClock_my_MM: function(test) { + test.expect(2); + var info = new LocaleInfo("my-MM"); + test.ok(info !== null); + + test.equal(info.getClock(), 24); + test.done(); } } diff --git a/js/test/date/testdatefmt_my_MM.js b/js/test/date/testdatefmt_my_MM.js new file mode 100644 index 0000000000..a255544631 --- /dev/null +++ b/js/test/date/testdatefmt_my_MM.js @@ -0,0 +1,1802 @@ +/* + * testdatefmt_my_MM.js - test the date formatter object in Burmese-Myanmar + * + * Copyright © 2020, JEDLSoft + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +if (typeof(JulianDate) === "undefined") { + var JulianDate = require("../../lib/JulianDate.js"); +} +if (typeof(GregorianDate) === "undefined") { + var GregorianDate = require("../../lib/GregorianDate.js"); +} +if (typeof(DateFmt) === "undefined") { + var DateFmt = require("../../lib/DateFmt.js"); +} +if (typeof(ilib) === "undefined") { + var ilib = require("../../lib/ilib.js"); +} + +module.exports.testdatefmt_my_MM = { + setUp: function(callback) { + ilib.clearCache(); + callback(); + }, + + testDateFmtConstructorEmpty_my_MM: function(test) { + test.expect(1); + var fmt = new DateFmt({locale: "my-MM"}); + + test.ok(fmt !== null); + test.done(); + }, + + testDateFmtSimpleShort_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "short", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '29-09-11'); + test.done(); + }, + + testDateFmtSimpleMedium_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "medium", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '2011၊ စက် 29'); + test.done(); + }, + + testDateFmtSimpleLong_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "long", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date),'2011၊ 29 စက်တင်ဘာ'); + test.done(); + }, + + testDateFmtSimpleFull_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '2011၊ စက်တင်ဘာ 29'); + test.done(); + }, + + testDateFmtSimpleTimeShort_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "short", type: "time", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '13:45'); + test.done(); + }, + + testDateFmtSimpleTimeMedium_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "medium", type: "time", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '13:45'); + test.done(); + }, + + testDateFmtSimpleTimeLong_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", timelength: "long", type: "time", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '13:45'); + test.done(); + }, + + testDateFmtSimpleTimeFull_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full", type: "time", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 1, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '1:45'); + test.done(); + }, + + testDateFmtDateTimeSimpleShort_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "short", type: "datetime", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '29-09-11 13:45'); + test.done(); + }, + + testDateFmtDateTimeSimpleMedium_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "medium", type: "datetime", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '2011၊ စက် 29 13:45'); + test.done(); + }, + + testDateFmtDateTimeSimpleLong_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "long", type: "datetime", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '2011၊ 29 စက်တင်ဘာ 13:45'); + test.done(); + }, + + testDateFmtDateTimeSimpleFull_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full", type: "datetime", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '2011၊ စက်တင်ဘာ 29 13:45'); + test.done(); + }, + + testDateFmtTemplateCalendar_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", calendar: "julian", template: "yyyy-MM-dd", useNative: false}); + test.ok(fmt !== null); + + var date = new JulianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), "2011-09-29"); + test.done(); + }, + + testDateFmtTemplateCalendarIncompatibleDateType_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", calendar: "julian", template: "yyyy-MM-dd HH:mm", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + // convert automatically to a Julian calendar date + test.equal(fmt.format(date), "2011-09-16 13:45"); + test.done(); + }, + + testDateFmtTemplateClock12SwitchHH_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", clock: "12", template: "HH:mm", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), "01:45"); + test.done(); + }, + + testDateFmtTemplateClock12Switchkk_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", clock: "12", template: "kk:mm", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), "01:45"); + test.done(); + }, + + testDateFmtTemplateClock24Switchhh_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", clock: "24", template: "hh:mm", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), "13:45"); + test.done(); + }, + + testDateFmtTemplateClock24SwitchKK: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", clock: "24", template: "KK:mm", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), "13:45"); + test.done(); + }, + + testDateFmtTemplateNoClockDoNotFollowLocaleDefault12hh_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", template: "hh:mm", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), "01:45"); + test.done(); + }, + + testDateFmtTemplateNoClockDoNotFollowLocaleDefault12KK: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", template: "KK:mm", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), "01:45"); + test.done(); + }, + + testDateFmtTemplateNoClockDoNotFollowLocaleDefault24HH_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", template: "HH:mm", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), "13:45"); + test.done(); + }, + + testDateFmtTemplateNoClockDoNotFollowLocaleDefault24kk_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", template: "kk:mm", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), "13:45"); + test.done(); + }, + + + testDateFmtTypeDate_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "date", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '29-09-11'); + test.done(); + }, + + testDateFmtTypeTime_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "time", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '13:45'); + test.done(); + }, + + testDateFmtTypeDateTime_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "datetime", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '29-09-11 13:45'); + test.done(); + }, + + testDateFmtShortDateComponentsY_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", date: "y", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), "11"); + test.done(); + }, + + testDateFmtShortDateComponentsM_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", date: "m", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '09'); + test.done(); + }, + + testDateFmtShortDateComponentsN_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", date: "n", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), 'စ'); + test.done(); + }, + + testDateFmtShortDateComponentsD_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", date: "d", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), "29"); + test.done(); + }, + + testDateFmtShortDateComponentsDM_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", date: "dm", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '29-09'); + test.done(); + }, + + testDateFmtShortDateComponentsMY_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", date: "my", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '09-11'); + test.done(); + }, + + testDateFmtShortDateComponentsDMY_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", date: "dmy", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '29-09-11'); + test.done(); + }, + + testDateFmtShortDateComponentsWDM_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", date: "wdm", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '29-09၊ က'); + test.done(); + }, + + testDateFmtShortDateComponentsWDMY_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", date: "wdmy", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '29-09-11၊ က'); + test.done(); + }, + + testDateFmtLongDateComponentsWDM_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", date: "wdm", length: "long", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '29 စက်တင်ဘာ၊ ကြာသပတေး'); + test.done(); + }, + + testDateFmtFullDateComponentsY_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full", date: "y", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), "2011"); + test.done(); + }, + + testDateFmtFullDateComponentsM_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full", date: "m", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), 'စက်တင်ဘာ'); + test.done(); + }, + + testDateFmtFullDateComponentsD_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full", date: "d", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), "29"); + test.done(); + }, + + testDateFmtFullDateComponentsDM_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full", date: "dm", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), 'စက်တင်ဘာ 29'); + test.done(); + }, + + testDateFmtFullDateComponentsMY_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full", date: "my", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '2011၊ စက်တင်ဘာ'); + test.done(); + }, + + testDateFmtFullDateComponentsDMY_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full", date: "dmy", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '2011၊ စက်တင်ဘာ 29'); + test.done(); + }, + + testDateFmtFullDateComponentsWDM_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full", date: "wdm", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), 'စက်တင်ဘာ 29၊ ကြာသပတေး'); + test.done(); + }, + + testDateFmtFullDateComponentsWDMY_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full", date: "wdmy", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(date), '2011၊ စက်တင်ဘာ 29၊ ကြာသပတေး'); + test.done(); + }, + + testDateFmtShortTimeComponentsS_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "time", time: "s", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "37"); + test.done(); + }, + + testDateFmtShortTimeComponentsM_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "time", time: "m", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "45"); + test.done(); + }, + + testDateFmtShortTimeComponentsH_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "time", time: "h", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "13"); + test.done(); + }, + + testDateFmtShortTimeComponentsMS_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "time", time: "ms", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "45:37"); + test.done(); + }, + + testDateFmtShortTimeComponentsHM_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "time", time: "hm",useNative:false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "13:45"); + test.done(); + }, + + testDateFmtShortTimeComponentsHMS_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "time", time: "hms", useNative:false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "13:45:37"); + test.done(); + }, + + testDateFmtShortTimeComponentsHMA_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "time", time: "hma", useNative:false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "13:45"); + test.done(); + }, + + testDateFmtShortTimeComponentsHMZ_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({ + locale: "my-MM", + type: "time", + time: "hmz", + timezone: "Asia/Yangon", + useNative: false + }); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "+0630 13:45"); + test.done(); + }, + + testDateFmtShortTimeComponentsHMAZ_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({ + locale: "my-MM", + type: "time", + time: "hmaz", + timezone: "Asia/Yangon", + useNative: false + }); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "+0630 13:45"); + test.done(); + }, + + testDateFmtShortTimeComponentsHMSA_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "time", time: "hmsa", useNative:false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "13:45:37"); + test.done(); + }, + + testDateFmtShortTimeComponentsHMSZ_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({ + locale: "my-MM", + type: "time", + time: "hmsz", + timezone: "Asia/Yangon", + useNative: false + }); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "+0630 13:45:37"); + test.done(); + }, + + testDateFmtShortTimeComponentsHMSAZ_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({ + locale: "my-MM", + type: "time", + time: "hmsaz", + timezone: "Asia/Yangon", + useNative: false + }); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "+0630 13:45:37"); + test.done(); + }, + + testDateFmtFullTimeComponentsS_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "time", length: "full", time: "s", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "37"); + test.done(); + }, + + testDateFmtFullTimeComponentsM_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "time", length: "full", time: "m", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "45"); + test.done(); + }, + + testDateFmtFullTimeComponentsH_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "time", length: "full", time: "h", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "13"); + test.done(); + }, + + testDateFmtFullTimeComponentsMS_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "time", length: "full", time: "ms",useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "45:37"); + test.done(); + }, + + testDateFmtFullTimeComponentsHM_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "time", length: "full", time: "hm", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "13:45"); + test.done(); + }, + + testDateFmtFullTimeComponentsHMS_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "time", length: "full", time: "hms", useNative:false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "13:45:37"); + test.done(); + }, + + testDateFmtFullTimeComponentsHMA_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({ + locale: "my-MM", + type: "time", + length: "full", + time: "hma", + useNative: false + }); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "13:45"); + test.done(); + }, + + testDateFmtFullTimeComponentsHMZ_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({ + locale: "my-MM", + type: "time", + length: "full", + time: "hmz", + timezone: "Asia/Yangon", + useNative: false + }); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "+0630 13:45"); + test.done(); + }, + + testDateFmtFullTimeComponentsHMAZ_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({ + locale: "my-MM", + type: "time", + length: "full", + time: "hmaz", + timezone: "Asia/Yangon", + useNative: false + }); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "+0630 13:45"); + test.done(); + }, + + testDateFmtFullTimeComponentsHMSA_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", type: "time", length: "full", time: "hmsa", useNative: false}); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "13:45:37"); + test.done(); + }, + + testDateFmtFullTimeComponentsHMSZ_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({ + locale: "my-MM", + type: "time", + length: "full", + time: "hmsz", + timezone: "Asia/Yangon", + useNative: false + }); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "+0630 13:45:37"); + test.done(); + }, + + testDateFmtFullTimeComponentsHMSAZ_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({ + locale: "my-MM", + type: "time", + length: "full", + time: "hmsaz", + timezone: "Asia/Yangon", + useNative: false + }); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "+0630 13:45:37"); + test.done(); + }, + + testDateFmtWithTimeZoneAndNoDST_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({ + locale: "my-MM", + type: "time", + length: "full", + time: "hmsz", + timezone: "Asia/Yangon", + useNative: false + }); + test.ok(fmt !== null); + + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 12, + day: 29, + hour: 13, + minute: 45, + second: 37, + millisecond: 0 + }); + test.equal(fmt.format(date), "+0630 13:45:37"); + test.done(); + }, + + testDateFmtFormatRelativeWithinMinuteAfter_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full"}); + test.ok(fmt !== null); + + var reference = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 30, + millisecond: 0 + }); + test.equal(fmt.formatRelative(reference, date), '30 စက္ကန့်အတွင်း'); + test.done(); + }, +testDateFmtFormatRelativeWithinMinuteBefore_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full"}); + test.ok(fmt !== null); + + var reference = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 44, + second: 30, + millisecond: 0 + }); + test.equal(fmt.formatRelative(reference, date), 'ပြီးခဲ့သည့် 30 စက္ကန့်'); + test.done(); + }, +testDateFmtFormatRelativeWithinHourAfter_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full"}); + test.ok(fmt !== null); + + var reference = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 55, + second: 0, + millisecond: 0 + }); + test.equal(fmt.formatRelative(reference, date), '10 မိနစ်အတွင်း'); + test.done(); + }, +testDateFmtFormatRelativeWithinHourBefore_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full"}); + test.ok(fmt !== null); + + var reference = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 35, + second: 0, + millisecond: 0 + }); + test.equal(fmt.formatRelative(reference, date), 'ပြီးခဲ့သည့် 10 မိနစ်'); + test.done(); + }, +testDateFmtFormatRelativeWithinDayAfter_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full"}); + test.ok(fmt !== null); + + var reference = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 20, + hour: 17, + minute: 55, + second: 0, + millisecond: 0 + }); + test.equal(fmt.formatRelative(reference, date), '4 နာရီအတွင်း'); + test.done(); + }, +testDateFmtFormatRelativeWithinDayBefore_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full"}); + test.ok(fmt !== null); + + var reference = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 20, + hour: 9, + minute: 35, + second: 0, + millisecond: 0 + }); + test.equal(fmt.formatRelative(reference, date), 'ပြီးခဲ့သည့် 4 နာရီ'); + test.done(); + }, + + testDateFmtFormatRelativeWithinFortnightAfter_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full"}); + test.ok(fmt !== null); + + var reference = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 24, + hour: 15, + minute: 55, + second: 0, + millisecond: 0 + }); + test.equal(fmt.formatRelative(reference, date), '4 ရက်အတွင်း'); + test.done(); + }, +testDateFmtFormatRelativeWithinFortnightBefore_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full"}); + test.ok(fmt !== null); + + var reference = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 16, + hour: 9, + minute: 35, + second: 0, + millisecond: 0 + }); + test.equal(fmt.formatRelative(reference, date), 'ပြီးခဲ့သည့် 4 ရက်'); + test.done(); + }, + + testDateFmtFormatRelativeWithinQuarterAfter_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full"}); + test.ok(fmt !== null); + + var reference = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 11, + day: 24, + hour: 15, + minute: 55, + second: 0, + millisecond: 0 + }); + test.equal(fmt.formatRelative(reference, date), '9 ပတ်အတွင်း'); + test.done(); + }, +testDateFmtFormatRelativeWithinQuarterBefore_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full"}); + test.ok(fmt !== null); + + var reference = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var date = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 7, + day: 18, + hour: 9, + minute: 35, + second: 0, + millisecond: 0 + }); + test.equal(fmt.formatRelative(reference, date), 'ပြီးခဲ့သည့် 9 ပတ်'); + test.done(); + }, + + testDateFmtFormatRelativeWithinTwoYearsAfter_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full"}); + test.ok(fmt !== null); + + var reference = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var date = new GregorianDate({ + locale: "my-MM", + year: 2013, + month: 1, + day: 24, + hour: 15, + minute: 55, + second: 0, + millisecond: 0 + }); + test.equal(fmt.formatRelative(reference, date), '16 လအတွင်း'); + test.done(); + }, +testDateFmtFormatRelativeWithinTwoYearsBefore_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full"}); + test.ok(fmt !== null); + + var reference = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var date = new GregorianDate({ + locale: "my-MM", + year: 2010, + month: 7, + day: 18, + hour: 9, + minute: 35, + second: 0, + millisecond: 0 + }); + test.equal(fmt.formatRelative(reference, date), 'ပြီးခဲ့သည့် 14 လ'); + test.done(); + }, + + testDateFmtFormatRelativeYearsAfter_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full"}); + test.ok(fmt !== null); + + var reference = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var date = new GregorianDate({ + locale: "my-MM", + year: 2025, + month: 10, + day: 24, + hour: 15, + minute: 55, + second: 0, + millisecond: 0 + }); + test.equal(fmt.formatRelative(reference, date), '14 နှစ်အတွင်း'); + test.done(); + }, +testDateFmtFormatRelativeYearsBefore_my_MM: function(test) { + test.expect(2); + var fmt = new DateFmt({locale: "my-MM", length: "full"}); + test.ok(fmt !== null); + + var reference = new GregorianDate({ + locale: "my-MM", + year: 2011, + month: 9, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var date = new GregorianDate({ + locale: "my-MM", + year: 1990, + month: 7, + day: 18, + hour: 9, + minute: 35, + second: 0, + millisecond: 0 + }); + test.equal(fmt.formatRelative(reference, date), 'ပြီးခဲ့သည့် 21 နှစ်'); + test.done(); + } +}; \ No newline at end of file diff --git a/js/test/date/testdatetimefmt.js b/js/test/date/testdatetimefmt.js index a1c97f1627..18340614fe 100644 --- a/js/test/date/testdatetimefmt.js +++ b/js/test/date/testdatetimefmt.js @@ -5327,6 +5327,32 @@ module.exports.testdatetimeformat = { result1 = new DateFmt({locale:"ne-NP", type:"time", time:"ahmsz", length:"full", useNative:false, timezone:"local"}).template; test.equal(result1, "HH:mm:ss z"); + test.done(); + }, + testDateTimeFormat_my_MM: function(test) { + test.expect(7); + + var result1, result2, result3, result4; + + result1 = new DateFmt({locale:"my-MM", type:"date", date:"dmwy", length: "full", useNative:false, timezone:"local"}).template; + result2 = new DateFmt({locale:"my-MM", type:"date", date:"dmwy", length: "long", useNative:false, timezone:"local"}).template; + result3 = new DateFmt({locale:"my-MM", type:"date", date:"dmwy", length: "medium", useNative:false, timezone:"local"}).template; + result4 = new DateFmt({locale:"my-MM", type:"date", date:"dmwy", length: "short", useNative:false, timezone:"local"}).template; + + test.equal(result1, "yyyy၊ MMMM d၊ EEEE"); + test.equal(result2, "yyyy၊ d MMMM၊ EEE"); + test.equal(result3, "yyyy၊ MMM d၊ EE"); + test.equal(result4, "dd-MM-yy၊ E"); + + result1 = new DateFmt({locale:"my-MM", type:"datetime", date:"dmwy", length: "full", useNative:false, timezone:"local"}).template; + result2 = new DateFmt({locale:"my-MM", type:"datetime", date:"dmwy", length: "short", useNative:false, timezone:"local"}).template; + + test.equal(result1, "yyyy၊ MMMM d၊ EEEE H:mm"); + test.equal(result2, "dd-MM-yy၊ E H:mm"); + + result1 = new DateFmt({locale:"my-MM", type:"time", time:"ahmsz", length:"full", useNative:false, timezone:"local"}).template; + test.equal(result1, "z HH:mm:ss"); + test.done(); } } \ No newline at end of file diff --git a/js/test/daterange/testSuite.html b/js/test/daterange/testSuite.html index 55b7f69dcb..413f869765 100644 --- a/js/test/daterange/testSuite.html +++ b/js/test/daterange/testSuite.html @@ -87,6 +87,7 @@ + diff --git a/js/test/daterange/testSuiteFiles.js b/js/test/daterange/testSuiteFiles.js index 08fe2e31c7..900b320692 100644 --- a/js/test/daterange/testSuiteFiles.js +++ b/js/test/daterange/testSuiteFiles.js @@ -75,6 +75,7 @@ module.exports.files = [ "testdatefmtrange_mn_Cyrl_MN.js", "testdatefmtrange_mr_IN.js", "testdatefmtrange_ms_MY.js", + "testdatefmtrange_my_MM.js", "testdatefmtrange_nb_NO.js", "testdatefmtrange_ne_NP.js", "testdatefmtrange_nl_NL.js", diff --git a/js/test/daterange/testdatefmtrange_fmttemplate.js b/js/test/daterange/testdatefmtrange_fmttemplate.js index 9bd12a458c..cdc74bad04 100644 --- a/js/test/daterange/testdatefmtrange_fmttemplate.js +++ b/js/test/daterange/testdatefmtrange_fmttemplate.js @@ -14434,6 +14434,78 @@ module.exports.testdaterangefmt = { test.done(); }, + testDateRngFmt_my_MM: function(test) { + test.expect(36); + var fmt; + var data = setVariables(); + var length = data["fullLength"]; + var abbrLength = data["abbrLength"]; + + var templatec00 = [],templatec01 = [],templatec02 = [],templatec03 = []; + var templatec10 = [],templatec11 = [],templatec12 = [],templatec20 = []; + var templatec30 = []; + // full, medium: ymd + // long: ydm + // short: dmy + + for (var i=0; i < 4; i++) { + fmt = new DateRngFmt({locale:"my-MM", length: length[i]}) + templatec00.push(fmt.dateFmt.formats.range["c00"][abbrLength[i]]); + templatec01.push(fmt.dateFmt.formats.range["c01"][abbrLength[i]]); + templatec02.push(fmt.dateFmt.formats.range["c02"][abbrLength[i]]); + templatec03.push(fmt.dateFmt.formats.range["c03"][abbrLength[i]]); + templatec10.push(fmt.dateFmt.formats.range["c10"][abbrLength[i]]); + templatec11.push(fmt.dateFmt.formats.range["c11"][abbrLength[i]]); + templatec12.push(fmt.dateFmt.formats.range["c12"][abbrLength[i]]); + templatec20.push(fmt.dateFmt.formats.range["c20"][abbrLength[i]]); + templatec30.push(fmt.dateFmt.formats.range["c30"][abbrLength[i]]); + } + test.equal(templatec00[0], '{sy}၊ {sm} {sd} {st} – {et}'); + test.equal(templatec00[1], '{sy}၊ {sd} {sm} {st} – {et}'); + test.equal(templatec00[2], '{sy}၊ {sm} {sd} {st} – {et}'); + test.equal(templatec00[3], '{sd}-{sm}-{sy} {st} – {et}'); + + test.equal(templatec01[0], '{sy}၊ {sm} {sd} {st} – {ey}၊ {em} {ed} {et}'); + test.equal(templatec01[1], '{sy}၊ {sd} {sm} {st} – {ey}၊ {ed} {em} {et}'); + test.equal(templatec01[2], '{sy}၊ {sm} {sd} {st} – {ey}၊ {em} {ed} {et}'); + test.equal(templatec01[3], '{sd}-{sm}-{sy} {st} – {ed}-{em}-{ey} {et}'); + + test.equal(templatec02[1], '{sy}၊ {sd} {sm} {st} – {ey}၊ {ed} {em} {et}'); + test.equal(templatec02[0], '{sy}၊ {sm} {sd} {st} – {ey}၊ {em} {ed} {et}'); + test.equal(templatec02[2], '{sy}၊ {sm} {sd} {st} – {ey}၊ {em} {ed} {et}'); + test.equal(templatec02[3], '{sd}-{sm}-{sy} {st} – {ed}-{em}-{ey} {et}'); + + test.equal(templatec03[0], '{sy}၊ {sm} {sd} {st} – {ey}၊ {em} {ed} {et}'); + test.equal(templatec03[1], '{sy}၊ {sd} {sm} {st} – {ey}၊ {ed} {em} {et}'); + test.equal(templatec03[2], '{sy}၊ {sm} {sd} {st} – {ey}၊ {em} {ed} {et}'); + test.equal(templatec03[3], '{sd}-{sm}-{sy} {st} – {ed}-{em}-{ey} {et}'); + + test.equal(templatec10[0], '{sy}၊ {sm} {sd} – {ed}'); + test.equal(templatec10[1], '{sy}၊ {sd} {sm} – {ed} {em}'); + test.equal(templatec10[2], '{sy}၊ {sm} {sd} – {ed}'); + test.equal(templatec10[3], '{sd} – {ed}-{em}-{ey}'); + + test.equal(templatec11[0], '{sy}၊ {sm} {sd} – {em} {ed}'); + test.equal(templatec11[1], '{sy}၊ {sd} {sm} – {ey}၊ {ed} {em}'); + test.equal(templatec11[2], '{sy}၊ {sm} {sd} – {ey}၊ {em} {ed}'); + test.equal(templatec11[3], '{sd}-{sm} – {ed}-{em}-{ey}'); + + test.equal(templatec12[0], '{sy}၊ {sm} {sd} – {ey}၊ {em} {ed}'); + test.equal(templatec12[1], '{sy}၊ {sd} {sm} – {ey}၊ {ed} {em}'); + test.equal(templatec12[2], '{sy}၊ {sm} {sd} – {ey}၊ {em} {ed}'); + test.equal(templatec12[3], '{sd}-{sm}-{sy} – {ed}-{em}-{ey}'); + + test.equal(templatec20[0], '{sy}၊ {sm} – {ey}၊ {em}'); + test.equal(templatec20[1], '{sy}၊ {sm} – {ey}၊ {em}'); + test.equal(templatec20[2], '{sy}၊ {sm} – {ey}၊ {em}'); + test.equal(templatec20[3], '{sm}-{sy} – {em}-{ey}'); + test.equal(templatec30[0], "{sy} – {ey}"); + test.equal(templatec30[1], "{sy} – {ey}"); + test.equal(templatec30[2], "{sy} – {ey}"); + test.equal(templatec30[3], "{sy} – {ey}"); + + test.done(); + }, testDateRngFmt_ne_NP: function(test) { test.expect(36); var fmt; diff --git a/js/test/daterange/testdatefmtrange_my_MM.js b/js/test/daterange/testdatefmtrange_my_MM.js new file mode 100644 index 0000000000..893e4906f4 --- /dev/null +++ b/js/test/daterange/testdatefmtrange_my_MM.js @@ -0,0 +1,692 @@ +/* + * testdatefmtrange_my_MM.js - test the date range formatter object Burmese-Myanmar + * + * Copyright © 2020, JEDLSoft + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +if (typeof(GregorianDate) === "undefined") { + var GregorianDate = require("../../lib/GregorianDate.js"); +} +if (typeof(DateRngFmt) === "undefined") { + var DateRngFmt = require("../../lib/DateRngFmt.js"); +} + +if (typeof(ilib) === "undefined") { + var ilib = require("../../lib/ilib.js"); +} + +module.exports.testdatefmtrange_my_MM = { + setUp: function(callback) { + ilib.clearCache(); + callback(); + }, + + testDateRngFmtmyMMRangeInDayShort: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "short", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '31-12-11 13:45 – 14:30'); + test.done(); + }, + testDateRngFmtmyMMRangeInDayMedium: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "medium", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ ဒီ 31 13:45 – 14:30'); + test.done(); + }, + testDateRngFmtmyMMRangeInDayLong: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "long", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ 31 ဒီဇင်ဘာ 13:45 – 14:30'); + test.done(); + }, + testDateRngFmtmyMMRangeInDayFull: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "full", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ ဒီဇင်ဘာ 31 13:45 – 14:30' ); + test.done(); + }, + + testDateRngFmtmyMMRangeNextDayShort: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "short", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 12, + day: 30, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '30-12-11 13:45 – 31-12-11 14:30'); + test.done(); + }, + testDateRngFmtmyMMRangeNextDayMedium: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "medium", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 12, + day: 30, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ ဒီ 30 13:45 – 2011၊ ဒီ 31 14:30'); + test.done(); + }, + testDateRngFmtmyMMRangeNextDayLong: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "long", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 12, + day: 30, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ 30 ဒီဇင်ဘာ 13:45 – 2011၊ 31 ဒီဇင်ဘာ 14:30'); + test.done(); + }, + testDateRngFmtmyMMRangeNextDayFull: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "full", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 12, + day: 30, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ ဒီဇင်ဘာ 30 13:45 – 2011၊ ဒီဇင်ဘာ 31 14:30'); + test.done(); + }, + + testDateRngFmtmyMMRangeMultiDayShort: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "short", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 12, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '20 – 31-12-11'); + test.done(); + }, + testDateRngFmtmyMMRangeMultiDayMedium: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "medium", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 12, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ ဒီ 20 – 31'); + test.done(); + }, + testDateRngFmtmyMMRangeMultiDayLong: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "long", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 12, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ 20 ဒီဇင်ဘာ – 31 ဒီဇင်ဘာ'); + test.done(); + }, + testDateRngFmtmyMMRangeMultiDayFull: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "full", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 12, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ ဒီဇင်ဘာ 20 – 31'); + test.done(); + }, + + testDateRngFmtmyMMRangeNextMonthShort: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "short", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '20-11 – 31-12-11'); + test.done(); + }, + testDateRngFmtmyMMRangeNextMonthMedium: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "medium", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ နို 20 – 2011၊ ဒီ 31'); + test.done(); + }, + testDateRngFmtmyMMRangeNextMonthLong: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "long", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ 20 နိုဝင်ဘာ – 2011၊ 31 ဒီဇင်ဘာ'); + test.done(); + }, + testDateRngFmtmyMMRangeNextMonthFull: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "full", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2011, + month: 12, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ နိုဝင်ဘာ 20 – ဒီဇင်ဘာ 31'); + test.done(); + }, + + testDateRngFmtmyMMRangeNextYearShort: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "short", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2012, + month: 1, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '20-11-11 – 31-01-12'); + test.done(); + }, + testDateRngFmtmyMMRangeNextYearMedium: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "medium", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2012, + month: 1, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ နို 20 – 2012၊ ဇန် 31'); + test.done(); + }, + testDateRngFmtmyMMRangeNextYearLong: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "long", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2012, + month: 1, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ 20 နိုဝင်ဘာ – 2012၊ 31 ဇန်နဝါရီ'); + test.done(); + }, + testDateRngFmtmyMMRangeNextYearFull: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "full", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2012, + month: 1, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ နိုဝင်ဘာ 20 – 2012၊ ဇန်နဝါရီ 31'); + test.done(); + }, + + testDateRngFmtmyMMRangeMultiYearShort: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "short", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2014, + month: 1, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '11-11 – 01-14'); + test.done(); + }, + testDateRngFmtmyMMRangeMultiYearMedium: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "medium", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2014, + month: 1, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ နို – 2014၊ ဇန်'); + test.done(); + }, + testDateRngFmtmyMMRangeMultiYearLong: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "long", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2014, + month: 1, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ နိုဝင်ဘာ – 2014၊ ဇန်နဝါရီ'); + test.done(); + }, + testDateRngFmtmyMMRangeMultiYearFull: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "full", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2014, + month: 1, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), '2011၊ နိုဝင်ဘာ – 2014၊ ဇန်နဝါရီ'); + test.done(); + }, + testDateRngFmtmyMMManyYearsFull: function(test) { + test.expect(2); + var fmt = new DateRngFmt({locale: "my-MM", length: "full", useNative: false}); + test.ok(fmt !== null); + + var start = new GregorianDate({ + year: 2011, + month: 11, + day: 20, + hour: 13, + minute: 45, + second: 0, + millisecond: 0 + }); + var end = new GregorianDate({ + year: 2064, + month: 1, + day: 31, + hour: 14, + minute: 30, + second: 0, + millisecond: 0 + }); + test.equal(fmt.format(start, end), "2011 – 2064"); + test.done(); + } +}; \ No newline at end of file diff --git a/js/test/durfmt/testdurfmt2.js b/js/test/durfmt/testdurfmt2.js index b906854395..1de5674ddb 100644 --- a/js/test/durfmt/testdurfmt2.js +++ b/js/test/durfmt/testdurfmt2.js @@ -9402,6 +9402,47 @@ module.exports.testdurfmt2 = { test.equal(clockformatted_9[2], '9 घण्टा9 मिनेट9 सेकेन्ड'); test.equal(clockformatted_9[3], '9 घण्टा9 मिनेट9 सेकेन्ड'); + test.done(); + }, + testDurFmt_my_MM: function(test) { + test.expect(16); + // 1 14 + var textfmt; + var data = setVariable(); + var length = data["fullLength"]; + + var textformatted_1 = [], textformatted_14 = []; + var clockformatted_1 = [], clockformatted_14 = []; + + for (var i=0; i<4; i++) { + textfmt = new DurationFmt({locale: "my-MM", style:"text", length:length[i], useNative: false}); + textformatted_1.push(textfmt.format({year: 1,month: 1,week: 1,day: 1}).toString()); + textformatted_14.push(textfmt.format({year: 14,month: 14,week: 14,day: 14}).toString()); + + clockformatted_1.push(textfmt.format({hour: 1,minute: 1,second: 1}).toString()); + clockformatted_14.push(textfmt.format({hour: 14,minute: 14,second: 14}).toString()); + } + + test.equal(textformatted_1[0], '1 နှစ် 1 လ 1 ပတ်နှင့် 1 ရက်'); + test.equal(textformatted_1[1], '1 နှစ် 1 လ 1 ပတ် 1 ရက်'); + test.equal(textformatted_1[2], '1 နှစ် 1 လ 1 ပတ် 1 ရက်'); + test.equal(textformatted_1[3], '1 နှစ် 1 လ 1 ပတ် 1 ရက်'); + + test.equal(textformatted_14[0], '14 နှစ် 14 လ 14 ပတ်နှင့် 14 ရက်'); + test.equal(textformatted_14[1], '14 နှစ် 14 လ 14 ပတ် 14 ရက်'); + test.equal(textformatted_14[2], '14 နှစ် 14 လ 14 ပတ် 14 ရက်'); + test.equal(textformatted_14[3], '14 နှစ် 14 လ 14 ပတ် 14 ရက်'); + + test.equal(clockformatted_1[0], '1 နာရီ 1 မိနစ်နှင့် 1 စက္ကန့်'); + test.equal(clockformatted_1[1], '1 နာရီ 1 မိနစ် 1 စက္ကန့်'); + test.equal(clockformatted_1[2], '1 နာရီ 1 မိနစ် 1 s'); + test.equal(clockformatted_1[3], '1 နာရီ 1 မိနစ် 1 s'); + + test.equal(clockformatted_14[0], '14 နာရီ 14 မိနစ်နှင့် 14 စက္ကန့်'); + test.equal(clockformatted_14[1], '14 နာရီ 14 မိနစ် 14 စက္ကန့်'); + test.equal(clockformatted_14[2], '14 နာရီ 14 မိနစ် 14 s'); + test.equal(clockformatted_14[3], '14 နာရီ 14 မိနစ် 14 s'); + test.done(); } } diff --git a/js/test/number/testcurrency.js b/js/test/number/testcurrency.js index 63d3037f5e..377a62bfbb 100644 --- a/js/test/number/testcurrency.js +++ b/js/test/number/testcurrency.js @@ -1904,6 +1904,14 @@ module.exports.testcurrency = { test.done(); }, + testCurrency_my_MM: function(test) { + test.expect(2); + var info = new LocaleInfo("my-MM"); + test.ok(info !== null); + + test.equal(info.getCurrency(), "MMK"); + test.done(); + }, testCurrency_be_BY: function(test) { test.expect(2); var info = new LocaleInfo("be-BY"); diff --git a/js/test/number/testnumfmt.js b/js/test/number/testnumfmt.js index 502de700b3..b1c9301700 100644 --- a/js/test/number/testnumfmt.js +++ b/js/test/number/testnumfmt.js @@ -1,7 +1,11 @@ /* * testnumfmt.js - test the number formatter object * +<<<<<<< HEAD + * Copyright © 2012-2018 2020 JEDLSoft +======= * Copyright © 2012-2018, 2020 JEDLSoft +>>>>>>> development * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -6871,6 +6875,98 @@ module.exports.testnumfmt = { test.equal(fmt.format(12345678900), "1.23E+10"); test.done(); }, + + //test cases for my-MM + + testNumFmt_my_MM: function(test) { + test.expect(2); + var fmt = new NumFmt({ + locale: "my-MM", + maxFractionDigits: 2 + }); + test.ok(fmt); + test.equal(fmt.format(12340568.78), "၁၂,၃၄၀,၅၆၈.၇၈"); + test.done(); + }, + testNumFmtNative_my_MM: function(test) { + test.expect(2); + var fmt = new NumFmt({ + locale: "my-MM", + useNative: true, + maxFractionDigits: 2 + }); + test.ok(fmt); + test.equal(fmt.format(57.8), "၅၇.၈"); + test.done(); + }, + testNumFmtPercentageFormatRegular_my_MM: function(test) { + test.expect(2); + var fmt = new NumFmt({ + locale: "my-MM", + useNative: true, + type: "percentage" + }); + test.ok(fmt); + test.equal(fmt.format(-57.8), '-၅၇.၈%'); + test.done(); + }, + testNumFmtPercentageNativeFormatRegular_my_MM: function(test) { + test.expect(2); + var fmt = new NumFmt({ + locale: "my-MM", + type: "percentage" + }); + test.ok(fmt); + test.equal(fmt.format(-57.8), '-၅၇.၈%'); + test.done(); + }, + testNumFmtCurrencyFormatNativeCurrencyForLocale_my_MM1: function(test) { + test.expect(2); + var fmt = new NumFmt({ + type: "currency", + locale: "my-MM", + useNative: true, + currency: "MMK" + }); + test.ok(fmt); + test.equal(fmt.format(123.57), "၁၂၄ K"); + test.done(); + }, + testNumFmtCurrencyFormatNegativeNativeCurrencyForLocale_my_MM1: function(test) { + test.expect(2); + var fmt = new NumFmt({ + type: "currency", + locale: "my-MM", + useNative: true, + currency: "MMK" + }); + test.ok(fmt); + test.equal(fmt.format(-123.57), "-၁၂၄ K"); + test.done(); + }, + testNumFmtCurrencyFormatCorrectCurrencyForLocale_my_MM: function(test) { + test.expect(2); + var fmt = new NumFmt({ + type: "currency", + locale: "my-MM", + currency: "MMK" + }); + test.ok(fmt); + test.equal(fmt.format(123.57), "၁၂၄ K"); + test.done(); + }, + testNumFmtPercentageFormatRegular_my_MM: function(test) { + test.expect(2); + var fmt = new NumFmt({ + locale: "my-MM", + useNative: true, + type: "percentage" + }); + test.ok(fmt); + test.equal(fmt.format(-1234568.78), "-၁,၂၃၄,၅၆၈.၇၈%"); + test.done(); + }, + //test cases for ne-NP testNumFmt_ne_NP: function(test) { test.expect(2); @@ -6890,9 +6986,10 @@ module.exports.testnumfmt = { maxFractionDigits: 2 }); test.ok(fmt); - test.equal(fmt.format(-1234568.78), "-१,२३४,५६८.७८"); + test.equal(fmt.format(-123.57), "-१२३.५७"); test.done(); }, + testNumFmtCurrencyFormatNativeCurrencyForLocale_ne_NP1: function(test) { test.expect(2); var fmt = new NumFmt({ diff --git a/js/test/number/testnumfmt2.js b/js/test/number/testnumfmt2.js index b89bbc46e7..05ad77d65a 100644 --- a/js/test/number/testnumfmt2.js +++ b/js/test/number/testnumfmt2.js @@ -3944,5 +3944,24 @@ module.exports.testnumfmt2 = { test.equal(li.getCurrencyFormats().commonNegative, "-{s} {n}"); test.equal(curfmt.format(57.05), "Rs 57.05"); //NPR test.done(); + }, + testNumFmt_my_MM: function(test) { + test.expect(9); + var li = new LocaleInfo("my-MM"); + var fmt = new NumFmt({locale:"my-MM", type:"standard", useNative:false}); + test.equal(li.getDecimalSeparator(), "."); + test.equal(li.getGroupingSeparator(), ","); + test.equal(fmt.format(123456789.45), "123,456,789.45"); + + var pctfmt = new NumFmt({locale:"my-MM", type:"percentage", useNative:false}); + test.equal(li.getPercentageFormat(), "{n}%"); + test.equal(li.getNegativePercentageFormat(), "-{n}%"); + test.equal(pctfmt.format(34), "34%"); + + var curfmt = new NumFmt({locale: "my-MM", type: "currency", useNative:false, currency:li.getCurrency()}); + test.equal(li.getCurrencyFormats().common, "{n} {s}"); + test.equal(li.getCurrencyFormats().commonNegative, "-{n} {s}"); + test.equal(curfmt.format(57.05), "57 K"); + test.done(); } } \ No newline at end of file diff --git a/js/test/root/testcountry.js b/js/test/root/testcountry.js index a7a33391f6..179791fef4 100644 --- a/js/test/root/testcountry.js +++ b/js/test/root/testcountry.js @@ -303,6 +303,33 @@ module.exports.testcountry = { test.equal(locale.toString(), "eu-ES"); test.done(); }, + testCountryLocale_my_MM: function(test) { + test.expect(4); + var ctry = new Country({ + locale: "my-MM" + }); + test.ok(ctry !== null); + + test.equal(ctry.getName("MO"),"မကာအို (တရုတ်ပြည်)"); + test.equal(ctry.getCode("မကာအို (တရုတ်ပြည်)"), "MO"); + var locale = ctry.getLocale(); + test.equal(locale.toString(), "my-MM"); + test.done(); + }, + testCountryLocale_my_MM2: function(test) { + test.expect(4); + var ctry = new Country({ + locale: "my-MM" + }); + test.ok(ctry !== null); + + test.equal(ctry.getName("KR"),"တောင်ကိုရီးယား"); + test.equal(ctry.getCode('တောင်ကိုရီးယား'), "KR"); + var locale = ctry.getLocale(); + test.equal(locale.toString(), "my-MM"); + test.done(); + }, + testCountryLocale_ne_NP: function(test) { test.expect(4); var ctry = new Country({ diff --git a/js/test/root/testlocaleinfo.js b/js/test/root/testlocaleinfo.js index 1719d2d3ad..5c9260df6e 100644 --- a/js/test/root/testlocaleinfo.js +++ b/js/test/root/testlocaleinfo.js @@ -13449,6 +13449,16 @@ module.exports.testlocaleinfo = { test.equal(info.getPaperSize(), "A4"); test.done(); }, + testLocaleInfoQuotation_my_MM: function(test) { + test.expect(4); + var info = new LocaleInfo("my-MM"); + test.ok(info !== null); + + test.equal(info.getDelimiterQuotationStart(), "“"); + test.equal(info.getDelimiterQuotationEnd(), "”"); + test.equal(info.getPaperSize(), "A4"); + test.done(); + }, testLocaleInfoQuotation_ne_NP: function(test) { test.expect(4); var info = new LocaleInfo("ne-NP"); diff --git a/js/test/root/testlocalematch.js b/js/test/root/testlocalematch.js index ffab5b1874..19e5f2e470 100644 --- a/js/test/root/testlocalematch.js +++ b/js/test/root/testlocalematch.js @@ -1260,6 +1260,28 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "eu-Latn-ES"); test.done(); }, + testLocaleMatcherGetLikelyLocaleByLocaleCode_my_MM: function(test) { + test.expect(3); + var lm = new LocaleMatcher({ + locale: "my-MM" + }); + test.ok(typeof(lm) !== "undefined"); + var locale = lm.getLikelyLocale(); + test.ok(typeof(locale) !== "undefined"); + test.equal(locale.getSpec(), "my-Mymr-MM"); + test.done(); + }, + testLocaleMatcherGetLikelyLocaleByLocaleCode_my: function(test) { + test.expect(3); + var lm = new LocaleMatcher({ + locale: "my" + }); + test.ok(typeof(lm) !== "undefined"); + var locale = lm.getLikelyLocale(); + test.ok(typeof(locale) !== "undefined"); + test.equal(locale.getSpec(), "my-Mymr-MM"); + test.done(); + }, testLocaleMatcherGetLikelyLocaleByLocaleCode_ne: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -1970,6 +1992,17 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "ka-GE"); test.done(); }, + testLocaleMatcherGetLikelyLocaleMinimalDefaultScriptForCountry_MM: function(test) { + test.expect(3); + var lm = new LocaleMatcher({ + locale: "MM" + }); + test.ok(typeof(lm) !== "undefined"); + var locale = lm.getLikelyLocaleMinimal(); + test.ok(typeof(locale) !== "undefined"); + test.equal(locale.getSpec(), "my-MM"); + test.done(); + }, testLocaleMatcherGetLikelyLocaleMinimalDefaultScriptForCountry_KG: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -1993,7 +2026,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "ca-AD"); test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalDefaultLocaleForScript1: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2125,6 +2157,28 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "ar-Hebr-IL"); test.done(); }, + testLocaleMatcherGetLikelyLocaleMinimalNonDefaultLocaleForLangScript_my_Mymr: function(test) { + test.expect(3); + var lm = new LocaleMatcher({ + locale: "my-Mymr" + }); + test.ok(typeof(lm) !== "undefined"); + var locale = lm.getLikelyLocaleMinimal(); + test.ok(typeof(locale) !== "undefined"); + test.equal(locale.getSpec(), "my-MM"); + test.done(); + }, + testLocaleMatcherGetLikelyLocaleMinimalNonDefaultLocaleForLangScript_Mymr: function(test) { + test.expect(3); + var lm = new LocaleMatcher({ + locale: "Mymr" + }); + test.ok(typeof(lm) !== "undefined"); + var locale = lm.getLikelyLocaleMinimal(); + test.ok(typeof(locale) !== "undefined"); + test.equal(locale.getSpec(), "my-MM"); + test.done(); + }, testLocaleMatcherGetLikelyLocaleMinimalNonDefaultLocaleForLangScript_ne_Deva: function(test) { test.expect(3); var lm = new LocaleMatcher({ diff --git a/js/test/root/testscriptinfo.js b/js/test/root/testscriptinfo.js index a70b3eba2d..3ce7f63cfd 100644 --- a/js/test/root/testscriptinfo.js +++ b/js/test/root/testscriptinfo.js @@ -2266,6 +2266,16 @@ module.exports.testscriptinfo = { test.equal(scinfo.getScriptDirection(), "ltr"); test.done(); }, + testScriptInfo_my_MM: function(test) { + test.expect(4); + var li = new LocaleInfo("my-MM"); + var scinfo = new ScriptInfo(li.getScript()); + test.ok(li !== null); + test.ok(scinfo !== null); + test.equal(li.getScript(), "Mymr"); + test.equal(scinfo.getScriptDirection(), "ltr"); + test.done(); + }, testScriptInfo_ne_NP: function(test) { test.expect(4); var li = new LocaleInfo("ne-NP"); diff --git a/js/test/root/teststrings.js b/js/test/root/teststrings.js index 2cf1339a11..c6af593467 100644 --- a/js/test/root/teststrings.js +++ b/js/test/root/teststrings.js @@ -3352,6 +3352,27 @@ module.exports.teststrings = { test.equal(str.formatChoice(16), "Default items"); test.done(); }, + testStringFormatChoiceCharClasses_my_MM: function(test) { + test.expect(2); + var str = new IString("0#There are no items.|one#There items are one|few#The items are few|many#The items are many|#Default items"); + str.setLocale("my-MM"); + + test.ok(str !== null); + + test.equal(str.formatChoice(1), "There items are one"); + test.done(); + }, + testStringFormatChoiceCharClasses_my_MM2: function(test) { + test.expect(2); + var str = new IString("0#There are no items.|one#There items are one|few#The items are few|many#The items are many|#Default items"); + str.setLocale("my-MM"); + + test.ok(str !== null); + + test.equal(str.formatChoice(5), "Default items"); + test.done(); + }, + testStringFormatChoiceCharClassesComplex1: function(test) { test.expect(2); var str = new IString("0#There are no items.|one#There items are one|few#The items are few|many#The items are many|#Default items"); @@ -3951,6 +3972,26 @@ module.exports.teststrings = { test.equal(str.formatChoice(1.7), "Default items"); test.done(); }, + testStringFormatChoiceDecimal_my_MM: function(test) { + test.expect(2); + var str = new IString("0#There are no items.|one#There items are one|few#The items are few|many#The items are many|#Default items"); + str.setLocale("my-MM"); + + test.ok(str !== null); + + test.equal(str.formatChoice(1.0), "There items are one"); + test.done(); + }, + testStringFormatChoiceDecimal_my_MM2: function(test) { + test.expect(2); + var str = new IString("0#There are no items.|one#There items are one|few#The items are few|many#The items are many|#Default items"); + str.setLocale("my-MM"); + + test.ok(str !== null); + + test.equal(str.formatChoice(3.7), "Default items"); + test.done(); + }, testStringFormatChoiceDecimal_ne_NP: function(test) { test.expect(2); var str = new IString("0#There are no items.|one#There items are one|few#The items are few|many#The items are many|#Default items"); diff --git a/js/test/strings-ext/testSuite.html b/js/test/strings-ext/testSuite.html index f730fef158..f1db51036c 100644 --- a/js/test/strings-ext/testSuite.html +++ b/js/test/strings-ext/testSuite.html @@ -59,6 +59,7 @@ + diff --git a/js/test/strings-ext/testSuiteCompiled.html b/js/test/strings-ext/testSuiteCompiled.html index aaa46776d0..b5e447a042 100644 --- a/js/test/strings-ext/testSuiteCompiled.html +++ b/js/test/strings-ext/testSuiteCompiled.html @@ -58,6 +58,7 @@ + diff --git a/js/test/strings-ext/testSuiteFiles.js b/js/test/strings-ext/testSuiteFiles.js index e506d05d90..70d5984b95 100644 --- a/js/test/strings-ext/testSuiteFiles.js +++ b/js/test/strings-ext/testSuiteFiles.js @@ -48,6 +48,7 @@ module.exports.files = [ "testlistfmt_ml_IN.js", "testlistfmt_mr_IN.js", "testlistfmt_ms.js", + "testlistfmt_my_MM.js", "testlistfmt_nb_NO.js", "testlistfmt_ne_NP.js", "testlistfmt_nl.js", diff --git a/js/test/strings-ext/testlistfmt_my_MM.js b/js/test/strings-ext/testlistfmt_my_MM.js new file mode 100644 index 0000000000..e32de326c1 --- /dev/null +++ b/js/test/strings-ext/testlistfmt_my_MM.js @@ -0,0 +1,253 @@ +/* + * testlistfmt_my_MM.js - test the list formatter object + * + * Copyright © 2020, JEDLSoft + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSe-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +if (typeof(ListFmt) === "undefined") { + var ListFmt = require("../../lib/ListFmt.js"); +} + +if (typeof(ilib) === "undefined") { + var ilib = require("../../lib/ilib.js"); +} + +module.exports.testlistfmt_my_MM = { + setUp: function(callback) { + ilib.clearCache(); + callback(); + }, + testListFmtNumberFormatOne_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္"]), "တစ္"); + test.done(); + }, + testListFmtNumberFormatTwo_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္", "ႎႀစ္"]), 'တစ္နှင့် ႎႀစ္'); + test.done(); + }, + testListFmtNumberFormatThree_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္", "ႎႀစ္", "သံုး"]), 'တစ္ ႎႀစ္နှင့် သံုး'); + test.done(); + }, + testListFmtNumberFormatFour_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္", "ႎႀစ္", "သံုး", "ေလး"]), 'တစ္ ႎႀစ္ သံုးနှင့် ေလး'); + test.done(); + }, + testListFmtNumberFormatFive_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္", "ႎႀစ္", "သံုး", "ေလး", "ငၝး"]), 'တစ္ ႎႀစ္ သံုး ေလးနှင့် ငၝး'); + test.done(); + }, + testListFmtUnitStyleNumberFormatOneShort_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM", + style: "unit" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္"]), "တစ္"); + test.done(); + }, + testListFmtUnitStyleNumberFormatTwoShort_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM", + style: "unit" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္", "ႎႀစ္"]), 'တစ္နှင့် ႎႀစ္'); + test.done(); + }, + testListFmtUnitStyleNumberFormatThreeShort_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM", + style: "unit" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္", "ႎႀစ္", "သံုး"]), 'တစ္ ႎႀစ္နှင့် သံုး'); + test.done(); + }, + testListFmtUnitStyleNumberFormatFourShort_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM", + style: "unit" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္", "ႎႀစ္", "သံုး", "ေလး"]), 'တစ္ ႎႀစ္ သံုးနှင့် ေလး'); + test.done(); + }, + testListFmtUnitStyleNumberFormatFiveShort_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM", + style: "unit" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္", "ႎႀစ္", "သံုး", "ေလး", "ငၝး"]), 'တစ္ ႎႀစ္ သံုး ေလးနှင့် ငၝး'); + test.done(); + }, + testListFmtUnitStyleNumberFormatOneFull_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM", + style: "unit", + length: "full" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္"]), "တစ္"); + test.done(); + }, + testListFmtUnitStyleNumberFormatTwoFull_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM", + style: "unit", + length: "full" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္", "ႎႀစ္"]), 'တစ္နှင့်ႎႀစ္'); + test.done(); + }, + testListFmtUnitStyleNumberFormatThreeFull_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM", + style: "unit", + length: "full" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္", "ႎႀစ္", "သံုး"]), 'တစ္ ႎႀစ္နှင့် သံုး'); + test.done(); + }, + testListFmtUnitStyleNumberFormatFourFull_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM", + style: "unit", + length: "full" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္", "ႎႀစ္", "သံုး", "ေလး"]), 'တစ္ ႎႀစ္ သံုးနှင့် ေလး'); + test.done(); + }, + testListFmtUnitStyleNumberFormatFiveFull_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM", + style: "unit", + length: "full" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္", "ႎႀစ္", "သံုး", "ေလး", "ငၝး"]), 'တစ္ ႎႀစ္ သံုး ေလးနှင့် ငၝး'); + test.done(); + }, + testListFmtORStyleNumberFormatOne_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM", + style: "disjunction" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္"]), "တစ္"); + test.done(); + }, + testListFmtORStyleNumberFormatTwo_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM", + style: "disjunction" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္", "ႎႀစ္"]), 'တစ္ သို့မဟုတ် ႎႀစ္'); + test.done(); + }, + testListFmtORStyleNumberFormatThree_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM", + style: "disjunction" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္", "ႎႀစ္", "သံုး"]), 'တစ္ ၊ ႎႀစ္ သို့မဟုတ် သံုး'); + test.done(); + }, + testListFmtORStyleNumberFormatFour_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM", + style: "disjunction" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္", "ႎႀစ္", "သံုး", "ေလး"]), 'တစ္ ၊ ႎႀစ္ သံုး သို့မဟုတ် ေလး'); + test.done(); + }, + testListFmtORStyleNumberFormatFiveFull_my_MM: function(test) { + var fmt = new ListFmt({ + locale: "my-MM", + style: "disjunction" + }); + + test.expect(2); + test.ok(fmt !== null); + test.equal(fmt.format(["တစ္", "ႎႀစ္", "သံုး", "ေလး", "ငၝး"]), 'တစ္ ၊ ႎႀစ္ သံုး ေလး သို့မဟုတ် ငၝး'); + test.done(); + } +}; \ No newline at end of file diff --git a/js/test/testSuite.html b/js/test/testSuite.html index 851d165de9..763fc60b5c 100644 --- a/js/test/testSuite.html +++ b/js/test/testSuite.html @@ -1,7 +1,7 @@