From 53c713907cb47f20ea782b6a86f534f6781e9837 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Thu, 6 Dec 2018 11:01:22 -0800 Subject: [PATCH 01/38] Take a stab at defining DateFmt.getFormatInfo() --- js/lib/AddressFmt.js | 2 +- js/lib/DateFmt.js | 253 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 254 insertions(+), 1 deletion(-) diff --git a/js/lib/AddressFmt.js b/js/lib/AddressFmt.js index 5df9d2bf64..896099b084 100644 --- a/js/lib/AddressFmt.js +++ b/js/lib/AddressFmt.js @@ -370,7 +370,7 @@ function invertAndFilter(object) { * // like "City" and "Postal Code" translated to. In this example, we * // are showing an input form for Dutch addresses, but the labels are * // written in US English. - * fmt.getAddressFormatInfo("en-US", true, ilib.bind(this, function(rows) { + * fmt.getFormatInfo("en-US", true, ilib.bind(this, function(rows) { * // iterate through the rows array and dynamically create the input * // elements with the given labels * })); diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index d6c060d9c6..fc28154f83 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -1606,4 +1606,257 @@ DateFmt.prototype = { } }; +/** + * Return information about the date format that can be used + * by UI builders to display a locale-sensitive set of input fields + * based on the current formatter's settings.

+ * + * The object returned by this method is an array of date + * format components. Each format component is an object + * that contains a "component" property and a "label" to display + * with it. The label is written in the given locale, or the + * locale of this formatter if the locale was not given.

+ * + * Field separators such as slashes or dots, etc., are given + * as a object with no component property. It only contains + * a label property.

+ * + * Optionally, if a format component is constrained to a + * particular pattern or to a fixed list of possible values, then + * the constraint rules are given in the "constraint" property. + * The values in the constraint property can be one of three types: + * + *

    + *
+ * + * Here is what the result would look like for a US short + * date/time format that includes the components of date, month, + * year, hour, minute, and meridiem: + *
+ * [
+ *   {
+ *     "component": "month",
+ *     "label": "Month",
+ *     "constraint": [1, 12]
+ *   },
+ *   {
+ *     "label": "/"
+ *   },
+ *   {
+ *     "component": "day",
+ *     "label": "Date",
+ *     "constraint": {
+ *       "leap": {
+ *          "1": [1, 31],
+ *          "2": [1, 29],
+ *          "3": [1, 31],
+ *          "4": [1, 30],
+ *          "5": [1, 31],
+ *          "6": [1, 30],
+ *          "7": [1, 31],
+ *          "8": [1, 31],
+ *          "9": [1, 30],
+ *          "10": [1, 31],
+ *          "11": [1, 30],
+ *          "12": [1, 31]
+ *       },
+ *       "regular": {
+ *          "1": [1, 31],
+ *          "2": [1, 28],
+ *          "3": [1, 31],
+ *          "4": [1, 30],
+ *          "5": [1, 31],
+ *          "6": [1, 30],
+ *          "7": [1, 31],
+ *          "8": [1, 31],
+ *          "9": [1, 30],
+ *          "10": [1, 31],
+ *          "11": [1, 30],
+ *          "12": [1, 31]
+ *       }
+ *     }
+ *   {
+ *     "label": "/"
+ *   },
+ *   {
+ *     "component": "year",
+ *     "label": "Year",
+ *     "constraint": "[0-9]+"
+ *   },
+ *   {
+ *     "label": " at "
+ *   },
+ *   {
+ *     "component": "hour",
+ *     "label": "Hour",
+ *     "constraint": [1, 12]
+ *   },
+ *   {
+ *     "label": ":"
+ *   },
+ *   {
+ *     "component": "minute",
+ *     "label": "Minute",
+ *     "constraint": [
+ *       "00",
+ *       "01",
+ *       "02",
+ *       "03",
+ *       "04",
+ *       "05",
+ *       "06",
+ *       "07",
+ *       "08",
+ *       "09",
+ *       "10",
+ *       "11",
+ *       ...
+ *       "59"
+ *     ]
+ *   },
+ *   {
+ *     "label": " "
+ *   },
+ *   {
+ *     "component": "meridiem",
+ *     "label": "AM/PM",
+ *     "constraint": ["AM", "PM"]
+ *   }
+ * ]
+ * 
+ *

+ * @example Example of calling the getFormatInfo method + * + * // the DateFmt should be created with the locale of the date you + * // would like the user to enter. + * new DateFmt({ + * locale: 'nl-NL', // for dates in the Netherlands + * onLoad: ilib.bind(this, function(fmt) { + * // The following is the locale of the UI you would like to see the labels + * // like "Year" and "Minute" translated to. In this example, we + * // are showing an input form for Dutch dates, but the labels are + * // written in US English. + * fmt.getFormatInfo("en-US", true, ilib.bind(this, function(components) { + * // iterate through the component array and dynamically create the input + * // elements with the given labels + * })); + * }) + * }); + * + * @param {Locale|string=} locale the locale to translate the labels + * to. If not given, the locale of the formatter will be used. + * @param {boolean=} sync true if this method should load the data + * synchronously, false if async + * @param {Function=} callback a callback to call when the data + * is ready + * @returns {Array.} An array date components + */ +DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { + var info; + var loc = new Locale(this.locale); + if (locale) { + if (typeof(locale) === "string") { + locale = new Locale(locale); + } + loc.language = locale.getLanguage(); + loc.spec = undefined; + } + + Utils.loadData({ + name: "regionnames.json", + object: "DateFmt", + locale: loc, + sync: this.sync, + loadParams: JSUtils.merge(this.loadParams, {returnOne: true}, true), + callback: ilib.bind(this, function(regions) { + this.regions = regions; + + new ResBundle({ + locale: loc, + name: "sysres", + sync: this.sync, + loadParams: this.loadParams, + onLoad: ilib.bind(this, function (rb) { + var type, format, fields = this.info.fields || defaultData.fields; + if (this.info.multiformat) { + type = isAsianLocale(this.locale) ? "asian" : "latin"; + fields = this.info.fields[type]; + } + + if (typeof(this.style) === 'object') { + format = this.style[type || "latin"]; + } else { + format = this.style; + } + new Address(" ", { + locale: loc, + sync: this.sync, + loadParams: this.loadParams, + onLoad: ilib.bind(this, function(localeAddress) { + var rows = format.split(/\n/g); + info = rows.map(ilib.bind(this, function(row) { + return row.split("}").filter(function(component) { + return component.length > 0; + }).map(ilib.bind(this, function(component) { + var name = component.replace(/.*{/, ""); + var obj = { + component: name, + label: rb.getStringJS(this.info.fieldNames[name]) + }; + var field = fields.filter(function(f) { + return f.name === name; + }); + if (field && field[0] && field[0].pattern) { + if (typeof(field[0].pattern) === "string") { + obj.constraint = field[0].pattern; + } + } + if (name === "country") { + obj.constraint = invertAndFilter(localeAddress.ctrynames); + } else if (name === "region" && this.regions[loc.getRegion()]) { + obj.constraint = this.regions[loc.getRegion()]; + } + return obj; + })); + })); + + if (callback && typeof(callback) === "function") { + callback(info); + } + }) + }); + }) + }); + }) + }); + + return info; +}; + + module.exports = DateFmt; From 40ce1e11ddcfade93b51c27cced3b16e959bf050 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Fri, 7 Dec 2018 01:02:53 -0800 Subject: [PATCH 02/38] Added unit tests and updated the documentation --- js/data/locale/dateres.json | 10 + js/lib/DateFmt.js | 49 +- js/test/date/testdatefmt.js | 1213 ++++++++++++++++++++--------------- 3 files changed, 723 insertions(+), 549 deletions(-) create mode 100644 js/data/locale/dateres.json diff --git a/js/data/locale/dateres.json b/js/data/locale/dateres.json new file mode 100644 index 0000000000..a9d8f0e598 --- /dev/null +++ b/js/data/locale/dateres.json @@ -0,0 +1,10 @@ +{ + "month": "Month", + "day": "Date", + "year": "Year", + "hour": "Hour", + "minute": "Minute", + "second": "Second", + "meridium": "AM/PM", + "timezone": "Time Zone" +} \ No newline at end of file diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index fc28154f83..09f7ac47ee 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -1614,44 +1614,55 @@ DateFmt.prototype = { * The object returned by this method is an array of date * format components. Each format component is an object * that contains a "component" property and a "label" to display - * with it. The label is written in the given locale, or the - * locale of this formatter if the locale was not given.

+ * with it. The component is the name of the property to use + * when constructing a new date with DateFactory(). The label + * is intended to be shown to the user and is written in the + * given locale, or the locale of this formatter if the + * locale was not given.

* * Field separators such as slashes or dots, etc., are given - * as a object with no component property. It only contains - * a label property.

+ * as a object with no "component" property. They only contain + * a "label" property with a string value. A user interface + * may choose to omit these if desired.

* * Optionally, if a format component is constrained to a - * particular pattern or to a fixed list of possible values, then - * the constraint rules are given in the "constraint" property. - * The values in the constraint property can be one of three types: + * particular pattern, range, or to a fixed list of possible + * values, then these constraint rules are given in the + * "constraint" property. + * The values in the constraint property can be one of these + * types: * *

    *
      array[2]<number> - an array of size 2 of numbers * that gives the start and end of a numeric range. *
        array<object> - an array of valid string values * given as objects that have "label" and "value" properties. The - * label is to be displayed to the user and the value is to be used - * to construct the new IDate object when the user has finished + * label is intended to be displayed to the user and the value + * is to be used to construct the new date object when the + * user has finished * selecting the components and the form is being evaluated or * submitted. *
          object - conditional constraints. In some cases, * the list of possible values for the months * or the days depends on which year and month is being - * displayed. When this happens, the constraint property is + * displayed. When this happens, the "constraint" property is * given as an object that gives the different sets of values - * depending on a property. For example, the list of month + * depending on a condition. The name of the condition is + * given in the "condition" property of this object. + * For example, the list of month * names in a Hebrew calendar depends on whether or not the * year is a leap year. In leap years, there are 13 months, - * and in regular years, there are 12 months. The constraint + * and in regular years, there are 12 months. The "constraint" * property for Hebrew calendars is returned as an object * that contains three properties, "condition", "leap", * and "regular". The "condition" says what the condition is - * based on, and each of "leap" and "regular" are + * based on (ie. whether or not it is a leap year), and + * each of "leap" and "regular" are * an array of strings that give the month names. - * It is up to the caller to create an IDate object for the + * It is up to the caller to create an date object with + * the DateFactory() function for the * given year and ask it whether or not it represents a - * leap year and display the correct list in the UI. + * leap year and then display the correct list in the UI. *
* * Here is what the result would look like for a US short @@ -1671,6 +1682,7 @@ DateFmt.prototype = { * "component": "day", * "label": "Date", * "constraint": { + * "condition": "leapyear", * "leap": { * "1": [1, 31], * "2": [1, 29], @@ -1750,6 +1762,10 @@ DateFmt.prototype = { * ] * *

+ * Note that the "minute" component comes with a preformatted list of values + * as strings, even though the minute is really a number. The preformatting + * ensures that the leading zero is not lost for minutes less than 10. + * * @example Example of calling the getFormatInfo method * * // the DateFmt should be created with the locale of the date you @@ -1771,7 +1787,8 @@ DateFmt.prototype = { * @param {Locale|string=} locale the locale to translate the labels * to. If not given, the locale of the formatter will be used. * @param {boolean=} sync true if this method should load the data - * synchronously, false if async + * synchronously and return it immediately, false if async operation is + * needed. * @param {Function=} callback a callback to call when the data * is ready * @returns {Array.} An array date components diff --git a/js/test/date/testdatefmt.js b/js/test/date/testdatefmt.js index 7bc311f4dc..7196a5d95b 100644 --- a/js/test/date/testdatefmt.js +++ b/js/test/date/testdatefmt.js @@ -1,6 +1,6 @@ /* * testdatefmt.js - test the date formatter object - * + * * Copyright © 2012-2015,2017, JEDLSoft * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -47,7 +47,7 @@ if (typeof(DateFactory) === "undefined") { function mockLoaderDF(paths, sync, params, callback) { var data = []; - + paths.forEach(function(path) { if (path === "localeinfo.json") { data.push(ilib.data.localeinfo); // for the generic, shared stuff @@ -61,7 +61,7 @@ function mockLoaderDF(paths, sync, params, callback) { }); if (typeof(callback) !== 'undefined') { - callback.call(this, data); + callback.call(this, data); } return data; } @@ -82,57 +82,57 @@ module.exports.testdatefmt = { testDateFmtConstructorEmpty: function(test) { test.expect(1); var fmt = new DateFmt(); - + test.ok(fmt !== null); test.done(); }, - + testDateFmtConstructorDefaultLocale: function(test) { test.expect(2); var fmt = new DateFmt(); - + test.ok(fmt !== null); - + test.equal(fmt.getLocale().toString(), "en-US"); test.done(); }, - + testDateFmtGetCalendarDefault: function(test) { test.expect(3); var fmt = new DateFmt(); - + test.ok(fmt !== null); var cal = fmt.getCalendar(); test.ok(cal !== null); - + test.equal(cal, "gregorian"); test.done(); }, - + testDateFmtGetCalendarExplicit: function(test) { test.expect(3); var fmt = new DateFmt({calendar: "julian"}); - + test.ok(fmt !== null); var cal = fmt.getCalendar(); test.ok(cal !== null); - + test.equal(cal, "julian"); test.done(); }, - + testDateFmtGetCalendarExplicitDefault: function(test) { test.expect(3); var fmt = new DateFmt({calendar: "gregorian"}); - + test.ok(fmt !== null); var cal = fmt.getCalendar(); test.ok(cal !== null); - + test.equal(cal, "gregorian"); test.done(); }, - + testDateFmtGetCalendarNotInThisLocale: function(test) { try { new DateFmt({calendar: "arabic", locale: 'en-US'}); @@ -143,308 +143,308 @@ module.exports.testdatefmt = { } test.done(); }, - + testDateFmtGetLength: function(test) { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + test.equal(fmt.getLength(), "full"); test.done(); }, - + testDateFmtGetLengthDefault: function(test) { test.expect(2); var fmt = new DateFmt(); test.ok(fmt !== null); - + test.equal(fmt.getLength(), "short"); test.done(); }, - + testDateFmtGetLengthBogus: function(test) { test.expect(2); var fmt = new DateFmt({length: "asdf"}); test.ok(fmt !== null); - + test.equal(fmt.getLength(), "short"); test.done(); }, - - + + testDateFmtGetType: function(test) { test.expect(2); var fmt = new DateFmt({type: "time"}); test.ok(fmt !== null); - + test.equal(fmt.getType(), "time"); test.done(); }, - + testDateFmtGetTypeDefault: function(test) { test.expect(2); var fmt = new DateFmt(); test.ok(fmt !== null); - + test.equal(fmt.getType(), "date"); test.done(); }, - + testDateFmtGetTypeBogus: function(test) { test.expect(2); var fmt = new DateFmt({type: "asdf"}); test.ok(fmt !== null); - + test.equal(fmt.getType(), "date"); test.done(); }, - - + + testDateFmtGetLocale: function(test) { test.expect(2); var fmt = new DateFmt({locale: "de-DE"}); test.ok(fmt !== null); - + test.equal(fmt.getLocale().toString(), "de-DE"); test.done(); }, - + testDateFmtGetLocaleDefault: function(test) { test.expect(2); var fmt = new DateFmt(); test.ok(fmt !== null); - + test.equal(fmt.getLocale().toString(), "en-US"); test.done(); }, - + testDateFmtGetLocaleBogus: function(test) { test.expect(2); var fmt = new DateFmt({locale: "zyy-XX"}); test.ok(fmt !== null); - + test.equal(fmt.getLocale().toString(), "zyy-XX"); test.done(); }, - + testDateFmtGetTimeComponentsDefault: function(test) { test.expect(2); var fmt = new DateFmt(); test.ok(fmt !== null); - + test.equal(fmt.getTimeComponents(), "ahm"); test.done(); }, - + testDateFmtGetTimeComponents: function(test) { test.expect(2); var fmt = new DateFmt({time: "hmsaz"}); test.ok(fmt !== null); - + test.equal(fmt.getTimeComponents(), "ahmsz"); test.done(); }, - + testDateFmtGetTimeComponentsReorder: function(test) { test.expect(2); var fmt = new DateFmt({time: "zahms"}); test.ok(fmt !== null); - + test.equal(fmt.getTimeComponents(), "ahmsz"); test.done(); }, - + testDateFmtGetTimeComponentsBogus: function(test) { test.expect(2); var fmt = new DateFmt({time: "asdf"}); test.ok(fmt !== null); - + // use the default test.equal(fmt.getTimeComponents(), "ahm"); test.done(); }, - + testDateFmtGetTimeComponentsICUSkeleton1: function(test) { test.expect(2); var fmt = new DateFmt({time: "EHm"}); test.ok(fmt !== null); - + test.equal(fmt.getTimeComponents(), "hm"); test.done(); }, - + testDateFmtGetTimeComponentsICUSkeleton2: function(test) { test.expect(2); var fmt = new DateFmt({time: "Hms"}); test.ok(fmt !== null); - + test.equal(fmt.getTimeComponents(), "hms"); test.done(); }, - + testDateFmtGetTimeComponentsICUSkeleton3: function(test) { test.expect(2); var fmt = new DateFmt({time: "Ehms"}); test.ok(fmt !== null); - + // ignore the non-time components test.equal(fmt.getTimeComponents(), "hms"); test.done(); }, - + testDateFmtGetTimeComponentsICUSkeleton3: function(test) { test.expect(2); var fmt = new DateFmt({time: "yMdhms"}); test.ok(fmt !== null); - + // ignore the non-time components test.equal(fmt.getTimeComponents(), "hms"); test.done(); }, - + testDateFmtGetDateComponentsDefault: function(test) { test.expect(2); var fmt = new DateFmt(); test.ok(fmt !== null); - + test.equal(fmt.getDateComponents(), "dmy"); test.done(); }, - + testDateFmtGetDateComponents: function(test) { test.expect(2); var fmt = new DateFmt({date: "dmwy"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponents(), "dmwy"); test.done(); }, - + testDateFmtGetDateComponentsReorder: function(test) { test.expect(2); var fmt = new DateFmt({date: "wmdy"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponents(), "dmwy"); test.done(); }, - + testDateFmtGetDateComponentsBogus: function(test) { test.expect(2); var fmt = new DateFmt({date: "asdf"}); test.ok(fmt !== null); - + // use the default test.equal(fmt.getDateComponents(), "dmy"); test.done(); }, - + testDateFmtGetDateComponentsICUSkeleton1: function(test) { test.expect(2); var fmt = new DateFmt({date: "yMMMMd"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponents(), "dmy"); test.done(); }, - + testDateFmtGetDateComponentsICUSkeleton2: function(test) { test.expect(2); var fmt = new DateFmt({date: "yMMd"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponents(), "dmy"); test.done(); }, - + testDateFmtGetDateComponentsICUSkeleton3: function(test) { test.expect(2); var fmt = new DateFmt({date: "yMMMM"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponents(), "my"); test.done(); }, - + testDateFmtGetDateComponentsICUSkeleton4: function(test) { test.expect(2); var fmt = new DateFmt({date: "MMMEd"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponents(), "dmw"); test.done(); }, - + testDateFmtGetDateComponentsICUSkeleton5: function(test) { test.expect(2); var fmt = new DateFmt({date: "GyMMMEd"}); test.ok(fmt !== null); - + // ignore the era test.equal(fmt.getDateComponents(), "dmwy"); test.done(); }, - + testDateFmtGetDateComponentsICUSkeleton6: function(test) { test.expect(2); var fmt = new DateFmt({date: "MMddhms"}); test.ok(fmt !== null); - + // ignore the time components test.equal(fmt.getDateComponents(), "dm"); test.done(); }, - + testDateFmtGetClockDefaultUS: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US"}); test.ok(fmt !== null); - + // use the default test.equal(fmt.getClock(), "12"); test.done(); }, - + testDateFmtGetClockDefaultDE: function(test) { test.expect(2); var fmt = new DateFmt({locale: "de-DE"}); test.ok(fmt !== null); - + // use the default test.equal(fmt.getClock(), "24"); test.done(); }, - + testDateFmtGetClockDefaultJP: function(test) { test.expect(2); var fmt = new DateFmt({locale: "ja-JP"}); test.ok(fmt !== null); - + // use the default test.equal(fmt.getClock(), "24"); test.done(); }, - + testDateFmtGetClock: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US", clock: "24"}); test.ok(fmt !== null); - + // use the default test.equal(fmt.getClock(), "24"); test.done(); }, - + testDateFmtGetClockBogus: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US", clock: "asdf"}); test.ok(fmt !== null); - + // use the default test.equal(fmt.getClock(), "12"); test.done(); }, - + testDateFmtGetTimeZoneDefault: function(test) { test.expect(2); ilib.tz = undefined; // just in case @@ -452,258 +452,258 @@ module.exports.testdatefmt = { if (ilib._getPlatform() === "nodejs") { process.env.TZ = ""; } - + test.ok(fmt !== null); - + test.equal(fmt.getTimeZone().getId(), "local"); test.done(); }, - + testDateFmtGetTimeZone: function(test) { test.expect(2); var fmt = new DateFmt({timezone: "Europe/Paris"}); test.ok(fmt !== null); - + test.equal(fmt.getTimeZone().getId(), "Europe/Paris"); test.done(); }, - + testDateFmtGetTemplateDefault: function(test) { test.expect(2); var fmt = new DateFmt(); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "M/d/yy"); test.done(); }, - + testDateFmtGetTemplate: function(test) { test.expect(2); var fmt = new DateFmt({template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "EEE 'the' DD 'of' MM, yyyy G"); test.done(); }, - + testDateFmtGetTemplateIgnoreProperties: function(test) { test.expect(2); var fmt = new DateFmt({date: 'y', template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "EEE 'the' DD 'of' MM, yyyy G"); test.done(); }, - + testDateFmtUseTemplateEmptyDateComponents: function(test) { test.expect(2); var fmt = new DateFmt({date: 'y', template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponents(), ""); test.done(); }, - + testDateFmtUseTemplateEmptyTimeComponents: function(test) { test.expect(2); var fmt = new DateFmt({time: 'h', template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + test.equal(fmt.getTimeComponents(), ""); test.done(); }, - + testDateFmtUseTemplateEmptyLength: function(test) { test.expect(2); var fmt = new DateFmt({length: 'short', template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + test.equal(fmt.getLength(), ""); test.done(); }, - + testDateFmtUseTemplateNonEmptyCalendar: function(test) { test.expect(2); var fmt = new DateFmt({calendar: 'julian', template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + test.equal(fmt.getCalendar(), "julian"); test.done(); }, - + testDateFmtUseTemplateNonEmptyLocale: function(test) { test.expect(2); var fmt = new DateFmt({locale: 'de-DE', template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + test.equal(fmt.getLocale().toString(), "de-DE"); test.done(); }, - + testDateFmtUseTemplateNonEmptyClock: function(test) { test.expect(2); var fmt = new DateFmt({clock: "24", template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + test.equal(fmt.getClock(), "24"); test.done(); }, - + testDateFmtUseTemplateWithClockHH: function(test) { test.expect(2); var fmt = new DateFmt({clock: "24", template: "hh:mm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "HH:mm"); test.done(); }, - + testDateFmtUseTemplateWithClockKK: function(test) { test.expect(2); var fmt = new DateFmt({clock: "24", template: "KK:mm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "kk:mm"); test.done(); }, - + testDateFmtUseTemplateWithClockhh: function(test) { test.expect(2); var fmt = new DateFmt({clock: "12", template: "HH:mm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "hh:mm"); test.done(); }, - + testDateFmtUseTemplateWithClockkk: function(test) { test.expect(2); var fmt = new DateFmt({clock: "12", template: "kk:mm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "KK:mm"); test.done(); }, - + testDateFmtUseTemplateWithClockHHSkipEscapedStrings24: function(test) { test.expect(2); var fmt = new DateFmt({clock: "24", template: "'hh' hh:mm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "'hh' HH:mm"); test.done(); }, - + testDateFmtUseTemplateWithClockHHSkipEscapedStrings12: function(test) { test.expect(2); var fmt = new DateFmt({clock: "12", template: "'HH' HH:mm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "'HH' hh:mm"); test.done(); }, - + testDateFmtUseTemplateNonEmptyTimeZone: function(test) { test.expect(3); var fmt = new DateFmt({timezone: 'Europe/Paris', template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + var tz = fmt.getTimeZone(); test.ok(typeof(tz) !== "undefined"); test.equal(tz.getId(), "Europe/Paris"); test.done(); }, - + testDateFmtGetTemplateCalendar: function(test) { test.expect(2); var fmt = new DateFmt({calendar: "julian"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "M/d/yy"); test.done(); }, - + testDateFmtGetTemplateLocale: function(test) { test.expect(2); var fmt = new DateFmt({locale: "de-DE"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "dd.MM.yy"); test.done(); }, - + testDateFmtGetTemplateLength: function(test) { test.expect(2); var fmt = new DateFmt({length: "long"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "MMMM d, yyyy"); test.done(); }, - + testDateFmtGetTemplateTypeDateTime: function(test) { test.expect(2); var fmt = new DateFmt({type: "datetime"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "M/d/yy, h:mm a"); test.done(); }, - + testDateFmtGetTemplateTypeTime: function(test) { test.expect(2); var fmt = new DateFmt({type: "time"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "h:mm a"); test.done(); }, - + testDateFmtGetTemplateDateComponents: function(test) { test.expect(2); var fmt = new DateFmt({date: "wdm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "E, M/d"); test.done(); }, - + testDateFmtGetTemplateDateComponentsWithICUSkeleton: function(test) { test.expect(2); var fmt = new DateFmt({date: "MMMEd"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "E, M/d"); test.done(); }, - + testDateFmtGetTemplateTimeComponents: function(test) { test.expect(2); var fmt = new DateFmt({type: "time", time: "hm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "h:mm"); test.done(); }, - + testDateFmtGetTemplateTimeComponentsWithICUSkeleton: function(test) { test.expect(2); var fmt = new DateFmt({type: "time", time: "Hm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "h:mm"); test.done(); }, - + testDateFmtGetTemplateTypeTime24: function(test) { test.expect(2); var fmt = new DateFmt({type: "time", clock: "24"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "HH:mm"); test.done(); }, - + testDateFmtTokenizeSimple: function(test) { test.expect(2); var fmt = new DateFmt(); @@ -713,11 +713,11 @@ module.exports.testdatefmt = { " ", "d" ]; - + test.deepEqual(fmt._tokenize("MMM d"), expected); test.done(); }, - + testDateFmtTokenizeAdjacentParts: function(test) { test.expect(2); var fmt = new DateFmt(); @@ -728,11 +728,11 @@ module.exports.testdatefmt = { "mm", "a" ]; - + test.deepEqual(fmt._tokenize("hh:mma"), expected); test.done(); }, - + testDateFmtTokenizeComplex: function(test) { test.expect(2); var fmt = new DateFmt(); @@ -753,11 +753,11 @@ module.exports.testdatefmt = { " ", "z" ]; - + test.deepEqual(fmt._tokenize("dd/MM/yyyy, h:mm:ssa z"), expected); test.done(); }, - + testDateFmtTokenizeWithEscapes: function(test) { test.expect(2); var fmt = new DateFmt(); @@ -773,21 +773,21 @@ module.exports.testdatefmt = { ", ", "yyyy" ]; - + test.deepEqual(fmt._tokenize("'El' d 'de' MMMM, yyyy"), expected); test.done(); }, - + testDateFmtAlternateInputs1: function(test) { // toUTCString doesn't work properly on qt, so we can't do this test if (ilib._getPlatform() !== "qt") { test.expect(2); var fmt = new DateFmt({ - timezone: "Etc/UTC", + timezone: "Etc/UTC", template: "EEE, d MMM yyyy kk:mm:ss z" }); test.ok(fmt !== null); - + var datMyBday = new Date("Fri Aug 13 1982 13:37:35 GMT-0700"); var ildMyBday = DateFactory({ timezone: "Etc/UTC", @@ -802,12 +802,12 @@ module.exports.testdatefmt = { var strFormattedDate2 = fmt.format(ildMyBday); strFormattedDate1 = strFormattedDate1.replace(/ \w{3}$/, ''); strFormattedDate2 = strFormattedDate2.replace(/ \w{3}$/, ''); - + test.equal(strFormattedDate2, strFormattedDate1); } test.done(); }, - + testDateFmtFormatJSDate1: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -816,14 +816,14 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted var datMyBday = new Date("Fri Aug 13 1982 13:37:35 GMT-0700"); test.equal(fmt.format(datMyBday), "1:37 PM"); test.done(); }, - + testDateFmtFormatJSDateRightTimeZone1: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -833,14 +833,14 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted var datMyBday = new Date("Wed May 14 2014 23:37:35 GMT-0700"); test.equal(fmt.format(datMyBday), "Wednesday"); test.done(); }, - + testDateFmtFormatJSDateRightTimeZone2: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -850,14 +850,14 @@ module.exports.testdatefmt = { timezone: "America/New_York" }); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted var datMyBday = new Date("Wed May 14 2014 23:37:35 GMT-0700"); test.equal(fmt.format(datMyBday), "Thursday"); test.done(); }, - + testDateFmtFormatJSDateRightTimeZone3: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -867,14 +867,14 @@ module.exports.testdatefmt = { timezone: "Australia/Perth" }); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted var datMyBday = new Date("Wed May 14 2014 20:37:35 GMT"); test.equal(fmt.format(datMyBday), "Thursday"); test.done(); }, - + testDateFmtFormatJSDateRightTimeZone4: function(test) { var d = new Date(); // test only works in north america @@ -890,14 +890,14 @@ module.exports.testdatefmt = { }); test.expect(2); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted var datMyBday = new Date('2014-05-13T03:17:48.674Z'); test.equal(fmt.format(datMyBday), "Monday"); test.done(); }, - + testDateFmtFormatJSDate2: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -906,13 +906,13 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted test.equal(fmt.format(398119055000), "1:37 PM"); test.done(); }, - + testDateFmtFormatJSDateRightTimeZone5: function(test) { var d = new Date(); // test only works in north america @@ -928,13 +928,13 @@ module.exports.testdatefmt = { }); test.expect(2); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted test.equal(fmt.format(1399951068674), "Monday"); test.done(); }, - + testDateFmtFormatJSDate3: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -943,13 +943,13 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted test.equal(fmt.format("Fri Aug 13 1982 13:37:35 GMT-0700"), "1:37 PM"); test.done(); }, - + testDateFmtFormatJSDateRightTimeZone6: function(test) { var d = new Date(); // test only works in north america @@ -965,139 +965,139 @@ module.exports.testdatefmt = { }); test.expect(2); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted test.equal(fmt.format("Wed May 14 2014 23:37:35 GMT-0700"), "Wednesday"); test.done(); }, - + testDateFmtGetMonthsOfYear1: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US"}); test.ok(fmt !== null); - + var arrMonths = fmt.getMonthsOfYear(); var expected = [undefined, "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]; test.deepEqual(arrMonths, expected); test.done(); }, - + testDateFmtGetMonthsOfYear2: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US"}); test.ok(fmt !== null); - + var arrMonths = fmt.getMonthsOfYear({length: "long"}); var expected = [undefined, "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; test.deepEqual(arrMonths, expected); test.done(); }, - + testDateFmtGetMonthsOfYearThai: function(test) { test.expect(2); // uses ThaiSolar calendar var fmt = new DateFmt({locale: "th-TH"}); test.ok(fmt !== null); - + var arrMonths = fmt.getMonthsOfYear({length: "long"}); - + var expected = [undefined, "ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."]; test.deepEqual(arrMonths, expected); test.done(); }, - + testDateFmtGetMonthsOfYearLeapYear: function(test) { test.expect(2); var d = DateFactory({type: "hebrew", locale: "en-US", year: 5774, month: 1, day: 1}); var fmt = new DateFmt({date: "en-US", calendar: "hebrew"}); test.ok(fmt !== null); - + var arrMonths = fmt.getMonthsOfYear({length: "long", date: d}); - + var expected = [undefined, "Nis", "Iyy", "Siv", "Tam", "Av", "Elu", "Tis", "Ḥes", "Kis", "Tev", "She", "Ada", "Ad2"]; test.deepEqual(arrMonths, expected); test.done(); }, - + testDateFmtGetMonthsOfYearNonLeapYear: function(test) { test.expect(2); var d = DateFactory({type: "hebrew", locale: "en-US", year: 5775, month: 1, day: 1}); var fmt = new DateFmt({date: "en-US", calendar: "hebrew"}); test.ok(fmt !== null); - + var arrMonths = fmt.getMonthsOfYear({length: "long", date: d}); - + var expected = [undefined, "Nis", "Iyy", "Siv", "Tam", "Av", "Elu", "Tis", "Ḥes", "Kis", "Tev", "She", "Ada"]; test.deepEqual(arrMonths, expected); test.done(); }, - + testDateFmtGetDaysOfWeek1: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US"}); test.ok(fmt !== null); - + var arrDays = fmt.getDaysOfWeek(); - + var expected = ["S", "M", "T", "W", "T", "F", "S"]; test.deepEqual(arrDays, expected); test.done(); }, - + testDateFmtGetDaysOfWeek2: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US"}); test.ok(fmt !== null); - + var arrDays = fmt.getDaysOfWeek({length: 'long'}); var expected = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; test.deepEqual(arrDays, expected); test.done(); }, - + testDateFmtGetDaysOfWeekOtherCalendar: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US", calendar: "hebrew"}); test.ok(fmt !== null); - + var arrDays = fmt.getDaysOfWeek({length: 'long'}); - + var expected = ["ris", "she", "shl", "rvi", "ḥam", "shi", "sha"]; test.deepEqual(arrDays, expected); test.done(); }, - + testDateFmtGetDaysOfWeekThai: function(test) { test.expect(2); var fmt = new DateFmt({locale: "th-TH", calendar: "thaisolar"}); test.ok(fmt !== null); - + var arrDays = fmt.getDaysOfWeek({length: 'long'}); - + var expected = ["อา.", "จ.", "อ.", "พ.", "พฤ.", "ศ.", "ส."]; test.deepEqual(arrDays, expected); test.done(); }, - + testDateFmtGetDaysOfWeekThaiInEnglish: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US", calendar: "thaisolar"}); test.ok(fmt !== null); - + var arrDays = fmt.getDaysOfWeek({length: 'long'}); - + var expected = ["ath", "cha", "ang", "phu", "phr", "suk", "sao"]; test.deepEqual(arrDays, expected); test.done(); }, - - + + testDateFmtWeekYear1: function(test) { test.expect(2); var fmt = new DateFmt({template: "w"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 1, @@ -1110,12 +1110,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "52"); test.done(); }, - + testDateFmtWeekYear2: function(test) { test.expect(2); var fmt = new DateFmt({template: "w"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 1, @@ -1128,12 +1128,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "1"); test.done(); }, - + testDateFmtWeekYear3: function(test) { test.expect(2); var fmt = new DateFmt({template: "w"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2010, month: 12, @@ -1146,12 +1146,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "52"); test.done(); }, - + testDateFmtWeekYear4: function(test) { test.expect(2); var fmt = new DateFmt({template: "w"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2009, month: 12, @@ -1164,12 +1164,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "53"); test.done(); }, - + testDateFmtWeekYear5: function(test) { test.expect(2); var fmt = new DateFmt({template: "w"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2008, month: 12, @@ -1182,12 +1182,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "1"); test.done(); }, - + testDateFmtWeekYear6: function(test) { test.expect(2); var fmt = new DateFmt({template: "w"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2007, month: 12, @@ -1200,12 +1200,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "1"); test.done(); }, - + testDateFmtWeekYearPad: function(test) { test.expect(2); var fmt = new DateFmt({template: "ww"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 1, @@ -1218,12 +1218,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "01"); test.done(); }, - + testDateFmtFormatWithEscapes: function(test) { test.expect(2); var fmt = new DateFmt({locale: 'es-MX', template: "'El' dd 'de' MMMM"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "es-MX", year: 2011, @@ -1237,12 +1237,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "El 05 de mayo"); test.done(); }, - + testDateFmtDayOfYearFirstD: function(test) { test.expect(2); var fmt = new DateFmt({template: "D"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 1, @@ -1255,12 +1255,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "1"); test.done(); }, - + testDateFmtDayOfYearFirstDD: function(test) { test.expect(2); var fmt = new DateFmt({template: "DD"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 1, @@ -1273,12 +1273,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "01"); test.done(); }, - + testDateFmtDayOfYearFirstDDD: function(test) { test.expect(2); var fmt = new DateFmt({template: "DDD"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 1, @@ -1291,12 +1291,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "001"); test.done(); }, - + testDateFmtDayOfYearLastD: function(test) { test.expect(2); var fmt = new DateFmt({template: "D"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 12, @@ -1309,12 +1309,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "365"); test.done(); }, - + testDateFmtDayOfYearLastDD: function(test) { test.expect(2); var fmt = new DateFmt({template: "DD"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 12, @@ -1327,12 +1327,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "365"); test.done(); }, - + testDateFmtDayOfYearLastDLeap: function(test) { test.expect(2); var fmt = new DateFmt({template: "D"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2008, month: 12, @@ -1345,12 +1345,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "366"); test.done(); }, - + testDateFmtDayOfYearLastDDD: function(test) { test.expect(2); var fmt = new DateFmt({template: "DDD"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 12, @@ -1363,12 +1363,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "365"); test.done(); }, - + testDateFmtDayOfYearPaddysDayD: function(test) { test.expect(2); var fmt = new DateFmt({template: "D"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 3, @@ -1381,12 +1381,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "76"); test.done(); }, - + testDateFmtDayOfYearPaddysDayDD: function(test) { test.expect(2); var fmt = new DateFmt({template: "DD"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 3, @@ -1399,12 +1399,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "76"); test.done(); }, - + testDateFmtDayOfYearPaddysDayDDD: function(test) { test.expect(2); var fmt = new DateFmt({template: "DDD"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 3, @@ -1417,12 +1417,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "076"); test.done(); }, - + testDateFmtDayOfYearPaddysDayDLeap: function(test) { test.expect(2); var fmt = new DateFmt({template: "D"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2008, month: 3, @@ -1435,12 +1435,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "77"); test.done(); }, - + testDateFmtDayOfYearPaddysDayDDLeap: function(test) { test.expect(2); var fmt = new DateFmt({template: "DD"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2008, month: 3, @@ -1453,12 +1453,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "77"); test.done(); }, - + testDateFmtDayOfYearPaddysDayDDDLeap: function(test) { test.expect(2); var fmt = new DateFmt({template: "DDD"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2008, month: 3, @@ -1471,12 +1471,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "077"); test.done(); }, - + testDateFmtWeekOfMonthUS: function(test) { test.expect(2); var fmt = new DateFmt({template: "W", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1490,12 +1490,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "1"); test.done(); }, - + testDateFmtWeekOfMonthDE: function(test) { test.expect(2); var fmt = new DateFmt({template: "W", locale: "de-DE"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "de-DE", year: 2011, @@ -1509,12 +1509,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "0"); test.done(); }, - + testDateFmtWeekOfMonthUSSept: function(test) { test.expect(2); var fmt = new DateFmt({template: "W", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1528,12 +1528,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "0"); test.done(); }, - + testDateFmtWeekOfMonthUSOct: function(test) { test.expect(2); var fmt = new DateFmt({template: "W", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1547,12 +1547,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "0"); test.done(); }, - + testDateFmtWeekOfMonthUSNov: function(test) { test.expect(2); var fmt = new DateFmt({template: "W", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1566,12 +1566,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "1"); test.done(); }, - + testDateFmtWeekOfMonthUSRegular: function(test) { test.expect(2); var fmt = new DateFmt({template: "W", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1585,12 +1585,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "4"); test.done(); }, - + testDateFmtWeekOfMonthDERegular: function(test) { test.expect(2); var fmt = new DateFmt({template: "W", locale: "de-DE"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "de-DE", year: 2011, @@ -1604,12 +1604,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "3"); test.done(); }, - + testDateFmtYear0YY: function(test) { test.expect(2); var fmt = new DateFmt({template: "yy"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 0, month: 12, @@ -1622,12 +1622,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "00"); test.done(); }, - + testDateFmtYear0YYYY: function(test) { test.expect(2); var fmt = new DateFmt({template: "yyyy"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 0, month: 12, @@ -1640,12 +1640,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "0000"); test.done(); }, - + testDateFmtYear1YY: function(test) { test.expect(2); var fmt = new DateFmt({template: "yy"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 1, month: 12, @@ -1658,12 +1658,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "01"); test.done(); }, - + testDateFmtYear1YYYY: function(test) { test.expect(2); var fmt = new DateFmt({template: "yyyy"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 1, month: 12, @@ -1676,12 +1676,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "0001"); test.done(); }, - + testDateFmtYearMinus1YY: function(test) { test.expect(2); var fmt = new DateFmt({template: "yy"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: -1, month: 12, @@ -1694,12 +1694,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "-01"); test.done(); }, - + testDateFmtYearMinus1YYYY: function(test) { test.expect(2); var fmt = new DateFmt({template: "yyyy"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: -1, month: 12, @@ -1712,12 +1712,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "-0001"); test.done(); }, - + testDateFmtOrdinalUS1: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1731,12 +1731,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "1st"); test.done(); }, - + testDateFmtOrdinalUS2: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1750,12 +1750,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "2nd"); test.done(); }, - + testDateFmtOrdinalUS3: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1769,12 +1769,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "3rd"); test.done(); }, - + testDateFmtOrdinalUS4: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1788,12 +1788,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "4th"); test.done(); }, - + testDateFmtOrdinalUS21: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1807,12 +1807,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "21st"); test.done(); }, - + testDateFmtOrdinalUSDefaultCase: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1826,12 +1826,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "27th"); test.done(); }, - + testDateFmtOrdinalDE1: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "de-DE"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "de-DE", year: 2011, @@ -1845,12 +1845,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "1."); test.done(); }, - + testDateFmtOrdinalDE2: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "de-DE"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "de-DE", year: 2011, @@ -1864,12 +1864,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "2."); test.done(); }, - + testDateFmtOrdinalDE3: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "de-DE"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "de-DE", year: 2011, @@ -1883,12 +1883,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "3."); test.done(); }, - + testDateFmtOrdinalDE4: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "de-DE"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "de-DE", year: 2011, @@ -1902,12 +1902,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "4."); test.done(); }, - + testDateFmtOrdinalDE21: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "de-DE"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "de-DE", year: 2011, @@ -1921,12 +1921,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "21."); test.done(); }, - + testDateFmtOrdinalDEDefaultCase: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "de-DE"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "de-DE", year: 2011, @@ -1940,12 +1940,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "27."); test.done(); }, - + testDateFmtEraCE: function(test) { test.expect(2); var fmt = new DateFmt({template: "G", locale: "en"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en", year: 2011, @@ -1959,12 +1959,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "CE"); test.done(); }, - + testDateFmtEraBCE: function(test) { test.expect(2); var fmt = new DateFmt({template: "G", locale: "en"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en", year: -46, @@ -1978,12 +1978,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "BCE"); test.done(); }, - + testDateFmtEraCEBoundary: function(test) { test.expect(2); var fmt = new DateFmt({template: "G", locale: "en"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en", year: 1, @@ -1997,12 +1997,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "CE"); test.done(); }, - + testDateFmtEraBCEBoundary: function(test) { test.expect(2); var fmt = new DateFmt({template: "G", locale: "en"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en", year: 0, @@ -2016,12 +2016,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "BCE"); test.done(); }, - + testDateFmtStandAloneMonthFull: function(test) { test.expect(2); var fmt = new DateFmt({template: "LLLL", locale: "fi-FI"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "fi-FI", year: 0, @@ -2035,12 +2035,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "joulukuu"); test.done(); }, - + testDateFmtStandAloneMonthLong: function(test) { test.expect(2); var fmt = new DateFmt({template: "LLL", locale: "fi-FI"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "fi-FI", year: 0, @@ -2054,12 +2054,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "joulu"); test.done(); }, - + testDateFmtStandAloneMonthMedium: function(test) { test.expect(2); var fmt = new DateFmt({template: "LL", locale: "fi-FI"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "fi-FI", year: 0, @@ -2073,12 +2073,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "jo"); test.done(); }, - + testDateFmtInFormatMonthFull: function(test) { test.expect(2); var fmt = new DateFmt({template: "MMMM", locale: "fi-FI"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "fi-FI", year: 0, @@ -2092,12 +2092,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "joulukuuta"); test.done(); }, - + testDateFmtInFormatMonthMedium: function(test) { test.expect(2); var fmt = new DateFmt({template: "MM", locale: "fi-FI"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "fi-FI", year: 0, @@ -2111,22 +2111,22 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "12"); test.done(); }, - + /* exception does not happen any more because we always convert the argument to the format method to an DateFactory first now. By default if a bogus argument is passed, this is treated as an empty/undefined parameter, which means the current date/time - + testDateFmtNonDateObject: function(test) { var fmt = new DateFmt({ - locale: "en-US", - type: "time", + locale: "en-US", + type: "time", length: "short", time: "hm" }); test.ok(fmt !== null); - + try { fmt.format({ locale: "en-US", @@ -2142,12 +2142,12 @@ module.exports.testdatefmt = { test.done(); }, */ - + testDateFmtFormatRelativeWithinMinuteAfter: function(test) { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 11, @@ -2173,7 +2173,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 11, @@ -2199,7 +2199,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 11, @@ -2225,7 +2225,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 11, @@ -2251,7 +2251,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 11, @@ -2277,7 +2277,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 11, @@ -2299,12 +2299,12 @@ module.exports.testdatefmt = { test.equal(fmt.formatRelative(reference, date), "4 hours ago"); test.done(); }, - + testDateFmtFormatRelativeWithinFortnightAfter: function(test) { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 11, @@ -2330,7 +2330,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 11, @@ -2352,12 +2352,12 @@ module.exports.testdatefmt = { test.equal(fmt.formatRelative(reference, date), "4 days ago"); test.done(); }, - + testDateFmtFormatRelativeWithinQuarterAfter: function(test) { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 9, @@ -2383,7 +2383,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 9, @@ -2405,12 +2405,12 @@ module.exports.testdatefmt = { test.equal(fmt.formatRelative(reference, date), "9 weeks ago"); test.done(); }, - + testDateFmtFormatRelativeWithinTwoYearsAfter: function(test) { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 9, @@ -2436,7 +2436,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 9, @@ -2458,12 +2458,12 @@ module.exports.testdatefmt = { test.equal(fmt.formatRelative(reference, date), "14 months ago"); test.done(); }, - + testDateFmtFormatRelativeYearsAfter: function(test) { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 9, @@ -2489,7 +2489,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 9, @@ -2511,7 +2511,7 @@ module.exports.testdatefmt = { test.equal(fmt.formatRelative(reference, date), "21 years ago"); test.done(); }, - + testDateFmtConvertToGMT: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2522,7 +2522,7 @@ module.exports.testdatefmt = { time: "hmaz" }); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 9, @@ -2534,11 +2534,11 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles", locale: "en-US" }); - + test.equal(fmt.format(date), "20/09/2011, 21:45 GMT/BST"); test.done(); }, - + testDateFmtConvertToOtherTimeZone: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2549,7 +2549,7 @@ module.exports.testdatefmt = { time: "hmaz" }); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 9, @@ -2561,11 +2561,11 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles", locale: "en-US" }); - + test.equal(fmt.format(date), "21/9/11, 6:45 am AEST"); test.done(); }, - + testDateFmtForTZWithNonWholeOffset1: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2575,16 +2575,16 @@ module.exports.testdatefmt = { timezone: "America/St_Johns" }); test.ok(fmt !== null); - + var date = new GregorianDate({ unixtime: 1394834293627, timezone: "Etc/UTC" }); - + test.equal(fmt.format(date), "7:28 PM"); test.done(); }, - + testDateFmtForTZWithNonWholeOffset2: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2594,7 +2594,7 @@ module.exports.testdatefmt = { timezone: "America/St_Johns" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "Etc/UTC", year: 2014, @@ -2605,12 +2605,12 @@ module.exports.testdatefmt = { second: 13, millisecond: 627 }); - + // St. John's is -3:30 from UTC, plus 1 hour DST test.equal(fmt.format(date), "7:28 PM"); test.done(); }, - + testDateFmtForTZWithNonWholeOffsetQuarterHour: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2620,17 +2620,17 @@ module.exports.testdatefmt = { timezone: "Asia/Kathmandu" }); test.ok(fmt !== null); - + var date = new GregorianDate({ unixtime: 1394834293627, timezone: "Etc/UTC" }); - + // Kathmandu is 5:45 ahead of UTC, no DST test.equal(fmt.format(date), "3:43 AM"); test.done(); }, - + testDateFmtForTZWithNonWholeOffsetQuarterHour2: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2640,7 +2640,7 @@ module.exports.testdatefmt = { timezone: "Asia/Kathmandu" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "Etc/UTC", year: 2014, @@ -2651,12 +2651,12 @@ module.exports.testdatefmt = { second: 13, millisecond: 627 }); - + // Kathmandu is 5:45 ahead of UTC, no DST test.equal(fmt.format(date), "3:43 AM"); test.done(); }, - + // test locales that are tier 2 and below by doing a single test to see that it basically works testDateFmtenNG: function(test) { test.expect(2); @@ -2668,7 +2668,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-NG", year: 2011, @@ -2679,11 +2679,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "Tuesday, 20 September 2011 at 1:45 PM"); test.done(); }, - + testDateFmtenPH: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2694,7 +2694,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-PH", year: 2011, @@ -2705,11 +2705,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "Tuesday, 20 September 2011 at 1:45 PM"); test.done(); }, - + testDateFmtenPK: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2720,7 +2720,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-PK", year: 2011, @@ -2731,11 +2731,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "Tuesday, 20 September 2011 at 1:45 PM"); test.done(); }, - + testDateFmtenAU: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2746,7 +2746,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-AU", year: 2011, @@ -2757,11 +2757,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "Tuesday, 20 September 2011 at 1:45 pm"); test.done(); }, - + testDateFmtenZA: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2772,7 +2772,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-ZA", year: 2011, @@ -2783,11 +2783,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "Tuesday, 20 September 2011 at 13:45"); test.done(); }, - + testDateFmtesES: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2798,7 +2798,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "es-ES", year: 2011, @@ -2809,11 +2809,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "martes, 20 de septiembre de 2011, 13:45"); test.done(); }, - + testDateFmtesMX: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2824,7 +2824,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "es-MX", year: 2011, @@ -2835,11 +2835,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "martes, 20 de septiembre de 2011, 13:45"); test.done(); }, - + testDateFmtesAR: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2850,7 +2850,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "es-AR", year: 2011, @@ -2861,12 +2861,12 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "martes, 20 de septiembre de 2011, 13:45"); test.done(); - + }, - + testDateFmttrTR: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2877,7 +2877,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "tr-TR", year: 2011, @@ -2888,11 +2888,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "20 Eylül 2011 Salı 13:45"); test.done(); }, - + testDateFmttrSV: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2903,7 +2903,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "sv-SE", year: 2011, @@ -2914,11 +2914,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "torsdag 20 oktober 2011 13:45"); test.done(); }, - + testDateFmttrNO: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2929,7 +2929,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "no-NO", year: 2011, @@ -2940,11 +2940,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "Torsdag 20. oktober 2011 13.45"); test.done(); }, - + testDateFmttrDA: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2955,7 +2955,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "da-DK", year: 2011, @@ -2966,7 +2966,7 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "torsdag den 20. oktober 2011 kl. 13.45"); test.done(); }, @@ -3097,16 +3097,16 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - + var date = new GregorianDate({ timezone: "Etc/UTC", unixtime: 1394359140000 // this is 3/9/2014 at 1:59am }); - + test.equal(fmt.format(date), "1:59 AM PST"); test.done(); }, - + testDateFmtTransitionToDSTRightAfter: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3116,17 +3116,17 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - + var date = new GregorianDate({ timezone: "Etc/UTC", unixtime: 1394359260000 }); - + // 2 minutes later test.equal(fmt.format(date), "3:01 AM PDT"); test.done(); }, - + testDateFmtTransitionFromDSTDayBefore: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3136,16 +3136,16 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - + var date = new GregorianDate({ timezone: "Etc/UTC", unixtime: 1414828740000 // this is 11/1/2014 at 0:59am }); - + test.equal(fmt.format(date), "12:59 AM PDT"); test.done(); }, - + testDateFmtTransitionFromDSTWellBefore: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3155,16 +3155,16 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - + var date = new GregorianDate({ timezone: "Etc/UTC", unixtime: 1414915140000 // this is 11/2/2014 at 0:59am }); - + test.equal(fmt.format(date), "12:59 AM PDT"); test.done(); }, - + testDateFmtTransitionFromDSTRightBefore: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3174,16 +3174,16 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - + var date = new GregorianDate({ timezone: "Etc/UTC", unixtime: 1414918740000 // this is 11/2/2014 at 1:59am }); - + test.equal(fmt.format(date), "1:59 AM PDT"); test.done(); }, - + testDateFmtTransitionFromDSTRightAfter: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3193,18 +3193,18 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - + var date = new GregorianDate({ timezone: "Etc/UTC", unixtime: 1414918860000 }); - + // 2 minutes later test.equal(fmt.format(date), "1:01 AM PST"); test.done(); }, - - + + testDateFmtAltCalThaiInEnglish: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3215,16 +3215,16 @@ module.exports.testdatefmt = { calendar: "thaisolar" }); test.ok(fmt !== null); - + var date = new ThaiSolarDate({ timezone: "America/Los_Angeles", unixtime: 1404445524043 }); - + test.equal(fmt.format(date), "Karakadakhom 3, 2557 at 8:45 PM"); test.done(); }, - + testDateFmtAltCalHebrewInEnglish: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3235,16 +3235,16 @@ module.exports.testdatefmt = { calendar: "hebrew" }); test.ok(fmt !== null); - + var date = new HebrewDate({ timezone: "America/Los_Angeles", unixtime: 1404445524043 }); - + test.equal(fmt.format(date), "Tammuz 6, 5774 at 8:45 PM"); test.done(); }, - + testDateFmtAltCalIslamicInEnglish: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3255,16 +3255,16 @@ module.exports.testdatefmt = { calendar: "islamic" }); test.ok(fmt !== null); - + var date = new IslamicDate({ timezone: "America/Los_Angeles", unixtime: 1404445524043 }); - + test.equal(fmt.format(date), "Ramaḍān 5, 1435 at 8:45 PM"); test.done(); }, - + testDateFmtAltCalPersianInEnglish: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3275,283 +3275,283 @@ module.exports.testdatefmt = { calendar: "persian" }); test.ok(fmt !== null); - + var date = new PersianDate({ timezone: "America/Los_Angeles", unixtime: 1404445524043 }); - + test.equal(fmt.format(date), "Tir 12, 1393 at 8:45 PM"); test.done(); }, - + testDateFmtGetMeridiemsRangeLength_with_am_ET_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET"}); test.ok(fmt !== null); - + test.equal(fmt.length, 5); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_am_ET_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "ጥዋት"); test.done(); }, - + testDateFmtGetMeridiemsRangeStart_with_am_ET_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET"}); test.ok(fmt !== null); - + test.equal(fmt[0].start, "00:00"); test.done(); }, - + testDateFmtGetMeridiemsRangeEnd_with_am_ET_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET"}); test.ok(fmt !== null); - + test.equal(fmt[0].end, "05:59"); test.done(); }, - + testDateFmtGetMeridiemsRangeLength_with_am_ET_locale_gregorian_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "gregorian"}); test.ok(fmt !== null); - + test.equal(fmt.length, 2); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_am_ET_locale_gregorian_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "gregorian"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "ጥዋት"); test.done(); }, - + testDateFmtGetMeridiemsRangeStart_with_am_ET_locale_gregorian_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "gregorian"}); test.ok(fmt !== null); - + test.equal(fmt[0].start, "00:00"); test.done(); }, - + testDateFmtGetMeridiemsRangeEnd_with_am_ET_locale_gregorian_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "gregorian"}); test.ok(fmt !== null); - + test.equal(fmt[0].end, "11:59"); test.done(); }, - + testDateFmtGetMeridiemsRangeLength_with_am_ET_locale_ethiopic_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "ethiopic"}); test.ok(fmt !== null); - + test.equal(fmt.length, 5); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_am_ET_locale_ethiopic_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "ethiopic"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "ጥዋት"); test.done(); }, - + testDateFmtGetMeridiemsRangeStart_with_am_ET_locale_ethiopic_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "ethiopic"}); test.ok(fmt !== null); - + test.equal(fmt[0].start, "00:00"); test.done(); }, - + testDateFmtGetMeridiemsRangeEnd_with_am_ET_locale_ethiopic_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "ethiopic"}); test.ok(fmt !== null); - + test.equal(fmt[0].end, "05:59"); test.done(); }, - + testDateFmtGetMeridiemsRangeLength_with_zh_CN_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN"}); test.ok(fmt !== null); - + test.equal(fmt.length, 2); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_zh_CN_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "上午"); test.done(); }, - + testDateFmtGetMeridiemsRangeStart_with_zh_CN_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN"}); test.ok(fmt !== null); - + test.equal(fmt[0].start, "00:00"); test.done(); }, - + testDateFmtGetMeridiemsRangeEnd_with_zh_CN_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN"}); test.ok(fmt !== null); - + test.equal(fmt[0].end, "11:59"); test.done(); }, - + testDateFmtGetMeridiemsRangeLength_with_zh_CN_locale_gregorian_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "gregorian"}); test.ok(fmt !== null); - + test.equal(fmt.length, 2); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_zh_CN_locale_gregorian_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "gregorian"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "上午"); test.done(); }, - + testDateFmtGetMeridiemsRangeStart_with_zh_CN_locale_gregorian_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "gregorian"}); test.ok(fmt !== null); - + test.equal(fmt[0].start, "00:00"); test.done(); }, - + testDateFmtGetMeridiemsRangeEnd_with_zh_CN_locale_gregorian_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "gregorian"}); test.ok(fmt !== null); - + test.equal(fmt[0].end, "11:59"); test.done(); }, - + testDateFmtGetMeridiemsRangeLength_with_zh_CN_locale_chinese_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "chinese"}); test.ok(fmt !== null); - + test.equal(fmt.length, 7); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_zh_CN_locale_chinese_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "chinese"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "凌晨"); test.done(); }, - + testDateFmtGetMeridiemsRangeStart_with_zh_CN_locale_chinese_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "chinese"}); test.ok(fmt !== null); - + test.equal(fmt[0].start, "00:00"); test.done(); }, - + testDateFmtGetMeridiemsRangeEnd_with_zh_CN_locale_chinese_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "chinese"}); test.ok(fmt !== null); - + test.equal(fmt[0].end, "05:59"); test.done(); }, - + testDateFmtGetMeridiemsRangeLength_with_en_US_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "en-US"}); test.ok(fmt !== null); - + test.equal(fmt.length, 2); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_en_US_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "en-US"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "AM"); test.done(); }, - + testDateFmtGetMeridiemsRangeStart_with_en_US_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "en-US"}); test.ok(fmt !== null); - + test.equal(fmt[0].start, "00:00"); test.done(); }, - + testDateFmtGetMeridiemsRangeEnd_with_en_US_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({locale: "en-US"}); test.ok(fmt !== null); - + test.equal(fmt[0].end, "11:59"); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_bn_IN_locale: function(test) { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "bn-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "AM"); test.equal(fmt[1].name, "PM"); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_gu_IN_locale: function(test) { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "gu-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "AM"); test.equal(fmt[1].name, "PM"); test.done(); @@ -3560,7 +3560,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "kn-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "ಪೂರ್ವಾಹ್ನ"); test.equal(fmt[1].name, "ಅಪರಾಹ್ನ"); test.done(); @@ -3569,7 +3569,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "ml-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "AM"); test.equal(fmt[1].name, "PM"); test.done(); @@ -3578,7 +3578,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "mr-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "म.पू."); test.equal(fmt[1].name, "म.उ."); test.done(); @@ -3587,7 +3587,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "or-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "AM"); test.equal(fmt[1].name, "PM"); test.done(); @@ -3596,7 +3596,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "pa-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "ਪੂ.ਦੁ."); test.equal(fmt[1].name, "ਬਾ.ਦੁ."); test.done(); @@ -3605,7 +3605,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "ta-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "முற்பகல்"); test.equal(fmt[1].name, "பிற்பகல்"); test.done(); @@ -3614,7 +3614,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "te-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "AM"); test.equal(fmt[1].name, "PM"); test.done(); @@ -3623,7 +3623,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "ur-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "AM"); test.equal(fmt[1].name, "PM"); test.done(); @@ -3632,7 +3632,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "as-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "পূৰ্বাহ্ণ"); test.equal(fmt[1].name, "অপৰাহ্ণ"); test.done(); @@ -3641,121 +3641,268 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "hi-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "पूर्वाह्न"); test.equal(fmt[1].name, "अपराह्न"); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_ur_PK_locale: function(test) { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "ur-PK"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "AM"); test.equal(fmt[1].name, "PM"); test.done(); }, - + testDateFmtGetMeridiemsRange_with_noArgument: function(test) { test.expect(2); var fmt = new DateFmt(); test.ok(fmt !== null); - + var mdRange = fmt.getMeridiemsRange(); // if locale is not specified, DateFmt takes default locale. test.ok("getMeridiemsRange should return length value greater than 0", mdRange.length > 0); test.done(); }, - + testDateFmtGetMeridiemsRange_with_undefined_locale: function(test) { test.expect(2); var fmt = new DateFmt({ locale: undefined }); test.ok(fmt !== null); - + var mdRange = fmt.getMeridiemsRange(); // if locale is not specified, DateFmt takes default locale. test.ok("getMeridiemsRange should return length value greater than 0", mdRange.length > 0); test.done(); }, - + testDateFmtGetMeridiemsRange_with_wrong_locale: function(test) { test.expect(2); var fmt = new DateFmt({ locale: "wrong" }); test.ok(fmt !== null); - + var mdRange = fmt.getMeridiemsRange(); // if locale is specified wrong value, DateFmt takes default locale. test.ok("getMeridiemsRange should return length value greater than 0", mdRange.length > 0); test.done(); }, - + testDateFmtTimeTemplate_mms: function(test) { test.expect(2); var fmt = new DateFmt({clock: "24", template: "mm:s"}); test.ok(fmt !== null); - + test.equal(fmt.format({minute: 0, second: 9}).toString(), "00:9"); test.done(); }, - + testDateFmtGetDateComponentOrderEN: function(test) { - test.expect(2); - - var fmt = new DateFmt({locale: "en"}) + test.expect(2); + + var fmt = new DateFmt({locale: "en"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponentOrder(), "mdy"); test.done(); }, - + testDateFmtGetDateComponentOrderENGB: function(test) { - test.expect(2); - - var fmt = new DateFmt({locale: "en-GB"}) + test.expect(2); + + var fmt = new DateFmt({locale: "en-GB"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponentOrder(), "dmy"); test.done(); }, - + testDateFmtGetDateComponentOrderENUS: function(test) { - test.expect(2); - - var fmt = new DateFmt({locale: "en-US"}) + test.expect(2); + + var fmt = new DateFmt({locale: "en-US"}) test.ok(fmt !== null); - + test.equal(fmt.getDateComponentOrder(), "mdy"); test.done(); }, testDateFmtGetDateComponentOrderDE: function(test) { - test.expect(2); - - var fmt = new DateFmt({locale: "de-DE"}) + test.expect(2); + + var fmt = new DateFmt({locale: "de-DE"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponentOrder(), "dmy"); test.done(); }, testDateFmtGetDateComponentOrderAK: function(test) { - test.expect(2); - - var fmt = new DateFmt({locale: "ak-GH"}) + test.expect(2); + + var fmt = new DateFmt({locale: "ak-GH"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponentOrder(), "ymd"); test.done(); }, testDateFmtGetDateComponentOrderLV: function(test) { - test.expect(2); - - var fmt = new DateFmt({locale: "lv-LV"}) + test.expect(2); + + var fmt = new DateFmt({locale: "lv-LV"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponentOrder(), "ydm"); + test.done(); + }, + + testDateFmtGetFormatInfoUSShort: function(test) { + test.expect(16); + + var fmt = new DateFmt({ + locale: "en-US", + type: "date", + date: "short" + }); + test.ok(fmt !== null); + + fmt.getFormatInfo(undefined, true, function(info) { + test.ok(info); + + test.equal(info.length, 5); + + test.equal(info[0].component, "month"); + test.equal(info[0].label, "Month"); + test.deepEquals(info[0].constraint, [1, 12]); + + test.ok(!info[1].component); + test.equal(info[1].label, "/"); + + test.equal(info[2].component, "day"); + test.equal(info[2].label, "Date"); + test.deepEquals(info[2].constraint, { + "condition": "leapyear", + "leap": { + "1": [1, 31], + "2": [1, 29], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + }, + "regular": { + "1": [1, 31], + "2": [1, 28], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + } + }); + + test.ok(!info[3].component); + test.equal(info[3].label, "/"); + + test.equal(info[4].component, "year"); + test.equal(info[4].label, "Year"); + test.equal(info[4].constraint, "[0-9]+"); + }); + + test.done(); + }, + + testDateFmtGetFormatInfoUSFull: function(test) { + test.expect(16); + + var fmt = new DateFmt({ + locale: "en-US", + type: "date", + date: "full" + }); + test.ok(fmt !== null); + + fmt.getFormatInfo(undefined, true, function(info) { + test.ok(info); + + test.equal(info.length, 5); + + test.equal(info[0].component, "month"); + test.equal(info[0].label, "Month"); + test.deepEquals(info[0].constraint, [ + {label: "January", value: 1}, + {label: "February", value: 2}, + {label: "March", value: 3}, + {label: "April", value: 4}, + {label: "May", value: 5}, + {label: "June", value: 6}, + {label: "July", value: 7}, + {label: "August", value: 8}, + {label: "September", value: 9}, + {label: "October", value: 10}, + {label: "November", value: 11}, + {label: "December", value: 12}, + ]); + + test.ok(!info[1].component); + test.equal(info[1].label, " "); + + test.equal(info[2].component, "day"); + test.equal(info[2].label, "Date"); + test.deepEquals(info[2].constraint, { + "condition": "leapyear", + "leap": { + "1": [1, 31], + "2": [1, 29], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + }, + "regular": { + "1": [1, 31], + "2": [1, 28], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + } + }); + + test.ok(!info[3].component); + test.equal(info[3].label, ", "); + + test.equal(info[4].component, "year"); + test.equal(info[4].label, "Year"); + test.equal(info[4].constraint, "[0-9]+"); + }); + test.done(); } }; \ No newline at end of file From caee9ade35137c479bfdf2ee765432f3089ea774 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Fri, 7 Dec 2018 15:56:15 -0800 Subject: [PATCH 03/38] Checkpoint... start to make the templateArr to constraints --- js/lib/DateFmt.js | 418 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 356 insertions(+), 62 deletions(-) diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index 09f7ac47ee..a811abea95 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -1804,74 +1804,368 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { loc.spec = undefined; } - Utils.loadData({ - name: "regionnames.json", - object: "DateFmt", + function sequence(start, end, pad) { + var constraint = []; + for (var i = start; i <= end; i++) { + constraint.push(pad ? JSUtils.pad(i, 2) : String(i)); + } + return constraint; + } + + new ResBundle({ locale: loc, + name: "dateres", sync: this.sync, - loadParams: JSUtils.merge(this.loadParams, {returnOne: true}, true), - callback: ilib.bind(this, function(regions) { - this.regions = regions; - - new ResBundle({ - locale: loc, - name: "sysres", - sync: this.sync, - loadParams: this.loadParams, - onLoad: ilib.bind(this, function (rb) { - var type, format, fields = this.info.fields || defaultData.fields; - if (this.info.multiformat) { - type = isAsianLocale(this.locale) ? "asian" : "latin"; - fields = this.info.fields[type]; - } - - if (typeof(this.style) === 'object') { - format = this.style[type || "latin"]; - } else { - format = this.style; - } - new Address(" ", { - locale: loc, - sync: this.sync, - loadParams: this.loadParams, - onLoad: ilib.bind(this, function(localeAddress) { - var rows = format.split(/\n/g); - info = rows.map(ilib.bind(this, function(row) { - return row.split("}").filter(function(component) { - return component.length > 0; - }).map(ilib.bind(this, function(component) { - var name = component.replace(/.*{/, ""); - var obj = { - component: name, - label: rb.getStringJS(this.info.fieldNames[name]) - }; - var field = fields.filter(function(f) { - return f.name === name; - }); - if (field && field[0] && field[0].pattern) { - if (typeof(field[0].pattern) === "string") { - obj.constraint = field[0].pattern; - } - } - if (name === "country") { - obj.constraint = invertAndFilter(localeAddress.ctrynames); - } else if (name === "region" && this.regions[loc.getRegion()]) { - obj.constraint = this.regions[loc.getRegion()]; - } - return obj; - })); - })); - - if (callback && typeof(callback) === "function") { - callback(info); + loadParams: this.loadParams, + onLoad: ilib.bind(this, function (rb) { + this.templateArr.map(ilib.bind(this, function(component) { + switch (component) { + case 'd': + return { + component: "day", + label: "Date", + template: "D", + constraint: { + "condition": "isLeap", + "regular": { + "1": sequence(1, 31), + "2": sequence(1, 28), + "3": sequence(1, 31), + "4": sequence(1, 30), + "5": sequence(1, 31), + "6": sequence(1, 30), + "7": sequence(1, 31), + "8": sequence(1, 31), + "9": sequence(1, 30), + "10": sequence(1, 31), + "11": sequence(1, 30), + "12": sequence(1, 31) + }, + "leap": { + "1": sequence(1, 31), + "2": sequence(1, 29), + "3": sequence(1, 31), + "4": sequence(1, 30), + "5": sequence(1, 31), + "6": sequence(1, 30), + "7": sequence(1, 31), + "8": sequence(1, 31), + "9": sequence(1, 30), + "10": sequence(1, 31), + "11": sequence(1, 30), + "12": sequence(1, 31) + } } - }) + }; + + case 'dd': + return { + component: "day", + label: "Date", + template: "DD", + constraint: { + "condition": "isLeap", + "regular": { + "1": sequence(1, 31, true), + "2": sequence(1, 28, true), + "3": sequence(1, 31, true), + "4": sequence(1, 30, true), + "5": sequence(1, 31, true), + "6": sequence(1, 30, true), + "7": sequence(1, 31, true), + "8": sequence(1, 31, true), + "9": sequence(1, 30, true), + "10": sequence(1, 31, true), + "11": sequence(1, 30, true), + "12": sequence(1, 31, true) + }, + "leap": { + "1": sequence(1, 31, true), + "2": sequence(1, 29, true), + "3": sequence(1, 31, true), + "4": sequence(1, 30, true), + "5": sequence(1, 31, true), + "6": sequence(1, 30, true), + "7": sequence(1, 31, true), + "8": sequence(1, 31, true), + "9": sequence(1, 30, true), + "10": sequence(1, 31, true), + "11": sequence(1, 30, true), + "12": sequence(1, 31, true) + } + } + }; + + case 'yy': + return { + component: "year", + label: "Year", + template: "YY", + constraint: "[0-9]{2}" + }; + + case 'yyyy': + return { + component: "year", + label: "Year", + template: "YYYY", + constraint: "[0-9]{4}" + }; + + case 'M': + return { + component: "month", + label: "Month", + template: "M", + constraint: "[0-9]{1,2}" + }; + + case 'MM': + return { + component: "month", + label: "Month", + template: "MM", + constraint: "[0-9]+" + }; + + case 'h': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: ["12"].concat(sequence(1, 11)) + }; + + case 'hh': + return { + component: "hour", + label: "Hour", + template: "HH", + constraint: ["12"].concat(sequence(1, 11, true)) + }; + + + case 'K': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: concat(sequence(0, 11)) + }; + + case 'KK': + return { + component: "hour", + label: "Hour", + template: "HH", + constraint: concat(sequence(0, 11, true)) + }; + + case 'H': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: [0, 23] + }; + + case 'HH': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: concat(sequence(0, 23, true)) + }; + + case 'k': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: ["24"].concat(sequence(0, 23)) + }; + + case 'kk': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: ["24"].concat(sequence(0, 23, true)) + }; + + case 'm': + return { + component: "minute", + label: "Minute", + template: "mm", + constraint: [0, 59] + }; + + case 'mm': + return { + component: "minute", + label: "Minute", + template: "mm", + constraint: sequence(0, 59, true) + }; + + case 's': + str += (date.second || "0"); + break; + case 'ss': + str += JSUtils.pad(date.second || "0", 2); + break; + case 'S': + str += (date.millisecond || "0"); + break; + case 'SSS': + str += JSUtils.pad(date.millisecond || "0", 3); + break; + + case 'N': + case 'NN': + case 'MMM': + case 'MMMM': + case 'L': + case 'LL': + case 'LLL': + case 'LLLL': + key = templateArr[i] + (date.month || 1); + str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); + break; + + case 'E': + case 'EE': + case 'EEE': + case 'EEEE': + case 'c': + case 'cc': + case 'ccc': + case 'cccc': + key = templateArr[i] + date.getDayOfWeek(); + //console.log("finding " + key + " in the resources"); + str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); + break; + + case 'a': + switch (this.meridiems) { + case "chinese": + if (date.hour < 6) { + key = "azh0"; // before dawn + } else if (date.hour < 9) { + key = "azh1"; // morning + } else if (date.hour < 12) { + key = "azh2"; // late morning/day before noon + } else if (date.hour < 13) { + key = "azh3"; // noon hour/midday + } else if (date.hour < 18) { + key = "azh4"; // afternoon + } else if (date.hour < 21) { + key = "azh5"; // evening time/dusk + } else { + key = "azh6"; // night time + } + break; + case "ethiopic": + if (date.hour < 6) { + key = "a0-ethiopic"; // morning + } else if (date.hour === 6 && date.minute === 0) { + key = "a1-ethiopic"; // noon + } else if (date.hour >= 6 && date.hour < 12) { + key = "a2-ethiopic"; // afternoon + } else if (date.hour >= 12 && date.hour < 18) { + key = "a3-ethiopic"; // evening + } else if (date.hour >= 18) { + key = "a4-ethiopic"; // night + } + break; + default: + key = date.hour < 12 ? "a0" : "a1"; + break; + } + //console.log("finding " + key + " in the resources"); + str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); + break; + + case 'w': + str += date.getWeekOfYear(); + break; + case 'ww': + str += JSUtils.pad(date.getWeekOfYear(), 2); + break; + + case 'D': + str += date.getDayOfYear(); + break; + case 'DD': + str += JSUtils.pad(date.getDayOfYear(), 2); + break; + case 'DDD': + str += JSUtils.pad(date.getDayOfYear(), 3); + break; + case 'W': + str += date.getWeekOfMonth(this.locale); + break; + + case 'G': + key = "G" + date.getEra(); + str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); + break; + + case 'O': + temp = this.sysres.getString("1#1st|2#2nd|3#3rd|21#21st|22#22nd|23#23rd|31#31st|#{num}th", "ordinalChoice"); + str += temp.formatChoice(date.day, {num: date.day}); + break; + + case 'z': // general time zone + tz = this.getTimeZone(); // lazy-load the tz + str += tz.getDisplayName(date, "standard"); + break; + case 'Z': // RFC 822 time zone + tz = this.getTimeZone(); // lazy-load the tz + str += tz.getDisplayName(date, "rfc822"); + break; + + default: + str += templateArr[i].replace(/'/g, ""); + break; + } + + })); + + var rows = format.split(/\n/g); + info = rows.map(ilib.bind(this, function(row) { + return row.split("}").filter(function(component) { + return component.length > 0; + }).map(ilib.bind(this, function(component) { + var name = component.replace(/.*{/, ""); + var obj = { + component: name, + label: rb.getStringJS(this.info.fieldNames[name]) + }; + var field = fields.filter(function(f) { + return f.name === name; }); - }) - }); + if (field && field[0] && field[0].pattern) { + if (typeof(field[0].pattern) === "string") { + obj.constraint = field[0].pattern; + } + } + if (name === "country") { + obj.constraint = invertAndFilter(localeAddress.ctrynames); + } else if (name === "region" && this.regions[loc.getRegion()]) { + obj.constraint = this.regions[loc.getRegion()]; + } + return obj; + })); + })); + + if (callback && typeof(callback) === "function") { + callback(info); + } }) }); - + return info; }; From 5bc3e334363188d5ceb5bb5511481a99cc93dbe4 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Sun, 9 Dec 2018 23:16:04 -0800 Subject: [PATCH 04/38] Add some validation regexps --- js/lib/DateFmt.js | 56 ++++++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index a811abea95..fd53a9bbb2 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -1855,7 +1855,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { "11": sequence(1, 30), "12": sequence(1, 31) } - } + }, + validation: "\\d{1,2}" }; case 'dd': @@ -1893,7 +1894,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { "11": sequence(1, 30, true), "12": sequence(1, 31, true) } - } + }, + validation: "\\d{1,2}" }; case 'yy': @@ -1901,7 +1903,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "year", label: "Year", template: "YY", - constraint: "[0-9]{2}" + constraint: "[0-9]{2}", + validation: "\\d{2}" }; case 'yyyy': @@ -1909,7 +1912,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "year", label: "Year", template: "YYYY", - constraint: "[0-9]{4}" + constraint: "[0-9]{4}", + validation: "\\d{4}" }; case 'M': @@ -1917,7 +1921,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "month", label: "Month", template: "M", - constraint: "[0-9]{1,2}" + constraint: [1, 12], + validation: "\\d{1,2}" }; case 'MM': @@ -1925,7 +1930,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "month", label: "Month", template: "MM", - constraint: "[0-9]+" + constraint: "[0-9]+", + validation: "\\d{2}" }; case 'h': @@ -1933,7 +1939,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "hour", label: "Hour", template: "H", - constraint: ["12"].concat(sequence(1, 11)) + constraint: ["12"].concat(sequence(1, 11)), + validation: "\\d{1,2}" }; case 'hh': @@ -1941,7 +1948,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "hour", label: "Hour", template: "HH", - constraint: ["12"].concat(sequence(1, 11, true)) + constraint: ["12"].concat(sequence(1, 11, true)), + validation: "\\d{2}" }; @@ -1950,7 +1958,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "hour", label: "Hour", template: "H", - constraint: concat(sequence(0, 11)) + constraint: concat(sequence(0, 11)), + validation: "\\d{1,2}" }; case 'KK': @@ -1958,7 +1967,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "hour", label: "Hour", template: "HH", - constraint: concat(sequence(0, 11, true)) + constraint: concat(sequence(0, 11, true)), + validation: "\\d{2}" }; case 'H': @@ -1966,7 +1976,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "hour", label: "Hour", template: "H", - constraint: [0, 23] + constraint: [0, 23], + validation: "\\d{1,2}" }; case 'HH': @@ -1974,7 +1985,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "hour", label: "Hour", template: "H", - constraint: concat(sequence(0, 23, true)) + constraint: concat(sequence(0, 23, true)), + validation: "\\d{1,2}" }; case 'k': @@ -1982,7 +1994,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "hour", label: "Hour", template: "H", - constraint: ["24"].concat(sequence(0, 23)) + constraint: ["24"].concat(sequence(0, 23)), + validation: "\\d{1,2}" }; case 'kk': @@ -1990,7 +2003,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "hour", label: "Hour", template: "H", - constraint: ["24"].concat(sequence(0, 23, true)) + constraint: ["24"].concat(sequence(0, 23, true)), + validation: "\\d{1,2}" }; case 'm': @@ -1998,16 +2012,18 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "minute", label: "Minute", template: "mm", - constraint: [0, 59] + constraint: [0, 59], + validation: "\\d{1,2}" }; case 'mm': return { - component: "minute", - label: "Minute", - template: "mm", - constraint: sequence(0, 59, true) - }; + component: "minute", + label: "Minute", + template: "mm", + constraint: sequence(0, 59, true), + validation: "\\d{2}" + }; case 's': str += (date.second || "0"); From e36d39bda9ad630b180ac3417f90860ef1a89aad Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Sun, 9 Dec 2018 23:17:44 -0800 Subject: [PATCH 05/38] More getFormatInfo work. Checkpoint commit. --- js/lib/DateFmt.js | 74 +++++++++++++++++++++++++++++++++++---------- js/lib/HebrewCal.js | 8 +++-- 2 files changed, 64 insertions(+), 18 deletions(-) diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index a811abea95..04d83e3965 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -2003,24 +2003,43 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { case 'mm': return { - component: "minute", - label: "Minute", - template: "mm", - constraint: sequence(0, 59, true) - }; + component: "minute", + label: "Minute", + template: "mm", + constraint: sequence(0, 59, true) + }; case 's': - str += (date.second || "0"); - break; + return { + component: "second", + label: "Second", + template: "ss", + constraint: [0, 59] + }; + case 'ss': - str += JSUtils.pad(date.second || "0", 2); - break; + return { + component: "second", + label: "Second", + template: "ss", + constraint: sequence(0, 59, true) + }; + case 'S': - str += (date.millisecond || "0"); - break; + return { + component: "millisecond", + label: "Millisecond", + template: "ms", + constraint: [0, 999] + }; + case 'SSS': - str += JSUtils.pad(date.millisecond || "0", 3); - break; + return { + component: "millisecond", + label: "Millisecond", + template: "ms", + constraint: sequence(0, 999, true) + }; case 'N': case 'NN': @@ -2030,9 +2049,32 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { case 'LL': case 'LLL': case 'LLLL': - key = templateArr[i] + (date.month || 1); - str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); - break; + return { + component: "month", + label: "Month", + template: "MMM", + constraint: { + "constraint": "isLeap", + "leap": (function() { + var ret = []; + var months = this.cal.getNumMonths(undefined, true); + for (var i = 1; i < months; i++) { + var key = component + i; + ret.push((this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key))); + } + return ret; + })(), + "regular": (function() { + var ret = []; + var months = this.cal.getNumMonths(undefined, false); + for (var i = 1; i < months; i++) { + var key = component + i; + ret.push((this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key))); + } + return ret; + })() + } + }; case 'E': case 'EE': diff --git a/js/lib/HebrewCal.js b/js/lib/HebrewCal.js index 3e6accf474..b861fda9da 100644 --- a/js/lib/HebrewCal.js +++ b/js/lib/HebrewCal.js @@ -177,9 +177,13 @@ HebrewCal.prototype.lastDayOfMonth = function(month, year) { * where 1=first month, 2=second month, etc. * * @param {number} year a year for which the number of months is sought + * @param {boolean} leap if the number of months is explicitly needed for a leap year, + * set this parameter to true. The year will be ignored in this case. + * @returns {number} the number of months in the given year or type of year */ -HebrewCal.prototype.getNumMonths = function(year) { - return this.isLeapYear(year) ? 13 : 12; +HebrewCal.prototype.getNumMonths = function(year, leap) { + var isLeap = typeof(leap) === "boolean" ? leap : this.isLeapYear(year); + return isLeap ? 13 : 12; }; /** From 46d55d3b62b6361459dfbee87aa65346b54aa344 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Mon, 10 Dec 2018 10:28:16 -0800 Subject: [PATCH 06/38] More work on getFormatInfo Add the idea of a value property, the value of which is a function that calculates the value of this field based on the value of other fields. For example, the day of week is not something that a UI typically displays in a date input form. Instead, you pick the year, month, and day and the day of week is determined automatically. More work is needed for time zones and to translate stuff. --- js/lib/DateFmt.js | 150 +++++++++++++++++++++++++++++----------------- 1 file changed, 94 insertions(+), 56 deletions(-) diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index 43371de815..15319fa313 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -1811,7 +1811,7 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { } return constraint; } - + new ResBundle({ locale: loc, name: "dateres", @@ -2030,7 +2030,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "second", label: "Second", template: "ss", - constraint: [0, 59] + constraint: [0, 59], + validation: "\\d{1,2}" }; case 'ss': @@ -2038,7 +2039,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "second", label: "Second", template: "ss", - constraint: sequence(0, 59, true) + constraint: sequence(0, 59, true), + validation: "\\d{2}" }; case 'S': @@ -2046,7 +2048,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "millisecond", label: "Millisecond", template: "ms", - constraint: [0, 999] + constraint: [0, 999], + validation: "\\d{1,3}" }; case 'SSS': @@ -2054,7 +2057,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "millisecond", label: "Millisecond", template: "ms", - constraint: sequence(0, 999, true) + constraint: sequence(0, 999, true), + validation: "\\d{3}" }; case 'N': @@ -2068,7 +2072,6 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { return { component: "month", label: "Month", - template: "MMM", constraint: { "constraint": "isLeap", "leap": (function() { @@ -2100,75 +2103,109 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { case 'cc': case 'ccc': case 'cccc': - key = templateArr[i] + date.getDayOfWeek(); - //console.log("finding " + key + " in the resources"); - str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); + return { + component: "dayofweek", + label: "Day of Week", + constraint: (function() { + var ret = []; + var months = this.cal.getNumMonths(undefined, true); + for (var i = 0; i < 7; i++) { + key = component + i; + //console.log("finding " + key + " in the resources"); + ret.push((this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key))); + } + return ret; + })() + }; break; case 'a': + var ret = { + component: "meridiem", + label: "AM/PM", + template: "AM/PM", + constraint: [] + }; switch (this.meridiems) { case "chinese": - if (date.hour < 6) { - key = "azh0"; // before dawn - } else if (date.hour < 9) { - key = "azh1"; // morning - } else if (date.hour < 12) { - key = "azh2"; // late morning/day before noon - } else if (date.hour < 13) { - key = "azh3"; // noon hour/midday - } else if (date.hour < 18) { - key = "azh4"; // afternoon - } else if (date.hour < 21) { - key = "azh5"; // evening time/dusk - } else { - key = "azh6"; // night time + for (var i = 0; i < 7; i++) { + var key = "azh" + i; + ret.constraint.push(this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); } break; case "ethiopic": - if (date.hour < 6) { - key = "a0-ethiopic"; // morning - } else if (date.hour === 6 && date.minute === 0) { - key = "a1-ethiopic"; // noon - } else if (date.hour >= 6 && date.hour < 12) { - key = "a2-ethiopic"; // afternoon - } else if (date.hour >= 12 && date.hour < 18) { - key = "a3-ethiopic"; // evening - } else if (date.hour >= 18) { - key = "a4-ethiopic"; // night + for (var i = 0; i < 7; i++) { + var key = "a" + i + "-ethiopic"; + ret.constraint.push(this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); } break; default: - key = date.hour < 12 ? "a0" : "a1"; - break; + ret.constraint.push(this.sysres.getString(undefined, "a0-" + this.calName) || this.sysres.getString(undefined, "a0")); + ret.constraint.push(this.sysres.getString(undefined, "a1-" + this.calName) || this.sysres.getString(undefined, "a1")); + break; } - //console.log("finding " + key + " in the resources"); - str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); - break; + return ret; case 'w': - str += date.getWeekOfYear(); - break; + return { + label: "Week of Year", + value: function(date) { + return date.getDayOfYear(); + } + }; + case 'ww': - str += JSUtils.pad(date.getWeekOfYear(), 2); - break; + return { + label: "Week of Year", + value: function(date) { + var temp = date.getWeekOfYear(); + return JSUtils.pad(temp, 2) + } + }; case 'D': - str += date.getDayOfYear(); - break; + return { + label: "Day of Year", + value: function(date) { + return date.getDayOfYear(); + } + }; + case 'DD': - str += JSUtils.pad(date.getDayOfYear(), 2); - break; + return { + label: "Day of Year", + value: function(date) { + var temp = date.getDayOfYear(); + return JSUtils.pad(temp, 2) + } + }; + case 'DDD': - str += JSUtils.pad(date.getDayOfYear(), 3); - break; + return { + label: "Day of Year", + value: function(date) { + var temp = date.getDayOfYear(); + return JSUtils.pad(temp, 3) + } + }; + case 'W': - str += date.getWeekOfMonth(this.locale); - break; + return { + label: "Week of Month", + value: function(date) { + return date.getWeekOfMonth(); + } + }; case 'G': - key = "G" + date.getEra(); - str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); - break; + var ret = { + component: "era", + label: "Era", + constraint: [] + }; + ret.constraint.push(this.sysres.getString(undefined, "G0-" + this.calName) || this.sysres.getString(undefined, "G0")); + ret.constraint.push(this.sysres.getString(undefined, "G1-" + this.calName) || this.sysres.getString(undefined, "G1")); + return ret; case 'O': temp = this.sysres.getString("1#1st|2#2nd|3#3rd|21#21st|22#22nd|23#23rd|31#31st|#{num}th", "ordinalChoice"); @@ -2185,8 +2222,9 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { break; default: - str += templateArr[i].replace(/'/g, ""); - break; + return { + label: component + }; } })); @@ -2223,7 +2261,7 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { } }) }); - + return info; }; From efcb0602b50c908b85cc44c0597400eea2913d86 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Thu, 6 Dec 2018 11:01:22 -0800 Subject: [PATCH 07/38] Take a stab at defining DateFmt.getFormatInfo() --- js/lib/AddressFmt.js | 2 +- js/lib/DateFmt.js | 253 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 254 insertions(+), 1 deletion(-) diff --git a/js/lib/AddressFmt.js b/js/lib/AddressFmt.js index 5df9d2bf64..896099b084 100644 --- a/js/lib/AddressFmt.js +++ b/js/lib/AddressFmt.js @@ -370,7 +370,7 @@ function invertAndFilter(object) { * // like "City" and "Postal Code" translated to. In this example, we * // are showing an input form for Dutch addresses, but the labels are * // written in US English. - * fmt.getAddressFormatInfo("en-US", true, ilib.bind(this, function(rows) { + * fmt.getFormatInfo("en-US", true, ilib.bind(this, function(rows) { * // iterate through the rows array and dynamically create the input * // elements with the given labels * })); diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index d6c060d9c6..fc28154f83 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -1606,4 +1606,257 @@ DateFmt.prototype = { } }; +/** + * Return information about the date format that can be used + * by UI builders to display a locale-sensitive set of input fields + * based on the current formatter's settings.

+ * + * The object returned by this method is an array of date + * format components. Each format component is an object + * that contains a "component" property and a "label" to display + * with it. The label is written in the given locale, or the + * locale of this formatter if the locale was not given.

+ * + * Field separators such as slashes or dots, etc., are given + * as a object with no component property. It only contains + * a label property.

+ * + * Optionally, if a format component is constrained to a + * particular pattern or to a fixed list of possible values, then + * the constraint rules are given in the "constraint" property. + * The values in the constraint property can be one of three types: + * + *

    + *
      array[2]<number> - an array of size 2 of numbers + * that gives the start and end of a numeric range. + *
        array<object> - an array of valid string values + * given as objects that have "label" and "value" properties. The + * label is to be displayed to the user and the value is to be used + * to construct the new IDate object when the user has finished + * selecting the components and the form is being evaluated or + * submitted. + *
          object - conditional constraints. In some cases, + * the list of possible values for the months + * or the days depends on which year and month is being + * displayed. When this happens, the constraint property is + * given as an object that gives the different sets of values + * depending on a property. For example, the list of month + * names in a Hebrew calendar depends on whether or not the + * year is a leap year. In leap years, there are 13 months, + * and in regular years, there are 12 months. The constraint + * property for Hebrew calendars is returned as an object + * that contains three properties, "condition", "leap", + * and "regular". The "condition" says what the condition is + * based on, and each of "leap" and "regular" are + * an array of strings that give the month names. + * It is up to the caller to create an IDate object for the + * given year and ask it whether or not it represents a + * leap year and display the correct list in the UI. + *
+ * + * Here is what the result would look like for a US short + * date/time format that includes the components of date, month, + * year, hour, minute, and meridiem: + *
+ * [
+ *   {
+ *     "component": "month",
+ *     "label": "Month",
+ *     "constraint": [1, 12]
+ *   },
+ *   {
+ *     "label": "/"
+ *   },
+ *   {
+ *     "component": "day",
+ *     "label": "Date",
+ *     "constraint": {
+ *       "leap": {
+ *          "1": [1, 31],
+ *          "2": [1, 29],
+ *          "3": [1, 31],
+ *          "4": [1, 30],
+ *          "5": [1, 31],
+ *          "6": [1, 30],
+ *          "7": [1, 31],
+ *          "8": [1, 31],
+ *          "9": [1, 30],
+ *          "10": [1, 31],
+ *          "11": [1, 30],
+ *          "12": [1, 31]
+ *       },
+ *       "regular": {
+ *          "1": [1, 31],
+ *          "2": [1, 28],
+ *          "3": [1, 31],
+ *          "4": [1, 30],
+ *          "5": [1, 31],
+ *          "6": [1, 30],
+ *          "7": [1, 31],
+ *          "8": [1, 31],
+ *          "9": [1, 30],
+ *          "10": [1, 31],
+ *          "11": [1, 30],
+ *          "12": [1, 31]
+ *       }
+ *     }
+ *   {
+ *     "label": "/"
+ *   },
+ *   {
+ *     "component": "year",
+ *     "label": "Year",
+ *     "constraint": "[0-9]+"
+ *   },
+ *   {
+ *     "label": " at "
+ *   },
+ *   {
+ *     "component": "hour",
+ *     "label": "Hour",
+ *     "constraint": [1, 12]
+ *   },
+ *   {
+ *     "label": ":"
+ *   },
+ *   {
+ *     "component": "minute",
+ *     "label": "Minute",
+ *     "constraint": [
+ *       "00",
+ *       "01",
+ *       "02",
+ *       "03",
+ *       "04",
+ *       "05",
+ *       "06",
+ *       "07",
+ *       "08",
+ *       "09",
+ *       "10",
+ *       "11",
+ *       ...
+ *       "59"
+ *     ]
+ *   },
+ *   {
+ *     "label": " "
+ *   },
+ *   {
+ *     "component": "meridiem",
+ *     "label": "AM/PM",
+ *     "constraint": ["AM", "PM"]
+ *   }
+ * ]
+ * 
+ *

+ * @example Example of calling the getFormatInfo method + * + * // the DateFmt should be created with the locale of the date you + * // would like the user to enter. + * new DateFmt({ + * locale: 'nl-NL', // for dates in the Netherlands + * onLoad: ilib.bind(this, function(fmt) { + * // The following is the locale of the UI you would like to see the labels + * // like "Year" and "Minute" translated to. In this example, we + * // are showing an input form for Dutch dates, but the labels are + * // written in US English. + * fmt.getFormatInfo("en-US", true, ilib.bind(this, function(components) { + * // iterate through the component array and dynamically create the input + * // elements with the given labels + * })); + * }) + * }); + * + * @param {Locale|string=} locale the locale to translate the labels + * to. If not given, the locale of the formatter will be used. + * @param {boolean=} sync true if this method should load the data + * synchronously, false if async + * @param {Function=} callback a callback to call when the data + * is ready + * @returns {Array.} An array date components + */ +DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { + var info; + var loc = new Locale(this.locale); + if (locale) { + if (typeof(locale) === "string") { + locale = new Locale(locale); + } + loc.language = locale.getLanguage(); + loc.spec = undefined; + } + + Utils.loadData({ + name: "regionnames.json", + object: "DateFmt", + locale: loc, + sync: this.sync, + loadParams: JSUtils.merge(this.loadParams, {returnOne: true}, true), + callback: ilib.bind(this, function(regions) { + this.regions = regions; + + new ResBundle({ + locale: loc, + name: "sysres", + sync: this.sync, + loadParams: this.loadParams, + onLoad: ilib.bind(this, function (rb) { + var type, format, fields = this.info.fields || defaultData.fields; + if (this.info.multiformat) { + type = isAsianLocale(this.locale) ? "asian" : "latin"; + fields = this.info.fields[type]; + } + + if (typeof(this.style) === 'object') { + format = this.style[type || "latin"]; + } else { + format = this.style; + } + new Address(" ", { + locale: loc, + sync: this.sync, + loadParams: this.loadParams, + onLoad: ilib.bind(this, function(localeAddress) { + var rows = format.split(/\n/g); + info = rows.map(ilib.bind(this, function(row) { + return row.split("}").filter(function(component) { + return component.length > 0; + }).map(ilib.bind(this, function(component) { + var name = component.replace(/.*{/, ""); + var obj = { + component: name, + label: rb.getStringJS(this.info.fieldNames[name]) + }; + var field = fields.filter(function(f) { + return f.name === name; + }); + if (field && field[0] && field[0].pattern) { + if (typeof(field[0].pattern) === "string") { + obj.constraint = field[0].pattern; + } + } + if (name === "country") { + obj.constraint = invertAndFilter(localeAddress.ctrynames); + } else if (name === "region" && this.regions[loc.getRegion()]) { + obj.constraint = this.regions[loc.getRegion()]; + } + return obj; + })); + })); + + if (callback && typeof(callback) === "function") { + callback(info); + } + }) + }); + }) + }); + }) + }); + + return info; +}; + + module.exports = DateFmt; From c9c1db2371e3e6534186d4f5564d162fb8b9cde2 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Fri, 7 Dec 2018 01:02:53 -0800 Subject: [PATCH 08/38] Added unit tests and updated the documentation --- js/data/locale/dateres.json | 10 + js/lib/DateFmt.js | 49 +- js/test/date/testdatefmt.js | 1213 ++++++++++++++++++++--------------- 3 files changed, 723 insertions(+), 549 deletions(-) create mode 100644 js/data/locale/dateres.json diff --git a/js/data/locale/dateres.json b/js/data/locale/dateres.json new file mode 100644 index 0000000000..a9d8f0e598 --- /dev/null +++ b/js/data/locale/dateres.json @@ -0,0 +1,10 @@ +{ + "month": "Month", + "day": "Date", + "year": "Year", + "hour": "Hour", + "minute": "Minute", + "second": "Second", + "meridium": "AM/PM", + "timezone": "Time Zone" +} \ No newline at end of file diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index fc28154f83..09f7ac47ee 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -1614,44 +1614,55 @@ DateFmt.prototype = { * The object returned by this method is an array of date * format components. Each format component is an object * that contains a "component" property and a "label" to display - * with it. The label is written in the given locale, or the - * locale of this formatter if the locale was not given.

+ * with it. The component is the name of the property to use + * when constructing a new date with DateFactory(). The label + * is intended to be shown to the user and is written in the + * given locale, or the locale of this formatter if the + * locale was not given.

* * Field separators such as slashes or dots, etc., are given - * as a object with no component property. It only contains - * a label property.

+ * as a object with no "component" property. They only contain + * a "label" property with a string value. A user interface + * may choose to omit these if desired.

* * Optionally, if a format component is constrained to a - * particular pattern or to a fixed list of possible values, then - * the constraint rules are given in the "constraint" property. - * The values in the constraint property can be one of three types: + * particular pattern, range, or to a fixed list of possible + * values, then these constraint rules are given in the + * "constraint" property. + * The values in the constraint property can be one of these + * types: * *

    *
      array[2]<number> - an array of size 2 of numbers * that gives the start and end of a numeric range. *
        array<object> - an array of valid string values * given as objects that have "label" and "value" properties. The - * label is to be displayed to the user and the value is to be used - * to construct the new IDate object when the user has finished + * label is intended to be displayed to the user and the value + * is to be used to construct the new date object when the + * user has finished * selecting the components and the form is being evaluated or * submitted. *
          object - conditional constraints. In some cases, * the list of possible values for the months * or the days depends on which year and month is being - * displayed. When this happens, the constraint property is + * displayed. When this happens, the "constraint" property is * given as an object that gives the different sets of values - * depending on a property. For example, the list of month + * depending on a condition. The name of the condition is + * given in the "condition" property of this object. + * For example, the list of month * names in a Hebrew calendar depends on whether or not the * year is a leap year. In leap years, there are 13 months, - * and in regular years, there are 12 months. The constraint + * and in regular years, there are 12 months. The "constraint" * property for Hebrew calendars is returned as an object * that contains three properties, "condition", "leap", * and "regular". The "condition" says what the condition is - * based on, and each of "leap" and "regular" are + * based on (ie. whether or not it is a leap year), and + * each of "leap" and "regular" are * an array of strings that give the month names. - * It is up to the caller to create an IDate object for the + * It is up to the caller to create an date object with + * the DateFactory() function for the * given year and ask it whether or not it represents a - * leap year and display the correct list in the UI. + * leap year and then display the correct list in the UI. *
* * Here is what the result would look like for a US short @@ -1671,6 +1682,7 @@ DateFmt.prototype = { * "component": "day", * "label": "Date", * "constraint": { + * "condition": "leapyear", * "leap": { * "1": [1, 31], * "2": [1, 29], @@ -1750,6 +1762,10 @@ DateFmt.prototype = { * ] * *

+ * Note that the "minute" component comes with a preformatted list of values + * as strings, even though the minute is really a number. The preformatting + * ensures that the leading zero is not lost for minutes less than 10. + * * @example Example of calling the getFormatInfo method * * // the DateFmt should be created with the locale of the date you @@ -1771,7 +1787,8 @@ DateFmt.prototype = { * @param {Locale|string=} locale the locale to translate the labels * to. If not given, the locale of the formatter will be used. * @param {boolean=} sync true if this method should load the data - * synchronously, false if async + * synchronously and return it immediately, false if async operation is + * needed. * @param {Function=} callback a callback to call when the data * is ready * @returns {Array.} An array date components diff --git a/js/test/date/testdatefmt.js b/js/test/date/testdatefmt.js index 7bc311f4dc..7196a5d95b 100644 --- a/js/test/date/testdatefmt.js +++ b/js/test/date/testdatefmt.js @@ -1,6 +1,6 @@ /* * testdatefmt.js - test the date formatter object - * + * * Copyright © 2012-2015,2017, JEDLSoft * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -47,7 +47,7 @@ if (typeof(DateFactory) === "undefined") { function mockLoaderDF(paths, sync, params, callback) { var data = []; - + paths.forEach(function(path) { if (path === "localeinfo.json") { data.push(ilib.data.localeinfo); // for the generic, shared stuff @@ -61,7 +61,7 @@ function mockLoaderDF(paths, sync, params, callback) { }); if (typeof(callback) !== 'undefined') { - callback.call(this, data); + callback.call(this, data); } return data; } @@ -82,57 +82,57 @@ module.exports.testdatefmt = { testDateFmtConstructorEmpty: function(test) { test.expect(1); var fmt = new DateFmt(); - + test.ok(fmt !== null); test.done(); }, - + testDateFmtConstructorDefaultLocale: function(test) { test.expect(2); var fmt = new DateFmt(); - + test.ok(fmt !== null); - + test.equal(fmt.getLocale().toString(), "en-US"); test.done(); }, - + testDateFmtGetCalendarDefault: function(test) { test.expect(3); var fmt = new DateFmt(); - + test.ok(fmt !== null); var cal = fmt.getCalendar(); test.ok(cal !== null); - + test.equal(cal, "gregorian"); test.done(); }, - + testDateFmtGetCalendarExplicit: function(test) { test.expect(3); var fmt = new DateFmt({calendar: "julian"}); - + test.ok(fmt !== null); var cal = fmt.getCalendar(); test.ok(cal !== null); - + test.equal(cal, "julian"); test.done(); }, - + testDateFmtGetCalendarExplicitDefault: function(test) { test.expect(3); var fmt = new DateFmt({calendar: "gregorian"}); - + test.ok(fmt !== null); var cal = fmt.getCalendar(); test.ok(cal !== null); - + test.equal(cal, "gregorian"); test.done(); }, - + testDateFmtGetCalendarNotInThisLocale: function(test) { try { new DateFmt({calendar: "arabic", locale: 'en-US'}); @@ -143,308 +143,308 @@ module.exports.testdatefmt = { } test.done(); }, - + testDateFmtGetLength: function(test) { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + test.equal(fmt.getLength(), "full"); test.done(); }, - + testDateFmtGetLengthDefault: function(test) { test.expect(2); var fmt = new DateFmt(); test.ok(fmt !== null); - + test.equal(fmt.getLength(), "short"); test.done(); }, - + testDateFmtGetLengthBogus: function(test) { test.expect(2); var fmt = new DateFmt({length: "asdf"}); test.ok(fmt !== null); - + test.equal(fmt.getLength(), "short"); test.done(); }, - - + + testDateFmtGetType: function(test) { test.expect(2); var fmt = new DateFmt({type: "time"}); test.ok(fmt !== null); - + test.equal(fmt.getType(), "time"); test.done(); }, - + testDateFmtGetTypeDefault: function(test) { test.expect(2); var fmt = new DateFmt(); test.ok(fmt !== null); - + test.equal(fmt.getType(), "date"); test.done(); }, - + testDateFmtGetTypeBogus: function(test) { test.expect(2); var fmt = new DateFmt({type: "asdf"}); test.ok(fmt !== null); - + test.equal(fmt.getType(), "date"); test.done(); }, - - + + testDateFmtGetLocale: function(test) { test.expect(2); var fmt = new DateFmt({locale: "de-DE"}); test.ok(fmt !== null); - + test.equal(fmt.getLocale().toString(), "de-DE"); test.done(); }, - + testDateFmtGetLocaleDefault: function(test) { test.expect(2); var fmt = new DateFmt(); test.ok(fmt !== null); - + test.equal(fmt.getLocale().toString(), "en-US"); test.done(); }, - + testDateFmtGetLocaleBogus: function(test) { test.expect(2); var fmt = new DateFmt({locale: "zyy-XX"}); test.ok(fmt !== null); - + test.equal(fmt.getLocale().toString(), "zyy-XX"); test.done(); }, - + testDateFmtGetTimeComponentsDefault: function(test) { test.expect(2); var fmt = new DateFmt(); test.ok(fmt !== null); - + test.equal(fmt.getTimeComponents(), "ahm"); test.done(); }, - + testDateFmtGetTimeComponents: function(test) { test.expect(2); var fmt = new DateFmt({time: "hmsaz"}); test.ok(fmt !== null); - + test.equal(fmt.getTimeComponents(), "ahmsz"); test.done(); }, - + testDateFmtGetTimeComponentsReorder: function(test) { test.expect(2); var fmt = new DateFmt({time: "zahms"}); test.ok(fmt !== null); - + test.equal(fmt.getTimeComponents(), "ahmsz"); test.done(); }, - + testDateFmtGetTimeComponentsBogus: function(test) { test.expect(2); var fmt = new DateFmt({time: "asdf"}); test.ok(fmt !== null); - + // use the default test.equal(fmt.getTimeComponents(), "ahm"); test.done(); }, - + testDateFmtGetTimeComponentsICUSkeleton1: function(test) { test.expect(2); var fmt = new DateFmt({time: "EHm"}); test.ok(fmt !== null); - + test.equal(fmt.getTimeComponents(), "hm"); test.done(); }, - + testDateFmtGetTimeComponentsICUSkeleton2: function(test) { test.expect(2); var fmt = new DateFmt({time: "Hms"}); test.ok(fmt !== null); - + test.equal(fmt.getTimeComponents(), "hms"); test.done(); }, - + testDateFmtGetTimeComponentsICUSkeleton3: function(test) { test.expect(2); var fmt = new DateFmt({time: "Ehms"}); test.ok(fmt !== null); - + // ignore the non-time components test.equal(fmt.getTimeComponents(), "hms"); test.done(); }, - + testDateFmtGetTimeComponentsICUSkeleton3: function(test) { test.expect(2); var fmt = new DateFmt({time: "yMdhms"}); test.ok(fmt !== null); - + // ignore the non-time components test.equal(fmt.getTimeComponents(), "hms"); test.done(); }, - + testDateFmtGetDateComponentsDefault: function(test) { test.expect(2); var fmt = new DateFmt(); test.ok(fmt !== null); - + test.equal(fmt.getDateComponents(), "dmy"); test.done(); }, - + testDateFmtGetDateComponents: function(test) { test.expect(2); var fmt = new DateFmt({date: "dmwy"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponents(), "dmwy"); test.done(); }, - + testDateFmtGetDateComponentsReorder: function(test) { test.expect(2); var fmt = new DateFmt({date: "wmdy"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponents(), "dmwy"); test.done(); }, - + testDateFmtGetDateComponentsBogus: function(test) { test.expect(2); var fmt = new DateFmt({date: "asdf"}); test.ok(fmt !== null); - + // use the default test.equal(fmt.getDateComponents(), "dmy"); test.done(); }, - + testDateFmtGetDateComponentsICUSkeleton1: function(test) { test.expect(2); var fmt = new DateFmt({date: "yMMMMd"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponents(), "dmy"); test.done(); }, - + testDateFmtGetDateComponentsICUSkeleton2: function(test) { test.expect(2); var fmt = new DateFmt({date: "yMMd"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponents(), "dmy"); test.done(); }, - + testDateFmtGetDateComponentsICUSkeleton3: function(test) { test.expect(2); var fmt = new DateFmt({date: "yMMMM"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponents(), "my"); test.done(); }, - + testDateFmtGetDateComponentsICUSkeleton4: function(test) { test.expect(2); var fmt = new DateFmt({date: "MMMEd"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponents(), "dmw"); test.done(); }, - + testDateFmtGetDateComponentsICUSkeleton5: function(test) { test.expect(2); var fmt = new DateFmt({date: "GyMMMEd"}); test.ok(fmt !== null); - + // ignore the era test.equal(fmt.getDateComponents(), "dmwy"); test.done(); }, - + testDateFmtGetDateComponentsICUSkeleton6: function(test) { test.expect(2); var fmt = new DateFmt({date: "MMddhms"}); test.ok(fmt !== null); - + // ignore the time components test.equal(fmt.getDateComponents(), "dm"); test.done(); }, - + testDateFmtGetClockDefaultUS: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US"}); test.ok(fmt !== null); - + // use the default test.equal(fmt.getClock(), "12"); test.done(); }, - + testDateFmtGetClockDefaultDE: function(test) { test.expect(2); var fmt = new DateFmt({locale: "de-DE"}); test.ok(fmt !== null); - + // use the default test.equal(fmt.getClock(), "24"); test.done(); }, - + testDateFmtGetClockDefaultJP: function(test) { test.expect(2); var fmt = new DateFmt({locale: "ja-JP"}); test.ok(fmt !== null); - + // use the default test.equal(fmt.getClock(), "24"); test.done(); }, - + testDateFmtGetClock: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US", clock: "24"}); test.ok(fmt !== null); - + // use the default test.equal(fmt.getClock(), "24"); test.done(); }, - + testDateFmtGetClockBogus: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US", clock: "asdf"}); test.ok(fmt !== null); - + // use the default test.equal(fmt.getClock(), "12"); test.done(); }, - + testDateFmtGetTimeZoneDefault: function(test) { test.expect(2); ilib.tz = undefined; // just in case @@ -452,258 +452,258 @@ module.exports.testdatefmt = { if (ilib._getPlatform() === "nodejs") { process.env.TZ = ""; } - + test.ok(fmt !== null); - + test.equal(fmt.getTimeZone().getId(), "local"); test.done(); }, - + testDateFmtGetTimeZone: function(test) { test.expect(2); var fmt = new DateFmt({timezone: "Europe/Paris"}); test.ok(fmt !== null); - + test.equal(fmt.getTimeZone().getId(), "Europe/Paris"); test.done(); }, - + testDateFmtGetTemplateDefault: function(test) { test.expect(2); var fmt = new DateFmt(); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "M/d/yy"); test.done(); }, - + testDateFmtGetTemplate: function(test) { test.expect(2); var fmt = new DateFmt({template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "EEE 'the' DD 'of' MM, yyyy G"); test.done(); }, - + testDateFmtGetTemplateIgnoreProperties: function(test) { test.expect(2); var fmt = new DateFmt({date: 'y', template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "EEE 'the' DD 'of' MM, yyyy G"); test.done(); }, - + testDateFmtUseTemplateEmptyDateComponents: function(test) { test.expect(2); var fmt = new DateFmt({date: 'y', template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponents(), ""); test.done(); }, - + testDateFmtUseTemplateEmptyTimeComponents: function(test) { test.expect(2); var fmt = new DateFmt({time: 'h', template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + test.equal(fmt.getTimeComponents(), ""); test.done(); }, - + testDateFmtUseTemplateEmptyLength: function(test) { test.expect(2); var fmt = new DateFmt({length: 'short', template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + test.equal(fmt.getLength(), ""); test.done(); }, - + testDateFmtUseTemplateNonEmptyCalendar: function(test) { test.expect(2); var fmt = new DateFmt({calendar: 'julian', template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + test.equal(fmt.getCalendar(), "julian"); test.done(); }, - + testDateFmtUseTemplateNonEmptyLocale: function(test) { test.expect(2); var fmt = new DateFmt({locale: 'de-DE', template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + test.equal(fmt.getLocale().toString(), "de-DE"); test.done(); }, - + testDateFmtUseTemplateNonEmptyClock: function(test) { test.expect(2); var fmt = new DateFmt({clock: "24", template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + test.equal(fmt.getClock(), "24"); test.done(); }, - + testDateFmtUseTemplateWithClockHH: function(test) { test.expect(2); var fmt = new DateFmt({clock: "24", template: "hh:mm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "HH:mm"); test.done(); }, - + testDateFmtUseTemplateWithClockKK: function(test) { test.expect(2); var fmt = new DateFmt({clock: "24", template: "KK:mm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "kk:mm"); test.done(); }, - + testDateFmtUseTemplateWithClockhh: function(test) { test.expect(2); var fmt = new DateFmt({clock: "12", template: "HH:mm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "hh:mm"); test.done(); }, - + testDateFmtUseTemplateWithClockkk: function(test) { test.expect(2); var fmt = new DateFmt({clock: "12", template: "kk:mm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "KK:mm"); test.done(); }, - + testDateFmtUseTemplateWithClockHHSkipEscapedStrings24: function(test) { test.expect(2); var fmt = new DateFmt({clock: "24", template: "'hh' hh:mm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "'hh' HH:mm"); test.done(); }, - + testDateFmtUseTemplateWithClockHHSkipEscapedStrings12: function(test) { test.expect(2); var fmt = new DateFmt({clock: "12", template: "'HH' HH:mm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "'HH' hh:mm"); test.done(); }, - + testDateFmtUseTemplateNonEmptyTimeZone: function(test) { test.expect(3); var fmt = new DateFmt({timezone: 'Europe/Paris', template: "EEE 'the' DD 'of' MM, yyyy G"}); test.ok(fmt !== null); - + var tz = fmt.getTimeZone(); test.ok(typeof(tz) !== "undefined"); test.equal(tz.getId(), "Europe/Paris"); test.done(); }, - + testDateFmtGetTemplateCalendar: function(test) { test.expect(2); var fmt = new DateFmt({calendar: "julian"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "M/d/yy"); test.done(); }, - + testDateFmtGetTemplateLocale: function(test) { test.expect(2); var fmt = new DateFmt({locale: "de-DE"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "dd.MM.yy"); test.done(); }, - + testDateFmtGetTemplateLength: function(test) { test.expect(2); var fmt = new DateFmt({length: "long"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "MMMM d, yyyy"); test.done(); }, - + testDateFmtGetTemplateTypeDateTime: function(test) { test.expect(2); var fmt = new DateFmt({type: "datetime"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "M/d/yy, h:mm a"); test.done(); }, - + testDateFmtGetTemplateTypeTime: function(test) { test.expect(2); var fmt = new DateFmt({type: "time"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "h:mm a"); test.done(); }, - + testDateFmtGetTemplateDateComponents: function(test) { test.expect(2); var fmt = new DateFmt({date: "wdm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "E, M/d"); test.done(); }, - + testDateFmtGetTemplateDateComponentsWithICUSkeleton: function(test) { test.expect(2); var fmt = new DateFmt({date: "MMMEd"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "E, M/d"); test.done(); }, - + testDateFmtGetTemplateTimeComponents: function(test) { test.expect(2); var fmt = new DateFmt({type: "time", time: "hm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "h:mm"); test.done(); }, - + testDateFmtGetTemplateTimeComponentsWithICUSkeleton: function(test) { test.expect(2); var fmt = new DateFmt({type: "time", time: "Hm"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "h:mm"); test.done(); }, - + testDateFmtGetTemplateTypeTime24: function(test) { test.expect(2); var fmt = new DateFmt({type: "time", clock: "24"}); test.ok(fmt !== null); - + test.equal(fmt.getTemplate(), "HH:mm"); test.done(); }, - + testDateFmtTokenizeSimple: function(test) { test.expect(2); var fmt = new DateFmt(); @@ -713,11 +713,11 @@ module.exports.testdatefmt = { " ", "d" ]; - + test.deepEqual(fmt._tokenize("MMM d"), expected); test.done(); }, - + testDateFmtTokenizeAdjacentParts: function(test) { test.expect(2); var fmt = new DateFmt(); @@ -728,11 +728,11 @@ module.exports.testdatefmt = { "mm", "a" ]; - + test.deepEqual(fmt._tokenize("hh:mma"), expected); test.done(); }, - + testDateFmtTokenizeComplex: function(test) { test.expect(2); var fmt = new DateFmt(); @@ -753,11 +753,11 @@ module.exports.testdatefmt = { " ", "z" ]; - + test.deepEqual(fmt._tokenize("dd/MM/yyyy, h:mm:ssa z"), expected); test.done(); }, - + testDateFmtTokenizeWithEscapes: function(test) { test.expect(2); var fmt = new DateFmt(); @@ -773,21 +773,21 @@ module.exports.testdatefmt = { ", ", "yyyy" ]; - + test.deepEqual(fmt._tokenize("'El' d 'de' MMMM, yyyy"), expected); test.done(); }, - + testDateFmtAlternateInputs1: function(test) { // toUTCString doesn't work properly on qt, so we can't do this test if (ilib._getPlatform() !== "qt") { test.expect(2); var fmt = new DateFmt({ - timezone: "Etc/UTC", + timezone: "Etc/UTC", template: "EEE, d MMM yyyy kk:mm:ss z" }); test.ok(fmt !== null); - + var datMyBday = new Date("Fri Aug 13 1982 13:37:35 GMT-0700"); var ildMyBday = DateFactory({ timezone: "Etc/UTC", @@ -802,12 +802,12 @@ module.exports.testdatefmt = { var strFormattedDate2 = fmt.format(ildMyBday); strFormattedDate1 = strFormattedDate1.replace(/ \w{3}$/, ''); strFormattedDate2 = strFormattedDate2.replace(/ \w{3}$/, ''); - + test.equal(strFormattedDate2, strFormattedDate1); } test.done(); }, - + testDateFmtFormatJSDate1: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -816,14 +816,14 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted var datMyBday = new Date("Fri Aug 13 1982 13:37:35 GMT-0700"); test.equal(fmt.format(datMyBday), "1:37 PM"); test.done(); }, - + testDateFmtFormatJSDateRightTimeZone1: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -833,14 +833,14 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted var datMyBday = new Date("Wed May 14 2014 23:37:35 GMT-0700"); test.equal(fmt.format(datMyBday), "Wednesday"); test.done(); }, - + testDateFmtFormatJSDateRightTimeZone2: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -850,14 +850,14 @@ module.exports.testdatefmt = { timezone: "America/New_York" }); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted var datMyBday = new Date("Wed May 14 2014 23:37:35 GMT-0700"); test.equal(fmt.format(datMyBday), "Thursday"); test.done(); }, - + testDateFmtFormatJSDateRightTimeZone3: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -867,14 +867,14 @@ module.exports.testdatefmt = { timezone: "Australia/Perth" }); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted var datMyBday = new Date("Wed May 14 2014 20:37:35 GMT"); test.equal(fmt.format(datMyBday), "Thursday"); test.done(); }, - + testDateFmtFormatJSDateRightTimeZone4: function(test) { var d = new Date(); // test only works in north america @@ -890,14 +890,14 @@ module.exports.testdatefmt = { }); test.expect(2); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted var datMyBday = new Date('2014-05-13T03:17:48.674Z'); test.equal(fmt.format(datMyBday), "Monday"); test.done(); }, - + testDateFmtFormatJSDate2: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -906,13 +906,13 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted test.equal(fmt.format(398119055000), "1:37 PM"); test.done(); }, - + testDateFmtFormatJSDateRightTimeZone5: function(test) { var d = new Date(); // test only works in north america @@ -928,13 +928,13 @@ module.exports.testdatefmt = { }); test.expect(2); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted test.equal(fmt.format(1399951068674), "Monday"); test.done(); }, - + testDateFmtFormatJSDate3: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -943,13 +943,13 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted test.equal(fmt.format("Fri Aug 13 1982 13:37:35 GMT-0700"), "1:37 PM"); test.done(); }, - + testDateFmtFormatJSDateRightTimeZone6: function(test) { var d = new Date(); // test only works in north america @@ -965,139 +965,139 @@ module.exports.testdatefmt = { }); test.expect(2); test.ok(fmt !== null); - - // test formatting a javascript date. It should be converted to + + // test formatting a javascript date. It should be converted to // an ilib date object automatically and then formatted test.equal(fmt.format("Wed May 14 2014 23:37:35 GMT-0700"), "Wednesday"); test.done(); }, - + testDateFmtGetMonthsOfYear1: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US"}); test.ok(fmt !== null); - + var arrMonths = fmt.getMonthsOfYear(); var expected = [undefined, "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]; test.deepEqual(arrMonths, expected); test.done(); }, - + testDateFmtGetMonthsOfYear2: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US"}); test.ok(fmt !== null); - + var arrMonths = fmt.getMonthsOfYear({length: "long"}); var expected = [undefined, "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; test.deepEqual(arrMonths, expected); test.done(); }, - + testDateFmtGetMonthsOfYearThai: function(test) { test.expect(2); // uses ThaiSolar calendar var fmt = new DateFmt({locale: "th-TH"}); test.ok(fmt !== null); - + var arrMonths = fmt.getMonthsOfYear({length: "long"}); - + var expected = [undefined, "ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."]; test.deepEqual(arrMonths, expected); test.done(); }, - + testDateFmtGetMonthsOfYearLeapYear: function(test) { test.expect(2); var d = DateFactory({type: "hebrew", locale: "en-US", year: 5774, month: 1, day: 1}); var fmt = new DateFmt({date: "en-US", calendar: "hebrew"}); test.ok(fmt !== null); - + var arrMonths = fmt.getMonthsOfYear({length: "long", date: d}); - + var expected = [undefined, "Nis", "Iyy", "Siv", "Tam", "Av", "Elu", "Tis", "Ḥes", "Kis", "Tev", "She", "Ada", "Ad2"]; test.deepEqual(arrMonths, expected); test.done(); }, - + testDateFmtGetMonthsOfYearNonLeapYear: function(test) { test.expect(2); var d = DateFactory({type: "hebrew", locale: "en-US", year: 5775, month: 1, day: 1}); var fmt = new DateFmt({date: "en-US", calendar: "hebrew"}); test.ok(fmt !== null); - + var arrMonths = fmt.getMonthsOfYear({length: "long", date: d}); - + var expected = [undefined, "Nis", "Iyy", "Siv", "Tam", "Av", "Elu", "Tis", "Ḥes", "Kis", "Tev", "She", "Ada"]; test.deepEqual(arrMonths, expected); test.done(); }, - + testDateFmtGetDaysOfWeek1: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US"}); test.ok(fmt !== null); - + var arrDays = fmt.getDaysOfWeek(); - + var expected = ["S", "M", "T", "W", "T", "F", "S"]; test.deepEqual(arrDays, expected); test.done(); }, - + testDateFmtGetDaysOfWeek2: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US"}); test.ok(fmt !== null); - + var arrDays = fmt.getDaysOfWeek({length: 'long'}); var expected = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; test.deepEqual(arrDays, expected); test.done(); }, - + testDateFmtGetDaysOfWeekOtherCalendar: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US", calendar: "hebrew"}); test.ok(fmt !== null); - + var arrDays = fmt.getDaysOfWeek({length: 'long'}); - + var expected = ["ris", "she", "shl", "rvi", "ḥam", "shi", "sha"]; test.deepEqual(arrDays, expected); test.done(); }, - + testDateFmtGetDaysOfWeekThai: function(test) { test.expect(2); var fmt = new DateFmt({locale: "th-TH", calendar: "thaisolar"}); test.ok(fmt !== null); - + var arrDays = fmt.getDaysOfWeek({length: 'long'}); - + var expected = ["อา.", "จ.", "อ.", "พ.", "พฤ.", "ศ.", "ส."]; test.deepEqual(arrDays, expected); test.done(); }, - + testDateFmtGetDaysOfWeekThaiInEnglish: function(test) { test.expect(2); var fmt = new DateFmt({locale: "en-US", calendar: "thaisolar"}); test.ok(fmt !== null); - + var arrDays = fmt.getDaysOfWeek({length: 'long'}); - + var expected = ["ath", "cha", "ang", "phu", "phr", "suk", "sao"]; test.deepEqual(arrDays, expected); test.done(); }, - - + + testDateFmtWeekYear1: function(test) { test.expect(2); var fmt = new DateFmt({template: "w"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 1, @@ -1110,12 +1110,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "52"); test.done(); }, - + testDateFmtWeekYear2: function(test) { test.expect(2); var fmt = new DateFmt({template: "w"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 1, @@ -1128,12 +1128,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "1"); test.done(); }, - + testDateFmtWeekYear3: function(test) { test.expect(2); var fmt = new DateFmt({template: "w"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2010, month: 12, @@ -1146,12 +1146,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "52"); test.done(); }, - + testDateFmtWeekYear4: function(test) { test.expect(2); var fmt = new DateFmt({template: "w"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2009, month: 12, @@ -1164,12 +1164,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "53"); test.done(); }, - + testDateFmtWeekYear5: function(test) { test.expect(2); var fmt = new DateFmt({template: "w"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2008, month: 12, @@ -1182,12 +1182,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "1"); test.done(); }, - + testDateFmtWeekYear6: function(test) { test.expect(2); var fmt = new DateFmt({template: "w"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2007, month: 12, @@ -1200,12 +1200,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "1"); test.done(); }, - + testDateFmtWeekYearPad: function(test) { test.expect(2); var fmt = new DateFmt({template: "ww"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 1, @@ -1218,12 +1218,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "01"); test.done(); }, - + testDateFmtFormatWithEscapes: function(test) { test.expect(2); var fmt = new DateFmt({locale: 'es-MX', template: "'El' dd 'de' MMMM"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "es-MX", year: 2011, @@ -1237,12 +1237,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "El 05 de mayo"); test.done(); }, - + testDateFmtDayOfYearFirstD: function(test) { test.expect(2); var fmt = new DateFmt({template: "D"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 1, @@ -1255,12 +1255,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "1"); test.done(); }, - + testDateFmtDayOfYearFirstDD: function(test) { test.expect(2); var fmt = new DateFmt({template: "DD"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 1, @@ -1273,12 +1273,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "01"); test.done(); }, - + testDateFmtDayOfYearFirstDDD: function(test) { test.expect(2); var fmt = new DateFmt({template: "DDD"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 1, @@ -1291,12 +1291,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "001"); test.done(); }, - + testDateFmtDayOfYearLastD: function(test) { test.expect(2); var fmt = new DateFmt({template: "D"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 12, @@ -1309,12 +1309,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "365"); test.done(); }, - + testDateFmtDayOfYearLastDD: function(test) { test.expect(2); var fmt = new DateFmt({template: "DD"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 12, @@ -1327,12 +1327,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "365"); test.done(); }, - + testDateFmtDayOfYearLastDLeap: function(test) { test.expect(2); var fmt = new DateFmt({template: "D"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2008, month: 12, @@ -1345,12 +1345,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "366"); test.done(); }, - + testDateFmtDayOfYearLastDDD: function(test) { test.expect(2); var fmt = new DateFmt({template: "DDD"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 12, @@ -1363,12 +1363,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "365"); test.done(); }, - + testDateFmtDayOfYearPaddysDayD: function(test) { test.expect(2); var fmt = new DateFmt({template: "D"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 3, @@ -1381,12 +1381,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "76"); test.done(); }, - + testDateFmtDayOfYearPaddysDayDD: function(test) { test.expect(2); var fmt = new DateFmt({template: "DD"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 3, @@ -1399,12 +1399,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "76"); test.done(); }, - + testDateFmtDayOfYearPaddysDayDDD: function(test) { test.expect(2); var fmt = new DateFmt({template: "DDD"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 3, @@ -1417,12 +1417,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "076"); test.done(); }, - + testDateFmtDayOfYearPaddysDayDLeap: function(test) { test.expect(2); var fmt = new DateFmt({template: "D"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2008, month: 3, @@ -1435,12 +1435,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "77"); test.done(); }, - + testDateFmtDayOfYearPaddysDayDDLeap: function(test) { test.expect(2); var fmt = new DateFmt({template: "DD"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2008, month: 3, @@ -1453,12 +1453,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "77"); test.done(); }, - + testDateFmtDayOfYearPaddysDayDDDLeap: function(test) { test.expect(2); var fmt = new DateFmt({template: "DDD"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2008, month: 3, @@ -1471,12 +1471,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "077"); test.done(); }, - + testDateFmtWeekOfMonthUS: function(test) { test.expect(2); var fmt = new DateFmt({template: "W", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1490,12 +1490,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "1"); test.done(); }, - + testDateFmtWeekOfMonthDE: function(test) { test.expect(2); var fmt = new DateFmt({template: "W", locale: "de-DE"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "de-DE", year: 2011, @@ -1509,12 +1509,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "0"); test.done(); }, - + testDateFmtWeekOfMonthUSSept: function(test) { test.expect(2); var fmt = new DateFmt({template: "W", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1528,12 +1528,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "0"); test.done(); }, - + testDateFmtWeekOfMonthUSOct: function(test) { test.expect(2); var fmt = new DateFmt({template: "W", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1547,12 +1547,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "0"); test.done(); }, - + testDateFmtWeekOfMonthUSNov: function(test) { test.expect(2); var fmt = new DateFmt({template: "W", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1566,12 +1566,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "1"); test.done(); }, - + testDateFmtWeekOfMonthUSRegular: function(test) { test.expect(2); var fmt = new DateFmt({template: "W", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1585,12 +1585,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "4"); test.done(); }, - + testDateFmtWeekOfMonthDERegular: function(test) { test.expect(2); var fmt = new DateFmt({template: "W", locale: "de-DE"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "de-DE", year: 2011, @@ -1604,12 +1604,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "3"); test.done(); }, - + testDateFmtYear0YY: function(test) { test.expect(2); var fmt = new DateFmt({template: "yy"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 0, month: 12, @@ -1622,12 +1622,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "00"); test.done(); }, - + testDateFmtYear0YYYY: function(test) { test.expect(2); var fmt = new DateFmt({template: "yyyy"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 0, month: 12, @@ -1640,12 +1640,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "0000"); test.done(); }, - + testDateFmtYear1YY: function(test) { test.expect(2); var fmt = new DateFmt({template: "yy"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 1, month: 12, @@ -1658,12 +1658,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "01"); test.done(); }, - + testDateFmtYear1YYYY: function(test) { test.expect(2); var fmt = new DateFmt({template: "yyyy"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 1, month: 12, @@ -1676,12 +1676,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "0001"); test.done(); }, - + testDateFmtYearMinus1YY: function(test) { test.expect(2); var fmt = new DateFmt({template: "yy"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: -1, month: 12, @@ -1694,12 +1694,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "-01"); test.done(); }, - + testDateFmtYearMinus1YYYY: function(test) { test.expect(2); var fmt = new DateFmt({template: "yyyy"}); test.ok(fmt !== null); - + var date = new GregorianDate({ year: -1, month: 12, @@ -1712,12 +1712,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "-0001"); test.done(); }, - + testDateFmtOrdinalUS1: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1731,12 +1731,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "1st"); test.done(); }, - + testDateFmtOrdinalUS2: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1750,12 +1750,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "2nd"); test.done(); }, - + testDateFmtOrdinalUS3: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1769,12 +1769,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "3rd"); test.done(); }, - + testDateFmtOrdinalUS4: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1788,12 +1788,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "4th"); test.done(); }, - + testDateFmtOrdinalUS21: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1807,12 +1807,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "21st"); test.done(); }, - + testDateFmtOrdinalUSDefaultCase: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "en-US"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-US", year: 2011, @@ -1826,12 +1826,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "27th"); test.done(); }, - + testDateFmtOrdinalDE1: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "de-DE"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "de-DE", year: 2011, @@ -1845,12 +1845,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "1."); test.done(); }, - + testDateFmtOrdinalDE2: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "de-DE"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "de-DE", year: 2011, @@ -1864,12 +1864,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "2."); test.done(); }, - + testDateFmtOrdinalDE3: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "de-DE"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "de-DE", year: 2011, @@ -1883,12 +1883,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "3."); test.done(); }, - + testDateFmtOrdinalDE4: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "de-DE"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "de-DE", year: 2011, @@ -1902,12 +1902,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "4."); test.done(); }, - + testDateFmtOrdinalDE21: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "de-DE"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "de-DE", year: 2011, @@ -1921,12 +1921,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "21."); test.done(); }, - + testDateFmtOrdinalDEDefaultCase: function(test) { test.expect(2); var fmt = new DateFmt({template: "O", locale: "de-DE"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "de-DE", year: 2011, @@ -1940,12 +1940,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "27."); test.done(); }, - + testDateFmtEraCE: function(test) { test.expect(2); var fmt = new DateFmt({template: "G", locale: "en"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en", year: 2011, @@ -1959,12 +1959,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "CE"); test.done(); }, - + testDateFmtEraBCE: function(test) { test.expect(2); var fmt = new DateFmt({template: "G", locale: "en"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en", year: -46, @@ -1978,12 +1978,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "BCE"); test.done(); }, - + testDateFmtEraCEBoundary: function(test) { test.expect(2); var fmt = new DateFmt({template: "G", locale: "en"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en", year: 1, @@ -1997,12 +1997,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "CE"); test.done(); }, - + testDateFmtEraBCEBoundary: function(test) { test.expect(2); var fmt = new DateFmt({template: "G", locale: "en"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en", year: 0, @@ -2016,12 +2016,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "BCE"); test.done(); }, - + testDateFmtStandAloneMonthFull: function(test) { test.expect(2); var fmt = new DateFmt({template: "LLLL", locale: "fi-FI"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "fi-FI", year: 0, @@ -2035,12 +2035,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "joulukuu"); test.done(); }, - + testDateFmtStandAloneMonthLong: function(test) { test.expect(2); var fmt = new DateFmt({template: "LLL", locale: "fi-FI"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "fi-FI", year: 0, @@ -2054,12 +2054,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "joulu"); test.done(); }, - + testDateFmtStandAloneMonthMedium: function(test) { test.expect(2); var fmt = new DateFmt({template: "LL", locale: "fi-FI"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "fi-FI", year: 0, @@ -2073,12 +2073,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "jo"); test.done(); }, - + testDateFmtInFormatMonthFull: function(test) { test.expect(2); var fmt = new DateFmt({template: "MMMM", locale: "fi-FI"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "fi-FI", year: 0, @@ -2092,12 +2092,12 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "joulukuuta"); test.done(); }, - + testDateFmtInFormatMonthMedium: function(test) { test.expect(2); var fmt = new DateFmt({template: "MM", locale: "fi-FI"}); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "fi-FI", year: 0, @@ -2111,22 +2111,22 @@ module.exports.testdatefmt = { test.equal(fmt.format(date), "12"); test.done(); }, - + /* exception does not happen any more because we always convert the argument to the format method to an DateFactory first now. By default if a bogus argument is passed, this is treated as an empty/undefined parameter, which means the current date/time - + testDateFmtNonDateObject: function(test) { var fmt = new DateFmt({ - locale: "en-US", - type: "time", + locale: "en-US", + type: "time", length: "short", time: "hm" }); test.ok(fmt !== null); - + try { fmt.format({ locale: "en-US", @@ -2142,12 +2142,12 @@ module.exports.testdatefmt = { test.done(); }, */ - + testDateFmtFormatRelativeWithinMinuteAfter: function(test) { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 11, @@ -2173,7 +2173,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 11, @@ -2199,7 +2199,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 11, @@ -2225,7 +2225,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 11, @@ -2251,7 +2251,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 11, @@ -2277,7 +2277,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 11, @@ -2299,12 +2299,12 @@ module.exports.testdatefmt = { test.equal(fmt.formatRelative(reference, date), "4 hours ago"); test.done(); }, - + testDateFmtFormatRelativeWithinFortnightAfter: function(test) { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 11, @@ -2330,7 +2330,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 11, @@ -2352,12 +2352,12 @@ module.exports.testdatefmt = { test.equal(fmt.formatRelative(reference, date), "4 days ago"); test.done(); }, - + testDateFmtFormatRelativeWithinQuarterAfter: function(test) { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 9, @@ -2383,7 +2383,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 9, @@ -2405,12 +2405,12 @@ module.exports.testdatefmt = { test.equal(fmt.formatRelative(reference, date), "9 weeks ago"); test.done(); }, - + testDateFmtFormatRelativeWithinTwoYearsAfter: function(test) { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 9, @@ -2436,7 +2436,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 9, @@ -2458,12 +2458,12 @@ module.exports.testdatefmt = { test.equal(fmt.formatRelative(reference, date), "14 months ago"); test.done(); }, - + testDateFmtFormatRelativeYearsAfter: function(test) { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 9, @@ -2489,7 +2489,7 @@ module.exports.testdatefmt = { test.expect(2); var fmt = new DateFmt({length: "full"}); test.ok(fmt !== null); - + var reference = new GregorianDate({ year: 2011, month: 9, @@ -2511,7 +2511,7 @@ module.exports.testdatefmt = { test.equal(fmt.formatRelative(reference, date), "21 years ago"); test.done(); }, - + testDateFmtConvertToGMT: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2522,7 +2522,7 @@ module.exports.testdatefmt = { time: "hmaz" }); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 9, @@ -2534,11 +2534,11 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles", locale: "en-US" }); - + test.equal(fmt.format(date), "20/09/2011, 21:45 GMT/BST"); test.done(); }, - + testDateFmtConvertToOtherTimeZone: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2549,7 +2549,7 @@ module.exports.testdatefmt = { time: "hmaz" }); test.ok(fmt !== null); - + var date = new GregorianDate({ year: 2011, month: 9, @@ -2561,11 +2561,11 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles", locale: "en-US" }); - + test.equal(fmt.format(date), "21/9/11, 6:45 am AEST"); test.done(); }, - + testDateFmtForTZWithNonWholeOffset1: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2575,16 +2575,16 @@ module.exports.testdatefmt = { timezone: "America/St_Johns" }); test.ok(fmt !== null); - + var date = new GregorianDate({ unixtime: 1394834293627, timezone: "Etc/UTC" }); - + test.equal(fmt.format(date), "7:28 PM"); test.done(); }, - + testDateFmtForTZWithNonWholeOffset2: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2594,7 +2594,7 @@ module.exports.testdatefmt = { timezone: "America/St_Johns" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "Etc/UTC", year: 2014, @@ -2605,12 +2605,12 @@ module.exports.testdatefmt = { second: 13, millisecond: 627 }); - + // St. John's is -3:30 from UTC, plus 1 hour DST test.equal(fmt.format(date), "7:28 PM"); test.done(); }, - + testDateFmtForTZWithNonWholeOffsetQuarterHour: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2620,17 +2620,17 @@ module.exports.testdatefmt = { timezone: "Asia/Kathmandu" }); test.ok(fmt !== null); - + var date = new GregorianDate({ unixtime: 1394834293627, timezone: "Etc/UTC" }); - + // Kathmandu is 5:45 ahead of UTC, no DST test.equal(fmt.format(date), "3:43 AM"); test.done(); }, - + testDateFmtForTZWithNonWholeOffsetQuarterHour2: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2640,7 +2640,7 @@ module.exports.testdatefmt = { timezone: "Asia/Kathmandu" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "Etc/UTC", year: 2014, @@ -2651,12 +2651,12 @@ module.exports.testdatefmt = { second: 13, millisecond: 627 }); - + // Kathmandu is 5:45 ahead of UTC, no DST test.equal(fmt.format(date), "3:43 AM"); test.done(); }, - + // test locales that are tier 2 and below by doing a single test to see that it basically works testDateFmtenNG: function(test) { test.expect(2); @@ -2668,7 +2668,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-NG", year: 2011, @@ -2679,11 +2679,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "Tuesday, 20 September 2011 at 1:45 PM"); test.done(); }, - + testDateFmtenPH: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2694,7 +2694,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-PH", year: 2011, @@ -2705,11 +2705,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "Tuesday, 20 September 2011 at 1:45 PM"); test.done(); }, - + testDateFmtenPK: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2720,7 +2720,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-PK", year: 2011, @@ -2731,11 +2731,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "Tuesday, 20 September 2011 at 1:45 PM"); test.done(); }, - + testDateFmtenAU: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2746,7 +2746,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-AU", year: 2011, @@ -2757,11 +2757,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "Tuesday, 20 September 2011 at 1:45 pm"); test.done(); }, - + testDateFmtenZA: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2772,7 +2772,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "en-ZA", year: 2011, @@ -2783,11 +2783,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "Tuesday, 20 September 2011 at 13:45"); test.done(); }, - + testDateFmtesES: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2798,7 +2798,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "es-ES", year: 2011, @@ -2809,11 +2809,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "martes, 20 de septiembre de 2011, 13:45"); test.done(); }, - + testDateFmtesMX: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2824,7 +2824,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "es-MX", year: 2011, @@ -2835,11 +2835,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "martes, 20 de septiembre de 2011, 13:45"); test.done(); }, - + testDateFmtesAR: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2850,7 +2850,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "es-AR", year: 2011, @@ -2861,12 +2861,12 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "martes, 20 de septiembre de 2011, 13:45"); test.done(); - + }, - + testDateFmttrTR: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2877,7 +2877,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "tr-TR", year: 2011, @@ -2888,11 +2888,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "20 Eylül 2011 Salı 13:45"); test.done(); }, - + testDateFmttrSV: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2903,7 +2903,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "sv-SE", year: 2011, @@ -2914,11 +2914,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "torsdag 20 oktober 2011 13:45"); test.done(); }, - + testDateFmttrNO: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2929,7 +2929,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "no-NO", year: 2011, @@ -2940,11 +2940,11 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "Torsdag 20. oktober 2011 13.45"); test.done(); }, - + testDateFmttrDA: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -2955,7 +2955,7 @@ module.exports.testdatefmt = { time: "hma" }); test.ok(fmt !== null); - + var date = new GregorianDate({ locale: "da-DK", year: 2011, @@ -2966,7 +2966,7 @@ module.exports.testdatefmt = { second: 0, millisecond: 0 }); - + test.equal(fmt.format(date), "torsdag den 20. oktober 2011 kl. 13.45"); test.done(); }, @@ -3097,16 +3097,16 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - + var date = new GregorianDate({ timezone: "Etc/UTC", unixtime: 1394359140000 // this is 3/9/2014 at 1:59am }); - + test.equal(fmt.format(date), "1:59 AM PST"); test.done(); }, - + testDateFmtTransitionToDSTRightAfter: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3116,17 +3116,17 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - + var date = new GregorianDate({ timezone: "Etc/UTC", unixtime: 1394359260000 }); - + // 2 minutes later test.equal(fmt.format(date), "3:01 AM PDT"); test.done(); }, - + testDateFmtTransitionFromDSTDayBefore: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3136,16 +3136,16 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - + var date = new GregorianDate({ timezone: "Etc/UTC", unixtime: 1414828740000 // this is 11/1/2014 at 0:59am }); - + test.equal(fmt.format(date), "12:59 AM PDT"); test.done(); }, - + testDateFmtTransitionFromDSTWellBefore: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3155,16 +3155,16 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - + var date = new GregorianDate({ timezone: "Etc/UTC", unixtime: 1414915140000 // this is 11/2/2014 at 0:59am }); - + test.equal(fmt.format(date), "12:59 AM PDT"); test.done(); }, - + testDateFmtTransitionFromDSTRightBefore: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3174,16 +3174,16 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - + var date = new GregorianDate({ timezone: "Etc/UTC", unixtime: 1414918740000 // this is 11/2/2014 at 1:59am }); - + test.equal(fmt.format(date), "1:59 AM PDT"); test.done(); }, - + testDateFmtTransitionFromDSTRightAfter: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3193,18 +3193,18 @@ module.exports.testdatefmt = { timezone: "America/Los_Angeles" }); test.ok(fmt !== null); - + var date = new GregorianDate({ timezone: "Etc/UTC", unixtime: 1414918860000 }); - + // 2 minutes later test.equal(fmt.format(date), "1:01 AM PST"); test.done(); }, - - + + testDateFmtAltCalThaiInEnglish: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3215,16 +3215,16 @@ module.exports.testdatefmt = { calendar: "thaisolar" }); test.ok(fmt !== null); - + var date = new ThaiSolarDate({ timezone: "America/Los_Angeles", unixtime: 1404445524043 }); - + test.equal(fmt.format(date), "Karakadakhom 3, 2557 at 8:45 PM"); test.done(); }, - + testDateFmtAltCalHebrewInEnglish: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3235,16 +3235,16 @@ module.exports.testdatefmt = { calendar: "hebrew" }); test.ok(fmt !== null); - + var date = new HebrewDate({ timezone: "America/Los_Angeles", unixtime: 1404445524043 }); - + test.equal(fmt.format(date), "Tammuz 6, 5774 at 8:45 PM"); test.done(); }, - + testDateFmtAltCalIslamicInEnglish: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3255,16 +3255,16 @@ module.exports.testdatefmt = { calendar: "islamic" }); test.ok(fmt !== null); - + var date = new IslamicDate({ timezone: "America/Los_Angeles", unixtime: 1404445524043 }); - + test.equal(fmt.format(date), "Ramaḍān 5, 1435 at 8:45 PM"); test.done(); }, - + testDateFmtAltCalPersianInEnglish: function(test) { test.expect(2); var fmt = new DateFmt({ @@ -3275,283 +3275,283 @@ module.exports.testdatefmt = { calendar: "persian" }); test.ok(fmt !== null); - + var date = new PersianDate({ timezone: "America/Los_Angeles", unixtime: 1404445524043 }); - + test.equal(fmt.format(date), "Tir 12, 1393 at 8:45 PM"); test.done(); }, - + testDateFmtGetMeridiemsRangeLength_with_am_ET_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET"}); test.ok(fmt !== null); - + test.equal(fmt.length, 5); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_am_ET_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "ጥዋት"); test.done(); }, - + testDateFmtGetMeridiemsRangeStart_with_am_ET_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET"}); test.ok(fmt !== null); - + test.equal(fmt[0].start, "00:00"); test.done(); }, - + testDateFmtGetMeridiemsRangeEnd_with_am_ET_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET"}); test.ok(fmt !== null); - + test.equal(fmt[0].end, "05:59"); test.done(); }, - + testDateFmtGetMeridiemsRangeLength_with_am_ET_locale_gregorian_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "gregorian"}); test.ok(fmt !== null); - + test.equal(fmt.length, 2); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_am_ET_locale_gregorian_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "gregorian"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "ጥዋት"); test.done(); }, - + testDateFmtGetMeridiemsRangeStart_with_am_ET_locale_gregorian_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "gregorian"}); test.ok(fmt !== null); - + test.equal(fmt[0].start, "00:00"); test.done(); }, - + testDateFmtGetMeridiemsRangeEnd_with_am_ET_locale_gregorian_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "gregorian"}); test.ok(fmt !== null); - + test.equal(fmt[0].end, "11:59"); test.done(); }, - + testDateFmtGetMeridiemsRangeLength_with_am_ET_locale_ethiopic_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "ethiopic"}); test.ok(fmt !== null); - + test.equal(fmt.length, 5); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_am_ET_locale_ethiopic_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "ethiopic"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "ጥዋት"); test.done(); }, - + testDateFmtGetMeridiemsRangeStart_with_am_ET_locale_ethiopic_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "ethiopic"}); test.ok(fmt !== null); - + test.equal(fmt[0].start, "00:00"); test.done(); }, - + testDateFmtGetMeridiemsRangeEnd_with_am_ET_locale_ethiopic_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "ethiopic"}); test.ok(fmt !== null); - + test.equal(fmt[0].end, "05:59"); test.done(); }, - + testDateFmtGetMeridiemsRangeLength_with_zh_CN_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN"}); test.ok(fmt !== null); - + test.equal(fmt.length, 2); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_zh_CN_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "上午"); test.done(); }, - + testDateFmtGetMeridiemsRangeStart_with_zh_CN_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN"}); test.ok(fmt !== null); - + test.equal(fmt[0].start, "00:00"); test.done(); }, - + testDateFmtGetMeridiemsRangeEnd_with_zh_CN_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN"}); test.ok(fmt !== null); - + test.equal(fmt[0].end, "11:59"); test.done(); }, - + testDateFmtGetMeridiemsRangeLength_with_zh_CN_locale_gregorian_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "gregorian"}); test.ok(fmt !== null); - + test.equal(fmt.length, 2); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_zh_CN_locale_gregorian_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "gregorian"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "上午"); test.done(); }, - + testDateFmtGetMeridiemsRangeStart_with_zh_CN_locale_gregorian_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "gregorian"}); test.ok(fmt !== null); - + test.equal(fmt[0].start, "00:00"); test.done(); }, - + testDateFmtGetMeridiemsRangeEnd_with_zh_CN_locale_gregorian_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "gregorian"}); test.ok(fmt !== null); - + test.equal(fmt[0].end, "11:59"); test.done(); }, - + testDateFmtGetMeridiemsRangeLength_with_zh_CN_locale_chinese_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "chinese"}); test.ok(fmt !== null); - + test.equal(fmt.length, 7); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_zh_CN_locale_chinese_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "chinese"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "凌晨"); test.done(); }, - + testDateFmtGetMeridiemsRangeStart_with_zh_CN_locale_chinese_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "chinese"}); test.ok(fmt !== null); - + test.equal(fmt[0].start, "00:00"); test.done(); }, - + testDateFmtGetMeridiemsRangeEnd_with_zh_CN_locale_chinese_meridiems: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "chinese"}); test.ok(fmt !== null); - + test.equal(fmt[0].end, "05:59"); test.done(); }, - + testDateFmtGetMeridiemsRangeLength_with_en_US_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "en-US"}); test.ok(fmt !== null); - + test.equal(fmt.length, 2); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_en_US_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "en-US"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "AM"); test.done(); }, - + testDateFmtGetMeridiemsRangeStart_with_en_US_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({ locale: "en-US"}); test.ok(fmt !== null); - + test.equal(fmt[0].start, "00:00"); test.done(); }, - + testDateFmtGetMeridiemsRangeEnd_with_en_US_locale: function(test) { test.expect(2); var fmt = DateFmt.getMeridiemsRange({locale: "en-US"}); test.ok(fmt !== null); - + test.equal(fmt[0].end, "11:59"); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_bn_IN_locale: function(test) { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "bn-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "AM"); test.equal(fmt[1].name, "PM"); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_gu_IN_locale: function(test) { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "gu-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "AM"); test.equal(fmt[1].name, "PM"); test.done(); @@ -3560,7 +3560,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "kn-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "ಪೂರ್ವಾಹ್ನ"); test.equal(fmt[1].name, "ಅಪರಾಹ್ನ"); test.done(); @@ -3569,7 +3569,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "ml-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "AM"); test.equal(fmt[1].name, "PM"); test.done(); @@ -3578,7 +3578,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "mr-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "म.पू."); test.equal(fmt[1].name, "म.उ."); test.done(); @@ -3587,7 +3587,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "or-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "AM"); test.equal(fmt[1].name, "PM"); test.done(); @@ -3596,7 +3596,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "pa-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "ਪੂ.ਦੁ."); test.equal(fmt[1].name, "ਬਾ.ਦੁ."); test.done(); @@ -3605,7 +3605,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "ta-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "முற்பகல்"); test.equal(fmt[1].name, "பிற்பகல்"); test.done(); @@ -3614,7 +3614,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "te-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "AM"); test.equal(fmt[1].name, "PM"); test.done(); @@ -3623,7 +3623,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "ur-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "AM"); test.equal(fmt[1].name, "PM"); test.done(); @@ -3632,7 +3632,7 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "as-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "পূৰ্বাহ্ণ"); test.equal(fmt[1].name, "অপৰাহ্ণ"); test.done(); @@ -3641,121 +3641,268 @@ module.exports.testdatefmt = { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "hi-IN"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "पूर्वाह्न"); test.equal(fmt[1].name, "अपराह्न"); test.done(); }, - + testDateFmtGetMeridiemsRangeName_with_ur_PK_locale: function(test) { test.expect(3); var fmt = DateFmt.getMeridiemsRange({locale: "ur-PK"}); test.ok(fmt !== null); - + test.equal(fmt[0].name, "AM"); test.equal(fmt[1].name, "PM"); test.done(); }, - + testDateFmtGetMeridiemsRange_with_noArgument: function(test) { test.expect(2); var fmt = new DateFmt(); test.ok(fmt !== null); - + var mdRange = fmt.getMeridiemsRange(); // if locale is not specified, DateFmt takes default locale. test.ok("getMeridiemsRange should return length value greater than 0", mdRange.length > 0); test.done(); }, - + testDateFmtGetMeridiemsRange_with_undefined_locale: function(test) { test.expect(2); var fmt = new DateFmt({ locale: undefined }); test.ok(fmt !== null); - + var mdRange = fmt.getMeridiemsRange(); // if locale is not specified, DateFmt takes default locale. test.ok("getMeridiemsRange should return length value greater than 0", mdRange.length > 0); test.done(); }, - + testDateFmtGetMeridiemsRange_with_wrong_locale: function(test) { test.expect(2); var fmt = new DateFmt({ locale: "wrong" }); test.ok(fmt !== null); - + var mdRange = fmt.getMeridiemsRange(); // if locale is specified wrong value, DateFmt takes default locale. test.ok("getMeridiemsRange should return length value greater than 0", mdRange.length > 0); test.done(); }, - + testDateFmtTimeTemplate_mms: function(test) { test.expect(2); var fmt = new DateFmt({clock: "24", template: "mm:s"}); test.ok(fmt !== null); - + test.equal(fmt.format({minute: 0, second: 9}).toString(), "00:9"); test.done(); }, - + testDateFmtGetDateComponentOrderEN: function(test) { - test.expect(2); - - var fmt = new DateFmt({locale: "en"}) + test.expect(2); + + var fmt = new DateFmt({locale: "en"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponentOrder(), "mdy"); test.done(); }, - + testDateFmtGetDateComponentOrderENGB: function(test) { - test.expect(2); - - var fmt = new DateFmt({locale: "en-GB"}) + test.expect(2); + + var fmt = new DateFmt({locale: "en-GB"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponentOrder(), "dmy"); test.done(); }, - + testDateFmtGetDateComponentOrderENUS: function(test) { - test.expect(2); - - var fmt = new DateFmt({locale: "en-US"}) + test.expect(2); + + var fmt = new DateFmt({locale: "en-US"}) test.ok(fmt !== null); - + test.equal(fmt.getDateComponentOrder(), "mdy"); test.done(); }, testDateFmtGetDateComponentOrderDE: function(test) { - test.expect(2); - - var fmt = new DateFmt({locale: "de-DE"}) + test.expect(2); + + var fmt = new DateFmt({locale: "de-DE"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponentOrder(), "dmy"); test.done(); }, testDateFmtGetDateComponentOrderAK: function(test) { - test.expect(2); - - var fmt = new DateFmt({locale: "ak-GH"}) + test.expect(2); + + var fmt = new DateFmt({locale: "ak-GH"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponentOrder(), "ymd"); test.done(); }, testDateFmtGetDateComponentOrderLV: function(test) { - test.expect(2); - - var fmt = new DateFmt({locale: "lv-LV"}) + test.expect(2); + + var fmt = new DateFmt({locale: "lv-LV"}); test.ok(fmt !== null); - + test.equal(fmt.getDateComponentOrder(), "ydm"); + test.done(); + }, + + testDateFmtGetFormatInfoUSShort: function(test) { + test.expect(16); + + var fmt = new DateFmt({ + locale: "en-US", + type: "date", + date: "short" + }); + test.ok(fmt !== null); + + fmt.getFormatInfo(undefined, true, function(info) { + test.ok(info); + + test.equal(info.length, 5); + + test.equal(info[0].component, "month"); + test.equal(info[0].label, "Month"); + test.deepEquals(info[0].constraint, [1, 12]); + + test.ok(!info[1].component); + test.equal(info[1].label, "/"); + + test.equal(info[2].component, "day"); + test.equal(info[2].label, "Date"); + test.deepEquals(info[2].constraint, { + "condition": "leapyear", + "leap": { + "1": [1, 31], + "2": [1, 29], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + }, + "regular": { + "1": [1, 31], + "2": [1, 28], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + } + }); + + test.ok(!info[3].component); + test.equal(info[3].label, "/"); + + test.equal(info[4].component, "year"); + test.equal(info[4].label, "Year"); + test.equal(info[4].constraint, "[0-9]+"); + }); + + test.done(); + }, + + testDateFmtGetFormatInfoUSFull: function(test) { + test.expect(16); + + var fmt = new DateFmt({ + locale: "en-US", + type: "date", + date: "full" + }); + test.ok(fmt !== null); + + fmt.getFormatInfo(undefined, true, function(info) { + test.ok(info); + + test.equal(info.length, 5); + + test.equal(info[0].component, "month"); + test.equal(info[0].label, "Month"); + test.deepEquals(info[0].constraint, [ + {label: "January", value: 1}, + {label: "February", value: 2}, + {label: "March", value: 3}, + {label: "April", value: 4}, + {label: "May", value: 5}, + {label: "June", value: 6}, + {label: "July", value: 7}, + {label: "August", value: 8}, + {label: "September", value: 9}, + {label: "October", value: 10}, + {label: "November", value: 11}, + {label: "December", value: 12}, + ]); + + test.ok(!info[1].component); + test.equal(info[1].label, " "); + + test.equal(info[2].component, "day"); + test.equal(info[2].label, "Date"); + test.deepEquals(info[2].constraint, { + "condition": "leapyear", + "leap": { + "1": [1, 31], + "2": [1, 29], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + }, + "regular": { + "1": [1, 31], + "2": [1, 28], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + } + }); + + test.ok(!info[3].component); + test.equal(info[3].label, ", "); + + test.equal(info[4].component, "year"); + test.equal(info[4].label, "Year"); + test.equal(info[4].constraint, "[0-9]+"); + }); + test.done(); } }; \ No newline at end of file From fafa807a68b283e48af2ff6513faa719982a328f Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Fri, 7 Dec 2018 15:56:15 -0800 Subject: [PATCH 09/38] Checkpoint... start to make the templateArr to constraints --- js/lib/DateFmt.js | 418 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 356 insertions(+), 62 deletions(-) diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index 09f7ac47ee..a811abea95 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -1804,74 +1804,368 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { loc.spec = undefined; } - Utils.loadData({ - name: "regionnames.json", - object: "DateFmt", + function sequence(start, end, pad) { + var constraint = []; + for (var i = start; i <= end; i++) { + constraint.push(pad ? JSUtils.pad(i, 2) : String(i)); + } + return constraint; + } + + new ResBundle({ locale: loc, + name: "dateres", sync: this.sync, - loadParams: JSUtils.merge(this.loadParams, {returnOne: true}, true), - callback: ilib.bind(this, function(regions) { - this.regions = regions; - - new ResBundle({ - locale: loc, - name: "sysres", - sync: this.sync, - loadParams: this.loadParams, - onLoad: ilib.bind(this, function (rb) { - var type, format, fields = this.info.fields || defaultData.fields; - if (this.info.multiformat) { - type = isAsianLocale(this.locale) ? "asian" : "latin"; - fields = this.info.fields[type]; - } - - if (typeof(this.style) === 'object') { - format = this.style[type || "latin"]; - } else { - format = this.style; - } - new Address(" ", { - locale: loc, - sync: this.sync, - loadParams: this.loadParams, - onLoad: ilib.bind(this, function(localeAddress) { - var rows = format.split(/\n/g); - info = rows.map(ilib.bind(this, function(row) { - return row.split("}").filter(function(component) { - return component.length > 0; - }).map(ilib.bind(this, function(component) { - var name = component.replace(/.*{/, ""); - var obj = { - component: name, - label: rb.getStringJS(this.info.fieldNames[name]) - }; - var field = fields.filter(function(f) { - return f.name === name; - }); - if (field && field[0] && field[0].pattern) { - if (typeof(field[0].pattern) === "string") { - obj.constraint = field[0].pattern; - } - } - if (name === "country") { - obj.constraint = invertAndFilter(localeAddress.ctrynames); - } else if (name === "region" && this.regions[loc.getRegion()]) { - obj.constraint = this.regions[loc.getRegion()]; - } - return obj; - })); - })); - - if (callback && typeof(callback) === "function") { - callback(info); + loadParams: this.loadParams, + onLoad: ilib.bind(this, function (rb) { + this.templateArr.map(ilib.bind(this, function(component) { + switch (component) { + case 'd': + return { + component: "day", + label: "Date", + template: "D", + constraint: { + "condition": "isLeap", + "regular": { + "1": sequence(1, 31), + "2": sequence(1, 28), + "3": sequence(1, 31), + "4": sequence(1, 30), + "5": sequence(1, 31), + "6": sequence(1, 30), + "7": sequence(1, 31), + "8": sequence(1, 31), + "9": sequence(1, 30), + "10": sequence(1, 31), + "11": sequence(1, 30), + "12": sequence(1, 31) + }, + "leap": { + "1": sequence(1, 31), + "2": sequence(1, 29), + "3": sequence(1, 31), + "4": sequence(1, 30), + "5": sequence(1, 31), + "6": sequence(1, 30), + "7": sequence(1, 31), + "8": sequence(1, 31), + "9": sequence(1, 30), + "10": sequence(1, 31), + "11": sequence(1, 30), + "12": sequence(1, 31) + } } - }) + }; + + case 'dd': + return { + component: "day", + label: "Date", + template: "DD", + constraint: { + "condition": "isLeap", + "regular": { + "1": sequence(1, 31, true), + "2": sequence(1, 28, true), + "3": sequence(1, 31, true), + "4": sequence(1, 30, true), + "5": sequence(1, 31, true), + "6": sequence(1, 30, true), + "7": sequence(1, 31, true), + "8": sequence(1, 31, true), + "9": sequence(1, 30, true), + "10": sequence(1, 31, true), + "11": sequence(1, 30, true), + "12": sequence(1, 31, true) + }, + "leap": { + "1": sequence(1, 31, true), + "2": sequence(1, 29, true), + "3": sequence(1, 31, true), + "4": sequence(1, 30, true), + "5": sequence(1, 31, true), + "6": sequence(1, 30, true), + "7": sequence(1, 31, true), + "8": sequence(1, 31, true), + "9": sequence(1, 30, true), + "10": sequence(1, 31, true), + "11": sequence(1, 30, true), + "12": sequence(1, 31, true) + } + } + }; + + case 'yy': + return { + component: "year", + label: "Year", + template: "YY", + constraint: "[0-9]{2}" + }; + + case 'yyyy': + return { + component: "year", + label: "Year", + template: "YYYY", + constraint: "[0-9]{4}" + }; + + case 'M': + return { + component: "month", + label: "Month", + template: "M", + constraint: "[0-9]{1,2}" + }; + + case 'MM': + return { + component: "month", + label: "Month", + template: "MM", + constraint: "[0-9]+" + }; + + case 'h': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: ["12"].concat(sequence(1, 11)) + }; + + case 'hh': + return { + component: "hour", + label: "Hour", + template: "HH", + constraint: ["12"].concat(sequence(1, 11, true)) + }; + + + case 'K': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: concat(sequence(0, 11)) + }; + + case 'KK': + return { + component: "hour", + label: "Hour", + template: "HH", + constraint: concat(sequence(0, 11, true)) + }; + + case 'H': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: [0, 23] + }; + + case 'HH': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: concat(sequence(0, 23, true)) + }; + + case 'k': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: ["24"].concat(sequence(0, 23)) + }; + + case 'kk': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: ["24"].concat(sequence(0, 23, true)) + }; + + case 'm': + return { + component: "minute", + label: "Minute", + template: "mm", + constraint: [0, 59] + }; + + case 'mm': + return { + component: "minute", + label: "Minute", + template: "mm", + constraint: sequence(0, 59, true) + }; + + case 's': + str += (date.second || "0"); + break; + case 'ss': + str += JSUtils.pad(date.second || "0", 2); + break; + case 'S': + str += (date.millisecond || "0"); + break; + case 'SSS': + str += JSUtils.pad(date.millisecond || "0", 3); + break; + + case 'N': + case 'NN': + case 'MMM': + case 'MMMM': + case 'L': + case 'LL': + case 'LLL': + case 'LLLL': + key = templateArr[i] + (date.month || 1); + str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); + break; + + case 'E': + case 'EE': + case 'EEE': + case 'EEEE': + case 'c': + case 'cc': + case 'ccc': + case 'cccc': + key = templateArr[i] + date.getDayOfWeek(); + //console.log("finding " + key + " in the resources"); + str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); + break; + + case 'a': + switch (this.meridiems) { + case "chinese": + if (date.hour < 6) { + key = "azh0"; // before dawn + } else if (date.hour < 9) { + key = "azh1"; // morning + } else if (date.hour < 12) { + key = "azh2"; // late morning/day before noon + } else if (date.hour < 13) { + key = "azh3"; // noon hour/midday + } else if (date.hour < 18) { + key = "azh4"; // afternoon + } else if (date.hour < 21) { + key = "azh5"; // evening time/dusk + } else { + key = "azh6"; // night time + } + break; + case "ethiopic": + if (date.hour < 6) { + key = "a0-ethiopic"; // morning + } else if (date.hour === 6 && date.minute === 0) { + key = "a1-ethiopic"; // noon + } else if (date.hour >= 6 && date.hour < 12) { + key = "a2-ethiopic"; // afternoon + } else if (date.hour >= 12 && date.hour < 18) { + key = "a3-ethiopic"; // evening + } else if (date.hour >= 18) { + key = "a4-ethiopic"; // night + } + break; + default: + key = date.hour < 12 ? "a0" : "a1"; + break; + } + //console.log("finding " + key + " in the resources"); + str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); + break; + + case 'w': + str += date.getWeekOfYear(); + break; + case 'ww': + str += JSUtils.pad(date.getWeekOfYear(), 2); + break; + + case 'D': + str += date.getDayOfYear(); + break; + case 'DD': + str += JSUtils.pad(date.getDayOfYear(), 2); + break; + case 'DDD': + str += JSUtils.pad(date.getDayOfYear(), 3); + break; + case 'W': + str += date.getWeekOfMonth(this.locale); + break; + + case 'G': + key = "G" + date.getEra(); + str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); + break; + + case 'O': + temp = this.sysres.getString("1#1st|2#2nd|3#3rd|21#21st|22#22nd|23#23rd|31#31st|#{num}th", "ordinalChoice"); + str += temp.formatChoice(date.day, {num: date.day}); + break; + + case 'z': // general time zone + tz = this.getTimeZone(); // lazy-load the tz + str += tz.getDisplayName(date, "standard"); + break; + case 'Z': // RFC 822 time zone + tz = this.getTimeZone(); // lazy-load the tz + str += tz.getDisplayName(date, "rfc822"); + break; + + default: + str += templateArr[i].replace(/'/g, ""); + break; + } + + })); + + var rows = format.split(/\n/g); + info = rows.map(ilib.bind(this, function(row) { + return row.split("}").filter(function(component) { + return component.length > 0; + }).map(ilib.bind(this, function(component) { + var name = component.replace(/.*{/, ""); + var obj = { + component: name, + label: rb.getStringJS(this.info.fieldNames[name]) + }; + var field = fields.filter(function(f) { + return f.name === name; }); - }) - }); + if (field && field[0] && field[0].pattern) { + if (typeof(field[0].pattern) === "string") { + obj.constraint = field[0].pattern; + } + } + if (name === "country") { + obj.constraint = invertAndFilter(localeAddress.ctrynames); + } else if (name === "region" && this.regions[loc.getRegion()]) { + obj.constraint = this.regions[loc.getRegion()]; + } + return obj; + })); + })); + + if (callback && typeof(callback) === "function") { + callback(info); + } }) }); - + return info; }; From 342edb208f039966d257f26a7127b755988007ac Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Sun, 9 Dec 2018 23:16:04 -0800 Subject: [PATCH 10/38] Add some validation regexps --- js/lib/DateFmt.js | 56 ++++++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index a811abea95..fd53a9bbb2 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -1855,7 +1855,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { "11": sequence(1, 30), "12": sequence(1, 31) } - } + }, + validation: "\\d{1,2}" }; case 'dd': @@ -1893,7 +1894,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { "11": sequence(1, 30, true), "12": sequence(1, 31, true) } - } + }, + validation: "\\d{1,2}" }; case 'yy': @@ -1901,7 +1903,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "year", label: "Year", template: "YY", - constraint: "[0-9]{2}" + constraint: "[0-9]{2}", + validation: "\\d{2}" }; case 'yyyy': @@ -1909,7 +1912,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "year", label: "Year", template: "YYYY", - constraint: "[0-9]{4}" + constraint: "[0-9]{4}", + validation: "\\d{4}" }; case 'M': @@ -1917,7 +1921,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "month", label: "Month", template: "M", - constraint: "[0-9]{1,2}" + constraint: [1, 12], + validation: "\\d{1,2}" }; case 'MM': @@ -1925,7 +1930,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "month", label: "Month", template: "MM", - constraint: "[0-9]+" + constraint: "[0-9]+", + validation: "\\d{2}" }; case 'h': @@ -1933,7 +1939,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "hour", label: "Hour", template: "H", - constraint: ["12"].concat(sequence(1, 11)) + constraint: ["12"].concat(sequence(1, 11)), + validation: "\\d{1,2}" }; case 'hh': @@ -1941,7 +1948,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "hour", label: "Hour", template: "HH", - constraint: ["12"].concat(sequence(1, 11, true)) + constraint: ["12"].concat(sequence(1, 11, true)), + validation: "\\d{2}" }; @@ -1950,7 +1958,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "hour", label: "Hour", template: "H", - constraint: concat(sequence(0, 11)) + constraint: concat(sequence(0, 11)), + validation: "\\d{1,2}" }; case 'KK': @@ -1958,7 +1967,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "hour", label: "Hour", template: "HH", - constraint: concat(sequence(0, 11, true)) + constraint: concat(sequence(0, 11, true)), + validation: "\\d{2}" }; case 'H': @@ -1966,7 +1976,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "hour", label: "Hour", template: "H", - constraint: [0, 23] + constraint: [0, 23], + validation: "\\d{1,2}" }; case 'HH': @@ -1974,7 +1985,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "hour", label: "Hour", template: "H", - constraint: concat(sequence(0, 23, true)) + constraint: concat(sequence(0, 23, true)), + validation: "\\d{1,2}" }; case 'k': @@ -1982,7 +1994,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "hour", label: "Hour", template: "H", - constraint: ["24"].concat(sequence(0, 23)) + constraint: ["24"].concat(sequence(0, 23)), + validation: "\\d{1,2}" }; case 'kk': @@ -1990,7 +2003,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "hour", label: "Hour", template: "H", - constraint: ["24"].concat(sequence(0, 23, true)) + constraint: ["24"].concat(sequence(0, 23, true)), + validation: "\\d{1,2}" }; case 'm': @@ -1998,16 +2012,18 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "minute", label: "Minute", template: "mm", - constraint: [0, 59] + constraint: [0, 59], + validation: "\\d{1,2}" }; case 'mm': return { - component: "minute", - label: "Minute", - template: "mm", - constraint: sequence(0, 59, true) - }; + component: "minute", + label: "Minute", + template: "mm", + constraint: sequence(0, 59, true), + validation: "\\d{2}" + }; case 's': str += (date.second || "0"); From a3fb15268b35897bf20ecce915aecdc94ee9e1b3 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Sun, 9 Dec 2018 23:17:44 -0800 Subject: [PATCH 11/38] More getFormatInfo work. Checkpoint commit. --- js/lib/DateFmt.js | 64 +++++++++++++++++++++++++++++++++++++-------- js/lib/HebrewCal.js | 8 ++++-- 2 files changed, 59 insertions(+), 13 deletions(-) diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index fd53a9bbb2..43371de815 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -2026,17 +2026,36 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { }; case 's': - str += (date.second || "0"); - break; + return { + component: "second", + label: "Second", + template: "ss", + constraint: [0, 59] + }; + case 'ss': - str += JSUtils.pad(date.second || "0", 2); - break; + return { + component: "second", + label: "Second", + template: "ss", + constraint: sequence(0, 59, true) + }; + case 'S': - str += (date.millisecond || "0"); - break; + return { + component: "millisecond", + label: "Millisecond", + template: "ms", + constraint: [0, 999] + }; + case 'SSS': - str += JSUtils.pad(date.millisecond || "0", 3); - break; + return { + component: "millisecond", + label: "Millisecond", + template: "ms", + constraint: sequence(0, 999, true) + }; case 'N': case 'NN': @@ -2046,9 +2065,32 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { case 'LL': case 'LLL': case 'LLLL': - key = templateArr[i] + (date.month || 1); - str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); - break; + return { + component: "month", + label: "Month", + template: "MMM", + constraint: { + "constraint": "isLeap", + "leap": (function() { + var ret = []; + var months = this.cal.getNumMonths(undefined, true); + for (var i = 1; i < months; i++) { + var key = component + i; + ret.push((this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key))); + } + return ret; + })(), + "regular": (function() { + var ret = []; + var months = this.cal.getNumMonths(undefined, false); + for (var i = 1; i < months; i++) { + var key = component + i; + ret.push((this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key))); + } + return ret; + })() + } + }; case 'E': case 'EE': diff --git a/js/lib/HebrewCal.js b/js/lib/HebrewCal.js index 3e6accf474..b861fda9da 100644 --- a/js/lib/HebrewCal.js +++ b/js/lib/HebrewCal.js @@ -177,9 +177,13 @@ HebrewCal.prototype.lastDayOfMonth = function(month, year) { * where 1=first month, 2=second month, etc. * * @param {number} year a year for which the number of months is sought + * @param {boolean} leap if the number of months is explicitly needed for a leap year, + * set this parameter to true. The year will be ignored in this case. + * @returns {number} the number of months in the given year or type of year */ -HebrewCal.prototype.getNumMonths = function(year) { - return this.isLeapYear(year) ? 13 : 12; +HebrewCal.prototype.getNumMonths = function(year, leap) { + var isLeap = typeof(leap) === "boolean" ? leap : this.isLeapYear(year); + return isLeap ? 13 : 12; }; /** From a332a4d5f8780ebc227548290cee5c33d3563061 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Mon, 10 Dec 2018 10:28:16 -0800 Subject: [PATCH 12/38] More work on getFormatInfo Add the idea of a value property, the value of which is a function that calculates the value of this field based on the value of other fields. For example, the day of week is not something that a UI typically displays in a date input form. Instead, you pick the year, month, and day and the day of week is determined automatically. More work is needed for time zones and to translate stuff. --- js/lib/DateFmt.js | 150 +++++++++++++++++++++++++++++----------------- 1 file changed, 94 insertions(+), 56 deletions(-) diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index 43371de815..15319fa313 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -1811,7 +1811,7 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { } return constraint; } - + new ResBundle({ locale: loc, name: "dateres", @@ -2030,7 +2030,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "second", label: "Second", template: "ss", - constraint: [0, 59] + constraint: [0, 59], + validation: "\\d{1,2}" }; case 'ss': @@ -2038,7 +2039,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "second", label: "Second", template: "ss", - constraint: sequence(0, 59, true) + constraint: sequence(0, 59, true), + validation: "\\d{2}" }; case 'S': @@ -2046,7 +2048,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "millisecond", label: "Millisecond", template: "ms", - constraint: [0, 999] + constraint: [0, 999], + validation: "\\d{1,3}" }; case 'SSS': @@ -2054,7 +2057,8 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { component: "millisecond", label: "Millisecond", template: "ms", - constraint: sequence(0, 999, true) + constraint: sequence(0, 999, true), + validation: "\\d{3}" }; case 'N': @@ -2068,7 +2072,6 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { return { component: "month", label: "Month", - template: "MMM", constraint: { "constraint": "isLeap", "leap": (function() { @@ -2100,75 +2103,109 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { case 'cc': case 'ccc': case 'cccc': - key = templateArr[i] + date.getDayOfWeek(); - //console.log("finding " + key + " in the resources"); - str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); + return { + component: "dayofweek", + label: "Day of Week", + constraint: (function() { + var ret = []; + var months = this.cal.getNumMonths(undefined, true); + for (var i = 0; i < 7; i++) { + key = component + i; + //console.log("finding " + key + " in the resources"); + ret.push((this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key))); + } + return ret; + })() + }; break; case 'a': + var ret = { + component: "meridiem", + label: "AM/PM", + template: "AM/PM", + constraint: [] + }; switch (this.meridiems) { case "chinese": - if (date.hour < 6) { - key = "azh0"; // before dawn - } else if (date.hour < 9) { - key = "azh1"; // morning - } else if (date.hour < 12) { - key = "azh2"; // late morning/day before noon - } else if (date.hour < 13) { - key = "azh3"; // noon hour/midday - } else if (date.hour < 18) { - key = "azh4"; // afternoon - } else if (date.hour < 21) { - key = "azh5"; // evening time/dusk - } else { - key = "azh6"; // night time + for (var i = 0; i < 7; i++) { + var key = "azh" + i; + ret.constraint.push(this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); } break; case "ethiopic": - if (date.hour < 6) { - key = "a0-ethiopic"; // morning - } else if (date.hour === 6 && date.minute === 0) { - key = "a1-ethiopic"; // noon - } else if (date.hour >= 6 && date.hour < 12) { - key = "a2-ethiopic"; // afternoon - } else if (date.hour >= 12 && date.hour < 18) { - key = "a3-ethiopic"; // evening - } else if (date.hour >= 18) { - key = "a4-ethiopic"; // night + for (var i = 0; i < 7; i++) { + var key = "a" + i + "-ethiopic"; + ret.constraint.push(this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); } break; default: - key = date.hour < 12 ? "a0" : "a1"; - break; + ret.constraint.push(this.sysres.getString(undefined, "a0-" + this.calName) || this.sysres.getString(undefined, "a0")); + ret.constraint.push(this.sysres.getString(undefined, "a1-" + this.calName) || this.sysres.getString(undefined, "a1")); + break; } - //console.log("finding " + key + " in the resources"); - str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); - break; + return ret; case 'w': - str += date.getWeekOfYear(); - break; + return { + label: "Week of Year", + value: function(date) { + return date.getDayOfYear(); + } + }; + case 'ww': - str += JSUtils.pad(date.getWeekOfYear(), 2); - break; + return { + label: "Week of Year", + value: function(date) { + var temp = date.getWeekOfYear(); + return JSUtils.pad(temp, 2) + } + }; case 'D': - str += date.getDayOfYear(); - break; + return { + label: "Day of Year", + value: function(date) { + return date.getDayOfYear(); + } + }; + case 'DD': - str += JSUtils.pad(date.getDayOfYear(), 2); - break; + return { + label: "Day of Year", + value: function(date) { + var temp = date.getDayOfYear(); + return JSUtils.pad(temp, 2) + } + }; + case 'DDD': - str += JSUtils.pad(date.getDayOfYear(), 3); - break; + return { + label: "Day of Year", + value: function(date) { + var temp = date.getDayOfYear(); + return JSUtils.pad(temp, 3) + } + }; + case 'W': - str += date.getWeekOfMonth(this.locale); - break; + return { + label: "Week of Month", + value: function(date) { + return date.getWeekOfMonth(); + } + }; case 'G': - key = "G" + date.getEra(); - str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); - break; + var ret = { + component: "era", + label: "Era", + constraint: [] + }; + ret.constraint.push(this.sysres.getString(undefined, "G0-" + this.calName) || this.sysres.getString(undefined, "G0")); + ret.constraint.push(this.sysres.getString(undefined, "G1-" + this.calName) || this.sysres.getString(undefined, "G1")); + return ret; case 'O': temp = this.sysres.getString("1#1st|2#2nd|3#3rd|21#21st|22#22nd|23#23rd|31#31st|#{num}th", "ordinalChoice"); @@ -2185,8 +2222,9 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { break; default: - str += templateArr[i].replace(/'/g, ""); - break; + return { + label: component + }; } })); @@ -2223,7 +2261,7 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { } }) }); - + return info; }; From 7a1c4a739eb749107d3e4be90758ade46f860973 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Mon, 10 Dec 2018 22:14:40 -0800 Subject: [PATCH 13/38] Unit tests run now (They don't pass though.) --- js/lib/DateFmt.js | 879 ++++++++++++++++++------------------ js/test/date/testdatefmt.js | 28 +- 2 files changed, 452 insertions(+), 455 deletions(-) diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index 15319fa313..fa6eb49d74 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -1606,6 +1606,423 @@ DateFmt.prototype = { } }; +/** + * @private + */ +DateFmt.prototype._mapFormatInfo = function(tzinfo) { + function sequence(start, end, pad) { + var constraint = []; + for (var i = start; i <= end; i++) { + constraint.push(pad ? JSUtils.pad(i, 2) : String(i)); + } + return constraint; + } + + return this.templateArr.map(ilib.bind(this, function(component) { + switch (component) { + case 'd': + return { + component: "day", + label: "Date", + template: "D", + constraint: { + "condition": "isLeap", + "regular": { + "1": [1, 31], + "2": [1, 28], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + }, + "leap": { + "1": [1, 31], + "2": [1, 29], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + } + }, + validation: "\\d{1,2}" + }; + + case 'dd': + return { + component: "day", + label: "Date", + template: "DD", + constraint: { + "condition": "isLeap", + "regular": { + "1": sequence(1, 31, true), + "2": sequence(1, 28, true), + "3": sequence(1, 31, true), + "4": sequence(1, 30, true), + "5": sequence(1, 31, true), + "6": sequence(1, 30, true), + "7": sequence(1, 31, true), + "8": sequence(1, 31, true), + "9": sequence(1, 30, true), + "10": sequence(1, 31, true), + "11": sequence(1, 30, true), + "12": sequence(1, 31, true) + }, + "leap": { + "1": sequence(1, 31, true), + "2": sequence(1, 29, true), + "3": sequence(1, 31, true), + "4": sequence(1, 30, true), + "5": sequence(1, 31, true), + "6": sequence(1, 30, true), + "7": sequence(1, 31, true), + "8": sequence(1, 31, true), + "9": sequence(1, 30, true), + "10": sequence(1, 31, true), + "11": sequence(1, 30, true), + "12": sequence(1, 31, true) + } + }, + validation: "\\d{1,2}" + }; + + case 'yy': + return { + component: "year", + label: "Year", + template: "YY", + constraint: "[0-9]{2}", + validation: "\\d{2}" + }; + + case 'yyyy': + return { + component: "year", + label: "Year", + template: "YYYY", + constraint: "[0-9]{4}", + validation: "\\d{4}" + }; + + case 'M': + return { + component: "month", + label: "Month", + template: "M", + constraint: [1, 12], + validation: "\\d{1,2}" + }; + + case 'MM': + return { + component: "month", + label: "Month", + template: "MM", + constraint: "[0-9]+", + validation: "\\d{2}" + }; + + case 'h': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: ["12"].concat(sequence(1, 11)), + validation: "\\d{1,2}" + }; + + case 'hh': + return { + component: "hour", + label: "Hour", + template: "HH", + constraint: ["12"].concat(sequence(1, 11, true)), + validation: "\\d{2}" + }; + + + case 'K': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: concat(sequence(0, 11)), + validation: "\\d{1,2}" + }; + + case 'KK': + return { + component: "hour", + label: "Hour", + template: "HH", + constraint: concat(sequence(0, 11, true)), + validation: "\\d{2}" + }; + + case 'H': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: [0, 23], + validation: "\\d{1,2}" + }; + + case 'HH': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: concat(sequence(0, 23, true)), + validation: "\\d{1,2}" + }; + + case 'k': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: ["24"].concat(sequence(0, 23)), + validation: "\\d{1,2}" + }; + + case 'kk': + return { + component: "hour", + label: "Hour", + template: "H", + constraint: ["24"].concat(sequence(0, 23, true)), + validation: "\\d{1,2}" + }; + + case 'm': + return { + component: "minute", + label: "Minute", + template: "mm", + constraint: [0, 59], + validation: "\\d{1,2}" + }; + + case 'mm': + return { + component: "minute", + label: "Minute", + template: "mm", + constraint: sequence(0, 59, true), + validation: "\\d{2}" + }; + + case 's': + return { + component: "second", + label: "Second", + template: "ss", + constraint: [0, 59], + validation: "\\d{1,2}" + }; + + case 'ss': + return { + component: "second", + label: "Second", + template: "ss", + constraint: sequence(0, 59, true), + validation: "\\d{2}" + }; + + case 'S': + return { + component: "millisecond", + label: "Millisecond", + template: "ms", + constraint: [0, 999], + validation: "\\d{1,3}" + }; + + case 'SSS': + return { + component: "millisecond", + label: "Millisecond", + template: "ms", + constraint: sequence(0, 999, true), + validation: "\\d{3}" + }; + + case 'N': + case 'NN': + case 'MMM': + case 'MMMM': + case 'L': + case 'LL': + case 'LLL': + case 'LLLL': + return { + component: "month", + label: "Month", + constraint: { + "constraint": "isLeap", + "leap": (function() { + var ret = []; + var months = this.cal.getNumMonths(undefined, true); + for (var i = 1; i < months; i++) { + var key = component + i; + ret.push((this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key))); + } + return ret; + })(), + "regular": (function() { + var ret = []; + var months = this.cal.getNumMonths(undefined, false); + for (var i = 1; i < months; i++) { + var key = component + i; + ret.push((this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key))); + } + return ret; + })() + } + }; + + case 'E': + case 'EE': + case 'EEE': + case 'EEEE': + case 'c': + case 'cc': + case 'ccc': + case 'cccc': + return { + component: "dayofweek", + label: "Day of Week", + constraint: (function() { + var ret = []; + var months = this.cal.getNumMonths(undefined, true); + for (var i = 0; i < 7; i++) { + key = component + i; + //console.log("finding " + key + " in the resources"); + ret.push((this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key))); + } + return ret; + })() + }; + break; + + case 'a': + var ret = { + component: "meridiem", + label: "AM/PM", + template: "AM/PM", + constraint: [] + }; + switch (this.meridiems) { + case "chinese": + for (var i = 0; i < 7; i++) { + var key = "azh" + i; + ret.constraint.push(this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); + } + break; + case "ethiopic": + for (var i = 0; i < 7; i++) { + var key = "a" + i + "-ethiopic"; + ret.constraint.push(this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); + } + break; + default: + ret.constraint.push(this.sysres.getString(undefined, "a0-" + this.calName) || this.sysres.getString(undefined, "a0")); + ret.constraint.push(this.sysres.getString(undefined, "a1-" + this.calName) || this.sysres.getString(undefined, "a1")); + break; + } + return ret; + + case 'w': + return { + label: "Week of Year", + value: function(date) { + return date.getDayOfYear(); + } + }; + + case 'ww': + return { + label: "Week of Year", + value: function(date) { + var temp = date.getWeekOfYear(); + return JSUtils.pad(temp, 2) + } + }; + + case 'D': + return { + label: "Day of Year", + value: function(date) { + return date.getDayOfYear(); + } + }; + + case 'DD': + return { + label: "Day of Year", + value: function(date) { + var temp = date.getDayOfYear(); + return JSUtils.pad(temp, 2) + } + }; + + case 'DDD': + return { + label: "Day of Year", + value: function(date) { + var temp = date.getDayOfYear(); + return JSUtils.pad(temp, 3) + } + }; + + case 'W': + return { + label: "Week of Month", + value: function(date) { + return date.getWeekOfMonth(); + } + }; + + case 'G': + var ret = { + component: "era", + label: "Era", + constraint: [] + }; + ret.constraint.push(this.sysres.getString(undefined, "G0-" + this.calName) || this.sysres.getString(undefined, "G0")); + ret.constraint.push(this.sysres.getString(undefined, "G1-" + this.calName) || this.sysres.getString(undefined, "G1")); + return ret; + + case 'z': // general time zone + case 'Z': // RFC 822 time zone + return { + component: "timezone", + label: "Time Zone", + constraint: tzinfo + }; + + default: + return { + label: component + }; + } + })); +}; + /** * Return information about the date format that can be used * by UI builders to display a locale-sensitive set of input fields @@ -1804,457 +2221,37 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { loc.spec = undefined; } - function sequence(start, end, pad) { - var constraint = []; - for (var i = start; i <= end; i++) { - constraint.push(pad ? JSUtils.pad(i, 2) : String(i)); - } - return constraint; - } - new ResBundle({ locale: loc, name: "dateres", sync: this.sync, loadParams: this.loadParams, onLoad: ilib.bind(this, function (rb) { - this.templateArr.map(ilib.bind(this, function(component) { - switch (component) { - case 'd': - return { - component: "day", - label: "Date", - template: "D", - constraint: { - "condition": "isLeap", - "regular": { - "1": sequence(1, 31), - "2": sequence(1, 28), - "3": sequence(1, 31), - "4": sequence(1, 30), - "5": sequence(1, 31), - "6": sequence(1, 30), - "7": sequence(1, 31), - "8": sequence(1, 31), - "9": sequence(1, 30), - "10": sequence(1, 31), - "11": sequence(1, 30), - "12": sequence(1, 31) - }, - "leap": { - "1": sequence(1, 31), - "2": sequence(1, 29), - "3": sequence(1, 31), - "4": sequence(1, 30), - "5": sequence(1, 31), - "6": sequence(1, 30), - "7": sequence(1, 31), - "8": sequence(1, 31), - "9": sequence(1, 30), - "10": sequence(1, 31), - "11": sequence(1, 30), - "12": sequence(1, 31) - } - }, - validation: "\\d{1,2}" - }; - - case 'dd': - return { - component: "day", - label: "Date", - template: "DD", - constraint: { - "condition": "isLeap", - "regular": { - "1": sequence(1, 31, true), - "2": sequence(1, 28, true), - "3": sequence(1, 31, true), - "4": sequence(1, 30, true), - "5": sequence(1, 31, true), - "6": sequence(1, 30, true), - "7": sequence(1, 31, true), - "8": sequence(1, 31, true), - "9": sequence(1, 30, true), - "10": sequence(1, 31, true), - "11": sequence(1, 30, true), - "12": sequence(1, 31, true) - }, - "leap": { - "1": sequence(1, 31, true), - "2": sequence(1, 29, true), - "3": sequence(1, 31, true), - "4": sequence(1, 30, true), - "5": sequence(1, 31, true), - "6": sequence(1, 30, true), - "7": sequence(1, 31, true), - "8": sequence(1, 31, true), - "9": sequence(1, 30, true), - "10": sequence(1, 31, true), - "11": sequence(1, 30, true), - "12": sequence(1, 31, true) - } - }, - validation: "\\d{1,2}" - }; - - case 'yy': - return { - component: "year", - label: "Year", - template: "YY", - constraint: "[0-9]{2}", - validation: "\\d{2}" - }; - - case 'yyyy': - return { - component: "year", - label: "Year", - template: "YYYY", - constraint: "[0-9]{4}", - validation: "\\d{4}" - }; - - case 'M': - return { - component: "month", - label: "Month", - template: "M", - constraint: [1, 12], - validation: "\\d{1,2}" - }; - - case 'MM': - return { - component: "month", - label: "Month", - template: "MM", - constraint: "[0-9]+", - validation: "\\d{2}" - }; - - case 'h': - return { - component: "hour", - label: "Hour", - template: "H", - constraint: ["12"].concat(sequence(1, 11)), - validation: "\\d{1,2}" - }; - - case 'hh': - return { - component: "hour", - label: "Hour", - template: "HH", - constraint: ["12"].concat(sequence(1, 11, true)), - validation: "\\d{2}" - }; - - - case 'K': - return { - component: "hour", - label: "Hour", - template: "H", - constraint: concat(sequence(0, 11)), - validation: "\\d{1,2}" - }; - - case 'KK': - return { - component: "hour", - label: "Hour", - template: "HH", - constraint: concat(sequence(0, 11, true)), - validation: "\\d{2}" - }; - - case 'H': - return { - component: "hour", - label: "Hour", - template: "H", - constraint: [0, 23], - validation: "\\d{1,2}" - }; - - case 'HH': - return { - component: "hour", - label: "Hour", - template: "H", - constraint: concat(sequence(0, 23, true)), - validation: "\\d{1,2}" - }; - - case 'k': - return { - component: "hour", - label: "Hour", - template: "H", - constraint: ["24"].concat(sequence(0, 23)), - validation: "\\d{1,2}" - }; - - case 'kk': - return { - component: "hour", - label: "Hour", - template: "H", - constraint: ["24"].concat(sequence(0, 23, true)), - validation: "\\d{1,2}" - }; - - case 'm': - return { - component: "minute", - label: "Minute", - template: "mm", - constraint: [0, 59], - validation: "\\d{1,2}" - }; - - case 'mm': - return { - component: "minute", - label: "Minute", - template: "mm", - constraint: sequence(0, 59, true), - validation: "\\d{2}" - }; - - case 's': - return { - component: "second", - label: "Second", - template: "ss", - constraint: [0, 59], - validation: "\\d{1,2}" - }; - - case 'ss': - return { - component: "second", - label: "Second", - template: "ss", - constraint: sequence(0, 59, true), - validation: "\\d{2}" - }; - - case 'S': - return { - component: "millisecond", - label: "Millisecond", - template: "ms", - constraint: [0, 999], - validation: "\\d{1,3}" - }; - - case 'SSS': - return { - component: "millisecond", - label: "Millisecond", - template: "ms", - constraint: sequence(0, 999, true), - validation: "\\d{3}" - }; - - case 'N': - case 'NN': - case 'MMM': - case 'MMMM': - case 'L': - case 'LL': - case 'LLL': - case 'LLLL': - return { - component: "month", - label: "Month", - constraint: { - "constraint": "isLeap", - "leap": (function() { - var ret = []; - var months = this.cal.getNumMonths(undefined, true); - for (var i = 1; i < months; i++) { - var key = component + i; - ret.push((this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key))); - } - return ret; - })(), - "regular": (function() { - var ret = []; - var months = this.cal.getNumMonths(undefined, false); - for (var i = 1; i < months; i++) { - var key = component + i; - ret.push((this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key))); - } - return ret; - })() - } - }; - - case 'E': - case 'EE': - case 'EEE': - case 'EEEE': - case 'c': - case 'cc': - case 'ccc': - case 'cccc': - return { - component: "dayofweek", - label: "Day of Week", - constraint: (function() { - var ret = []; - var months = this.cal.getNumMonths(undefined, true); - for (var i = 0; i < 7; i++) { - key = component + i; - //console.log("finding " + key + " in the resources"); - ret.push((this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key))); - } - return ret; - })() - }; - break; - - case 'a': - var ret = { - component: "meridiem", - label: "AM/PM", - template: "AM/PM", - constraint: [] - }; - switch (this.meridiems) { - case "chinese": - for (var i = 0; i < 7; i++) { - var key = "azh" + i; - ret.constraint.push(this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); - } - break; - case "ethiopic": - for (var i = 0; i < 7; i++) { - var key = "a" + i + "-ethiopic"; - ret.constraint.push(this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); - } - break; - default: - ret.constraint.push(this.sysres.getString(undefined, "a0-" + this.calName) || this.sysres.getString(undefined, "a0")); - ret.constraint.push(this.sysres.getString(undefined, "a1-" + this.calName) || this.sysres.getString(undefined, "a1")); - break; - } - return ret; - - case 'w': - return { - label: "Week of Year", - value: function(date) { - return date.getDayOfYear(); - } - }; - - case 'ww': - return { - label: "Week of Year", - value: function(date) { - var temp = date.getWeekOfYear(); - return JSUtils.pad(temp, 2) - } - }; - - case 'D': - return { - label: "Day of Year", - value: function(date) { - return date.getDayOfYear(); - } - }; - - case 'DD': - return { - label: "Day of Year", - value: function(date) { - var temp = date.getDayOfYear(); - return JSUtils.pad(temp, 2) - } - }; - - case 'DDD': - return { - label: "Day of Year", - value: function(date) { - var temp = date.getDayOfYear(); - return JSUtils.pad(temp, 3) - } - }; - - case 'W': - return { - label: "Week of Month", - value: function(date) { - return date.getWeekOfMonth(); - } - }; - - case 'G': - var ret = { - component: "era", - label: "Era", - constraint: [] - }; - ret.constraint.push(this.sysres.getString(undefined, "G0-" + this.calName) || this.sysres.getString(undefined, "G0")); - ret.constraint.push(this.sysres.getString(undefined, "G1-" + this.calName) || this.sysres.getString(undefined, "G1")); - return ret; - - case 'O': - temp = this.sysres.getString("1#1st|2#2nd|3#3rd|21#21st|22#22nd|23#23rd|31#31st|#{num}th", "ordinalChoice"); - str += temp.formatChoice(date.day, {num: date.day}); - break; - - case 'z': // general time zone - tz = this.getTimeZone(); // lazy-load the tz - str += tz.getDisplayName(date, "standard"); - break; - case 'Z': // RFC 822 time zone - tz = this.getTimeZone(); // lazy-load the tz - str += tz.getDisplayName(date, "rfc822"); - break; - - default: - return { - label: component - }; + var info, zone = false; + for (var i = 0; i < this.templateArr.length; i++) { + if (this.templateArr[i] === "z" || this.templateArr[i] === "Z") { + zone = true; + break; } + } - })); - - var rows = format.split(/\n/g); - info = rows.map(ilib.bind(this, function(row) { - return row.split("}").filter(function(component) { - return component.length > 0; - }).map(ilib.bind(this, function(component) { - var name = component.replace(/.*{/, ""); - var obj = { - component: name, - label: rb.getStringJS(this.info.fieldNames[name]) - }; - var field = fields.filter(function(f) { - return f.name === name; - }); - if (field && field[0] && field[0].pattern) { - if (typeof(field[0].pattern) === "string") { - obj.constraint = field[0].pattern; - } - } - if (name === "country") { - obj.constraint = invertAndFilter(localeAddress.ctrynames); - } else if (name === "region" && this.regions[loc.getRegion()]) { - obj.constraint = this.regions[loc.getRegion()]; + if (zone) { + TimeZone.getAvailableIds(undefined, sync, ilib.bind(this, function(tzinfo) { + var set = new ISet(tzinfo); + set.add("Etc/UTC"); + set.add("Etc/GMT"); + for (var j = 1; j < 13; j++) { + set.add("Etc/GMT+" + j); + set.add("Etc/GMT-" + j); } - return obj; + set.add("Etc/GMT-13"); + set.add("Etc/GMT-14"); + + info = this._mapFormatInfo(set.asArray().sort()); })); - })); + } else { + info = this._mapFormatInfo(); + } if (callback && typeof(callback) === "function") { callback(info); diff --git a/js/test/date/testdatefmt.js b/js/test/date/testdatefmt.js index 7196a5d95b..9bc7c00783 100644 --- a/js/test/date/testdatefmt.js +++ b/js/test/date/testdatefmt.js @@ -3776,18 +3776,18 @@ module.exports.testdatefmt = { test.equal(info[0].component, "month"); test.equal(info[0].label, "Month"); - test.deepEquals(info[0].constraint, [1, 12]); + test.deepEqual(info[0].constraint, [1, 12]); test.ok(!info[1].component); test.equal(info[1].label, "/"); test.equal(info[2].component, "day"); test.equal(info[2].label, "Date"); - test.deepEquals(info[2].constraint, { - "condition": "leapyear", - "leap": { + test.deepEqual(info[2].constraint, { + "condition": "isLeap", + "regular": { "1": [1, 31], - "2": [1, 29], + "2": [1, 28], "3": [1, 31], "4": [1, 30], "5": [1, 31], @@ -3799,9 +3799,9 @@ module.exports.testdatefmt = { "11": [1, 30], "12": [1, 31] }, - "regular": { + "leap": { "1": [1, 31], - "2": [1, 28], + "2": [1, 29], "3": [1, 31], "4": [1, 30], "5": [1, 31], @@ -3843,7 +3843,7 @@ module.exports.testdatefmt = { test.equal(info[0].component, "month"); test.equal(info[0].label, "Month"); - test.deepEquals(info[0].constraint, [ + test.deepEqual(info[0].constraint, [ {label: "January", value: 1}, {label: "February", value: 2}, {label: "March", value: 3}, @@ -3863,11 +3863,11 @@ module.exports.testdatefmt = { test.equal(info[2].component, "day"); test.equal(info[2].label, "Date"); - test.deepEquals(info[2].constraint, { - "condition": "leapyear", - "leap": { + test.deepEqual(info[2].constraint, { + "condition": "isLeap", + "regular": { "1": [1, 31], - "2": [1, 29], + "2": [1, 28], "3": [1, 31], "4": [1, 30], "5": [1, 31], @@ -3879,9 +3879,9 @@ module.exports.testdatefmt = { "11": [1, 30], "12": [1, 31] }, - "regular": { + "leap": { "1": [1, 31], - "2": [1, 28], + "2": [1, 29], "3": [1, 31], "4": [1, 30], "5": [1, 31], From dfc9442e1ecfd60c1e1a840d4204b7cea3653b89 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Tue, 11 Dec 2018 10:32:41 -0800 Subject: [PATCH 14/38] Better callback handling --- js/data/locale/dateres.json | 11 +---------- js/lib/DateFmt.js | 10 ++++++---- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/js/data/locale/dateres.json b/js/data/locale/dateres.json index a9d8f0e598..9e26dfeeb6 100644 --- a/js/data/locale/dateres.json +++ b/js/data/locale/dateres.json @@ -1,10 +1 @@ -{ - "month": "Month", - "day": "Date", - "year": "Year", - "hour": "Hour", - "minute": "Minute", - "second": "Second", - "meridium": "AM/PM", - "timezone": "Time Zone" -} \ No newline at end of file +{} \ No newline at end of file diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index fa6eb49d74..ef608da4de 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -2248,13 +2248,15 @@ DateFmt.prototype.getFormatInfo = function(locale, sync, callback) { set.add("Etc/GMT-14"); info = this._mapFormatInfo(set.asArray().sort()); + if (callback && typeof(callback) === "function") { + callback(info); + } })); } else { info = this._mapFormatInfo(); - } - - if (callback && typeof(callback) === "function") { - callback(info); + if (callback && typeof(callback) === "function") { + callback(info); + } } }) }); From 74e2387c3596a757669296ccae25952a1184778b Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Mon, 24 Dec 2018 00:16:34 -0800 Subject: [PATCH 15/38] JSdoc update --- js/lib/DateFmt.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index 15319fa313..cdef9db4d7 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -1613,8 +1613,21 @@ DateFmt.prototype = { * * The object returned by this method is an array of date * format components. Each format component is an object - * that contains a "component" property and a "label" to display - * with it. The component is the name of the property to use + * that contains properties that describe that component. + * The list of possible properties on each object are: + * + *
    + *
  • component - if this component describes a part + * of the date which can be entered by the user, the component + * property gives the name of that component. This can be used + * as a property name for the options of the DateFactory() + * function. For example, if the value of "component" is "year", + * then the value of the input field can be used as the "year" + * property when calling DateFactory(). + *
  • label - a localized string to display for this + * component as a label. + *
  • template + * . The component is the name of the property to use * when constructing a new date with DateFactory(). The label * is intended to be shown to the user and is written in the * given locale, or the locale of this formatter if the From 2fe707cd220d2189f5ca65849a8802190bd6c1de Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Thu, 3 Jan 2019 23:33:42 -0800 Subject: [PATCH 16/38] Update docs - use "placeholder" instead of "template" property - use an options param instead of separate params to the getFormatInfo --- js/lib/DateFmt.js | 159 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 117 insertions(+), 42 deletions(-) diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index ef608da4de..820fe0b260 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -1624,7 +1624,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "day", label: "Date", - template: "D", + placeholder: "D", constraint: { "condition": "isLeap", "regular": { @@ -1663,7 +1663,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "day", label: "Date", - template: "DD", + placeholder: "DD", constraint: { "condition": "isLeap", "regular": { @@ -1702,7 +1702,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "year", label: "Year", - template: "YY", + placeholder: "YY", constraint: "[0-9]{2}", validation: "\\d{2}" }; @@ -1711,7 +1711,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "year", label: "Year", - template: "YYYY", + placeholder: "YYYY", constraint: "[0-9]{4}", validation: "\\d{4}" }; @@ -1720,7 +1720,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "month", label: "Month", - template: "M", + placeholder: "M", constraint: [1, 12], validation: "\\d{1,2}" }; @@ -1729,7 +1729,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "month", label: "Month", - template: "MM", + placeholder: "MM", constraint: "[0-9]+", validation: "\\d{2}" }; @@ -1738,7 +1738,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "hour", label: "Hour", - template: "H", + placeholder: "H", constraint: ["12"].concat(sequence(1, 11)), validation: "\\d{1,2}" }; @@ -1747,7 +1747,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "hour", label: "Hour", - template: "HH", + placeholder: "HH", constraint: ["12"].concat(sequence(1, 11, true)), validation: "\\d{2}" }; @@ -1757,7 +1757,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "hour", label: "Hour", - template: "H", + placeholder: "H", constraint: concat(sequence(0, 11)), validation: "\\d{1,2}" }; @@ -1766,7 +1766,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "hour", label: "Hour", - template: "HH", + placeholder: "HH", constraint: concat(sequence(0, 11, true)), validation: "\\d{2}" }; @@ -1775,7 +1775,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "hour", label: "Hour", - template: "H", + placeholder: "H", constraint: [0, 23], validation: "\\d{1,2}" }; @@ -1784,7 +1784,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "hour", label: "Hour", - template: "H", + placeholder: "H", constraint: concat(sequence(0, 23, true)), validation: "\\d{1,2}" }; @@ -1793,7 +1793,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "hour", label: "Hour", - template: "H", + placeholder: "H", constraint: ["24"].concat(sequence(0, 23)), validation: "\\d{1,2}" }; @@ -1802,7 +1802,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "hour", label: "Hour", - template: "H", + placeholder: "H", constraint: ["24"].concat(sequence(0, 23, true)), validation: "\\d{1,2}" }; @@ -1811,7 +1811,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "minute", label: "Minute", - template: "mm", + placeholder: "mm", constraint: [0, 59], validation: "\\d{1,2}" }; @@ -1820,7 +1820,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "minute", label: "Minute", - template: "mm", + placeholder: "mm", constraint: sequence(0, 59, true), validation: "\\d{2}" }; @@ -1829,7 +1829,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "second", label: "Second", - template: "ss", + placeholder: "ss", constraint: [0, 59], validation: "\\d{1,2}" }; @@ -1838,7 +1838,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "second", label: "Second", - template: "ss", + placeholder: "ss", constraint: sequence(0, 59, true), validation: "\\d{2}" }; @@ -1847,7 +1847,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "millisecond", label: "Millisecond", - template: "ms", + placeholder: "ms", constraint: [0, 999], validation: "\\d{1,3}" }; @@ -1856,7 +1856,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "millisecond", label: "Millisecond", - template: "ms", + placeholder: "ms", constraint: sequence(0, 999, true), validation: "\\d{3}" }; @@ -1923,7 +1923,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { var ret = { component: "meridiem", label: "AM/PM", - template: "AM/PM", + placeholder: "AM/PM", constraint: [] }; switch (this.meridiems) { @@ -2040,11 +2040,24 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { * Field separators such as slashes or dots, etc., are given * as a object with no "component" property. They only contain * a "label" property with a string value. A user interface - * may choose to omit these if desired.

    + * may choose to use them or omit these as needed.

    * - * Optionally, if a format component is constrained to a + * User interfaces can construct two different types of input + * forms: a constrained form and a free-form form. In a + * constrained form, things like the month are displayed as + * as a drop-down box containing a fixed list of month names. + * The user may only choose from that list. In a free-form + * form, the user is presented with text input fields in + * which they can either type whatever they want or type in + * a value from a constrained list of characters. This + * method returns info that can be used to create either + * type of form. It is up to the form element coder to + * decide which type they would like.

    + * + * For a constrained form, some date format components + * must conform to a * particular pattern, range, or to a fixed list of possible - * values, then these constraint rules are given in the + * values. These constraint rules are given in the * "constraint" property. * The values in the constraint property can be one of these * types: @@ -2072,35 +2085,79 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { * and in regular years, there are 12 months. The "constraint" * property for Hebrew calendars is returned as an object * that contains three properties, "condition", "leap", - * and "regular". The "condition" says what the condition is - * based on (ie. whether or not it is a leap year), and + * and "regular". The "condition" property is set to "isLeap" + * (ie. whether or not it is a leap year), and * each of "leap" and "regular" are - * an array of strings that give the month names. + * an array of strings that give the month names in a leap + * year (13 months) and a regular year (12 months) respectively. * It is up to the caller to create an date object with * the DateFactory() function for the * given year and ask it whether or not it represents a * leap year and then display the correct list in the UI. * * - * Here is what the result would look like for a US short - * date/time format that includes the components of date, month, - * year, hour, minute, and meridiem: + * For a free-form form, the user interface must validate the + * values that the user has typed into the text field. To aid + * with this, this method returns a validation property which + * contains either a regular expression or a function. The + * regular expression tests whether or not what the user has + * entered is valid. If the validation property is set to + * a function, this function would take a single + * parameter which is the text value of the input field, and + * it returns a boolean value: true if the input is valid, + * and false otherwise. If it does not make sense for a + * particular date format component to be free-form, such + * as the "AM/PM" choice for a time, then the validation + * property will be left off. UI builders should only allow + * free-form fields for those components that have a + * "validation" property. Otherwise, use a constrained + * input form element instead.

    + * + * Some date format components do not represent values that + * a user may enter, but instead values that are calculated + * based on other date format components. For example, the + * day of the week is a + * property of a date that is calculated based on the day, + * month, and year that the user has entered. It would not + * make sense for the user to be able to choose a day of + * the week that does not correspond to the day, month, and + * year. To handle calculated + * date format components, this method returns a "value" + * property which is a function which returns + * the calculated value of the field. Its parameter is a date + * object that has been created from the other date format + * components.

    + * + * @example Here is what the result would look like for a US short + * date/time format that includes the components of day of + * the week, date, month, year, hour, minute, and meridiem: + * *

      * [
      *   {
    - *     "component": "month",
    - *     "label": "Month",
    - *     "constraint": [1, 12]
    + *     "label": "Day of Week",   // optional label
    + *     "value": function(date) { returns the calculated, localized day of week name }
      *   },
      *   {
    - *     "label": "/"
    + *     "label": " "              // fixed field (optionally displayed in the UI)
    + *   }
    + *   {
    + *     "component": "month",     // property name to use when calling DateFactory() for this field
    + *     "label": "Month",         // label describing this field
    + *     "placeholder": "DD",      // the placeholder text for this field
    + *     "constraint": [1, 12],    // constraint rules for a drop-down box for the month
    + *     "validation": "\\d{1,2}"  // validation rule for a free-form text input
    + *   },
    + *   {
    + *     "label": "/"              // fixed field (optionally displayed in the UI)
      *   },
      *   {
      *     "component": "day",
      *     "label": "Date",
    + *     "placeholder": "DD",
      *     "constraint": {
    - *       "condition": "leapyear",
    - *       "leap": {
    + *       "condition": "isLeap ", // condition to switch upon
    + *       "leap": {               // if the condition is "leap year" use these constraints
      *          "1": [1, 31],
      *          "2": [1, 29],
      *          "3": [1, 31],
    @@ -2128,14 +2185,16 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) {
      *          "11": [1, 30],
      *          "12": [1, 31]
      *       }
    - *     }
    + *     },
    + *     "validation": "\\d{1,2}"
      *   {
      *     "label": "/"
      *   },
      *   {
      *     "component": "year",
      *     "label": "Year",
    - *     "constraint": "[0-9]+"
    + *     "placeholder": "YYYY",
    + *     "validation": "[0-9]+"
      *   },
      *   {
      *     "label": " at "
    @@ -2143,7 +2202,9 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) {
      *   {
      *     "component": "hour",
      *     "label": "Hour",
    - *     "constraint": [1, 12]
    + *     "placeholder": "H",
    + *     "constraint": [1, 12],
    + *     "validation": "\\d{1,2}"
      *   },
      *   {
      *     "label": ":"
    @@ -2166,7 +2227,9 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) {
      *       "11",
      *       ...
      *       "59"
    - *     ]
    + *     ],
    + *     "placeholder": "mm",
    + *     "validation": "\\d{2}"
      *   },
      *   {
      *     "label": " "
    @@ -2174,6 +2237,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) {
      *   {
      *     "component": "meridiem",
      *     "label": "AM/PM",
    + *     "placeholder": "AM/PM",
      *     "constraint": ["AM", "PM"]
      *   }
      * ]
    @@ -2194,7 +2258,11 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) {
      *     // like "Year" and "Minute" translated to. In this example, we
      *     // are showing an input form for Dutch dates, but the labels are
      *     // written in US English.
    - *     fmt.getFormatInfo("en-US", true, ilib.bind(this, function(components) {
    + *     fmt.getFormatInfo({
    + *       locale: "en-US",
    + *       sync: true,
    + *       style: "constrained",
    + *       callback: ilib.bind(this, function(components) {
      *       // iterate through the component array and dynamically create the input
      *       // elements with the given labels
      *     }));
    @@ -2210,7 +2278,14 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) {
      * is ready
      * @returns {Array.} An array date components
      */
    -DateFmt.prototype.getFormatInfo = function(locale, sync, callback) {
    +DateFmt.prototype.getFormatInfo = function(options) {
    +    var locale, sync = true, callback;
    +
    +    if (options) {
    +        locale = options.locale;
    +        sync = !!options.sync;
    +        callback = options.callback;
    +    }
         var info;
         var loc = new Locale(this.locale);
         if (locale) {
    
    From dfdf39077c06c96358e2338daada5c21cec8bc7d Mon Sep 17 00:00:00 2001
    From: Edwin Hoogerbeets 
    Date: Tue, 8 Jan 2019 10:18:14 -0800
    Subject: [PATCH 17/38] Reworked the documentation for getFormatInfo()
    
    ---
     js/lib/DateFmt.js | 111 +++++++++++++++++++++++++++-------------------
     1 file changed, 65 insertions(+), 46 deletions(-)
    
    diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js
    index 3b58bc79bb..2293b3f709 100644
    --- a/js/lib/DateFmt.js
    +++ b/js/lib/DateFmt.js
    @@ -2025,67 +2025,86 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) {
     
     /**
      * Return information about the date format that can be used
    - * by UI builders to display a locale-sensitive set of input fields
    - * based on the current formatter's settings.

    + * by UI frameworks to display a locale-sensitive input form.

    * * The object returned by this method is an array of date * format components. Each format component is an object - * that contains properties that describe that component. + * that contains information that can be used to display + * a field in an input form. * The list of possible properties on each object are: - * + * *

      *
    • component - if this component describes a part - * of the date which can be entered by the user, the component - * property gives the name of that component. This can be used - * as a property name for the options of the DateFactory() - * function. For example, if the value of "component" is "year", + * of the date format which can be entered by the user (as opposed + * to the fixed parts which cannot), then this property gives + * the name of that component when the value is used + * with the DateFactory() function to construct an IDate instance. + * For example, if the value of "component" is "year", * then the value of the input field can be used as the "year" * property when calling DateFactory(). - *
    • label - a localized string to display for this - * component as a label. - *
    • template + *
    • label - a localized text to display for this + * component as a label. The text is localized to the given + * locale. If a locale is not given, then it uses the locale + * of the formatter. + *
    • placeholder - the localized placeholder text to + * display in a free-form, empty text input field, which gives + * the user a hint as to what to enter in that field. The text + * is localized to the given + * locale. If a locale is not given, then it uses the locale + * of the formatter. + *
    • validation - a regular expression or function + * that validates the input value of a free-form text input + * field. When the validation property is a regular expression, + * the expression matches when the value of the field is valid. + * When the validation property is a function, the function + * would take a single parameter which is the value of + * the input field. It returns a boolean value: true if the + * input is valid, and false otherwise. + *
    • constraint - a rule that describes the constraints + * on valid values for this component. This is intended to be + * used with input fields such as drop-down boxes. Constraints + * are sometimes conditional. (See the description below.) + *
    • value - a function that this the value of + * a calculated field. (See the description below.) *
    - * . The component is the name of the property to use - * when constructing a new date with DateFactory(). The label - * is intended to be shown to the user and is written in the - * given locale, or the locale of this formatter if the - * locale was not given.

    * * Field separators such as slashes or dots, etc., are given * as a object with no "component" property. They only contain * a "label" property with a string value. A user interface - * may choose to use them or omit these as needed.

    + * may choose to use these purely formatting components or ignore + * them as needed.

    * * User interfaces can construct two different types of input - * forms: a constrained form and a free-form form. In a - * constrained form, things like the month are displayed as + * forms: constrained or free-form. In a constrained form, + * components such as the month are displayed as * as a drop-down box containing a fixed list of month names. - * The user may only choose from that list. In a free-form - * form, the user is presented with text input fields in - * which they can either type whatever they want or type in - * a value from a constrained list of characters. This - * method returns info that can be used to create either - * type of form. It is up to the form element coder to - * decide which type they would like.

    + * The user may only choose from that list and it is therefore + * impossible to choose an invalid value. In a free-form + * form, the user is presented with text input fields where + * they can type whatever they want. The resulting value should + * be validated using the validation rules before submitting + * the form. The getFormatInfo + * method returns information that can be used to create either + * type of form. It is up to the caller to + * decide which type of form to present to the user.

    * - * For a constrained form, some date format components - * must conform to a - * particular pattern, range, or to a fixed list of possible - * values. These constraint rules are given in the - * "constraint" property. - * The values in the constraint property can be one of these - * types: + * For a constrained form element, the input value + * must conform to a particular pattern, range, or a fixed + * list of possible values. The rule for this is given in + * the "constraint" property. + * The values of the constraint property can be one of the + * following types: * *

      *
        array[2]<number> - an array of size 2 of numbers - * that gives the start and end of a numeric range. + * that gives the start and end of a numeric range. The input must + * be between the start and end of the range, inclusive. *
          array<object> - an array of valid string values * given as objects that have "label" and "value" properties. The * label is intended to be displayed to the user and the value * is to be used to construct the new date object when the - * user has finished - * selecting the components and the form is being evaluated or - * submitted. + * user has finished selecting the components and the form is + * being evaluated or submitted. *
            object - conditional constraints. In some cases, * the list of possible values for the months * or the days depends on which year and month is being @@ -2104,15 +2123,13 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { * each of "leap" and "regular" are * an array of strings that give the month names in a leap * year (13 months) and a regular year (12 months) respectively. - * It is up to the caller to create an date object with - * the DateFactory() function for the - * given year and ask it whether or not it represents a + * It is up to the caller to test if a particular year is a * leap year and then display the correct list in the UI. *
    * * For a free-form form, the user interface must validate the * values that the user has typed into the text field. To aid - * with this, this method returns a validation property which + * with this, this method returns a "validation" property which * contains either a regular expression or a function. The * regular expression tests whether or not what the user has * entered is valid. If the validation property is set to @@ -2140,7 +2157,9 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { * property which is a function which returns * the calculated value of the field. Its parameter is a date * object that has been created from the other date format - * components.

    + * components. Its single parameter is an object that contains + * the other date input components, similar to what you might + * pass to the DateFactory function.

    * * @example Here is what the result would look like for a US short * date/time format that includes the components of day of @@ -2157,7 +2176,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { * } * { * "component": "month", // property name to use when calling DateFactory() for this field - * "label": "Month", // label describing this field + * "label": "Month", // label describing this field, in this case translated to English/US * "placeholder": "DD", // the placeholder text for this field * "constraint": [1, 12], // constraint rules for a drop-down box for the month * "validation": "\\d{1,2}" // validation rule for a free-form text input @@ -2275,16 +2294,16 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { * fmt.getFormatInfo({ * locale: "en-US", * sync: true, - * style: "constrained", * callback: ilib.bind(this, function(components) { * // iterate through the component array and dynamically create the input - * // elements with the given labels + * // elements with the given labels and placeholders and such * })); * }) * }); * * @param {Locale|string=} locale the locale to translate the labels - * to. If not given, the locale of the formatter will be used. + * to. This is distinct from the locale of the date being entered. + * If not given, the locale of the formatter will be used. * @param {boolean=} sync true if this method should load the data * synchronously and return it immediately, false if async operation is * needed. From 8b124924a35a232e6523b0a89859aabc7a4fb5ed Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Tue, 8 Jan 2019 10:39:31 -0800 Subject: [PATCH 18/38] Update tests to use options param Also updated the jsdocs to reflect the options param. --- js/lib/DateFmt.js | 43 ++++++- js/test/date/testdatefmt.js | 240 ++++++++++++++++++------------------ 2 files changed, 161 insertions(+), 122 deletions(-) diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index 2293b3f709..2903de6daa 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -2027,11 +2027,43 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { * Return information about the date format that can be used * by UI frameworks to display a locale-sensitive input form.

    * - * The object returned by this method is an array of date + * The options parameter is an object that can contain any of + * the following properties: + * + *

      + *
    • locale - the locale to translate the labels + * to. If not given, the locale of the formatter will be used. + * The locale of the formatter specifies the format of the + * date input and which components are available and in what + * order, whereas this locale property only specifies the language + * used for the labels. + * + *
    • sync - if true, this method should load the data + * synchronously. If false, load the data asynchronously and + * call the onLoad callback function when it is done. The onLoad + * parameter must be specified in order to receive the data. + * + *
    • onLoad - a callback function to call when the data is fully + * loaded. When the onLoad option is given, this method will attempt to + * load any missing locale data using the ilib loader callback. + * When this method is done (even if the data is already preassembled), the + * onLoad function is called with the results as a parameter, so this + * callback can be used with preassembled or dynamic data loading or a + * mix of the two. + * + *
    • loadParams - an object containing parameters to pass to the + * loader callback function when locale data is missing. The parameters are not + * interpretted or modified in any way. They are simply passed along. The object + * may contain any property/value pairs as long as the calling code is in + * agreement with the loader callback function as to what those parameters mean. + *
    + * + * The results object returned by this method or passed to the onLoad + * callback is an array of date * format components. Each format component is an object * that contains information that can be used to display * a field in an input form. - * The list of possible properties on each object are: + * The list of possible properties on each component object are: * *
      *
    • component - if this component describes a part @@ -2312,12 +2344,13 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { * @returns {Array.} An array date components */ DateFmt.prototype.getFormatInfo = function(options) { - var locale, sync = true, callback; + var locale, sync = true, callback, loadParams; if (options) { locale = options.locale; sync = !!options.sync; callback = options.callback; + loadParams = options.loadParams; } var info; var loc = new Locale(this.locale); @@ -2332,8 +2365,8 @@ DateFmt.prototype.getFormatInfo = function(options) { new ResBundle({ locale: loc, name: "dateres", - sync: this.sync, - loadParams: this.loadParams, + sync: sync, + loadParams: loadParams, onLoad: ilib.bind(this, function (rb) { var info, zone = false; for (var i = 0; i < this.templateArr.length; i++) { diff --git a/js/test/date/testdatefmt.js b/js/test/date/testdatefmt.js index 606f90758d..b452aafb72 100644 --- a/js/test/date/testdatefmt.js +++ b/js/test/date/testdatefmt.js @@ -3769,58 +3769,61 @@ module.exports.testdatefmt = { }); test.ok(fmt !== null); - fmt.getFormatInfo(undefined, true, function(info) { - test.ok(info); - - test.equal(info.length, 5); - - test.equal(info[0].component, "month"); - test.equal(info[0].label, "Month"); - test.deepEqual(info[0].constraint, [1, 12]); - - test.ok(!info[1].component); - test.equal(info[1].label, "/"); - - test.equal(info[2].component, "day"); - test.equal(info[2].label, "Date"); - test.deepEqual(info[2].constraint, { - "condition": "isLeap", - "regular": { - "1": [1, 31], - "2": [1, 28], - "3": [1, 31], - "4": [1, 30], - "5": [1, 31], - "6": [1, 30], - "7": [1, 31], - "8": [1, 31], - "9": [1, 30], - "10": [1, 31], - "11": [1, 30], - "12": [1, 31] - }, - "leap": { - "1": [1, 31], - "2": [1, 29], - "3": [1, 31], - "4": [1, 30], - "5": [1, 31], - "6": [1, 30], - "7": [1, 31], - "8": [1, 31], - "9": [1, 30], - "10": [1, 31], - "11": [1, 30], - "12": [1, 31] - } - }); - - test.ok(!info[3].component); - test.equal(info[3].label, "/"); - - test.equal(info[4].component, "year"); - test.equal(info[4].label, "Year"); - test.equal(info[4].constraint, "[0-9]+"); + fmt.getFormatInfo({ + sync: true, + onLoad: function(info) { + test.ok(info); + + test.equal(info.length, 5); + + test.equal(info[0].component, "month"); + test.equal(info[0].label, "Month"); + test.deepEqual(info[0].constraint, [1, 12]); + + test.ok(!info[1].component); + test.equal(info[1].label, "/"); + + test.equal(info[2].component, "day"); + test.equal(info[2].label, "Date"); + test.deepEqual(info[2].constraint, { + "condition": "isLeap", + "regular": { + "1": [1, 31], + "2": [1, 28], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + }, + "leap": { + "1": [1, 31], + "2": [1, 29], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + } + }); + + test.ok(!info[3].component); + test.equal(info[3].label, "/"); + + test.equal(info[4].component, "year"); + test.equal(info[4].label, "Year"); + test.equal(info[4].constraint, "[0-9]+"); + } }); test.done(); @@ -3836,71 +3839,74 @@ module.exports.testdatefmt = { }); test.ok(fmt !== null); - fmt.getFormatInfo(undefined, true, function(info) { - test.ok(info); - - test.equal(info.length, 5); - - test.equal(info[0].component, "month"); - test.equal(info[0].label, "Month"); - test.deepEqual(info[0].constraint, [ - {label: "January", value: 1}, - {label: "February", value: 2}, - {label: "March", value: 3}, - {label: "April", value: 4}, - {label: "May", value: 5}, - {label: "June", value: 6}, - {label: "July", value: 7}, - {label: "August", value: 8}, - {label: "September", value: 9}, - {label: "October", value: 10}, - {label: "November", value: 11}, - {label: "December", value: 12}, - ]); - - test.ok(!info[1].component); - test.equal(info[1].label, " "); - - test.equal(info[2].component, "day"); - test.equal(info[2].label, "Date"); - test.deepEqual(info[2].constraint, { - "condition": "isLeap", - "regular": { - "1": [1, 31], - "2": [1, 28], - "3": [1, 31], - "4": [1, 30], - "5": [1, 31], - "6": [1, 30], - "7": [1, 31], - "8": [1, 31], - "9": [1, 30], - "10": [1, 31], - "11": [1, 30], - "12": [1, 31] - }, - "leap": { - "1": [1, 31], - "2": [1, 29], - "3": [1, 31], - "4": [1, 30], - "5": [1, 31], - "6": [1, 30], - "7": [1, 31], - "8": [1, 31], - "9": [1, 30], - "10": [1, 31], - "11": [1, 30], - "12": [1, 31] - } - }); - - test.ok(!info[3].component); - test.equal(info[3].label, ", "); - - test.equal(info[4].component, "year"); - test.equal(info[4].label, "Year"); - test.equal(info[4].constraint, "[0-9]+"); + fmt.getFormatInfo({ + sync: true, + onLoad: function(info) { + test.ok(info); + + test.equal(info.length, 5); + + test.equal(info[0].component, "month"); + test.equal(info[0].label, "Month"); + test.deepEqual(info[0].constraint, [ + {label: "January", value: 1}, + {label: "February", value: 2}, + {label: "March", value: 3}, + {label: "April", value: 4}, + {label: "May", value: 5}, + {label: "June", value: 6}, + {label: "July", value: 7}, + {label: "August", value: 8}, + {label: "September", value: 9}, + {label: "October", value: 10}, + {label: "November", value: 11}, + {label: "December", value: 12}, + ]); + + test.ok(!info[1].component); + test.equal(info[1].label, " "); + + test.equal(info[2].component, "day"); + test.equal(info[2].label, "Date"); + test.deepEqual(info[2].constraint, { + "condition": "isLeap", + "regular": { + "1": [1, 31], + "2": [1, 28], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + }, + "leap": { + "1": [1, 31], + "2": [1, 29], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + } + }); + + test.ok(!info[3].component); + test.equal(info[3].label, ", "); + + test.equal(info[4].component, "year"); + test.equal(info[4].label, "Year"); + test.equal(info[4].constraint, "[0-9]+"); + } }); test.done(); From ce9a22449ba7e8028fd12ca2f5759b58322e1c21 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Mon, 3 Jun 2019 23:08:15 -0700 Subject: [PATCH 19/38] Added a lot more unit tests. Things don't work yet... --- js/lib/DateFmt.js | 271 +++++-------- js/test/date/testSuiteFiles.js | 3 +- js/test/date/testdatefmt.js | 155 +------- js/test/date/testdatefmtasync.js | 124 +++++- js/test/date/testgetformatinfo.js | 612 ++++++++++++++++++++++++++++++ 5 files changed, 842 insertions(+), 323 deletions(-) create mode 100644 js/test/date/testgetformatinfo.js diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index 2903de6daa..732cd84b0b 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -1609,7 +1609,7 @@ DateFmt.prototype = { /** * @private */ -DateFmt.prototype._mapFormatInfo = function(tzinfo) { +DateFmt.prototype._mapFormatInfo = function(year, tzinfo) { function sequence(start, end, pad) { var constraint = []; for (var i = start; i <= end; i++) { @@ -1618,6 +1618,8 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return constraint; } + var isLeap = this.cal.isLeapYear(year); + return this.templateArr.map(ilib.bind(this, function(component) { switch (component) { case 'd': @@ -1626,35 +1628,18 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { label: "Date", placeholder: "D", constraint: { - "condition": "isLeap", - "regular": { - "1": [1, 31], - "2": [1, 28], - "3": [1, 31], - "4": [1, 30], - "5": [1, 31], - "6": [1, 30], - "7": [1, 31], - "8": [1, 31], - "9": [1, 30], - "10": [1, 31], - "11": [1, 30], - "12": [1, 31] - }, - "leap": { - "1": [1, 31], - "2": [1, 29], - "3": [1, 31], - "4": [1, 30], - "5": [1, 31], - "6": [1, 30], - "7": [1, 31], - "8": [1, 31], - "9": [1, 30], - "10": [1, 31], - "11": [1, 30], - "12": [1, 31] - } + "1": [1, 31], + "2": [1, isLeap ? 29 : 28], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] }, validation: "\\d{1,2}" }; @@ -1665,35 +1650,18 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { label: "Date", placeholder: "DD", constraint: { - "condition": "isLeap", - "regular": { - "1": sequence(1, 31, true), - "2": sequence(1, 28, true), - "3": sequence(1, 31, true), - "4": sequence(1, 30, true), - "5": sequence(1, 31, true), - "6": sequence(1, 30, true), - "7": sequence(1, 31, true), - "8": sequence(1, 31, true), - "9": sequence(1, 30, true), - "10": sequence(1, 31, true), - "11": sequence(1, 30, true), - "12": sequence(1, 31, true) - }, - "leap": { - "1": sequence(1, 31, true), - "2": sequence(1, 29, true), - "3": sequence(1, 31, true), - "4": sequence(1, 30, true), - "5": sequence(1, 31, true), - "6": sequence(1, 30, true), - "7": sequence(1, 31, true), - "8": sequence(1, 31, true), - "9": sequence(1, 30, true), - "10": sequence(1, 31, true), - "11": sequence(1, 30, true), - "12": sequence(1, 31, true) - } + "1": sequence(1, 31, true), + "2": sequence(1, isLeap ? 29 : 28, true), + "3": sequence(1, 31, true), + "4": sequence(1, 30, true), + "5": sequence(1, 31, true), + "6": sequence(1, 30, true), + "7": sequence(1, 31, true), + "8": sequence(1, 31, true), + "9": sequence(1, 30, true), + "10": sequence(1, 31, true), + "11": sequence(1, 30, true), + "12": sequence(1, 31, true) }, validation: "\\d{1,2}" }; @@ -1872,27 +1840,18 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "month", label: "Month", - constraint: { - "constraint": "isLeap", - "leap": (function() { - var ret = []; - var months = this.cal.getNumMonths(undefined, true); - for (var i = 1; i < months; i++) { - var key = component + i; - ret.push((this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key))); - } - return ret; - })(), - "regular": (function() { - var ret = []; - var months = this.cal.getNumMonths(undefined, false); - for (var i = 1; i < months; i++) { - var key = component + i; - ret.push((this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key))); - } - return ret; - })() - } + constraint: (function() { + var ret = []; + var months = this.cal.getNumMonths(year); + for (var i = 1; i < months; i++) { + var key = component + i; + ret.push({ + label: this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key), + value: i + }); + } + return ret; + })() }; case 'E': @@ -1906,16 +1865,14 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { return { component: "dayofweek", label: "Day of Week", - constraint: (function() { - var ret = []; - var months = this.cal.getNumMonths(undefined, true); - for (var i = 0; i < 7; i++) { - key = component + i; - //console.log("finding " + key + " in the resources"); - ret.push((this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key))); + constraint: ilib.bind(this, function(date) { + var d = date.getJSDate(); + var key = component.replace(/c/g, 'E') + d.getDay(); + if (this.calName !== "gregorian") { + key += '-' + this.calName; } - return ret; - })() + return this.sysres.getString(undefined, key); + }) }; break; @@ -2038,6 +1995,13 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { * order, whereas this locale property only specifies the language * used for the labels. * + *
    • year - the year for which the formats are being sought. + * For some calendars such as the Hebrew calendar, the number of + * and the length of the months depends upon the year. Even in the + * Gregorian calendar, the length of February changes in leap + * years, though the number of months or their names do not + * change. If not specified, the default is the current year. + * *
    • sync - if true, this method should load the data * synchronously. If false, load the data asynchronously and * call the onLoad callback function when it is done. The onLoad @@ -2056,7 +2020,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { * interpretted or modified in any way. They are simply passed along. The object * may contain any property/value pairs as long as the calling code is in * agreement with the loader callback function as to what those parameters mean. - * + * * * The results object returned by this method or passed to the onLoad * callback is an array of date @@ -2094,8 +2058,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { * input is valid, and false otherwise. *
    • constraint - a rule that describes the constraints * on valid values for this component. This is intended to be - * used with input fields such as drop-down boxes. Constraints - * are sometimes conditional. (See the description below.) + * used with input fields such as drop-down boxes. *
    • value - a function that this the value of * a calculated field. (See the description below.) * @@ -2131,32 +2094,17 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { *
        array[2]<number> - an array of size 2 of numbers * that gives the start and end of a numeric range. The input must * be between the start and end of the range, inclusive. + *
          array[2]<string> - an array of strings gives + * the exact range of values possible for this field. The input must + * be one of these values. This is mainly intended for use in + * drop-down boxes. The value of the chosen element is the value + * that should be returned for the field. *
            array<object> - an array of valid string values * given as objects that have "label" and "value" properties. The * label is intended to be displayed to the user and the value * is to be used to construct the new date object when the * user has finished selecting the components and the form is * being evaluated or submitted. - *
              object - conditional constraints. In some cases, - * the list of possible values for the months - * or the days depends on which year and month is being - * displayed. When this happens, the "constraint" property is - * given as an object that gives the different sets of values - * depending on a condition. The name of the condition is - * given in the "condition" property of this object. - * For example, the list of month - * names in a Hebrew calendar depends on whether or not the - * year is a leap year. In leap years, there are 13 months, - * and in regular years, there are 12 months. The "constraint" - * property for Hebrew calendars is returned as an object - * that contains three properties, "condition", "leap", - * and "regular". The "condition" property is set to "isLeap" - * (ie. whether or not it is a leap year), and - * each of "leap" and "regular" are - * an array of strings that give the month names in a leap - * year (13 months) and a regular year (12 months) respectively. - * It is up to the caller to test if a particular year is a - * leap year and then display the correct list in the UI. * * * For a free-form form, the user interface must validate the @@ -2170,8 +2118,9 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { * it returns a boolean value: true if the input is valid, * and false otherwise. If it does not make sense for a * particular date format component to be free-form, such - * as the "AM/PM" choice for a time, then the validation - * property will be left off. UI builders should only allow + * as the "AM/PM" choice for a meridiem, then the validation + * property will be left off. Only the given choices are + * valid. UI builders should only allow * free-form fields for those components that have a * "validation" property. Otherwise, use a constrained * input form element instead.

              @@ -2179,12 +2128,11 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { * Some date format components do not represent values that * a user may enter, but instead values that are calculated * based on other date format components. For example, the - * day of the week is a - * property of a date that is calculated based on the day, - * month, and year that the user has entered. It would not + * day of the week is a property that is calculated based + * on the date the user has entered. It would not * make sense for the user to be able to choose a day of * the week that does not correspond to the day, month, and - * year. To handle calculated + * year they have already chosen. To handle calculated * date format components, this method returns a "value" * property which is a function which returns * the calculated value of the field. Its parameter is a date @@ -2194,8 +2142,8 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) { * pass to the DateFactory function.

              * * @example Here is what the result would look like for a US short - * date/time format that includes the components of day of - * the week, date, month, year, hour, minute, and meridiem: + * date/time format for a leap year. This includes the components + * of day of the week, date, month, year, hour, minute, and meridiem: * *

                * [
              @@ -2205,11 +2153,11 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) {
                *   },
                *   {
                *     "label": " "              // fixed field (optionally displayed in the UI)
              - *   }
              + *   },
                *   {
                *     "component": "month",     // property name to use when calling DateFactory() for this field
                *     "label": "Month",         // label describing this field, in this case translated to English/US
              - *     "placeholder": "DD",      // the placeholder text for this field
              + *     "placeholder": "M",       // the placeholder text for this field
                *     "constraint": [1, 12],    // constraint rules for a drop-down box for the month
                *     "validation": "\\d{1,2}"  // validation rule for a free-form text input
                *   },
              @@ -2221,37 +2169,22 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) {
                *     "label": "Date",
                *     "placeholder": "DD",
                *     "constraint": {
              - *       "condition": "isLeap ", // condition to switch upon
              - *       "leap": {               // if the condition is "leap year" use these constraints
              - *          "1": [1, 31],
              - *          "2": [1, 29],
              - *          "3": [1, 31],
              - *          "4": [1, 30],
              - *          "5": [1, 31],
              - *          "6": [1, 30],
              - *          "7": [1, 31],
              - *          "8": [1, 31],
              - *          "9": [1, 30],
              - *          "10": [1, 31],
              - *          "11": [1, 30],
              - *          "12": [1, 31]
              - *       },
              - *       "regular": {
              - *          "1": [1, 31],
              - *          "2": [1, 28],
              - *          "3": [1, 31],
              - *          "4": [1, 30],
              - *          "5": [1, 31],
              - *          "6": [1, 30],
              - *          "7": [1, 31],
              - *          "8": [1, 31],
              - *          "9": [1, 30],
              - *          "10": [1, 31],
              - *          "11": [1, 30],
              - *          "12": [1, 31]
              - *       }
              + *       // if the given years is a leap year use these constraints
              + *       "1": [1, 31],
              + *       "2": [1, 29],
              + *       "3": [1, 31],
              + *       "4": [1, 30],
              + *       "5": [1, 31],
              + *       "6": [1, 30],
              + *       "7": [1, 31],
              + *       "8": [1, 31],
              + *       "9": [1, 30],
              + *       "10": [1, 31],
              + *       "11": [1, 30],
              + *       "12": [1, 31]
                *     },
                *     "validation": "\\d{1,2}"
              + *   },
                *   {
                *     "label": "/"
                *   },
              @@ -2278,7 +2211,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) {
                *     "component": "minute",
                *     "label": "Minute",
                *     "constraint": [
              - *       "00",
              + *       "00",                   // note that these are strings so that they can be zero-padded
                *       "01",
                *       "02",
                *       "03",
              @@ -2318,6 +2251,7 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) {
                * // would like the user to enter.
                * new DateFmt({
                *   locale: 'nl-NL', // for dates in the Netherlands
              + *   year: 2019,
                *   onLoad: ilib.bind(this, function(fmt) {
                *     // The following is the locale of the UI you would like to see the labels
                *     // like "Year" and "Minute" translated to. In this example, we
              @@ -2327,30 +2261,26 @@ DateFmt.prototype._mapFormatInfo = function(tzinfo) {
                *       locale: "en-US",
                *       sync: true,
                *       callback: ilib.bind(this, function(components) {
              - *       // iterate through the component array and dynamically create the input
              - *       // elements with the given labels and placeholders and such
              + *       // here you should iterate through the component array and dynamically create the input
              + *       // elements with the given labels and placeholders and such, and install
              + *       // the appropriate validators
                *     }));
                *   })
                * });
                *
              - * @param {Locale|string=} locale the locale to translate the labels
              - * to. This is distinct from the locale of the date being entered.
              - * If not given, the locale of the formatter will be used.
              - * @param {boolean=} sync true if this method should load the data
              - * synchronously and return it immediately, false if async operation is
              - * needed.
              - * @param {Function=} callback a callback to call when the data
              - * is ready
              - * @returns {Array.} An array date components
              + * @param {Object} options option to control this function. (See the description
              + * above.)
              + * @returns {Array.} An array of date components
                */
               DateFmt.prototype.getFormatInfo = function(options) {
              -    var locale, sync = true, callback, loadParams;
              +    var locale, sync = true, callback, loadParams, year;
               
                   if (options) {
                       locale = options.locale;
                       sync = !!options.sync;
              -        callback = options.callback;
              +        callback = options.onLoad;
                       loadParams = options.loadParams;
              +        year = options.year;
                   }
                   var info;
                   var loc = new Locale(this.locale);
              @@ -2362,6 +2292,13 @@ DateFmt.prototype.getFormatInfo = function(options) {
                       loc.spec = undefined;
                   }
               
              +    if (!year) {
              +        var now = DateFactory({
              +            type: this.calName
              +        });
              +        year = now.getYear();
              +    }
              +
                   new ResBundle({
                       locale: loc,
                       name: "dateres",
              @@ -2388,13 +2325,13 @@ DateFmt.prototype.getFormatInfo = function(options) {
                                   set.add("Etc/GMT-13");
                                   set.add("Etc/GMT-14");
               
              -                    info = this._mapFormatInfo(set.asArray().sort());
              +                    info = this._mapFormatInfo(year, set.asArray().sort());
                                   if (callback && typeof(callback) === "function") {
                                       callback(info);
                                   }
                               }));
                           } else {
              -                info = this._mapFormatInfo();
              +                info = this._mapFormatInfo(year);
                               if (callback && typeof(callback) === "function") {
                                   callback(info);
                               }
              diff --git a/js/test/date/testSuiteFiles.js b/js/test/date/testSuiteFiles.js
              index ded0c6b62c..560c1493c0 100644
              --- a/js/test/date/testSuiteFiles.js
              +++ b/js/test/date/testSuiteFiles.js
              @@ -1,7 +1,7 @@
               /*
                * testSuiteFiles.js - list the test files in this directory
                * 
              - * Copyright © 2017-2018, JEDLSoft
              + * Copyright © 2017-2019, JEDLSoft
                *
                * Licensed under the Apache License, Version 2.0 (the "License");
                * you may not use this file except in compliance with the License.
              @@ -18,6 +18,7 @@
                */
               
               module.exports.files = [
              +    "testgetformatinfo.js",
                   "testclock.js",
                   "testcalendar.js",
                   "testdate.js",
              diff --git a/js/test/date/testdatefmt.js b/js/test/date/testdatefmt.js
              index 8bff287b9f..bf8bc2f2bf 100644
              --- a/js/test/date/testdatefmt.js
              +++ b/js/test/date/testdatefmt.js
              @@ -1,7 +1,7 @@
               /*
                * testdatefmt.js - test the date formatter object
                *
              - * Copyright © 2012-2015,2017, JEDLSoft
              + * Copyright © 2012-2015,2017,2019 JEDLSoft
                *
                * Licensed under the Apache License, Version 2.0 (the "License");
                * you may not use this file except in compliance with the License.
              @@ -3756,159 +3756,6 @@ module.exports.testdatefmt = {
                       test.ok(fmt !== null);
               
                       test.equal(fmt.getDateComponentOrder(), "ydm");
              -        test.done();
              -    },
              -
              -    testDateFmtGetFormatInfoUSShort: function(test) {
              -        test.expect(16);
              -
              -        var fmt = new DateFmt({
              -            locale: "en-US",
              -            type: "date",
              -            date: "short"
              -        });
              -        test.ok(fmt !== null);
              -
              -        fmt.getFormatInfo({
              -            sync: true,
              -            onLoad: function(info) {
              -                test.ok(info);
              -
              -                test.equal(info.length, 5);
              -
              -                test.equal(info[0].component, "month");
              -                test.equal(info[0].label, "Month");
              -                test.deepEqual(info[0].constraint, [1, 12]);
              -
              -                test.ok(!info[1].component);
              -                test.equal(info[1].label, "/");
              -
              -                test.equal(info[2].component, "day");
              -                test.equal(info[2].label, "Date");
              -                test.deepEqual(info[2].constraint, {
              -                    "condition": "isLeap",
              -                    "regular": {
              -                        "1": [1, 31],
              -                        "2": [1, 28],
              -                        "3": [1, 31],
              -                        "4": [1, 30],
              -                        "5": [1, 31],
              -                        "6": [1, 30],
              -                        "7": [1, 31],
              -                        "8": [1, 31],
              -                        "9": [1, 30],
              -                        "10": [1, 31],
              -                        "11": [1, 30],
              -                        "12": [1, 31]
              -                    },
              -                    "leap": {
              -                        "1": [1, 31],
              -                        "2": [1, 29],
              -                        "3": [1, 31],
              -                        "4": [1, 30],
              -                        "5": [1, 31],
              -                        "6": [1, 30],
              -                        "7": [1, 31],
              -                        "8": [1, 31],
              -                        "9": [1, 30],
              -                        "10": [1, 31],
              -                        "11": [1, 30],
              -                        "12": [1, 31]
              -                    }
              -                });
              -
              -                test.ok(!info[3].component);
              -                test.equal(info[3].label, "/");
              -
              -                test.equal(info[4].component, "year");
              -                test.equal(info[4].label, "Year");
              -                test.equal(info[4].constraint, "[0-9]+");
              -            }
              -        });
              -
              -        test.done();
              -    },
              -
              -    testDateFmtGetFormatInfoUSFull: function(test) {
              -        test.expect(16);
              -
              -        var fmt = new DateFmt({
              -            locale: "en-US",
              -            type: "date",
              -            date: "full"
              -        });
              -        test.ok(fmt !== null);
              -
              -        fmt.getFormatInfo({
              -            sync: true,
              -            onLoad: function(info) {
              -                test.ok(info);
              -
              -                test.equal(info.length, 5);
              -
              -                test.equal(info[0].component, "month");
              -                test.equal(info[0].label, "Month");
              -                test.deepEqual(info[0].constraint, [
              -                    {label: "January", value: 1},
              -                    {label: "February", value: 2},
              -                    {label: "March", value: 3},
              -                    {label: "April", value: 4},
              -                    {label: "May", value: 5},
              -                    {label: "June", value: 6},
              -                    {label: "July", value: 7},
              -                    {label: "August", value: 8},
              -                    {label: "September", value: 9},
              -                    {label: "October", value: 10},
              -                    {label: "November", value: 11},
              -                    {label: "December", value: 12},
              -                ]);
              -
              -                test.ok(!info[1].component);
              -                test.equal(info[1].label, " ");
              -
              -                test.equal(info[2].component, "day");
              -                test.equal(info[2].label, "Date");
              -                test.deepEqual(info[2].constraint, {
              -                    "condition": "isLeap",
              -                    "regular": {
              -                        "1": [1, 31],
              -                        "2": [1, 28],
              -                        "3": [1, 31],
              -                        "4": [1, 30],
              -                        "5": [1, 31],
              -                        "6": [1, 30],
              -                        "7": [1, 31],
              -                        "8": [1, 31],
              -                        "9": [1, 30],
              -                        "10": [1, 31],
              -                        "11": [1, 30],
              -                        "12": [1, 31]
              -                    },
              -                    "leap": {
              -                        "1": [1, 31],
              -                        "2": [1, 29],
              -                        "3": [1, 31],
              -                        "4": [1, 30],
              -                        "5": [1, 31],
              -                        "6": [1, 30],
              -                        "7": [1, 31],
              -                        "8": [1, 31],
              -                        "9": [1, 30],
              -                        "10": [1, 31],
              -                        "11": [1, 30],
              -                        "12": [1, 31]
              -                    }
              -                });
              -
              -                test.ok(!info[3].component);
              -                test.equal(info[3].label, ", ");
              -
              -                test.equal(info[4].component, "year");
              -                test.equal(info[4].label, "Year");
              -                test.equal(info[4].constraint, "[0-9]+");
              -            }
              -        });
              -
                       test.done();
                   }
               };
              diff --git a/js/test/date/testdatefmtasync.js b/js/test/date/testdatefmtasync.js
              index 64ef4682ed..c7a1f61a3f 100644
              --- a/js/test/date/testdatefmtasync.js
              +++ b/js/test/date/testdatefmtasync.js
              @@ -304,5 +304,127 @@ module.exports.testdatefmtasync = {
               
                           }
                       });
              -    }
              +    },
              +    
              +    testDateFmtGetFormatInfoUSShortAsync: function(test) {
              +        test.expect(16);
              +
              +        var fmt = new DateFmt({
              +            locale: "en-US",
              +            type: "date",
              +            date: "short"
              +        });
              +        test.ok(fmt !== null);
              +
              +        fmt.getFormatInfo({
              +            sync: false,
              +            year: 2019,
              +            onLoad: function(info) {
              +                test.ok(info);
              +
              +                test.equal(info.length, 5);
              +
              +                test.equal(info[0].component, "month");
              +                test.equal(info[0].label, "Month");
              +                test.deepEqual(info[0].constraint, [1, 12]);
              +
              +                test.ok(!info[1].component);
              +                test.equal(info[1].label, "/");
              +
              +                test.equal(info[2].component, "day");
              +                test.equal(info[2].label, "Date");
              +                test.deepEqual(info[2].constraint, {
              +                    "1": [1, 31],
              +                    "2": [1, 28],
              +                    "3": [1, 31],
              +                    "4": [1, 30],
              +                    "5": [1, 31],
              +                    "6": [1, 30],
              +                    "7": [1, 31],
              +                    "8": [1, 31],
              +                    "9": [1, 30],
              +                    "10": [1, 31],
              +                    "11": [1, 30],
              +                    "12": [1, 31]
              +                });
              +
              +                test.ok(!info[3].component);
              +                test.equal(info[3].label, "/");
              +
              +                test.equal(info[4].component, "year");
              +                test.equal(info[4].label, "Year");
              +                test.equal(info[4].constraint, "[0-9]{2}");
              +                test.done();
              +            }
              +        });
              +
              +    },
              +    
              +    testDateFmtGetFormatInfoGregorianTranslatedAsync: function(test) {
              +        test.expect(16);
              +
              +        var fmt = new DateFmt({
              +            locale: "en-US",
              +            type: "date",
              +            date: "full"
              +        });
              +        test.ok(fmt !== null);
              +
              +        fmt.getFormatInfo({
              +            locale: "de-DE",
              +            year: 2019,
              +            sync: false,
              +            onLoad: function(info) {
              +                test.ok(info);
              +
              +                test.equal(info.length, 5);
              +
              +                test.equal(info[0].component, "month");
              +                test.equal(info[0].label, "Monat");
              +                test.deepEqual(info[0].constraint, [
              +                    {label: "Januar", value: 1},
              +                    {label: "Februar", value: 2},
              +                    {label: "März", value: 3},
              +                    {label: "April", value: 4},
              +                    {label: "Mai", value: 5},
              +                    {label: "Juni", value: 6},
              +                    {label: "Juli", value: 7},
              +                    {label: "August", value: 8},
              +                    {label: "September", value: 9},
              +                    {label: "Oktober", value: 10},
              +                    {label: "November", value: 11},
              +                    {label: "Dezember", value: 12},
              +                ]);
              +
              +                test.ok(!info[1].component);
              +                test.equal(info[1].label, " ");
              +
              +                test.equal(info[2].component, "day");
              +                test.equal(info[2].label, "Datum");
              +                test.deepEqual(info[2].constraint, {
              +                    "1": [1, 31],
              +                    "2": [1, 28],
              +                    "3": [1, 31],
              +                    "4": [1, 30],
              +                    "5": [1, 31],
              +                    "6": [1, 30],
              +                    "7": [1, 31],
              +                    "8": [1, 31],
              +                    "9": [1, 30],
              +                    "10": [1, 31],
              +                    "11": [1, 30],
              +                    "12": [1, 31]
              +                });
              +
              +                test.ok(!info[3].component);
              +                test.equal(info[3].label, ", ");
              +
              +                test.equal(info[4].component, "year");
              +                test.equal(info[4].label, "Jahr");
              +                test.equal(info[4].constraint, "[0-9]+");
              +                test.done();
              +            }
              +        });
              +
              +    },
               };
              \ No newline at end of file
              diff --git a/js/test/date/testgetformatinfo.js b/js/test/date/testgetformatinfo.js
              new file mode 100644
              index 0000000000..2120e1a40a
              --- /dev/null
              +++ b/js/test/date/testgetformatinfo.js
              @@ -0,0 +1,612 @@
              +/*
              + * testgetformatinfo.js - test the date formatter object's 
              + * getFormatInfo call
              + *
              + * Copyright © 2019 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(ilib) === "undefined") {
              +    var ilib = require("../../lib/ilib.js");
              +}
              +if (typeof(DateFmt) === "undefined") {
              +    var DateFmt = require("../../lib/DateFmt.js");
              +}
              +
              +module.exports.testdategetformatinfo = {
              +    setUp: function(callback) {
              +        ilib.clearCache();
              +        callback();
              +    },
              +
              +    testDateFmtGetFormatInfoUSShort: function(test) {
              +        test.expect(16);
              +
              +        var fmt = new DateFmt({
              +            locale: "en-US",
              +            type: "date",
              +            date: "short"
              +        });
              +        test.ok(fmt !== null);
              +
              +        fmt.getFormatInfo({
              +            sync: true,
              +            year: 2019, // non leap year
              +            onLoad: function(info) {
              +                test.ok(info);
              +
              +                test.equal(info.length, 5);
              +
              +                test.equal(info[0].component, "month");
              +                test.equal(info[0].label, "Month");
              +                test.deepEqual(info[0].constraint, [1, 12]);
              +
              +                test.ok(!info[1].component);
              +                test.equal(info[1].label, "/");
              +
              +                test.equal(info[2].component, "day");
              +                test.equal(info[2].label, "Date");
              +                test.deepEqual(info[2].constraint, {
              +                    "1": [1, 31],
              +                    "2": [1, 28],
              +                    "3": [1, 31],
              +                    "4": [1, 30],
              +                    "5": [1, 31],
              +                    "6": [1, 30],
              +                    "7": [1, 31],
              +                    "8": [1, 31],
              +                    "9": [1, 30],
              +                    "10": [1, 31],
              +                    "11": [1, 30],
              +                    "12": [1, 31]
              +                });
              +
              +                test.ok(!info[3].component);
              +                test.equal(info[3].label, "/");
              +
              +                test.equal(info[4].component, "year");
              +                test.equal(info[4].label, "Year");
              +                test.equal(info[4].constraint, "[0-9]{2}");
              +            }
              +        });
              +
              +        test.done();
              +    },
              +
              +    testDateFmtGetFormatInfoUSShortLeapYear: function(test) {
              +        test.expect(16);
              +
              +        var fmt = new DateFmt({
              +            locale: "en-US",
              +            type: "date",
              +            date: "short"
              +        });
              +        test.ok(fmt !== null);
              +
              +        fmt.getFormatInfo({
              +            sync: true,
              +            year: 2020, // leap year
              +            onLoad: function(info) {
              +                test.ok(info);
              +
              +                test.equal(info.length, 5);
              +
              +                test.equal(info[0].component, "month");
              +                test.equal(info[0].label, "Month");
              +                test.deepEqual(info[0].constraint, [1, 12]);
              +
              +                test.ok(!info[1].component);
              +                test.equal(info[1].label, "/");
              +
              +                test.equal(info[2].component, "day");
              +                test.equal(info[2].label, "Date");
              +                test.deepEqual(info[2].constraint, {
              +                    "1": [1, 31],
              +                    "2": [1, 29],
              +                    "3": [1, 31],
              +                    "4": [1, 30],
              +                    "5": [1, 31],
              +                    "6": [1, 30],
              +                    "7": [1, 31],
              +                    "8": [1, 31],
              +                    "9": [1, 30],
              +                    "10": [1, 31],
              +                    "11": [1, 30],
              +                    "12": [1, 31]
              +                });
              +
              +                test.ok(!info[3].component);
              +                test.equal(info[3].label, "/");
              +
              +                test.equal(info[4].component, "year");
              +                test.equal(info[4].label, "Year");
              +                test.equal(info[4].constraint, "[0-9]{2}");
              +            }
              +        });
              +
              +        test.done();
              +    },
              +
              +    testDateFmtGetFormatInfoUSFull: function(test) {
              +        test.expect(16);
              +
              +        var fmt = new DateFmt({
              +            locale: "en-US",
              +            type: "date",
              +            date: "full"
              +        });
              +        test.ok(fmt !== null);
              +
              +        fmt.getFormatInfo({
              +            sync: true,
              +            year: 2019,
              +            onLoad: function(info) {
              +                test.ok(info);
              +
              +                test.equal(info.length, 5);
              +
              +                test.equal(info[0].component, "month");
              +                test.equal(info[0].label, "Month");
              +                test.deepEqual(info[0].constraint, [
              +                    {label: "January", value: 1},
              +                    {label: "February", value: 2},
              +                    {label: "March", value: 3},
              +                    {label: "April", value: 4},
              +                    {label: "May", value: 5},
              +                    {label: "June", value: 6},
              +                    {label: "July", value: 7},
              +                    {label: "August", value: 8},
              +                    {label: "September", value: 9},
              +                    {label: "October", value: 10},
              +                    {label: "November", value: 11},
              +                    {label: "December", value: 12},
              +                ]);
              +
              +                test.ok(!info[1].component);
              +                test.equal(info[1].label, " ");
              +
              +                test.equal(info[2].component, "day");
              +                test.equal(info[2].label, "Date");
              +                test.deepEqual(info[2].constraint, {
              +                    "1": [1, 31],
              +                    "2": [1, 28],
              +                    "3": [1, 31],
              +                    "4": [1, 30],
              +                    "5": [1, 31],
              +                    "6": [1, 30],
              +                    "7": [1, 31],
              +                    "8": [1, 31],
              +                    "9": [1, 30],
              +                    "10": [1, 31],
              +                    "11": [1, 30],
              +                    "12": [1, 31]
              +                });
              +
              +                test.ok(!info[3].component);
              +                test.equal(info[3].label, ", ");
              +
              +                test.equal(info[4].component, "year");
              +                test.equal(info[4].label, "Year");
              +                test.equal(info[4].constraint, "[0-9]+");
              +            }
              +        });
              +
              +        test.done();
              +    },
              +
              +    testDateFmtGetFormatInfoGregorianTranslated: function(test) {
              +        test.expect(16);
              +
              +        var fmt = new DateFmt({
              +            locale: "en-US",
              +            type: "date",
              +            date: "full"
              +        });
              +        test.ok(fmt !== null);
              +
              +        fmt.getFormatInfo({
              +            locale: "de-DE",
              +            year: 2019,
              +            sync: true,
              +            onLoad: function(info) {
              +                test.ok(info);
              +
              +                test.equal(info.length, 5);
              +
              +                test.equal(info[0].component, "month");
              +                test.equal(info[0].label, "Monat");
              +                test.deepEqual(info[0].constraint, [
              +                    {label: "Januar", value: 1},
              +                    {label: "Februar", value: 2},
              +                    {label: "März", value: 3},
              +                    {label: "April", value: 4},
              +                    {label: "Mai", value: 5},
              +                    {label: "Juni", value: 6},
              +                    {label: "Juli", value: 7},
              +                    {label: "August", value: 8},
              +                    {label: "September", value: 9},
              +                    {label: "Oktober", value: 10},
              +                    {label: "November", value: 11},
              +                    {label: "Dezember", value: 12},
              +                ]);
              +
              +                test.ok(!info[1].component);
              +                test.equal(info[1].label, " ");
              +
              +                test.equal(info[2].component, "day");
              +                test.equal(info[2].label, "Tag");
              +                test.deepEqual(info[2].constraint, {
              +                    "1": [1, 31],
              +                    "2": [1, 28],
              +                    "3": [1, 31],
              +                    "4": [1, 30],
              +                    "5": [1, 31],
              +                    "6": [1, 30],
              +                    "7": [1, 31],
              +                    "8": [1, 31],
              +                    "9": [1, 30],
              +                    "10": [1, 31],
              +                    "11": [1, 30],
              +                    "12": [1, 31]
              +                });
              +
              +                test.ok(!info[3].component);
              +                test.equal(info[3].label, ", ");
              +
              +                test.equal(info[4].component, "year");
              +                test.equal(info[4].label, "Jahr");
              +                test.equal(info[4].constraint, "[0-9]+");
              +            }
              +        });
              +
              +        test.done();
              +    },
              +    
              +    testDateFmtGetFormatInfoUSShortAllFields: function(test) {
              +        test.expect(16);
              +
              +        var fmt = new DateFmt({
              +            locale: "en-US",
              +            type: "datetime",
              +            date: "short",
              +            date: "wmdy",
              +            time: "ahmsz"
              +        });
              +        test.ok(fmt !== null);
              +
              +        fmt.getFormatInfo({
              +            sync: true,
              +            year: 2019, // non leap year
              +            onLoad: function(info) {
              +                test.ok(info);
              +
              +                test.equal(info.length, 15);
              +
              +                test.equal(info[0].label, "Day of Week"),
              +                test.equal(typeof(info[0].value), "function");
              +
              +                test.ok(!info[1].component);
              +                test.equal(info[1].label, " ");
              +
              +                test.equal(info[2].component, "month");
              +                test.equal(info[2].label, "Month");
              +                test.deepEqual(info[2].constraint, [1, 12]);
              +
              +                test.ok(!info[3].component);
              +                test.equal(info[3].label, "/");
              +
              +                test.equal(info[4].component, "day");
              +                test.equal(info[4].label, "Date");
              +                test.deepEqual(info[4].constraint, {
              +                    "1": [1, 31],
              +                    "2": [1, 28],
              +                    "3": [1, 31],
              +                    "4": [1, 30],
              +                    "5": [1, 31],
              +                    "6": [1, 30],
              +                    "7": [1, 31],
              +                    "8": [1, 31],
              +                    "9": [1, 30],
              +                    "10": [1, 31],
              +                    "11": [1, 30],
              +                    "12": [1, 31]
              +                });
              +
              +                test.ok(!info[5].component);
              +                test.equal(info[5].label, "/");
              +
              +                test.equal(info[6].component, "year");
              +                test.equal(info[6].label, "Year");
              +                test.equal(info[6].constraint, "[0-9]{2}");
              +
              +                test.ok(!info[7].component);
              +                test.equal(info[7].label, " at ");
              +
              +                test.equal(info[8].component, "hour");
              +                test.equal(info[8].label, "Hour");
              +                test.equal(info[8].placeholder, "H");
              +                test.deepEqual(info[8].constraint, [1, 12]);
              +                test.equal(info[8].validation, "\\d{1,2}");
              +
              +                test.ok(!info[9].component);
              +                test.equal(info[9].label, ":");
              +
              +                test.equal(info[10].component, "minute");
              +                test.equal(info[10].label, "Minute");
              +                test.equal(info[10].placeholder, "mm");
              +                for (var i = 0; i < 60; i++) {
              +                    test.equal(Number(info[10].constraint[i]), i);
              +                }
              +                test.equal(info[10].validation, "\\d{2}");
              +
              +                test.ok(!info[11].component);
              +                test.equal(info[11].label, ":");
              +
              +                test.equal(info[12].component, "second");
              +                test.equal(info[12].label, "Second");
              +                test.equal(info[12].placeholder, "ss");
              +                for (var i = 0; i < 60; i++) {
              +                    test.equal(Number(info[12].constraint[i]), i);
              +                }
              +                test.equal(info[12].validation, "\\d{2}");
              +
              +                test.ok(!info[13].component);
              +                test.equal(info[13].label, " ");
              +
              +                test.equal(info[14].component, "meridiem");
              +                test.equal(info[14].label, "AM/PM");
              +                test.equal(info[14].placeholder, "AM/PM");
              +                test.deepEqual(info[14].constraint, ["AM", "PM"]);
              +            }
              +        });
              +
              +        test.done();
              +    },
              +
              +    testDateFmtGetFormatInfoDayOfWeekCalculator: function(test) {
              +        test.expect(16);
              +
              +        var fmt = new DateFmt({
              +            locale: "en-US",
              +            type: "datetime",
              +            date: "short",
              +            date: "wmdy",
              +        });
              +        test.ok(fmt !== null);
              +
              +        fmt.getFormatInfo({
              +            sync: true,
              +            year: 2019, // non leap year
              +            onLoad: function(info) {
              +                test.ok(info);
              +
              +                test.equal(info[0].label, "Day of Week"),
              +                test.equal(typeof(info[0].value), "function");
              +
              +                test.equal(info[0].value(new Date(2019, 5, 3)), "Monday");
              +                test.equal(info[0].value(new Date(2019, 7, 23)), "Friday");
              +            }
              +        });
              +
              +        test.done();
              +    },
              +
              +
              +    testDateFmtGetFormatInfoHebrewCalendarNonLeap: function(test) {
              +        test.expect(16);
              +
              +        var fmt = new DateFmt({
              +            locale: "en-US",
              +            type: "date",
              +            date: "full",
              +            calendar: "hebrew"
              +        });
              +        test.ok(fmt !== null);
              +
              +        fmt.getFormatInfo({
              +            sync: true,
              +            year: 5780, // non leap year
              +            onLoad: function(info) {
              +                test.ok(info);
              +
              +                test.equal(info.length, 5);
              +
              +                test.equal(info[0].component, "month");
              +                test.equal(info[0].label, "Month");
              +                test.deepEqual(info[0].constraint, [
              +                    {label: "Nisan", value: 1},
              +                    {label: "Iyyar", value: 2},
              +                    {label: "Sivan", value: 3},
              +                    {label: "Tammuz", value: 4},
              +                    {label: "Av", value: 5},
              +                    {label: "Elul", value: 6},
              +                    {label: "Tishri", value: 7},
              +                    {label: "Ḥeshvan", value: 8},
              +                    {label: "Kislev", value: 9},
              +                    {label: "Teveth", value: 10},
              +                    {label: "Shevat", value: 11},
              +                    {label: "Adar", value: 12},
              +                ]);
              +
              +                test.ok(!info[1].component);
              +                test.equal(info[1].label, " ");
              +
              +                test.equal(info[2].component, "day");
              +                test.equal(info[2].label, "Date");
              +                test.deepEqual(info[2].constraint, {
              +                    "1": [1, 30],
              +                    "2": [1, 29],
              +                    "3": [1, 30],
              +                    "4": [1, 29],
              +                    "5": [1, 30],
              +                    "6": [1, 29],
              +                    "7": [1, 30],
              +                    "8": [1, 30],
              +                    "9": [1, 30],
              +                    "10": [1, 29],
              +                    "11": [1, 30],
              +                    "12": [1, 30]
              +                });
              +
              +                test.ok(!info[3].component);
              +                test.equal(info[3].label, ", ");
              +
              +                test.equal(info[4].component, "year");
              +                test.equal(info[4].label, "Year");
              +                test.equal(info[4].constraint, "[0-9]+");
              +            }
              +        });
              +
              +        test.done();
              +    },
              +
              +    testDateFmtGetFormatInfoHebrewCalendarLeap: function(test) {
              +        test.expect(16);
              +
              +        var fmt = new DateFmt({
              +            locale: "en-US",
              +            type: "date",
              +            date: "full",
              +            calendar: "hebrew"
              +        });
              +        test.ok(fmt !== null);
              +
              +        fmt.getFormatInfo({
              +            sync: true,
              +            year: 5779, // leap year
              +            onLoad: function(info) {
              +                test.ok(info);
              +
              +                test.equal(info.length, 5);
              +
              +                test.equal(info[0].component, "month");
              +                test.equal(info[0].label, "Month");
              +                test.deepEqual(info[0].constraint, [
              +                    {label: "Nisan", value: 1},
              +                    {label: "Iyyar", value: 2},
              +                    {label: "Sivan", value: 3},
              +                    {label: "Tammuz", value: 4},
              +                    {label: "Av", value: 5},
              +                    {label: "Elul", value: 6},
              +                    {label: "Tishri", value: 7},
              +                    {label: "Ḥeshvan", value: 8},
              +                    {label: "Kislev", value: 9},
              +                    {label: "Teveth", value: 10},
              +                    {label: "Shevat", value: 11},
              +                    {label: "Adar I", value: 12},
              +                    {label: "Adar II", value: 13},
              +                ]);
              +
              +                test.ok(!info[1].component);
              +                test.equal(info[1].label, " ");
              +
              +                test.equal(info[2].component, "day");
              +                test.equal(info[2].label, "Date");
              +                test.deepEqual(info[2].constraint, {
              +                    "1": [1, 30],
              +                    "2": [1, 29],
              +                    "3": [1, 30],
              +                    "4": [1, 29],
              +                    "5": [1, 30],
              +                    "6": [1, 29],
              +                    "7": [1, 30],
              +                    "8": [1, 30],
              +                    "9": [1, 30],
              +                    "10": [1, 29],
              +                    "11": [1, 30],
              +                    "12": [1, 30],
              +                    "13": [1, 29]
              +                });
              +
              +                test.ok(!info[3].component);
              +                test.equal(info[3].label, ", ");
              +
              +                test.equal(info[4].component, "year");
              +                test.equal(info[4].label, "Year");
              +                test.equal(info[4].constraint, "[0-9]+");
              +            }
              +        });
              +
              +        test.done();
              +    },
              +    
              +    testDateFmtGetFormatInfoHebrewCalendarInHebrew: function(test) {
              +        test.expect(16);
              +
              +        var fmt = new DateFmt({
              +            locale: "he-IL",
              +            type: "date",
              +            date: "full",
              +            calendar: "hebrew"
              +        });
              +        test.ok(fmt !== null);
              +
              +        fmt.getFormatInfo({
              +            sync: true,
              +            year: 5780, // non leap year
              +            onLoad: function(info) {
              +                test.ok(info);
              +
              +                test.equal(info.length, 5);
              +
              +                test.equal(info[0].component, "month");
              +                test.equal(info[0].label, "חודש");
              +                test.deepEqual(info[0].constraint, [
              +                    {label: "Nisan", value: 1},
              +                    {label: "Iyyar", value: 2},
              +                    {label: "Sivan", value: 3},
              +                    {label: "Tammuz", value: 4},
              +                    {label: "Av", value: 5},
              +                    {label: "Elul", value: 6},
              +                    {label: "Tishri", value: 7},
              +                    {label: "Ḥeshvan", value: 8},
              +                    {label: "Kislev", value: 9},
              +                    {label: "Teveth", value: 10},
              +                    {label: "Shevat", value: 11},
              +                    {label: "Adar", value: 12},
              +                ]);
              +
              +                test.ok(!info[1].component);
              +                test.equal(info[1].label, " ");
              +
              +                test.equal(info[2].component, "day");
              +                test.equal(info[2].label, "אשר");
              +                test.deepEqual(info[2].constraint, {
              +                    "1": [1, 30],
              +                    "2": [1, 29],
              +                    "3": [1, 30],
              +                    "4": [1, 29],
              +                    "5": [1, 30],
              +                    "6": [1, 29],
              +                    "7": [1, 30],
              +                    "8": [1, 30],
              +                    "9": [1, 30],
              +                    "10": [1, 29],
              +                    "11": [1, 30],
              +                    "12": [1, 30]
              +                });
              +
              +                test.ok(!info[3].component);
              +                test.equal(info[3].label, ", ");
              +
              +                test.equal(info[4].component, "year");
              +                test.equal(info[4].label, "שנה");
              +                test.equal(info[4].constraint, "[0-9]+");
              +            }
              +        });
              +
              +        test.done();
              +    }
              +};
              
              From f6097266918b9fcfe75e9bc5591beae5cdc185b9 Mon Sep 17 00:00:00 2001
              From: Edwin Hoogerbeets 
              Date: Tue, 4 Jun 2019 11:37:59 -0700
              Subject: [PATCH 20/38] Resourcified all strings that the user will see
              
              ---
               js/lib/DateFmt.js | 118 +++++++++++++++++++++++++---------------------
               1 file changed, 63 insertions(+), 55 deletions(-)
              
              diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js
              index 732cd84b0b..e5bb694473 100644
              --- a/js/lib/DateFmt.js
              +++ b/js/lib/DateFmt.js
              @@ -1609,7 +1609,7 @@ DateFmt.prototype = {
               /**
                * @private
                */
              -DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
              +DateFmt.prototype._mapFormatInfo = function(year, rb, tzinfo) {
                   function sequence(start, end, pad) {
                       var constraint = [];
                       for (var i = start; i <= end; i++) {
              @@ -1619,14 +1619,23 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                   }
               
                   var isLeap = this.cal.isLeapYear(year);
              +    var dateStr = rb.getStringJS("Date"); // i18n: date input form label for the day of the month field
              +    var yearStr = rb.getStringJS("Year"); // i18n: date input form label for the year field
              +    var monthStr = rb.getStringJS("Month"); // i18n: date input form label for the months field
              +    var hourStr = rb.getStringJS("Hour"); // i18n: date input form label for the hours field
              +    var minuteStr = rb.getStringJS("Minute"); // i18n: date input form label for the minutes field
              +    var secondStr = rb.getStringJS("Second"); // i18n: date input form label for the seconds field
              +    var milliStr = rb.getStringJS("Millisecond"); // i18n: date input form label for the milliseconds field
              +    var woyStr = rb.getStringJS("Week of Year"); // i18n: date input form label for a week of the year field
              +    var doyStr = rb.getStringJS("Day of Year"); // i18n: date input form label for the day of the year field
               
                   return this.templateArr.map(ilib.bind(this, function(component) {
                       switch (component) {
                           case 'd':
                               return {
                                   component: "day",
              -                    label: "Date",
              -                    placeholder: "D",
              +                    label: dateStr,
              +                    placeholder: rb.getStringJS("D"), // i18n: date format placeholder string for 1 digit date
                                   constraint: {
                                       "1": [1, 31],
                                       "2": [1, isLeap ? 29 : 28],
              @@ -1647,8 +1656,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'dd':
                               return {
                                   component: "day",
              -                    label: "Date",
              -                    placeholder: "DD",
              +                    label: dateStr,
              +                    placeholder: rb.getStringJS("DD"), // i18n: date format placeholder string for 2 digit date
                                   constraint: {
                                       "1": sequence(1, 31, true),
                                       "2": sequence(1, isLeap ? 29 : 28, true),
              @@ -1669,8 +1678,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'yy':
                               return {
                                   component: "year",
              -                    label: "Year",
              -                    placeholder: "YY",
              +                    label: yearStr,
              +                    placeholder: rb.getStringJS("YY"), // i18n: date format placeholder string for 2 digit year
                                   constraint: "[0-9]{2}",
                                   validation: "\\d{2}"
                               };
              @@ -1678,8 +1687,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'yyyy':
                               return {
                                   component: "year",
              -                    label: "Year",
              -                    placeholder: "YYYY",
              +                    label: yearStr,
              +                    placeholder: rb.getStringJS("YYYY"), // i18n: date format placeholder string for 4 digit year
                                   constraint: "[0-9]{4}",
                                   validation: "\\d{4}"
                               };
              @@ -1687,8 +1696,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'M':
                               return {
                                   component: "month",
              -                    label: "Month",
              -                    placeholder: "M",
              +                    label: monthStr,
              +                    placeholder: rb.getStringJS("M"), // i18n: date format placeholder string for 1 digit month
                                   constraint: [1, 12],
                                   validation: "\\d{1,2}"
                               };
              @@ -1696,8 +1705,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'MM':
                               return {
                                   component: "month",
              -                    label: "Month",
              -                    placeholder: "MM",
              +                    label: monthStr,
              +                    placeholder: rb.getStringJS("MM"), // i18n: date format placeholder string for 2 digit month
                                   constraint: "[0-9]+",
                                   validation: "\\d{2}"
                               };
              @@ -1705,8 +1714,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'h':
                               return {
                                   component: "hour",
              -                    label: "Hour",
              -                    placeholder: "H",
              +                    label: hourStr,
              +                    placeholder: rb.getStringJS("H"), // i18n: date format placeholder string for 1 digit hour
                                   constraint: ["12"].concat(sequence(1, 11)),
                                   validation: "\\d{1,2}"
                               };
              @@ -1714,8 +1723,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'hh':
                               return {
                                   component: "hour",
              -                    label: "Hour",
              -                    placeholder: "HH",
              +                    label: hourStr,
              +                    placeholder: rb.getStringJS("HH"), // i18n: date format placeholder string for 2 digit hour,
                                   constraint: ["12"].concat(sequence(1, 11, true)),
                                   validation: "\\d{2}"
                               };
              @@ -1724,8 +1733,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'K':
                               return {
                                   component: "hour",
              -                    label: "Hour",
              -                    placeholder: "H",
              +                    label: hourStr,
              +                    placeholder: rb.getStringJS("H"), // i18n: date format placeholder string for 1 digit hour
                                   constraint: concat(sequence(0, 11)),
                                   validation: "\\d{1,2}"
                               };
              @@ -1733,8 +1742,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'KK':
                               return {
                                   component: "hour",
              -                    label: "Hour",
              -                    placeholder: "HH",
              +                    label: hourStr,
              +                    placeholder: rb.getStringJS("HH"), // i18n: date format placeholder string for 2 digit hour,
                                   constraint: concat(sequence(0, 11, true)),
                                   validation: "\\d{2}"
                               };
              @@ -1742,8 +1751,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'H':
                               return {
                                   component: "hour",
              -                    label: "Hour",
              -                    placeholder: "H",
              +                    label: hourStr,
              +                    placeholder: rb.getStringJS("H"), // i18n: date format placeholder string for 1 digit hour
                                   constraint: [0, 23],
                                   validation: "\\d{1,2}"
                               };
              @@ -1751,8 +1760,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'HH':
                               return {
                                   component: "hour",
              -                    label: "Hour",
              -                    placeholder: "H",
              +                    label: hourStr,
              +                    placeholder: rb.getStringJS("HH"), // i18n: date format placeholder string for 2 digit hour
                                   constraint: concat(sequence(0, 23, true)),
                                   validation: "\\d{1,2}"
                               };
              @@ -1760,8 +1769,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'k':
                               return {
                                   component: "hour",
              -                    label: "Hour",
              -                    placeholder: "H",
              +                    label: hourStr,
              +                    placeholder: rb.getStringJS("H"), // i18n: date format placeholder string for 1 digit hour
                                   constraint: ["24"].concat(sequence(0, 23)),
                                   validation: "\\d{1,2}"
                               };
              @@ -1769,8 +1778,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'kk':
                               return {
                                   component: "hour",
              -                    label: "Hour",
              -                    placeholder: "H",
              +                    label: hourStr,
              +                    placeholder: rb.getStringJS("H"), // i18n: date format placeholder string for 1 digit hour
                                   constraint: ["24"].concat(sequence(0, 23, true)),
                                   validation: "\\d{1,2}"
                               };
              @@ -1778,8 +1787,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'm':
                               return {
                                   component: "minute",
              -                    label: "Minute",
              -                    placeholder: "mm",
              +                    label: minuteStr,
              +                    placeholder: rb.getStringJS("mm"), // i18n: date format placeholder string for 2 digit minute
                                   constraint: [0, 59],
                                   validation: "\\d{1,2}"
                               };
              @@ -1787,8 +1796,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'mm':
                               return {
                                   component: "minute",
              -                    label: "Minute",
              -                    placeholder: "mm",
              +                    label: minuteStr,
              +                    placeholder: rb.getStringJS("mm"), // i18n: date format placeholder string for 2 digit minute
                                   constraint: sequence(0, 59, true),
                                   validation: "\\d{2}"
                               };
              @@ -1796,8 +1805,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 's':
                               return {
                                   component: "second",
              -                    label: "Second",
              -                    placeholder: "ss",
              +                    label: secondStr,
              +                    placeholder: rb.getStringJS("ss"), // i18n: date format placeholder string for 2 digit second
                                   constraint: [0, 59],
                                   validation: "\\d{1,2}"
                               };
              @@ -1805,8 +1814,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'ss':
                               return {
                                   component: "second",
              -                    label: "Second",
              -                    placeholder: "ss",
              +                    label: secondStr,
              +                    placeholder: rb.getStringJS("ss"), // i18n: date format placeholder string for 2 digit second
                                   constraint: sequence(0, 59, true),
                                   validation: "\\d{2}"
                               };
              @@ -1814,8 +1823,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'S':
                               return {
                                   component: "millisecond",
              -                    label: "Millisecond",
              -                    placeholder: "ms",
              +                    label: milliStr,
              +                    placeholder: rb.getStringJS("ms"), // i18n: date format placeholder string for 2 digit millisecond
                                   constraint: [0, 999],
                                   validation: "\\d{1,3}"
                               };
              @@ -1823,8 +1832,8 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'SSS':
                               return {
                                   component: "millisecond",
              -                    label: "Millisecond",
              -                    placeholder: "ms",
              +                    label: milliStr,
              +                    placeholder: rb.getStringJS("ms"), // i18n: date format placeholder string for 2 digit millisecond
                                   constraint: sequence(0, 999, true),
                                   validation: "\\d{3}"
                               };
              @@ -1839,7 +1848,7 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'LLLL':
                               return {
                                   component: "month",
              -                    label: "Month",
              +                    label: monthStr,
                                   constraint: (function() {
                                       var ret = [];
                                       var months = this.cal.getNumMonths(year);
              @@ -1864,7 +1873,7 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'cccc':
                               return {
                                   component: "dayofweek",
              -                    label: "Day of Week",
              +                    label: rb.getStringJS("Day of Week"), // i18n: date input form label for the day of the week field
                                   constraint: ilib.bind(this, function(date) {
                                       var d = date.getJSDate();
                                       var key = component.replace(/c/g, 'E') + d.getDay();
              @@ -1879,8 +1888,7 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'a':
                               var ret = {
                                   component: "meridiem",
              -                    label: "AM/PM",
              -                    placeholder: "AM/PM",
              +                    label: rb.getStringJS("AM/PM"), // i18n: date input form label for the meridiem field
                                   constraint: []
                               };
                               switch (this.meridiems) {
              @@ -1905,7 +1913,7 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
               
                           case 'w':
                               return {
              -                    label: "Week of Year",
              +                    label: woyStr,
                                   value: function(date) {
                                       return date.getDayOfYear();
                                   }
              @@ -1913,7 +1921,7 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
               
                           case 'ww':
                               return {
              -                    label: "Week of Year",
              +                    label: woyStr,
                                   value: function(date) {
                                       var temp = date.getWeekOfYear();
                                       return JSUtils.pad(temp, 2)
              @@ -1922,7 +1930,7 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
               
                           case 'D':
                               return {
              -                    label: "Day of Year",
              +                    label: doyStr,
                                   value: function(date) {
                                       return date.getDayOfYear();
                                   }
              @@ -1930,7 +1938,7 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
               
                           case 'DD':
                               return {
              -                    label: "Day of Year",
              +                    label: doyStr,
                                   value: function(date) {
                                       var temp = date.getDayOfYear();
                                       return JSUtils.pad(temp, 2)
              @@ -1939,7 +1947,7 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
               
                           case 'DDD':
                               return {
              -                    label: "Day of Year",
              +                    label: doyStr,
                                   value: function(date) {
                                       var temp = date.getDayOfYear();
                                       return JSUtils.pad(temp, 3)
              @@ -1948,7 +1956,7 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
               
                           case 'W':
                               return {
              -                    label: "Week of Month",
              +                    label: rb.getStringJS("Week of Month"), // i18n: date input form label for the week of the month field
                                   value: function(date) {
                                       return date.getWeekOfMonth();
                                   }
              @@ -1957,7 +1965,7 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'G':
                               var ret = {
                                   component: "era",
              -                    label: "Era",
              +                    label: rb.getString("Era"), // i18n: date input form label for the era field
                                   constraint: []
                               };
                               ret.constraint.push(this.sysres.getString(undefined, "G0-" + this.calName) || this.sysres.getString(undefined, "G0"));
              @@ -1968,7 +1976,7 @@ DateFmt.prototype._mapFormatInfo = function(year, tzinfo) {
                           case 'Z': // RFC 822 time zone
                               return {
                                   component: "timezone",
              -                    label: "Time Zone",
              +                    label: rb.getString("Time Zone"), // i18n: date input form label for the time zone field
                                   constraint: tzinfo
                               };
               
              @@ -2325,13 +2333,13 @@ DateFmt.prototype.getFormatInfo = function(options) {
                                   set.add("Etc/GMT-13");
                                   set.add("Etc/GMT-14");
               
              -                    info = this._mapFormatInfo(year, set.asArray().sort());
              +                    info = this._mapFormatInfo(year, rb, set.asArray().sort());
                                   if (callback && typeof(callback) === "function") {
                                       callback(info);
                                   }
                               }));
                           } else {
              -                info = this._mapFormatInfo(year);
              +                info = this._mapFormatInfo(year, rb);
                               if (callback && typeof(callback) === "function") {
                                   callback(info);
                               }
              
              From 39a9bdce16eecb21a982f5c807790dc343a26d23 Mon Sep 17 00:00:00 2001
              From: Edwin Hoogerbeets 
              Date: Thu, 6 Jun 2019 22:30:52 -0700
              Subject: [PATCH 21/38] Update CLDR tools to generate the dateres.json files
              
              ---
               tools/cldr/datefmts.js     | 56 +++++++++++++++++++++++++++++++++++---
               tools/cldr/gendatefmts2.js | 51 +++++++++++++++++++++++++++++-----
               2 files changed, 96 insertions(+), 11 deletions(-)
              
              diff --git a/tools/cldr/datefmts.js b/tools/cldr/datefmts.js
              index c35062e5f5..8becc5642e 100644
              --- a/tools/cldr/datefmts.js
              +++ b/tools/cldr/datefmts.js
              @@ -1617,6 +1617,7 @@ module.exports = {
               
                       return formats;
                   },
              +
                   createDurationResourceDetail: function (cldrUnitData, durationObject, length, language, script) {
                       var durationSysres = {};
                       var durationSysresTest = {};
              @@ -1655,6 +1656,7 @@ module.exports = {
               
                       return durationSysres;
                   },
              +
                   createDurationResources: function (cldrData, language, script) {
                       var durationObject = {
                           "durationPropertiesFull" : {
              @@ -1857,6 +1859,7 @@ module.exports = {
                       }
                       return mergedSysres;
                   },
              +
                   createRelativeFormatDetail: function (cldrDateFieldsData, relativeObject, relation, length, language, script) {
                       var relativeSysres = {};
                       var dataLength = "";
              @@ -2041,7 +2044,7 @@ module.exports = {
                           // already the minimum, so we don't need to do anything
                           return;
                       }
              -        
              +
                       console.log("Promoting " + totals[0].name + "/" + filename + " to " + parentName + "\n");
                       // promote a child as the new root, dropping the current root
                       group.data = group[totals[0].name].data;
              @@ -2049,8 +2052,8 @@ module.exports = {
               
                   pruneFormatsChild: function(parent, child) {
                       console.log(".");
              -        
              -        // first recursively prune all the grandchildren before pruning the child or else the child 
              +
              +        // first recursively prune all the grandchildren before pruning the child or else the child
                       // will be too sparse to prune the grandchildren
                       for (var localebit in child) {
                           if (localebit !== "und" && localebit !== "data") {
              @@ -2099,7 +2102,7 @@ module.exports = {
                       // don't write out empty files!
                       if (contents !== "{}") {
                           console.log(localeComponents.join("-") + " ");
              -            
              +
                           makeDirs(dir);
                           fs.writeFileSync(filename, JSON.stringify(group.data, undefined, 4), 'utf8');
                       }
              @@ -2109,5 +2112,50 @@ module.exports = {
                               module.exports.writeFormats(outputDir, outfile, group[comp], localeComponents.concat([comp]));
                           }
                       }
              +    },
              +
              +    createRootDisplayNames: function() {
              +        return {
              +            "AM/PM": "AM/PM",
              +            "Day": "Day",
              +            "Day of Year": "Day Of Year",
              +            "Era": "Era",
              +            "Hour": "Hour",
              +            "Minute": "Minute",
              +            "Month": "Month",
              +            "Second": "Second",
              +            "Time Zone": "Time Zone",
              +            "Week": "Week",
              +            "Week of Month": "Week Of Month",
              +            "Year": "Year"
              +        };
              +    },
              +
              +    createDisplayNames: function(cldrData, language, script) {
              +        var formats = {};
              +        var fieldNames = {
              +            "dayperiod": "AM/PM",
              +            "day": "Day",
              +            "dayOfYear": "Day of Year",
              +            "era": "Era",
              +            "hour": "Hour",
              +            "minute": "Minute",
              +            "month": "Month",
              +            "second": "Second",
              +            "zone": "Time Zone",
              +            "week": "Week",
              +            "weekOfMonth": "Week of Month",
              +            "year": "Year"
              +        };
              +
              +        for (var dateField in fieldNames) {
              +            if (typeof(cldrData[dateField]) !== 'undefined' && cldrData[dateField].displayName) {
              +                if (fieldNames[dateField] !== cldrData[dateField].displayName) {
              +                    formats[fieldNames[dateField]] = cldrData[dateField].displayName;
              +                }
              +            }
              +        }
              +
              +        return formats;
                   }
               };
              diff --git a/tools/cldr/gendatefmts2.js b/tools/cldr/gendatefmts2.js
              index e982615718..a3bc87d75d 100644
              --- a/tools/cldr/gendatefmts2.js
              +++ b/tools/cldr/gendatefmts2.js
              @@ -56,7 +56,7 @@ var hardCodeData = {
               var aux = require("./datefmts.js");
               
               function usage() {
              -    console.log("Usage: gendatefmts [-h] [ locale_data_dir ]\n" +
              +    console.log("Usage: gendatefmts2 [-h] [ locale_data_dir ]\n" +
                       "Generate date formats information files.\n" +
                       "-h or --help\n" +
                       "  this help\n" +
              @@ -93,21 +93,25 @@ function anyProperties(data) {
                   return false;
               }
               
              -function writeSystemResources(language, script, region, data) {
              -    var path = calcLocalePath(language, script, region, "");
              +function writeResources(language, script, region, filename, data) {
              +    var locpath = calcLocalePath(language, script, region, "");
                   // if (data && data.generated) {
                   if (anyProperties(data)) {
              -        console.log("Writing " + path + "\n");
              -        makeDirs(path);
              -        fs.writeFileSync(path + "/sysres.json", JSON.stringify(data, true, 4), "utf-8");
              +        console.log("Writing " + locpath + "\n");
              +        makeDirs(locpath);
              +        fs.writeFileSync(path.join(locpath, filename), JSON.stringify(data, true, 4), "utf-8");
                   } else {
              -        console.log("Skipping empty " + path + "\n");
              +        console.log("Skipping empty " + locpath + "\n");
                   }
                   // } else {
                   // console.log("Skipping existing " + path + "\n");
                   // }
               }
               
              +function writeSystemResources(language, script, region, data) {
              +    writeResources(language, script, region, "sysres.json", data);
              +}
              +
               var localeDirName;
               var tmpDirName = "./tmp";
               process.argv.forEach(function (val, index, array) {
              @@ -141,11 +145,14 @@ console.log("Reading existing locale data ...");
               
               var dateFormats = {};
               var systemResources = {};
              +var displayNames = {};
               
               console.log("dateformats.json: ");
               aux.walkLocaleDir(dateFormats, /dateformats\.json$/, localeDirName, "");
               console.log("sysres.json: ");
               aux.walkLocaleDir(systemResources, /sysres\.json$/, localeDirName, "");
              +console.log("dateres.json:");
              +displayNames.data = aux.createRootDisplayNames();
               
               console.log("\nMerging formats forward ...");
               
              @@ -263,6 +270,11 @@ list.forEach(function (file) {
                   group = aux.getFormatGroup(systemResources, localeComponents);
                   group.data = merge(group.data || {}, newFormats);
               
              +    // Date/Time display names
              +    newFormats = aux.createDisplayNames(dateFields.main[file].dates.fields, language, script, region);
              +    group = aux.getFormatGroup(displayNames, localeComponents);
              +    group.data = merge(group.data || {}, newFormats);
              +
                   // separator
                   seperator = require(path.join(sourceDir, "listPatterns.json"));
                   newFormats = aux.createSeperatorResources(seperator.main[file].listPatterns, language);
              @@ -351,4 +363,29 @@ writeSystemResources(undefined, undefined, undefined, systemResources.data);
               //aux.writeFormats(localeDirName, "sysres.json", systemResources, []);
               console.log("\n");
               
              +mergeAndPrune(displayNames);
              +for (language in displayNames) {
              +    if (language && displayNames[language] && language !== 'data' && language !== 'merged') {
              +        for (var subpart in displayNames[language]) {
              +            if (subpart && displayNames[language][subpart] && subpart !== 'data' && subpart !== 'merged') {
              +                if (Locale.isScriptCode(subpart)) {
              +                    script = subpart;
              +                    for (region in displayNames[language][script]) {
              +                        if (region && displayNames[language][script][region] && region !== 'data' && region !== 'merged') {
              +                            writeResources(language, script, region, "dateres.json", displayNames[language][script][region].data);
              +                        }
              +                    }
              +                    writeResources(language, script, undefined, "dateres.json", displayNames[language][script].data);
              +                } else {
              +                    writeResources(language, undefined, subpart, "dateres.json", displayNames[language][subpart].data);
              +                }
              +            }
              +        }
              +        writeResources(language, undefined, undefined, "dateres.json", displayNames[language].data);
              +    }
              +}
              +writeResources(undefined, undefined, undefined, "dateres.json", displayNames.data);
              +
              +console.log("\n");
              +
               console.log("Done.");
              
              From 111222cea7201438709d81e8d2e12005e26f8a3f Mon Sep 17 00:00:00 2001
              From: Edwin Hoogerbeets 
              Date: Thu, 6 Jun 2019 22:31:41 -0700
              Subject: [PATCH 22/38] Add the dateres.json files
              
              Generated from the cldr 34 data.
              ---
               js/data/locale/af/dateres.json       | 14 ++++++++++++++
               js/data/locale/agq/dateres.json      | 12 ++++++++++++
               js/data/locale/ak/dateres.json       | 12 ++++++++++++
               js/data/locale/am/dateres.json       | 14 ++++++++++++++
               js/data/locale/ar/dateres.json       | 14 ++++++++++++++
               js/data/locale/as/dateres.json       | 14 ++++++++++++++
               js/data/locale/asa/dateres.json      | 12 ++++++++++++
               js/data/locale/ast/dateres.json      | 12 ++++++++++++
               js/data/locale/az/Cyrl/dateres.json  |  6 ++++++
               js/data/locale/az/dateres.json       | 12 ++++++++++++
               js/data/locale/bas/dateres.json      | 12 ++++++++++++
               js/data/locale/be/dateres.json       | 13 +++++++++++++
               js/data/locale/bem/dateres.json      | 12 ++++++++++++
               js/data/locale/bez/dateres.json      | 12 ++++++++++++
               js/data/locale/bg/dateres.json       | 14 ++++++++++++++
               js/data/locale/bm/dateres.json       | 12 ++++++++++++
               js/data/locale/bn/dateres.json       | 13 +++++++++++++
               js/data/locale/bo/dateres.json       | 10 ++++++++++
               js/data/locale/br/dateres.json       | 12 ++++++++++++
               js/data/locale/brx/dateres.json      | 12 ++++++++++++
               js/data/locale/bs/Cyrl/dateres.json  | 14 ++++++++++++++
               js/data/locale/bs/dateres.json       | 14 ++++++++++++++
               js/data/locale/ca/dateres.json       | 14 ++++++++++++++
               js/data/locale/ccp/dateres.json      | 11 +++++++++++
               js/data/locale/ce/dateres.json       | 14 ++++++++++++++
               js/data/locale/cgg/dateres.json      | 12 ++++++++++++
               js/data/locale/chr/dateres.json      | 14 ++++++++++++++
               js/data/locale/ckb/dateres.json      |  4 ++++
               js/data/locale/cs/dateres.json       | 14 ++++++++++++++
               js/data/locale/cu/dateres.json       |  4 ++++
               js/data/locale/cy/dateres.json       | 13 +++++++++++++
               js/data/locale/da/dateres.json       | 13 +++++++++++++
               js/data/locale/dateres.json          | 15 ++++++++++++++-
               js/data/locale/dav/dateres.json      | 12 ++++++++++++
               js/data/locale/de/dateres.json       | 13 +++++++++++++
               js/data/locale/dje/dateres.json      | 12 ++++++++++++
               js/data/locale/dsb/dateres.json      | 12 ++++++++++++
               js/data/locale/dua/dateres.json      | 12 ++++++++++++
               js/data/locale/dyo/dateres.json      |  9 +++++++++
               js/data/locale/dz/dateres.json       | 12 ++++++++++++
               js/data/locale/ebu/dateres.json      | 12 ++++++++++++
               js/data/locale/ee/dateres.json       | 12 ++++++++++++
               js/data/locale/el/dateres.json       | 14 ++++++++++++++
               js/data/locale/en/dateres.json       | 13 +++++++++++++
               js/data/locale/eo/dateres.json       |  4 ++++
               js/data/locale/es/DO/dateres.json    |  8 ++++++++
               js/data/locale/es/dateres.json       | 14 ++++++++++++++
               js/data/locale/et/dateres.json       | 14 ++++++++++++++
               js/data/locale/eu/dateres.json       | 13 +++++++++++++
               js/data/locale/ewo/dateres.json      | 12 ++++++++++++
               js/data/locale/fa/dateres.json       | 14 ++++++++++++++
               js/data/locale/ff/dateres.json       | 12 ++++++++++++
               js/data/locale/fi/dateres.json       | 14 ++++++++++++++
               js/data/locale/fil/dateres.json      | 13 +++++++++++++
               js/data/locale/fo/dateres.json       | 13 +++++++++++++
               js/data/locale/fr/CA/dateres.json    |  4 ++++
               js/data/locale/fr/dateres.json       | 14 ++++++++++++++
               js/data/locale/fur/dateres.json      | 12 ++++++++++++
               js/data/locale/fy/dateres.json       | 11 +++++++++++
               js/data/locale/ga/dateres.json       | 14 ++++++++++++++
               js/data/locale/gd/dateres.json       | 14 ++++++++++++++
               js/data/locale/gl/dateres.json       | 14 ++++++++++++++
               js/data/locale/gsw/dateres.json      | 12 ++++++++++++
               js/data/locale/gu/dateres.json       | 13 +++++++++++++
               js/data/locale/guz/dateres.json      | 12 ++++++++++++
               js/data/locale/gv/dateres.json       |  4 ++++
               js/data/locale/ha/dateres.json       | 12 ++++++++++++
               js/data/locale/haw/dateres.json      |  4 ++++
               js/data/locale/he/dateres.json       | 14 ++++++++++++++
               js/data/locale/hi/dateres.json       | 14 ++++++++++++++
               js/data/locale/hr/dateres.json       | 13 +++++++++++++
               js/data/locale/hsb/dateres.json      | 12 ++++++++++++
               js/data/locale/hu/dateres.json       | 14 ++++++++++++++
               js/data/locale/hy/dateres.json       | 14 ++++++++++++++
               js/data/locale/ia/dateres.json       | 13 +++++++++++++
               js/data/locale/id/dateres.json       | 13 +++++++++++++
               js/data/locale/ig/dateres.json       | 12 ++++++++++++
               js/data/locale/ii/dateres.json       | 12 ++++++++++++
               js/data/locale/is/dateres.json       | 14 ++++++++++++++
               js/data/locale/it/dateres.json       | 13 +++++++++++++
               js/data/locale/ja/dateres.json       | 14 ++++++++++++++
               js/data/locale/jgo/dateres.json      |  4 ++++
               js/data/locale/jmc/dateres.json      | 12 ++++++++++++
               js/data/locale/jv/dateres.json       | 12 ++++++++++++
               js/data/locale/ka/dateres.json       | 14 ++++++++++++++
               js/data/locale/kab/dateres.json      | 12 ++++++++++++
               js/data/locale/kam/dateres.json      | 12 ++++++++++++
               js/data/locale/kde/dateres.json      | 12 ++++++++++++
               js/data/locale/kea/dateres.json      | 11 +++++++++++
               js/data/locale/khq/dateres.json      | 12 ++++++++++++
               js/data/locale/ki/dateres.json       | 12 ++++++++++++
               js/data/locale/kk/dateres.json       | 14 ++++++++++++++
               js/data/locale/kkj/dateres.json      |  4 ++++
               js/data/locale/kl/dateres.json       |  4 ++++
               js/data/locale/kln/dateres.json      | 12 ++++++++++++
               js/data/locale/km/dateres.json       | 14 ++++++++++++++
               js/data/locale/kn/dateres.json       | 13 +++++++++++++
               js/data/locale/ko/dateres.json       | 14 ++++++++++++++
               js/data/locale/kok/dateres.json      | 14 ++++++++++++++
               js/data/locale/ks/dateres.json       | 12 ++++++++++++
               js/data/locale/ksb/dateres.json      | 12 ++++++++++++
               js/data/locale/ksf/dateres.json      | 12 ++++++++++++
               js/data/locale/ksh/dateres.json      | 12 ++++++++++++
               js/data/locale/ku/dateres.json       | 12 ++++++++++++
               js/data/locale/kw/dateres.json       |  4 ++++
               js/data/locale/ky/dateres.json       | 14 ++++++++++++++
               js/data/locale/lag/dateres.json      | 12 ++++++++++++
               js/data/locale/lb/dateres.json       | 12 ++++++++++++
               js/data/locale/lg/dateres.json       | 11 +++++++++++
               js/data/locale/lkt/dateres.json      | 11 +++++++++++
               js/data/locale/ln/dateres.json       | 12 ++++++++++++
               js/data/locale/lo/dateres.json       | 14 ++++++++++++++
               js/data/locale/lrc/dateres.json      | 12 ++++++++++++
               js/data/locale/lt/dateres.json       | 14 ++++++++++++++
               js/data/locale/lu/dateres.json       | 12 ++++++++++++
               js/data/locale/luo/dateres.json      | 12 ++++++++++++
               js/data/locale/luy/dateres.json      | 12 ++++++++++++
               js/data/locale/lv/dateres.json       | 14 ++++++++++++++
               js/data/locale/mas/dateres.json      | 12 ++++++++++++
               js/data/locale/mer/dateres.json      | 12 ++++++++++++
               js/data/locale/mfe/dateres.json      | 12 ++++++++++++
               js/data/locale/mg/dateres.json       | 10 ++++++++++
               js/data/locale/mgh/dateres.json      | 12 ++++++++++++
               js/data/locale/mgo/dateres.json      |  8 ++++++++
               js/data/locale/mi/dateres.json       | 11 +++++++++++
               js/data/locale/mk/dateres.json       | 14 ++++++++++++++
               js/data/locale/ml/dateres.json       | 13 +++++++++++++
               js/data/locale/mn/dateres.json       | 14 ++++++++++++++
               js/data/locale/mr/dateres.json       | 14 ++++++++++++++
               js/data/locale/ms/dateres.json       | 12 ++++++++++++
               js/data/locale/mt/dateres.json       | 12 ++++++++++++
               js/data/locale/mua/dateres.json      | 12 ++++++++++++
               js/data/locale/my/dateres.json       | 14 ++++++++++++++
               js/data/locale/mzn/dateres.json      | 12 ++++++++++++
               js/data/locale/naq/dateres.json      | 12 ++++++++++++
               js/data/locale/nb/dateres.json       | 14 ++++++++++++++
               js/data/locale/nd/dateres.json       | 11 +++++++++++
               js/data/locale/nds/dateres.json      |  4 ++++
               js/data/locale/ne/dateres.json       | 14 ++++++++++++++
               js/data/locale/nl/dateres.json       | 14 ++++++++++++++
               js/data/locale/nmg/dateres.json      | 12 ++++++++++++
               js/data/locale/nn/dateres.json       | 14 ++++++++++++++
               js/data/locale/nnh/dateres.json      |  8 ++++++++
               js/data/locale/nus/dateres.json      | 12 ++++++++++++
               js/data/locale/nyn/dateres.json      | 12 ++++++++++++
               js/data/locale/om/dateres.json       |  4 ++++
               js/data/locale/or/dateres.json       | 14 ++++++++++++++
               js/data/locale/os/dateres.json       | 12 ++++++++++++
               js/data/locale/pa/Arab/dateres.json  | 12 ++++++++++++
               js/data/locale/pa/dateres.json       | 14 ++++++++++++++
               js/data/locale/pl/dateres.json       | 14 ++++++++++++++
               js/data/locale/prg/dateres.json      |  4 ++++
               js/data/locale/ps/dateres.json       | 14 ++++++++++++++
               js/data/locale/pt/dateres.json       | 13 +++++++++++++
               js/data/locale/qu/dateres.json       |  4 ++++
               js/data/locale/rm/dateres.json       | 12 ++++++++++++
               js/data/locale/rn/dateres.json       | 12 ++++++++++++
               js/data/locale/ro/dateres.json       | 14 ++++++++++++++
               js/data/locale/rof/dateres.json      | 12 ++++++++++++
               js/data/locale/ru/dateres.json       | 13 +++++++++++++
               js/data/locale/rw/dateres.json       |  4 ++++
               js/data/locale/rwk/dateres.json      | 12 ++++++++++++
               js/data/locale/sah/dateres.json      | 12 ++++++++++++
               js/data/locale/saq/dateres.json      | 12 ++++++++++++
               js/data/locale/sbp/dateres.json      | 12 ++++++++++++
               js/data/locale/sd/dateres.json       | 14 ++++++++++++++
               js/data/locale/se/FI/dateres.json    |  8 ++++++++
               js/data/locale/se/dateres.json       | 12 ++++++++++++
               js/data/locale/seh/dateres.json      | 10 ++++++++++
               js/data/locale/ses/dateres.json      | 12 ++++++++++++
               js/data/locale/sg/dateres.json       | 12 ++++++++++++
               js/data/locale/shi/Latn/dateres.json | 12 ++++++++++++
               js/data/locale/shi/dateres.json      | 12 ++++++++++++
               js/data/locale/si/dateres.json       | 14 ++++++++++++++
               js/data/locale/sk/dateres.json       | 13 +++++++++++++
               js/data/locale/sl/dateres.json       | 14 ++++++++++++++
               js/data/locale/smn/dateres.json      |  4 ++++
               js/data/locale/sn/dateres.json       | 12 ++++++++++++
               js/data/locale/so/dateres.json       |  4 ++++
               js/data/locale/sq/dateres.json       | 14 ++++++++++++++
               js/data/locale/sr/Latn/dateres.json  | 14 ++++++++++++++
               js/data/locale/sr/dateres.json       | 14 ++++++++++++++
               js/data/locale/sv/dateres.json       | 14 ++++++++++++++
               js/data/locale/sw/CD/dateres.json    |  6 ++++++
               js/data/locale/sw/dateres.json       | 13 +++++++++++++
               js/data/locale/ta/dateres.json       | 14 ++++++++++++++
               js/data/locale/te/dateres.json       | 13 +++++++++++++
               js/data/locale/teo/dateres.json      | 12 ++++++++++++
               js/data/locale/tg/dateres.json       | 12 ++++++++++++
               js/data/locale/th/dateres.json       | 14 ++++++++++++++
               js/data/locale/ti/dateres.json       | 14 ++++++++++++++
               js/data/locale/tk/dateres.json       | 14 ++++++++++++++
               js/data/locale/to/dateres.json       | 13 +++++++++++++
               js/data/locale/tr/dateres.json       | 14 ++++++++++++++
               js/data/locale/tt/dateres.json       | 11 +++++++++++
               js/data/locale/twq/dateres.json      | 12 ++++++++++++
               js/data/locale/tzm/dateres.json      | 12 ++++++++++++
               js/data/locale/ug/dateres.json       | 12 ++++++++++++
               js/data/locale/uk/dateres.json       | 14 ++++++++++++++
               js/data/locale/ur/dateres.json       | 14 ++++++++++++++
               js/data/locale/uz/Arab/dateres.json  |  6 ++++++
               js/data/locale/uz/Cyrl/dateres.json  | 14 ++++++++++++++
               js/data/locale/uz/dateres.json       | 14 ++++++++++++++
               js/data/locale/vai/Latn/dateres.json |  9 +++++++++
               js/data/locale/vai/dateres.json      | 11 +++++++++++
               js/data/locale/vi/dateres.json       | 14 ++++++++++++++
               js/data/locale/vo/dateres.json       |  4 ++++
               js/data/locale/vun/dateres.json      | 12 ++++++++++++
               js/data/locale/wae/dateres.json      | 11 +++++++++++
               js/data/locale/wo/dateres.json       | 12 ++++++++++++
               js/data/locale/xh/dateres.json       |  4 ++++
               js/data/locale/xog/dateres.json      | 12 ++++++++++++
               js/data/locale/yav/dateres.json      | 12 ++++++++++++
               js/data/locale/yi/dateres.json       | 12 ++++++++++++
               js/data/locale/yo/BJ/dateres.json    |  8 ++++++++
               js/data/locale/yo/dateres.json       | 12 ++++++++++++
               js/data/locale/yue/Hans/dateres.json |  7 +++++++
               js/data/locale/yue/dateres.json      | 14 ++++++++++++++
               js/data/locale/zgh/dateres.json      | 12 ++++++++++++
               js/data/locale/zh/Hant/dateres.json  |  9 +++++++++
               js/data/locale/zh/dateres.json       | 14 ++++++++++++++
               js/data/locale/zu/dateres.json       | 12 ++++++++++++
               222 files changed, 2602 insertions(+), 1 deletion(-)
               create mode 100644 js/data/locale/af/dateres.json
               create mode 100644 js/data/locale/agq/dateres.json
               create mode 100644 js/data/locale/ak/dateres.json
               create mode 100644 js/data/locale/am/dateres.json
               create mode 100644 js/data/locale/ar/dateres.json
               create mode 100644 js/data/locale/as/dateres.json
               create mode 100644 js/data/locale/asa/dateres.json
               create mode 100644 js/data/locale/ast/dateres.json
               create mode 100644 js/data/locale/az/Cyrl/dateres.json
               create mode 100644 js/data/locale/az/dateres.json
               create mode 100644 js/data/locale/bas/dateres.json
               create mode 100644 js/data/locale/be/dateres.json
               create mode 100644 js/data/locale/bem/dateres.json
               create mode 100644 js/data/locale/bez/dateres.json
               create mode 100644 js/data/locale/bg/dateres.json
               create mode 100644 js/data/locale/bm/dateres.json
               create mode 100644 js/data/locale/bn/dateres.json
               create mode 100644 js/data/locale/bo/dateres.json
               create mode 100644 js/data/locale/br/dateres.json
               create mode 100644 js/data/locale/brx/dateres.json
               create mode 100644 js/data/locale/bs/Cyrl/dateres.json
               create mode 100644 js/data/locale/bs/dateres.json
               create mode 100644 js/data/locale/ca/dateres.json
               create mode 100644 js/data/locale/ccp/dateres.json
               create mode 100644 js/data/locale/ce/dateres.json
               create mode 100644 js/data/locale/cgg/dateres.json
               create mode 100644 js/data/locale/chr/dateres.json
               create mode 100644 js/data/locale/ckb/dateres.json
               create mode 100644 js/data/locale/cs/dateres.json
               create mode 100644 js/data/locale/cu/dateres.json
               create mode 100644 js/data/locale/cy/dateres.json
               create mode 100644 js/data/locale/da/dateres.json
               create mode 100644 js/data/locale/dav/dateres.json
               create mode 100644 js/data/locale/de/dateres.json
               create mode 100644 js/data/locale/dje/dateres.json
               create mode 100644 js/data/locale/dsb/dateres.json
               create mode 100644 js/data/locale/dua/dateres.json
               create mode 100644 js/data/locale/dyo/dateres.json
               create mode 100644 js/data/locale/dz/dateres.json
               create mode 100644 js/data/locale/ebu/dateres.json
               create mode 100644 js/data/locale/ee/dateres.json
               create mode 100644 js/data/locale/el/dateres.json
               create mode 100644 js/data/locale/en/dateres.json
               create mode 100644 js/data/locale/eo/dateres.json
               create mode 100644 js/data/locale/es/DO/dateres.json
               create mode 100644 js/data/locale/es/dateres.json
               create mode 100644 js/data/locale/et/dateres.json
               create mode 100644 js/data/locale/eu/dateres.json
               create mode 100644 js/data/locale/ewo/dateres.json
               create mode 100644 js/data/locale/fa/dateres.json
               create mode 100644 js/data/locale/ff/dateres.json
               create mode 100644 js/data/locale/fi/dateres.json
               create mode 100644 js/data/locale/fil/dateres.json
               create mode 100644 js/data/locale/fo/dateres.json
               create mode 100644 js/data/locale/fr/CA/dateres.json
               create mode 100644 js/data/locale/fr/dateres.json
               create mode 100644 js/data/locale/fur/dateres.json
               create mode 100644 js/data/locale/fy/dateres.json
               create mode 100644 js/data/locale/ga/dateres.json
               create mode 100644 js/data/locale/gd/dateres.json
               create mode 100644 js/data/locale/gl/dateres.json
               create mode 100644 js/data/locale/gsw/dateres.json
               create mode 100644 js/data/locale/gu/dateres.json
               create mode 100644 js/data/locale/guz/dateres.json
               create mode 100644 js/data/locale/gv/dateres.json
               create mode 100644 js/data/locale/ha/dateres.json
               create mode 100644 js/data/locale/haw/dateres.json
               create mode 100644 js/data/locale/he/dateres.json
               create mode 100644 js/data/locale/hi/dateres.json
               create mode 100644 js/data/locale/hr/dateres.json
               create mode 100644 js/data/locale/hsb/dateres.json
               create mode 100644 js/data/locale/hu/dateres.json
               create mode 100644 js/data/locale/hy/dateres.json
               create mode 100644 js/data/locale/ia/dateres.json
               create mode 100644 js/data/locale/id/dateres.json
               create mode 100644 js/data/locale/ig/dateres.json
               create mode 100644 js/data/locale/ii/dateres.json
               create mode 100644 js/data/locale/is/dateres.json
               create mode 100644 js/data/locale/it/dateres.json
               create mode 100644 js/data/locale/ja/dateres.json
               create mode 100644 js/data/locale/jgo/dateres.json
               create mode 100644 js/data/locale/jmc/dateres.json
               create mode 100644 js/data/locale/jv/dateres.json
               create mode 100644 js/data/locale/ka/dateres.json
               create mode 100644 js/data/locale/kab/dateres.json
               create mode 100644 js/data/locale/kam/dateres.json
               create mode 100644 js/data/locale/kde/dateres.json
               create mode 100644 js/data/locale/kea/dateres.json
               create mode 100644 js/data/locale/khq/dateres.json
               create mode 100644 js/data/locale/ki/dateres.json
               create mode 100644 js/data/locale/kk/dateres.json
               create mode 100644 js/data/locale/kkj/dateres.json
               create mode 100644 js/data/locale/kl/dateres.json
               create mode 100644 js/data/locale/kln/dateres.json
               create mode 100644 js/data/locale/km/dateres.json
               create mode 100644 js/data/locale/kn/dateres.json
               create mode 100644 js/data/locale/ko/dateres.json
               create mode 100644 js/data/locale/kok/dateres.json
               create mode 100644 js/data/locale/ks/dateres.json
               create mode 100644 js/data/locale/ksb/dateres.json
               create mode 100644 js/data/locale/ksf/dateres.json
               create mode 100644 js/data/locale/ksh/dateres.json
               create mode 100644 js/data/locale/ku/dateres.json
               create mode 100644 js/data/locale/kw/dateres.json
               create mode 100644 js/data/locale/ky/dateres.json
               create mode 100644 js/data/locale/lag/dateres.json
               create mode 100644 js/data/locale/lb/dateres.json
               create mode 100644 js/data/locale/lg/dateres.json
               create mode 100644 js/data/locale/lkt/dateres.json
               create mode 100644 js/data/locale/ln/dateres.json
               create mode 100644 js/data/locale/lo/dateres.json
               create mode 100644 js/data/locale/lrc/dateres.json
               create mode 100644 js/data/locale/lt/dateres.json
               create mode 100644 js/data/locale/lu/dateres.json
               create mode 100644 js/data/locale/luo/dateres.json
               create mode 100644 js/data/locale/luy/dateres.json
               create mode 100644 js/data/locale/lv/dateres.json
               create mode 100644 js/data/locale/mas/dateres.json
               create mode 100644 js/data/locale/mer/dateres.json
               create mode 100644 js/data/locale/mfe/dateres.json
               create mode 100644 js/data/locale/mg/dateres.json
               create mode 100644 js/data/locale/mgh/dateres.json
               create mode 100644 js/data/locale/mgo/dateres.json
               create mode 100644 js/data/locale/mi/dateres.json
               create mode 100644 js/data/locale/mk/dateres.json
               create mode 100644 js/data/locale/ml/dateres.json
               create mode 100644 js/data/locale/mn/dateres.json
               create mode 100644 js/data/locale/mr/dateres.json
               create mode 100644 js/data/locale/ms/dateres.json
               create mode 100644 js/data/locale/mt/dateres.json
               create mode 100644 js/data/locale/mua/dateres.json
               create mode 100644 js/data/locale/my/dateres.json
               create mode 100644 js/data/locale/mzn/dateres.json
               create mode 100644 js/data/locale/naq/dateres.json
               create mode 100644 js/data/locale/nb/dateres.json
               create mode 100644 js/data/locale/nd/dateres.json
               create mode 100644 js/data/locale/nds/dateres.json
               create mode 100644 js/data/locale/ne/dateres.json
               create mode 100644 js/data/locale/nl/dateres.json
               create mode 100644 js/data/locale/nmg/dateres.json
               create mode 100644 js/data/locale/nn/dateres.json
               create mode 100644 js/data/locale/nnh/dateres.json
               create mode 100644 js/data/locale/nus/dateres.json
               create mode 100644 js/data/locale/nyn/dateres.json
               create mode 100644 js/data/locale/om/dateres.json
               create mode 100644 js/data/locale/or/dateres.json
               create mode 100644 js/data/locale/os/dateres.json
               create mode 100644 js/data/locale/pa/Arab/dateres.json
               create mode 100644 js/data/locale/pa/dateres.json
               create mode 100644 js/data/locale/pl/dateres.json
               create mode 100644 js/data/locale/prg/dateres.json
               create mode 100644 js/data/locale/ps/dateres.json
               create mode 100644 js/data/locale/pt/dateres.json
               create mode 100644 js/data/locale/qu/dateres.json
               create mode 100644 js/data/locale/rm/dateres.json
               create mode 100644 js/data/locale/rn/dateres.json
               create mode 100644 js/data/locale/ro/dateres.json
               create mode 100644 js/data/locale/rof/dateres.json
               create mode 100644 js/data/locale/ru/dateres.json
               create mode 100644 js/data/locale/rw/dateres.json
               create mode 100644 js/data/locale/rwk/dateres.json
               create mode 100644 js/data/locale/sah/dateres.json
               create mode 100644 js/data/locale/saq/dateres.json
               create mode 100644 js/data/locale/sbp/dateres.json
               create mode 100644 js/data/locale/sd/dateres.json
               create mode 100644 js/data/locale/se/FI/dateres.json
               create mode 100644 js/data/locale/se/dateres.json
               create mode 100644 js/data/locale/seh/dateres.json
               create mode 100644 js/data/locale/ses/dateres.json
               create mode 100644 js/data/locale/sg/dateres.json
               create mode 100644 js/data/locale/shi/Latn/dateres.json
               create mode 100644 js/data/locale/shi/dateres.json
               create mode 100644 js/data/locale/si/dateres.json
               create mode 100644 js/data/locale/sk/dateres.json
               create mode 100644 js/data/locale/sl/dateres.json
               create mode 100644 js/data/locale/smn/dateres.json
               create mode 100644 js/data/locale/sn/dateres.json
               create mode 100644 js/data/locale/so/dateres.json
               create mode 100644 js/data/locale/sq/dateres.json
               create mode 100644 js/data/locale/sr/Latn/dateres.json
               create mode 100644 js/data/locale/sr/dateres.json
               create mode 100644 js/data/locale/sv/dateres.json
               create mode 100644 js/data/locale/sw/CD/dateres.json
               create mode 100644 js/data/locale/sw/dateres.json
               create mode 100644 js/data/locale/ta/dateres.json
               create mode 100644 js/data/locale/te/dateres.json
               create mode 100644 js/data/locale/teo/dateres.json
               create mode 100644 js/data/locale/tg/dateres.json
               create mode 100644 js/data/locale/th/dateres.json
               create mode 100644 js/data/locale/ti/dateres.json
               create mode 100644 js/data/locale/tk/dateres.json
               create mode 100644 js/data/locale/to/dateres.json
               create mode 100644 js/data/locale/tr/dateres.json
               create mode 100644 js/data/locale/tt/dateres.json
               create mode 100644 js/data/locale/twq/dateres.json
               create mode 100644 js/data/locale/tzm/dateres.json
               create mode 100644 js/data/locale/ug/dateres.json
               create mode 100644 js/data/locale/uk/dateres.json
               create mode 100644 js/data/locale/ur/dateres.json
               create mode 100644 js/data/locale/uz/Arab/dateres.json
               create mode 100644 js/data/locale/uz/Cyrl/dateres.json
               create mode 100644 js/data/locale/uz/dateres.json
               create mode 100644 js/data/locale/vai/Latn/dateres.json
               create mode 100644 js/data/locale/vai/dateres.json
               create mode 100644 js/data/locale/vi/dateres.json
               create mode 100644 js/data/locale/vo/dateres.json
               create mode 100644 js/data/locale/vun/dateres.json
               create mode 100644 js/data/locale/wae/dateres.json
               create mode 100644 js/data/locale/wo/dateres.json
               create mode 100644 js/data/locale/xh/dateres.json
               create mode 100644 js/data/locale/xog/dateres.json
               create mode 100644 js/data/locale/yav/dateres.json
               create mode 100644 js/data/locale/yi/dateres.json
               create mode 100644 js/data/locale/yo/BJ/dateres.json
               create mode 100644 js/data/locale/yo/dateres.json
               create mode 100644 js/data/locale/yue/Hans/dateres.json
               create mode 100644 js/data/locale/yue/dateres.json
               create mode 100644 js/data/locale/zgh/dateres.json
               create mode 100644 js/data/locale/zh/Hant/dateres.json
               create mode 100644 js/data/locale/zh/dateres.json
               create mode 100644 js/data/locale/zu/dateres.json
              
              diff --git a/js/data/locale/af/dateres.json b/js/data/locale/af/dateres.json
              new file mode 100644
              index 0000000000..542ade8486
              --- /dev/null
              +++ b/js/data/locale/af/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "vm./nm.",
              +    "Day": "dag",
              +    "Day of Year": "dag van jaar",
              +    "Era": "era",
              +    "Hour": "uur",
              +    "Minute": "minuut",
              +    "Month": "maand",
              +    "Second": "sekonde",
              +    "Time Zone": "tydsone",
              +    "Week": "week",
              +    "Week of Month": "week van maand",
              +    "Year": "jaar"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/agq/dateres.json b/js/data/locale/agq/dateres.json
              new file mode 100644
              index 0000000000..7ebc776dcf
              --- /dev/null
              +++ b/js/data/locale/agq/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "â tsɨ̀",
              +    "Day": "utsuʔ",
              +    "Era": "kɨtîgh",
              +    "Hour": "tàm",
              +    "Minute": "menè",
              +    "Month": "ndzɔŋ",
              +    "Second": "sɛkɔ̀n",
              +    "Time Zone": "dɨŋò kɨ enɨ̀gha",
              +    "Week": "ewɨn",
              +    "Year": "kɨnûm"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ak/dateres.json b/js/data/locale/ak/dateres.json
              new file mode 100644
              index 0000000000..c505a7137c
              --- /dev/null
              +++ b/js/data/locale/ak/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Da bere",
              +    "Day": "Da",
              +    "Era": "Bere",
              +    "Hour": "Dɔnhwer",
              +    "Minute": "Sema",
              +    "Month": "Bosome",
              +    "Second": "Sɛkɛnd",
              +    "Time Zone": "Bere apaamu",
              +    "Week": "Dapɛn",
              +    "Year": "Afe"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/am/dateres.json b/js/data/locale/am/dateres.json
              new file mode 100644
              index 0000000000..d857f0c6b5
              --- /dev/null
              +++ b/js/data/locale/am/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "ጥዋት/ከሰዓት",
              +    "Day": "ቀን",
              +    "Day of Year": "የዓመቱ ቀን",
              +    "Era": "ዘመን",
              +    "Hour": "ሰዓት",
              +    "Minute": "ደቂቃ",
              +    "Month": "ወር",
              +    "Second": "ሰከንድ",
              +    "Time Zone": "የሰዓት ሰቅ",
              +    "Week": "ሳምንት",
              +    "Week of Month": "የወሩ ሳምንት",
              +    "Year": "ዓመት"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ar/dateres.json b/js/data/locale/ar/dateres.json
              new file mode 100644
              index 0000000000..02aa82da91
              --- /dev/null
              +++ b/js/data/locale/ar/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "ص/م",
              +    "Day": "يوم",
              +    "Day of Year": "يوم من السنة",
              +    "Era": "العصر",
              +    "Hour": "الساعات",
              +    "Minute": "الدقائق",
              +    "Month": "الشهر",
              +    "Second": "الثواني",
              +    "Time Zone": "التوقيت",
              +    "Week": "الأسبوع",
              +    "Week of Month": "الأسبوع من الشهر",
              +    "Year": "السنة"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/as/dateres.json b/js/data/locale/as/dateres.json
              new file mode 100644
              index 0000000000..76f726e5cd
              --- /dev/null
              +++ b/js/data/locale/as/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "পূৰ্বাহ্ন/অপৰাহ্ন",
              +    "Day": "দিন",
              +    "Day of Year": "বছৰৰ দিন",
              +    "Era": "যুগ",
              +    "Hour": "ঘণ্টা",
              +    "Minute": "মিনিট",
              +    "Month": "মাহ",
              +    "Second": "ছেকেণ্ড",
              +    "Time Zone": "সময় ক্ষেত্ৰ",
              +    "Week": "সপ্তাহ",
              +    "Week of Month": "মাহৰ সপ্তাহ",
              +    "Year": "বছৰ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/asa/dateres.json b/js/data/locale/asa/dateres.json
              new file mode 100644
              index 0000000000..a321dab211
              --- /dev/null
              +++ b/js/data/locale/asa/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Marango athiku",
              +    "Day": "Thiku",
              +    "Era": "Edhi",
              +    "Hour": "Thaa",
              +    "Minute": "Dakika",
              +    "Month": "Mweji",
              +    "Second": "Thekunde",
              +    "Time Zone": "Majira Athaa",
              +    "Week": "Ndisha",
              +    "Year": "Mwaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ast/dateres.json b/js/data/locale/ast/dateres.json
              new file mode 100644
              index 0000000000..61cae2a0fe
              --- /dev/null
              +++ b/js/data/locale/ast/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "periodu del día",
              +    "Day": "día",
              +    "Era": "era",
              +    "Hour": "hora",
              +    "Minute": "minutu",
              +    "Month": "mes",
              +    "Second": "segundu",
              +    "Time Zone": "estaya horaria",
              +    "Week": "selmana",
              +    "Year": "añu"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/az/Cyrl/dateres.json b/js/data/locale/az/Cyrl/dateres.json
              new file mode 100644
              index 0000000000..ec809a68ae
              --- /dev/null
              +++ b/js/data/locale/az/Cyrl/dateres.json
              @@ -0,0 +1,6 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day of Year": "Day Of Year",
              +    "Time Zone": "Zone",
              +    "Week of Month": "Week Of Month"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/az/dateres.json b/js/data/locale/az/dateres.json
              new file mode 100644
              index 0000000000..702fdd0191
              --- /dev/null
              +++ b/js/data/locale/az/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "Day": "Gün",
              +    "Day of Year": "ilin günü",
              +    "Hour": "Saat",
              +    "Minute": "Dəqiqə",
              +    "Month": "Ay",
              +    "Second": "Saniyə",
              +    "Time Zone": "Saat Qurşağı",
              +    "Week": "Həftə",
              +    "Week of Month": "Ayın həftəsi",
              +    "Year": "İl"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/bas/dateres.json b/js/data/locale/bas/dateres.json
              new file mode 100644
              index 0000000000..6060bc9d23
              --- /dev/null
              +++ b/js/data/locale/bas/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "njǎmùha",
              +    "Day": "kɛl",
              +    "Era": "kèk",
              +    "Hour": "ŋgɛŋ",
              +    "Minute": "ŋget",
              +    "Month": "soŋ",
              +    "Second": "hìŋgeŋget",
              +    "Time Zone": "komboo i ŋgɛŋ",
              +    "Week": "sɔndɛ̂",
              +    "Year": "ŋwìi"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/be/dateres.json b/js/data/locale/be/dateres.json
              new file mode 100644
              index 0000000000..fd0052cddd
              --- /dev/null
              +++ b/js/data/locale/be/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "дзень",
              +    "Day of Year": "дзень года",
              +    "Era": "эра",
              +    "Hour": "гадзіна",
              +    "Minute": "хвіліна",
              +    "Month": "месяц",
              +    "Second": "секунда",
              +    "Time Zone": "часавы пояс",
              +    "Week": "тыд",
              +    "Week of Month": "тыдзень месяца",
              +    "Year": "год"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/bem/dateres.json b/js/data/locale/bem/dateres.json
              new file mode 100644
              index 0000000000..1c25fd505d
              --- /dev/null
              +++ b/js/data/locale/bem/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Akasuba",
              +    "Day": "Ubushiku",
              +    "Era": "Inkulo",
              +    "Hour": "Insa",
              +    "Minute": "Mineti",
              +    "Month": "Umweshi",
              +    "Second": "Sekondi",
              +    "Time Zone": "Zone",
              +    "Week": "Umulungu",
              +    "Year": "Umwaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/bez/dateres.json b/js/data/locale/bez/dateres.json
              new file mode 100644
              index 0000000000..79c51bb886
              --- /dev/null
              +++ b/js/data/locale/bez/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Lwamelau",
              +    "Day": "Sihu",
              +    "Era": "Amajira",
              +    "Hour": "Saa",
              +    "Minute": "Dakika",
              +    "Month": "Mwedzi",
              +    "Second": "Sekunde",
              +    "Time Zone": "Amajira ga saa",
              +    "Week": "Mlungu gumamfu",
              +    "Year": "Mwaha"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/bg/dateres.json b/js/data/locale/bg/dateres.json
              new file mode 100644
              index 0000000000..2b6ac9c9e4
              --- /dev/null
              +++ b/js/data/locale/bg/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "пр.об./сл.об.",
              +    "Day": "ден",
              +    "Day of Year": "ден от годината",
              +    "Era": "ера",
              +    "Hour": "час",
              +    "Minute": "минута",
              +    "Month": "месец",
              +    "Second": "секунда",
              +    "Time Zone": "часова зона",
              +    "Week": "седмица",
              +    "Week of Month": "седмица от месеца",
              +    "Year": "година"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/bm/dateres.json b/js/data/locale/bm/dateres.json
              new file mode 100644
              index 0000000000..83a34a1e4d
              --- /dev/null
              +++ b/js/data/locale/bm/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "sɔgɔma/tile/wula/su",
              +    "Day": "don",
              +    "Era": "tile",
              +    "Hour": "lɛrɛ",
              +    "Minute": "miniti",
              +    "Month": "kalo",
              +    "Second": "sekondi",
              +    "Time Zone": "sigikun tilena",
              +    "Week": "dɔgɔkun",
              +    "Year": "san"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/bn/dateres.json b/js/data/locale/bn/dateres.json
              new file mode 100644
              index 0000000000..f249a1ae9d
              --- /dev/null
              +++ b/js/data/locale/bn/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "দিন",
              +    "Day of Year": "বছরের দিন",
              +    "Era": "যুগ",
              +    "Hour": "ঘণ্টা",
              +    "Minute": "মিনিট",
              +    "Month": "মাস",
              +    "Second": "সেকেন্ড",
              +    "Time Zone": "সময় অঞ্চল",
              +    "Week": "সপ্তাহ",
              +    "Week of Month": "মাসের সপ্তাহ",
              +    "Year": "বছর"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/bo/dateres.json b/js/data/locale/bo/dateres.json
              new file mode 100644
              index 0000000000..c406361cf2
              --- /dev/null
              +++ b/js/data/locale/bo/dateres.json
              @@ -0,0 +1,10 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day": "ཉིན།",
              +    "Hour": "ཆུ་ཚོད་",
              +    "Minute": "སྐར་མ།",
              +    "Month": "ཟླ་བ་",
              +    "Second": "སྐར་ཆ།",
              +    "Time Zone": "དུས་ཚོད།",
              +    "Year": "ལོ།"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/br/dateres.json b/js/data/locale/br/dateres.json
              new file mode 100644
              index 0000000000..663dd89eb1
              --- /dev/null
              +++ b/js/data/locale/br/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "AM/GM",
              +    "Day": "deiz",
              +    "Era": "amzervezh",
              +    "Hour": "eur",
              +    "Minute": "munut",
              +    "Month": "miz",
              +    "Second": "eilenn",
              +    "Time Zone": "takad eur",
              +    "Week": "sizhun",
              +    "Year": "bloaz"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/brx/dateres.json b/js/data/locale/brx/dateres.json
              new file mode 100644
              index 0000000000..9c8a88d7b8
              --- /dev/null
              +++ b/js/data/locale/brx/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "फुं/बेलासे",
              +    "Day": "सान",
              +    "Era": "जौथाय",
              +    "Hour": "रिंगा",
              +    "Minute": "मिनिथ",
              +    "Month": "दान",
              +    "Second": "सेखेन्द",
              +    "Time Zone": "ओनसोल",
              +    "Week": "सबथा/हबथा",
              +    "Year": "बोसोर"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/bs/Cyrl/dateres.json b/js/data/locale/bs/Cyrl/dateres.json
              new file mode 100644
              index 0000000000..d806ac6ba4
              --- /dev/null
              +++ b/js/data/locale/bs/Cyrl/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "пре подне/поподне",
              +    "Day": "дан",
              +    "Day of Year": "Day Of Year",
              +    "Era": "ера",
              +    "Hour": "час",
              +    "Minute": "минут",
              +    "Month": "месец",
              +    "Second": "секунд",
              +    "Time Zone": "зона",
              +    "Week": "недеља",
              +    "Week of Month": "Week Of Month",
              +    "Year": "година"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/bs/dateres.json b/js/data/locale/bs/dateres.json
              new file mode 100644
              index 0000000000..a21d23f625
              --- /dev/null
              +++ b/js/data/locale/bs/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "prijepodne/poslijepodne",
              +    "Day": "dan",
              +    "Day of Year": "dan u godini",
              +    "Era": "era",
              +    "Hour": "sat",
              +    "Minute": "minuta",
              +    "Month": "mjesec",
              +    "Second": "sekunda",
              +    "Time Zone": "vremenska zona",
              +    "Week": "sedmica",
              +    "Week of Month": "sedmica u mjesecu",
              +    "Year": "godina"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ca/dateres.json b/js/data/locale/ca/dateres.json
              new file mode 100644
              index 0000000000..909b66c3de
              --- /dev/null
              +++ b/js/data/locale/ca/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "a. m./p. m.",
              +    "Day": "dia",
              +    "Day of Year": "dia de l’any",
              +    "Era": "era",
              +    "Hour": "hora",
              +    "Minute": "minut",
              +    "Month": "mes",
              +    "Second": "segon",
              +    "Time Zone": "fus horari",
              +    "Week": "setmana",
              +    "Week of Month": "setmana del mes",
              +    "Year": "any"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ccp/dateres.json b/js/data/locale/ccp/dateres.json
              new file mode 100644
              index 0000000000..9e2392d77f
              --- /dev/null
              +++ b/js/data/locale/ccp/dateres.json
              @@ -0,0 +1,11 @@
              +{
              +    "Day": "𑄘𑄨𑄚𑄴",
              +    "Era": "𑄡𑄪𑄇𑄴",
              +    "Hour": "𑄊𑄮𑄚𑄴𑄓",
              +    "Minute": "𑄟𑄨𑄚𑄨𑄖𑄴",
              +    "Month": "𑄟𑄏𑄴",
              +    "Second": "𑄥𑄬𑄉𑄬𑄚𑄴",
              +    "Time Zone": "𑄃𑄧𑄇𑄴𑄖𑄧𑄢𑄴 𑄎𑄉",
              +    "Week": "𑄥𑄛𑄴𑄖",
              +    "Year": "𑄝𑄧𑄏𑄧𑄢𑄴"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ce/dateres.json b/js/data/locale/ce/dateres.json
              new file mode 100644
              index 0000000000..df46149fed
              --- /dev/null
              +++ b/js/data/locale/ce/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "делкъал тӀехьа",
              +    "Day": "де",
              +    "Day of Year": "шеран де",
              +    "Era": "мур",
              +    "Hour": "сахьт",
              +    "Minute": "минот",
              +    "Month": "бутт",
              +    "Second": "секунд",
              +    "Time Zone": "сахьтан аса",
              +    "Week": "кӀира",
              +    "Week of Month": "беттан кӀира",
              +    "Year": "шо"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/cgg/dateres.json b/js/data/locale/cgg/dateres.json
              new file mode 100644
              index 0000000000..b5ca5ba48c
              --- /dev/null
              +++ b/js/data/locale/cgg/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Nyomushana/nyekiro",
              +    "Day": "Eizooba",
              +    "Era": "Obunaku",
              +    "Hour": "Shaaha",
              +    "Minute": "Edakiika",
              +    "Month": "Omwezi",
              +    "Second": "Obucweka/Esekendi",
              +    "Time Zone": "Zone",
              +    "Week": "Esande",
              +    "Year": "Omwaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/chr/dateres.json b/js/data/locale/chr/dateres.json
              new file mode 100644
              index 0000000000..ce6dd96fb2
              --- /dev/null
              +++ b/js/data/locale/chr/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "ᏌᎾᎴ/ᏒᎯᏱ",
              +    "Day": "ᎢᎦ",
              +    "Day of Year": "ᎢᎦ ᎤᏕᏘᏴᏌᏗᏒᎢ",
              +    "Era": "ᏗᏓᎴᏂᏍᎬ",
              +    "Hour": "ᏑᏟᎶᏓ",
              +    "Minute": "ᎢᏯᏔᏬᏍᏔᏅ",
              +    "Month": "ᎧᎸᎢ",
              +    "Second": "ᎠᏎᏢ",
              +    "Time Zone": "ᏂᎬᎾᏛ ᏧᏓᎴᏅᏓ ᏓᏟᎢᎵᏍᏒᎢ",
              +    "Week": "ᏒᎾᏙᏓᏆᏍᏗ",
              +    "Week of Month": "ᏒᎾᏙᏓᏆᏍᏗ ᎧᎸᎢ",
              +    "Year": "ᎤᏕᏘᏴᏌᏗᏒᎢ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ckb/dateres.json b/js/data/locale/ckb/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/ckb/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/cs/dateres.json b/js/data/locale/cs/dateres.json
              new file mode 100644
              index 0000000000..a1c76beae4
              --- /dev/null
              +++ b/js/data/locale/cs/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "část dne",
              +    "Day": "den",
              +    "Day of Year": "den v roce",
              +    "Era": "letopočet",
              +    "Hour": "hodina",
              +    "Minute": "minuta",
              +    "Month": "měsíc",
              +    "Second": "sekunda",
              +    "Time Zone": "časové pásmo",
              +    "Week": "týden",
              +    "Week of Month": "týden v měsíci",
              +    "Year": "rok"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/cu/dateres.json b/js/data/locale/cu/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/cu/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/cy/dateres.json b/js/data/locale/cy/dateres.json
              new file mode 100644
              index 0000000000..e3ddaa1596
              --- /dev/null
              +++ b/js/data/locale/cy/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "diwrnod",
              +    "Day of Year": "rhif y dydd yn y flwyddyn",
              +    "Era": "oes",
              +    "Hour": "awr",
              +    "Minute": "munud",
              +    "Month": "mis",
              +    "Second": "eiliad",
              +    "Time Zone": "cylchfa amser",
              +    "Week": "wythnos",
              +    "Week of Month": "rhif wythnos yn y mis",
              +    "Year": "blwyddyn"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/da/dateres.json b/js/data/locale/da/dateres.json
              new file mode 100644
              index 0000000000..5d064c8f18
              --- /dev/null
              +++ b/js/data/locale/da/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "dag",
              +    "Day of Year": "dag i året",
              +    "Era": "æra",
              +    "Hour": "time",
              +    "Minute": "minut",
              +    "Month": "måned",
              +    "Second": "sekund",
              +    "Time Zone": "tidszone",
              +    "Week": "uge",
              +    "Week of Month": "uge i måneden",
              +    "Year": "år"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/dateres.json b/js/data/locale/dateres.json
              index 0967ef424b..e713408074 100644
              --- a/js/data/locale/dateres.json
              +++ b/js/data/locale/dateres.json
              @@ -1 +1,14 @@
              -{}
              +{
              +    "AM/PM": "AM/PM",
              +    "Day": "Day",
              +    "Day of Year": "Day Of Year",
              +    "Era": "Era",
              +    "Hour": "Hour",
              +    "Minute": "Minute",
              +    "Month": "Month",
              +    "Second": "Second",
              +    "Time Zone": "Time Zone",
              +    "Week": "Week",
              +    "Week of Month": "Week Of Month",
              +    "Year": "Year"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/dav/dateres.json b/js/data/locale/dav/dateres.json
              new file mode 100644
              index 0000000000..a27c209752
              --- /dev/null
              +++ b/js/data/locale/dav/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "KE/PE",
              +    "Day": "Ituku",
              +    "Era": "Ngelo",
              +    "Hour": "Saa",
              +    "Minute": "Dakika",
              +    "Month": "Mori",
              +    "Second": "Sekunde",
              +    "Time Zone": "Majira ya saa",
              +    "Week": "Juma",
              +    "Year": "Mwaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/de/dateres.json b/js/data/locale/de/dateres.json
              new file mode 100644
              index 0000000000..03c042a867
              --- /dev/null
              +++ b/js/data/locale/de/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "AM/PM": "Tageshälfte",
              +    "Day": "Tag",
              +    "Day of Year": "Tag des Jahres",
              +    "Era": "Epoche",
              +    "Hour": "Stunde",
              +    "Month": "Monat",
              +    "Second": "Sekunde",
              +    "Time Zone": "Zeitzone",
              +    "Week": "Woche",
              +    "Week of Month": "Woche des Monats",
              +    "Year": "Jahr"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/dje/dateres.json b/js/data/locale/dje/dateres.json
              new file mode 100644
              index 0000000000..1c8463120e
              --- /dev/null
              +++ b/js/data/locale/dje/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Subbaahi/Zaarikay banda",
              +    "Day": "Zaari",
              +    "Era": "Zaman",
              +    "Hour": "Guuru",
              +    "Minute": "Miniti",
              +    "Month": "Handu",
              +    "Second": "Miti",
              +    "Time Zone": "Leerazuu",
              +    "Week": "Hebu",
              +    "Year": "Jiiri"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/dsb/dateres.json b/js/data/locale/dsb/dateres.json
              new file mode 100644
              index 0000000000..f8580722ab
              --- /dev/null
              +++ b/js/data/locale/dsb/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "połojca dnja",
              +    "Day": "źeń",
              +    "Era": "epocha",
              +    "Hour": "góźina",
              +    "Minute": "minuta",
              +    "Month": "mjasec",
              +    "Second": "sekunda",
              +    "Time Zone": "casowe pasmo",
              +    "Week": "tyźeń",
              +    "Year": "lěto"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/dua/dateres.json b/js/data/locale/dua/dateres.json
              new file mode 100644
              index 0000000000..8cc015780e
              --- /dev/null
              +++ b/js/data/locale/dua/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "epasi a búnyá",
              +    "Day": "búnyá",
              +    "Era": "póndá",
              +    "Hour": "ŋgandɛ",
              +    "Minute": "ndɔkɔ",
              +    "Month": "mɔ́di",
              +    "Second": "píndí",
              +    "Time Zone": "Zone",
              +    "Week": "disama",
              +    "Year": "mbú"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/dyo/dateres.json b/js/data/locale/dyo/dateres.json
              new file mode 100644
              index 0000000000..e8c0e3348d
              --- /dev/null
              +++ b/js/data/locale/dyo/dateres.json
              @@ -0,0 +1,9 @@
              +{
              +    "AM/PM": "Bujom / Kalíim",
              +    "Day": "Funak",
              +    "Era": "Jamanay",
              +    "Month": "Fuleeŋ",
              +    "Time Zone": "Zone",
              +    "Week": "Lóokuŋ",
              +    "Year": "Emit"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/dz/dateres.json b/js/data/locale/dz/dateres.json
              new file mode 100644
              index 0000000000..2874b68ee2
              --- /dev/null
              +++ b/js/data/locale/dz/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "སྔ་ཆ/ཕྱི་ཆ་",
              +    "Day": "ཚེས་",
              +    "Era": "དུས་བསྐལ",
              +    "Hour": "ཆུ་ཚོད",
              +    "Minute": "སྐར་མ",
              +    "Month": "ཟླ་ཝ་",
              +    "Second": "སྐར་ཆཱ་",
              +    "Time Zone": "དུས་ཀུལ",
              +    "Week": "བདུན་ཕྲག",
              +    "Year": "ལོ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ebu/dateres.json b/js/data/locale/ebu/dateres.json
              new file mode 100644
              index 0000000000..f5c705cc0c
              --- /dev/null
              +++ b/js/data/locale/ebu/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day": "Mũthenya",
              +    "Era": "Ivinda",
              +    "Hour": "Ithaa",
              +    "Minute": "Ndagĩka",
              +    "Month": "Mweri",
              +    "Second": "Sekondi",
              +    "Time Zone": "Gĩthaa",
              +    "Week": "Kiumia",
              +    "Year": "Mwaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ee/dateres.json b/js/data/locale/ee/dateres.json
              new file mode 100644
              index 0000000000..6de1e316e6
              --- /dev/null
              +++ b/js/data/locale/ee/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "ŋkekea me",
              +    "Day": "ŋkeke",
              +    "Era": "ŋɔli",
              +    "Hour": "gaƒoƒo",
              +    "Minute": "aɖabaƒoƒo",
              +    "Month": "ɣleti",
              +    "Second": "sekend",
              +    "Time Zone": "nutomegaƒoƒo",
              +    "Week": "kɔsiɖa ɖeka",
              +    "Year": "ƒe"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/el/dateres.json b/js/data/locale/el/dateres.json
              new file mode 100644
              index 0000000000..8dab9028ba
              --- /dev/null
              +++ b/js/data/locale/el/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "π.μ./μ.μ.",
              +    "Day": "ημέρα",
              +    "Day of Year": "ημέρα έτους",
              +    "Era": "περίοδος",
              +    "Hour": "ώρα",
              +    "Minute": "λεπτό",
              +    "Month": "μήνας",
              +    "Second": "δευτερόλεπτο",
              +    "Time Zone": "ζώνη ώρας",
              +    "Week": "εβδομάδα",
              +    "Week of Month": "εβδομάδα μήνα",
              +    "Year": "έτος"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/en/dateres.json b/js/data/locale/en/dateres.json
              new file mode 100644
              index 0000000000..acbee02d1e
              --- /dev/null
              +++ b/js/data/locale/en/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "day",
              +    "Day of Year": "day of year",
              +    "Era": "era",
              +    "Hour": "hour",
              +    "Minute": "minute",
              +    "Month": "month",
              +    "Second": "second",
              +    "Time Zone": "time zone",
              +    "Week": "week",
              +    "Week of Month": "week of month",
              +    "Year": "year"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/eo/dateres.json b/js/data/locale/eo/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/eo/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/es/DO/dateres.json b/js/data/locale/es/DO/dateres.json
              new file mode 100644
              index 0000000000..6aeb9d66d3
              --- /dev/null
              +++ b/js/data/locale/es/DO/dateres.json
              @@ -0,0 +1,8 @@
              +{
              +    "Day": "Día",
              +    "Minute": "Minuto",
              +    "Month": "Mes",
              +    "Second": "Segundo",
              +    "Week": "Semana",
              +    "Year": "Año"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/es/dateres.json b/js/data/locale/es/dateres.json
              new file mode 100644
              index 0000000000..59333eb5c1
              --- /dev/null
              +++ b/js/data/locale/es/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "a. m./p. m.",
              +    "Day": "día",
              +    "Day of Year": "día del año",
              +    "Era": "era",
              +    "Hour": "hora",
              +    "Minute": "minuto",
              +    "Month": "mes",
              +    "Second": "segundo",
              +    "Time Zone": "zona horaria",
              +    "Week": "semana",
              +    "Week of Month": "semana del mes",
              +    "Year": "año"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/et/dateres.json b/js/data/locale/et/dateres.json
              new file mode 100644
              index 0000000000..94835c81db
              --- /dev/null
              +++ b/js/data/locale/et/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "enne/pärast lõunat",
              +    "Day": "päev",
              +    "Day of Year": "aasta päev",
              +    "Era": "ajastu",
              +    "Hour": "tund",
              +    "Minute": "minut",
              +    "Month": "kuu",
              +    "Second": "sekund",
              +    "Time Zone": "ajavöönd",
              +    "Week": "nädal",
              +    "Week of Month": "kuu nädal",
              +    "Year": "aasta"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/eu/dateres.json b/js/data/locale/eu/dateres.json
              new file mode 100644
              index 0000000000..47d2ea4305
              --- /dev/null
              +++ b/js/data/locale/eu/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "eguna",
              +    "Day of Year": "urteko #. eguna",
              +    "Era": "aroa",
              +    "Hour": "ordua",
              +    "Minute": "minutua",
              +    "Month": "hilabetea",
              +    "Second": "segundoa",
              +    "Time Zone": "ordu-zona",
              +    "Week": "astea",
              +    "Week of Month": "hileko #. astea",
              +    "Year": "urtea"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ewo/dateres.json b/js/data/locale/ewo/dateres.json
              new file mode 100644
              index 0000000000..f26955db13
              --- /dev/null
              +++ b/js/data/locale/ewo/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Kírí / Ngəgógəle",
              +    "Day": "Amǒs",
              +    "Era": "Abǒg",
              +    "Hour": "Awola",
              +    "Minute": "Enútɛn",
              +    "Month": "Ngɔn",
              +    "Second": "Akábəga",
              +    "Time Zone": "Nkɔŋ Awola",
              +    "Week": "Sɔ́ndɔ",
              +    "Year": "M̀bú"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/fa/dateres.json b/js/data/locale/fa/dateres.json
              new file mode 100644
              index 0000000000..d74e2154b9
              --- /dev/null
              +++ b/js/data/locale/fa/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "قبل/بعدازظهر",
              +    "Day": "روز",
              +    "Day of Year": "روز سال",
              +    "Era": "دوره",
              +    "Hour": "ساعت",
              +    "Minute": "دقیقه",
              +    "Month": "ماه",
              +    "Second": "ثانیه",
              +    "Time Zone": "منطقهٔ زمانی",
              +    "Week": "هفته",
              +    "Week of Month": "هفتهٔ ماه",
              +    "Year": "سال"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ff/dateres.json b/js/data/locale/ff/dateres.json
              new file mode 100644
              index 0000000000..c97169bd6c
              --- /dev/null
              +++ b/js/data/locale/ff/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Sahnga",
              +    "Day": "Ñalnde",
              +    "Era": "Jamaanu",
              +    "Hour": "Waktu",
              +    "Minute": "Hoƴom",
              +    "Month": "Lewru",
              +    "Second": "Majaango",
              +    "Time Zone": "Diiwaan waktu",
              +    "Week": "Yontere",
              +    "Year": "Hitaande"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/fi/dateres.json b/js/data/locale/fi/dateres.json
              new file mode 100644
              index 0000000000..ec6dd7e621
              --- /dev/null
              +++ b/js/data/locale/fi/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "vuorokaudenaika",
              +    "Day": "päivä",
              +    "Day of Year": "vuodenpäivä",
              +    "Era": "aikakausi",
              +    "Hour": "tunti",
              +    "Minute": "minuutti",
              +    "Month": "kuukausi",
              +    "Second": "sekunti",
              +    "Time Zone": "aikavyöhyke",
              +    "Week": "viikko",
              +    "Week of Month": "kuukauden viikko",
              +    "Year": "vuosi"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/fil/dateres.json b/js/data/locale/fil/dateres.json
              new file mode 100644
              index 0000000000..935c7bb060
              --- /dev/null
              +++ b/js/data/locale/fil/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "araw",
              +    "Day of Year": "araw ng taon",
              +    "Era": "panahon",
              +    "Hour": "oras",
              +    "Minute": "minuto",
              +    "Month": "buwan",
              +    "Second": "segundo",
              +    "Time Zone": "time zone",
              +    "Week": "linggo",
              +    "Week of Month": "linggo ng buwan",
              +    "Year": "taon"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/fo/dateres.json b/js/data/locale/fo/dateres.json
              new file mode 100644
              index 0000000000..c3dc059b0a
              --- /dev/null
              +++ b/js/data/locale/fo/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "dagur",
              +    "Day of Year": "dagur í árinum",
              +    "Era": "tíðarrokning",
              +    "Hour": "tími",
              +    "Minute": "minuttur",
              +    "Month": "mánaður",
              +    "Second": "sekund",
              +    "Time Zone": "tíðarøki",
              +    "Week": "vika",
              +    "Week of Month": "vika í mánaðinum",
              +    "Year": "ár"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/fr/CA/dateres.json b/js/data/locale/fr/CA/dateres.json
              new file mode 100644
              index 0000000000..176850c0d5
              --- /dev/null
              +++ b/js/data/locale/fr/CA/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "Day of Year": "jour de l’année",
              +    "Week of Month": "semaine du mois"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/fr/dateres.json b/js/data/locale/fr/dateres.json
              new file mode 100644
              index 0000000000..1988f0284b
              --- /dev/null
              +++ b/js/data/locale/fr/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "cadran",
              +    "Day": "jour",
              +    "Day of Year": "jour (année)",
              +    "Era": "ère",
              +    "Hour": "heure",
              +    "Minute": "minute",
              +    "Month": "mois",
              +    "Second": "seconde",
              +    "Time Zone": "fuseau horaire",
              +    "Week": "semaine",
              +    "Week of Month": "semaine (mois)",
              +    "Year": "année"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/fur/dateres.json b/js/data/locale/fur/dateres.json
              new file mode 100644
              index 0000000000..8781a1e13a
              --- /dev/null
              +++ b/js/data/locale/fur/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "toc dal dì",
              +    "Day": "dì",
              +    "Era": "ere",
              +    "Hour": "ore",
              +    "Minute": "minût",
              +    "Month": "mês",
              +    "Second": "secont",
              +    "Time Zone": "zone",
              +    "Week": "setemane",
              +    "Year": "an"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/fy/dateres.json b/js/data/locale/fy/dateres.json
              new file mode 100644
              index 0000000000..fc485ea062
              --- /dev/null
              +++ b/js/data/locale/fy/dateres.json
              @@ -0,0 +1,11 @@
              +{
              +    "Day": "dei",
              +    "Era": "Tiidsrin",
              +    "Hour": "oere",
              +    "Minute": "Minút",
              +    "Month": "Moanne",
              +    "Second": "Sekonde",
              +    "Time Zone": "Zone",
              +    "Week": "Wike",
              +    "Year": "Jier"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ga/dateres.json b/js/data/locale/ga/dateres.json
              new file mode 100644
              index 0000000000..8eb1ed99a1
              --- /dev/null
              +++ b/js/data/locale/ga/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "a.m./p.m.",
              +    "Day": "Lá",
              +    "Day of Year": "Lá den bhliain",
              +    "Era": "Ré",
              +    "Hour": "Uair",
              +    "Minute": "Nóiméad",
              +    "Month": "Mí",
              +    "Second": "Soicind",
              +    "Time Zone": "Crios Ama",
              +    "Week": "Seachtain",
              +    "Week of Month": "Seachtain den mhí",
              +    "Year": "Bliain"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/gd/dateres.json b/js/data/locale/gd/dateres.json
              new file mode 100644
              index 0000000000..b328efa114
              --- /dev/null
              +++ b/js/data/locale/gd/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "m/f",
              +    "Day": "latha",
              +    "Day of Year": "là dhen bhliadhna",
              +    "Era": "linn",
              +    "Hour": "uair a thìde",
              +    "Minute": "mionaid",
              +    "Month": "mìos",
              +    "Second": "diog",
              +    "Time Zone": "roinn-tìde",
              +    "Week": "seachdain",
              +    "Week of Month": "seachdain dhen mhìos",
              +    "Year": "bliadhna"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/gl/dateres.json b/js/data/locale/gl/dateres.json
              new file mode 100644
              index 0000000000..09f0593141
              --- /dev/null
              +++ b/js/data/locale/gl/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "a.m./p.m.",
              +    "Day": "día",
              +    "Day of Year": "día do ano",
              +    "Era": "era",
              +    "Hour": "hora",
              +    "Minute": "minuto",
              +    "Month": "mes",
              +    "Second": "segundo",
              +    "Time Zone": "fuso horario",
              +    "Week": "semana",
              +    "Week of Month": "semana do mes",
              +    "Year": "ano"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/gsw/dateres.json b/js/data/locale/gsw/dateres.json
              new file mode 100644
              index 0000000000..5fcc4569b5
              --- /dev/null
              +++ b/js/data/locale/gsw/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Tageshälfti",
              +    "Day": "Tag",
              +    "Era": "Epoche",
              +    "Hour": "Schtund",
              +    "Minute": "Minuute",
              +    "Month": "Monet",
              +    "Second": "Sekunde",
              +    "Time Zone": "Zone",
              +    "Week": "Wuche",
              +    "Year": "Jaar"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/gu/dateres.json b/js/data/locale/gu/dateres.json
              new file mode 100644
              index 0000000000..703467258d
              --- /dev/null
              +++ b/js/data/locale/gu/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "દિવસ",
              +    "Day of Year": "વર્ષનો દિવસ",
              +    "Era": "યુગ",
              +    "Hour": "કલાક",
              +    "Minute": "મિનિટ",
              +    "Month": "મહિનો",
              +    "Second": "સેકન્ડ",
              +    "Time Zone": "સમય ઝોન",
              +    "Week": "અઠવાડિયું",
              +    "Week of Month": "મહિનાનું અઠવાડિયું",
              +    "Year": "વર્ષ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/guz/dateres.json b/js/data/locale/guz/dateres.json
              new file mode 100644
              index 0000000000..f9247ac89f
              --- /dev/null
              +++ b/js/data/locale/guz/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Mambia gose Morogoba",
              +    "Day": "Rituko",
              +    "Era": "Ebiro",
              +    "Hour": "Ensa",
              +    "Minute": "Edakika",
              +    "Month": "Omotienyi",
              +    "Second": "Esekendi",
              +    "Time Zone": "Chinse ‘chimo",
              +    "Week": "Omokubio",
              +    "Year": "Omwaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/gv/dateres.json b/js/data/locale/gv/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/gv/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ha/dateres.json b/js/data/locale/ha/dateres.json
              new file mode 100644
              index 0000000000..66a742122a
              --- /dev/null
              +++ b/js/data/locale/ha/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Yini",
              +    "Day": "Kwana",
              +    "Era": "Zamani",
              +    "Hour": "Awa",
              +    "Minute": "Minti",
              +    "Month": "Wata",
              +    "Second": "Daƙiƙa",
              +    "Time Zone": "Agogo",
              +    "Week": "Mako",
              +    "Year": "Shekara"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/haw/dateres.json b/js/data/locale/haw/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/haw/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/he/dateres.json b/js/data/locale/he/dateres.json
              new file mode 100644
              index 0000000000..cddfc3231b
              --- /dev/null
              +++ b/js/data/locale/he/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "לפנה״צ/אחה״צ",
              +    "Day": "יום",
              +    "Day of Year": "יום בשנה",
              +    "Era": "תקופה",
              +    "Hour": "שעה",
              +    "Minute": "דקה",
              +    "Month": "חודש",
              +    "Second": "שנייה",
              +    "Time Zone": "אזור",
              +    "Week": "שבוע",
              +    "Week of Month": "השבוע בחודש",
              +    "Year": "שנה"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/hi/dateres.json b/js/data/locale/hi/dateres.json
              new file mode 100644
              index 0000000000..a92455a1d8
              --- /dev/null
              +++ b/js/data/locale/hi/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "पूर्वाह्न/अपराह्न",
              +    "Day": "दिन",
              +    "Day of Year": "वर्ष का दिन",
              +    "Era": "युग",
              +    "Hour": "घंटा",
              +    "Minute": "मिनट",
              +    "Month": "माह",
              +    "Second": "सेकंड",
              +    "Time Zone": "समय क्षेत्र",
              +    "Week": "सप्ताह",
              +    "Week of Month": "माह का सप्ताह",
              +    "Year": "वर्ष"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/hr/dateres.json b/js/data/locale/hr/dateres.json
              new file mode 100644
              index 0000000000..9ba4bc39ee
              --- /dev/null
              +++ b/js/data/locale/hr/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "dan",
              +    "Day of Year": "dan u godini",
              +    "Era": "era",
              +    "Hour": "sat",
              +    "Minute": "minuta",
              +    "Month": "mjesec",
              +    "Second": "sekunda",
              +    "Time Zone": "vremenska zona",
              +    "Week": "tjedan",
              +    "Week of Month": "tjedan u mjesecu",
              +    "Year": "godina"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/hsb/dateres.json b/js/data/locale/hsb/dateres.json
              new file mode 100644
              index 0000000000..0755b5f52b
              --- /dev/null
              +++ b/js/data/locale/hsb/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "połojca dnja",
              +    "Day": "dźeń",
              +    "Era": "doba",
              +    "Hour": "hodźina",
              +    "Minute": "minuta",
              +    "Month": "měsac",
              +    "Second": "sekunda",
              +    "Time Zone": "časowe pasmo",
              +    "Week": "tydźeń",
              +    "Year": "lěto"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/hu/dateres.json b/js/data/locale/hu/dateres.json
              new file mode 100644
              index 0000000000..466eb505f8
              --- /dev/null
              +++ b/js/data/locale/hu/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "napszak",
              +    "Day": "nap",
              +    "Day of Year": "év napja",
              +    "Era": "éra",
              +    "Hour": "óra",
              +    "Minute": "perc",
              +    "Month": "hónap",
              +    "Second": "másodperc",
              +    "Time Zone": "időzóna",
              +    "Week": "hét",
              +    "Week of Month": "hónap hete",
              +    "Year": "év"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/hy/dateres.json b/js/data/locale/hy/dateres.json
              new file mode 100644
              index 0000000000..0d95027b7b
              --- /dev/null
              +++ b/js/data/locale/hy/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "ԿԱ/ԿՀ",
              +    "Day": "օր",
              +    "Day of Year": "տարվա օր",
              +    "Era": "թվարկություն",
              +    "Hour": "ժամ",
              +    "Minute": "րոպե",
              +    "Month": "ամիս",
              +    "Second": "վայրկյան",
              +    "Time Zone": "ժամային գոտի",
              +    "Week": "շաբաթ",
              +    "Week of Month": "ամսվա շաբաթ",
              +    "Year": "տարի"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ia/dateres.json b/js/data/locale/ia/dateres.json
              new file mode 100644
              index 0000000000..ef7852299d
              --- /dev/null
              +++ b/js/data/locale/ia/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "die",
              +    "Day of Year": "die del anno",
              +    "Era": "era",
              +    "Hour": "hora",
              +    "Minute": "minuta",
              +    "Month": "mense",
              +    "Second": "secunda",
              +    "Time Zone": "fuso horari",
              +    "Week": "septimana",
              +    "Week of Month": "septimana del mense",
              +    "Year": "anno"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/id/dateres.json b/js/data/locale/id/dateres.json
              new file mode 100644
              index 0000000000..f398f110c0
              --- /dev/null
              +++ b/js/data/locale/id/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "hari",
              +    "Day of Year": "Hari dalam Setahun",
              +    "Era": "era",
              +    "Hour": "Jam",
              +    "Minute": "menit",
              +    "Month": "bulan",
              +    "Second": "detik",
              +    "Time Zone": "zona waktu",
              +    "Week": "minggu",
              +    "Week of Month": "minggu",
              +    "Year": "tahun"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ig/dateres.json b/js/data/locale/ig/dateres.json
              new file mode 100644
              index 0000000000..e80d83204d
              --- /dev/null
              +++ b/js/data/locale/ig/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "N’ụtụtụ/N’anyasị",
              +    "Day": "Ụbọchị",
              +    "Era": "Agba",
              +    "Hour": "Elekere",
              +    "Minute": "Nkeji",
              +    "Month": "Ọnwa",
              +    "Second": "Nkejinta",
              +    "Time Zone": "Mpaghara oge",
              +    "Week": "Izu",
              +    "Year": "Afọ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ii/dateres.json b/js/data/locale/ii/dateres.json
              new file mode 100644
              index 0000000000..ccdffb87c5
              --- /dev/null
              +++ b/js/data/locale/ii/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "ꎸꄑ/ꁯꋒ",
              +    "Day": "ꑍ",
              +    "Era": "ꃅꋊ",
              +    "Hour": "ꄮꈉ",
              +    "Minute": "ꃏ",
              +    "Month": "ꆪ",
              +    "Second": "ꇙ",
              +    "Time Zone": "ꃅꄷꄮꈉ",
              +    "Week": "ꑭꆏ",
              +    "Year": "ꈎ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/is/dateres.json b/js/data/locale/is/dateres.json
              new file mode 100644
              index 0000000000..25b4da056f
              --- /dev/null
              +++ b/js/data/locale/is/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "f.h./e.h.",
              +    "Day": "dagur",
              +    "Day of Year": "dagur í ári",
              +    "Era": "tímabil",
              +    "Hour": "klukkustund",
              +    "Minute": "mínúta",
              +    "Month": "mánuður",
              +    "Second": "sekúnda",
              +    "Time Zone": "tímabelti",
              +    "Week": "vika",
              +    "Week of Month": "vika í mánuði",
              +    "Year": "ár"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/it/dateres.json b/js/data/locale/it/dateres.json
              new file mode 100644
              index 0000000000..449c8a63a8
              --- /dev/null
              +++ b/js/data/locale/it/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "giorno",
              +    "Day of Year": "giorno dell’anno",
              +    "Era": "era",
              +    "Hour": "ora",
              +    "Minute": "minuto",
              +    "Month": "mese",
              +    "Second": "secondo",
              +    "Time Zone": "fuso orario",
              +    "Week": "settimana",
              +    "Week of Month": "settimana del mese",
              +    "Year": "anno"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ja/dateres.json b/js/data/locale/ja/dateres.json
              new file mode 100644
              index 0000000000..8c35b386be
              --- /dev/null
              +++ b/js/data/locale/ja/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "午前/午後",
              +    "Day": "日",
              +    "Day of Year": "年の通日",
              +    "Era": "時代",
              +    "Hour": "時",
              +    "Minute": "分",
              +    "Month": "月",
              +    "Second": "秒",
              +    "Time Zone": "タイムゾーン",
              +    "Week": "週",
              +    "Week of Month": "月の週番号",
              +    "Year": "年"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/jgo/dateres.json b/js/data/locale/jgo/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/jgo/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/jmc/dateres.json b/js/data/locale/jmc/dateres.json
              new file mode 100644
              index 0000000000..6cb392f9e3
              --- /dev/null
              +++ b/js/data/locale/jmc/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Mfiri o siku",
              +    "Day": "Mfiri",
              +    "Era": "Kacha",
              +    "Hour": "Saa",
              +    "Minute": "Dakyika",
              +    "Month": "Mori",
              +    "Second": "Sekunde",
              +    "Time Zone": "Mfiri o saa",
              +    "Week": "Wiikyi",
              +    "Year": "Maka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/jv/dateres.json b/js/data/locale/jv/dateres.json
              new file mode 100644
              index 0000000000..bacc99cfab
              --- /dev/null
              +++ b/js/data/locale/jv/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "isuk/wengi",
              +    "Day": "dino",
              +    "Era": "era",
              +    "Hour": "jam",
              +    "Minute": "menit",
              +    "Month": "sasi",
              +    "Second": "detik",
              +    "Time Zone": "zona wektu",
              +    "Week": "pekan",
              +    "Year": "taun"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ka/dateres.json b/js/data/locale/ka/dateres.json
              new file mode 100644
              index 0000000000..074deac3cb
              --- /dev/null
              +++ b/js/data/locale/ka/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "დღის ნახევარი",
              +    "Day": "დღე",
              +    "Day of Year": "წლის დღე",
              +    "Era": "ეპოქა",
              +    "Hour": "საათი",
              +    "Minute": "წუთი",
              +    "Month": "თვე",
              +    "Second": "წამი",
              +    "Time Zone": "დროის სარტყელი",
              +    "Week": "კვირა",
              +    "Week of Month": "თვის კვირა",
              +    "Year": "წელი"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/kab/dateres.json b/js/data/locale/kab/dateres.json
              new file mode 100644
              index 0000000000..26d07b6285
              --- /dev/null
              +++ b/js/data/locale/kab/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "n tufat / n tmeddit",
              +    "Day": "Ass",
              +    "Era": "Tallit",
              +    "Hour": "Tamert",
              +    "Minute": "Tamrect",
              +    "Month": "Aggur",
              +    "Second": "Tasint",
              +    "Time Zone": "Aseglem asergan",
              +    "Week": "Ddurt",
              +    "Year": "Aseggas"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/kam/dateres.json b/js/data/locale/kam/dateres.json
              new file mode 100644
              index 0000000000..944af6c735
              --- /dev/null
              +++ b/js/data/locale/kam/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Ĩyakwakya/Ĩyawĩoo",
              +    "Day": "Mũthenya",
              +    "Era": "Ĩvinda",
              +    "Hour": "Saa",
              +    "Minute": "Ndatĩka",
              +    "Month": "Mwai",
              +    "Second": "sekondi",
              +    "Time Zone": "Kĩsio kya ĩsaa",
              +    "Week": "Kyumwa",
              +    "Year": "Mwaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/kde/dateres.json b/js/data/locale/kde/dateres.json
              new file mode 100644
              index 0000000000..4f1be55c32
              --- /dev/null
              +++ b/js/data/locale/kde/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Muhi/Chilo",
              +    "Day": "Lihiku",
              +    "Era": "Mahiku",
              +    "Hour": "Saa",
              +    "Minute": "Dakika",
              +    "Month": "Mwedi",
              +    "Second": "Sekunde",
              +    "Time Zone": "Npanda wa muda",
              +    "Week": "Lijuma",
              +    "Year": "Mwaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/kea/dateres.json b/js/data/locale/kea/dateres.json
              new file mode 100644
              index 0000000000..f719f909e5
              --- /dev/null
              +++ b/js/data/locale/kea/dateres.json
              @@ -0,0 +1,11 @@
              +{
              +    "AM/PM": "am/pm",
              +    "Day": "Dia",
              +    "Hour": "Ora",
              +    "Minute": "Minutu",
              +    "Month": "Mes",
              +    "Second": "Sigundu",
              +    "Time Zone": "Ora lokal",
              +    "Week": "Simana",
              +    "Year": "Anu"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/khq/dateres.json b/js/data/locale/khq/dateres.json
              new file mode 100644
              index 0000000000..62efc40805
              --- /dev/null
              +++ b/js/data/locale/khq/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Adduha wala Aluula",
              +    "Day": "Jaari",
              +    "Era": "Zaman",
              +    "Hour": "Guuru",
              +    "Minute": "Miniti",
              +    "Month": "Handu",
              +    "Second": "Miti",
              +    "Time Zone": "Leerazuu",
              +    "Week": "Hebu",
              +    "Year": "Jiiri"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ki/dateres.json b/js/data/locale/ki/dateres.json
              new file mode 100644
              index 0000000000..575f11a8d2
              --- /dev/null
              +++ b/js/data/locale/ki/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day": "Mũthenya",
              +    "Era": "Kĩhinda",
              +    "Hour": "Ithaa",
              +    "Minute": "Ndagĩka",
              +    "Month": "Mweri",
              +    "Second": "Sekunde",
              +    "Time Zone": "Mũcooro wa mathaa",
              +    "Week": "Kiumia",
              +    "Year": "Mwaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/kk/dateres.json b/js/data/locale/kk/dateres.json
              new file mode 100644
              index 0000000000..39c1a3f0cc
              --- /dev/null
              +++ b/js/data/locale/kk/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "АМ/РМ",
              +    "Day": "күн",
              +    "Day of Year": "жылдағы күн",
              +    "Era": "дәуір",
              +    "Hour": "сағат",
              +    "Minute": "минут",
              +    "Month": "ай",
              +    "Second": "секунд",
              +    "Time Zone": "уақыт белдеуі",
              +    "Week": "апта",
              +    "Week of Month": "айдағы апта",
              +    "Year": "жыл"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/kkj/dateres.json b/js/data/locale/kkj/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/kkj/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/kl/dateres.json b/js/data/locale/kl/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/kl/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/kln/dateres.json b/js/data/locale/kln/dateres.json
              new file mode 100644
              index 0000000000..39cf5ab305
              --- /dev/null
              +++ b/js/data/locale/kln/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "BE/KE",
              +    "Day": "Betut",
              +    "Era": "Ibinta",
              +    "Hour": "Sait",
              +    "Minute": "Minitit",
              +    "Month": "Arawet",
              +    "Second": "Sekondit",
              +    "Time Zone": "Saitab sonit",
              +    "Week": "Wikit",
              +    "Year": "Kenyit"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/km/dateres.json b/js/data/locale/km/dateres.json
              new file mode 100644
              index 0000000000..32fe145224
              --- /dev/null
              +++ b/js/data/locale/km/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "ព្រឹក/ល្ងាច",
              +    "Day": "ថ្ងៃ",
              +    "Day of Year": "ថ្ងៃនៃឆ្នាំ",
              +    "Era": "សករាជ",
              +    "Hour": "ម៉ោង",
              +    "Minute": "នាទី",
              +    "Month": "ខែ",
              +    "Second": "វិនាទី",
              +    "Time Zone": "ល្វែងម៉ោង",
              +    "Week": "សប្ដាហ៍",
              +    "Week of Month": "សប្ដាហ៍នៃខែ",
              +    "Year": "ឆ្នាំ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/kn/dateres.json b/js/data/locale/kn/dateres.json
              new file mode 100644
              index 0000000000..4c68acf0ed
              --- /dev/null
              +++ b/js/data/locale/kn/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "ದಿನ",
              +    "Day of Year": "ವರ್ಷದ ದಿನ",
              +    "Era": "ಯುಗ",
              +    "Hour": "ಗಂಟೆ",
              +    "Minute": "ನಿಮಿಷ",
              +    "Month": "ತಿಂಗಳು",
              +    "Second": "ಸೆಕೆಂಡ್",
              +    "Time Zone": "ಸಮಯ ವಲಯ",
              +    "Week": "ವಾರ",
              +    "Week of Month": "ತಿಂಗಳ ವಾರ",
              +    "Year": "ವರ್ಷ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ko/dateres.json b/js/data/locale/ko/dateres.json
              new file mode 100644
              index 0000000000..a1f8c3df89
              --- /dev/null
              +++ b/js/data/locale/ko/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "오전/오후",
              +    "Day": "일",
              +    "Day of Year": "년의 일",
              +    "Era": "연호",
              +    "Hour": "시",
              +    "Minute": "분",
              +    "Month": "월",
              +    "Second": "초",
              +    "Time Zone": "시간대",
              +    "Week": "주",
              +    "Week of Month": "월의 주",
              +    "Year": "년"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/kok/dateres.json b/js/data/locale/kok/dateres.json
              new file mode 100644
              index 0000000000..e54a3a14d8
              --- /dev/null
              +++ b/js/data/locale/kok/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "दिसाचोकालावधी",
              +    "Day": "दीस",
              +    "Day of Year": "वर्साचो दीस",
              +    "Era": "शक",
              +    "Hour": "वर",
              +    "Minute": "मिनीट",
              +    "Month": "म्हयनो",
              +    "Second": "सेकंद",
              +    "Time Zone": "झोन",
              +    "Week": "सप्तक",
              +    "Week of Month": "म्हयन्यातलो सप्तक",
              +    "Year": "वर्स"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ks/dateres.json b/js/data/locale/ks/dateres.json
              new file mode 100644
              index 0000000000..79989c5ecb
              --- /dev/null
              +++ b/js/data/locale/ks/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "صبح/رات",
              +    "Day": "دۄہ",
              +    "Era": "دور",
              +    "Hour": "گٲنٛٹہٕ",
              +    "Minute": "مِنَٹ",
              +    "Month": "رٮ۪تھ",
              +    "Second": "سٮ۪کَنڑ",
              +    "Time Zone": "زون",
              +    "Week": "ہفتہٕ",
              +    "Year": "ؤری"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ksb/dateres.json b/js/data/locale/ksb/dateres.json
              new file mode 100644
              index 0000000000..e292c8e809
              --- /dev/null
              +++ b/js/data/locale/ksb/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Namshii",
              +    "Day": "Siku",
              +    "Era": "Mishi",
              +    "Hour": "Saa",
              +    "Minute": "Dakika",
              +    "Month": "Ng’ezi",
              +    "Second": "Sekunde",
              +    "Time Zone": "Majila",
              +    "Week": "Niki",
              +    "Year": "Ng’waka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ksf/dateres.json b/js/data/locale/ksf/dateres.json
              new file mode 100644
              index 0000000000..855262e490
              --- /dev/null
              +++ b/js/data/locale/ksf/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Sárúwá / Cɛɛ́nko",
              +    "Day": "Ŋwós",
              +    "Era": "Byámɛɛn",
              +    "Hour": "Cámɛɛn",
              +    "Minute": "Mǝnít",
              +    "Month": "Ŋwíí",
              +    "Second": "Háu",
              +    "Time Zone": "Wáas",
              +    "Week": "Sɔ́ndǝ",
              +    "Year": "Bǝk"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ksh/dateres.json b/js/data/locale/ksh/dateres.json
              new file mode 100644
              index 0000000000..4421282a93
              --- /dev/null
              +++ b/js/data/locale/ksh/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Daachteil",
              +    "Day": "Daach",
              +    "Era": "Ähra",
              +    "Hour": "Schtund",
              +    "Minute": "Menutt",
              +    "Month": "Mohnd",
              +    "Second": "Sekond",
              +    "Time Zone": "Zickzohn",
              +    "Week": "Woch",
              +    "Year": "Johr"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ku/dateres.json b/js/data/locale/ku/dateres.json
              new file mode 100644
              index 0000000000..a3bdeb5f8f
              --- /dev/null
              +++ b/js/data/locale/ku/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day": "roj",
              +    "Era": "serdem",
              +    "Hour": "saet",
              +    "Minute": "deqîqe",
              +    "Month": "meh",
              +    "Second": "saniye",
              +    "Time Zone": "Zone",
              +    "Week": "hefte",
              +    "Year": "sal"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/kw/dateres.json b/js/data/locale/kw/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/kw/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ky/dateres.json b/js/data/locale/ky/dateres.json
              new file mode 100644
              index 0000000000..efb9bf1791
              --- /dev/null
              +++ b/js/data/locale/ky/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "ТЧ/ТК",
              +    "Day": "күн",
              +    "Day of Year": "жылдын күнү",
              +    "Era": "заман",
              +    "Hour": "саат",
              +    "Minute": "мүнөт",
              +    "Month": "ай",
              +    "Second": "секунд",
              +    "Time Zone": "убакыт алкагы",
              +    "Week": "апта",
              +    "Week of Month": "айдын жумасы",
              +    "Year": "жыл"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/lag/dateres.json b/js/data/locale/lag/dateres.json
              new file mode 100644
              index 0000000000..89c1397459
              --- /dev/null
              +++ b/js/data/locale/lag/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Mpɨɨndɨ ja sikʉ",
              +    "Day": "Sikʉ",
              +    "Era": "Mpɨɨndɨ",
              +    "Hour": "Sáa",
              +    "Minute": "Dakíka",
              +    "Month": "Mweéri",
              +    "Second": "Sekúunde",
              +    "Time Zone": "Mpɨɨndɨ ja mɨɨtʉ",
              +    "Week": "Wíiki",
              +    "Year": "Mwaáka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/lb/dateres.json b/js/data/locale/lb/dateres.json
              new file mode 100644
              index 0000000000..eeca8ae0a5
              --- /dev/null
              +++ b/js/data/locale/lb/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Dageshallschent",
              +    "Day": "Dag",
              +    "Era": "Epoch",
              +    "Hour": "Stonn",
              +    "Minute": "Minutt",
              +    "Month": "Mount",
              +    "Second": "Sekonn",
              +    "Time Zone": "Zäitzon",
              +    "Week": "Woch",
              +    "Year": "Joer"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/lg/dateres.json b/js/data/locale/lg/dateres.json
              new file mode 100644
              index 0000000000..017f6cba42
              --- /dev/null
              +++ b/js/data/locale/lg/dateres.json
              @@ -0,0 +1,11 @@
              +{
              +    "Day": "Lunaku",
              +    "Era": "Mulembe",
              +    "Hour": "Saawa",
              +    "Minute": "Dakiika",
              +    "Month": "Mwezi",
              +    "Second": "Kasikonda",
              +    "Time Zone": "Ssaawa za:",
              +    "Week": "Sabbiiti",
              +    "Year": "Mwaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/lkt/dateres.json b/js/data/locale/lkt/dateres.json
              new file mode 100644
              index 0000000000..c6a1d3e6fc
              --- /dev/null
              +++ b/js/data/locale/lkt/dateres.json
              @@ -0,0 +1,11 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day": "Aŋpétu",
              +    "Hour": "Owápȟe",
              +    "Minute": "Owápȟe oȟʼáŋkȟo",
              +    "Month": "Wí",
              +    "Second": "Okpí",
              +    "Time Zone": "Zone",
              +    "Week": "Okó",
              +    "Year": "Ómakȟa"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ln/dateres.json b/js/data/locale/ln/dateres.json
              new file mode 100644
              index 0000000000..3046a0bc8a
              --- /dev/null
              +++ b/js/data/locale/ln/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Eleko ya mokɔlɔ",
              +    "Day": "Mokɔlɔ",
              +    "Era": "Ntángo",
              +    "Hour": "Ngonga",
              +    "Minute": "Monúti",
              +    "Month": "Sánzá",
              +    "Second": "Sɛkɔ́ndɛ",
              +    "Time Zone": "Ntáká ya ngonga",
              +    "Week": "Pɔ́sɔ",
              +    "Year": "Mobú"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/lo/dateres.json b/js/data/locale/lo/dateres.json
              new file mode 100644
              index 0000000000..b0d0152614
              --- /dev/null
              +++ b/js/data/locale/lo/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "ກ່ອນທ່ຽງ/ຫຼັງທ່ຽງ",
              +    "Day": "ມື້",
              +    "Day of Year": "ມື້ຂອງປີ",
              +    "Era": "ສະໄໝ",
              +    "Hour": "ຊົ່ວໂມງ",
              +    "Minute": "ນາທີ",
              +    "Month": "ເດືອນ",
              +    "Second": "ວິນາທີ",
              +    "Time Zone": "ເຂດເວລາ",
              +    "Week": "ອາທິດ",
              +    "Week of Month": "ອາທິດຂອງເດືອນ",
              +    "Year": "ປີ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/lrc/dateres.json b/js/data/locale/lrc/dateres.json
              new file mode 100644
              index 0000000000..06d288093a
              --- /dev/null
              +++ b/js/data/locale/lrc/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "گات روٙز",
              +    "Day": "روٙز",
              +    "Era": "سأرۉ",
              +    "Hour": "ساأت",
              +    "Minute": "دئیقە",
              +    "Month": "ما",
              +    "Second": "ثانیە",
              +    "Time Zone": "راساگە",
              +    "Week": "ھأفتە",
              +    "Year": "سال"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/lt/dateres.json b/js/data/locale/lt/dateres.json
              new file mode 100644
              index 0000000000..fac8dc4bb1
              --- /dev/null
              +++ b/js/data/locale/lt/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "iki pietų / po pietų",
              +    "Day": "diena",
              +    "Day of Year": "metų diena",
              +    "Era": "era",
              +    "Hour": "valanda",
              +    "Minute": "minutė",
              +    "Month": "mėnuo",
              +    "Second": "sekundė",
              +    "Time Zone": "laiko juosta",
              +    "Week": "savaitė",
              +    "Week of Month": "mėnesio savaitė",
              +    "Year": "metai"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/lu/dateres.json b/js/data/locale/lu/dateres.json
              new file mode 100644
              index 0000000000..31018ecb0f
              --- /dev/null
              +++ b/js/data/locale/lu/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Mutantshi wa diba",
              +    "Day": "Dituku",
              +    "Era": "Tshipungu",
              +    "Hour": "Diba",
              +    "Minute": "Kasunsu",
              +    "Month": "Ngondo",
              +    "Second": "Kasunsukusu",
              +    "Time Zone": "Nzeepu",
              +    "Week": "Lubingu",
              +    "Year": "Tshidimu"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/luo/dateres.json b/js/data/locale/luo/dateres.json
              new file mode 100644
              index 0000000000..273396a2b3
              --- /dev/null
              +++ b/js/data/locale/luo/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "odieochieng’/otieno",
              +    "Day": "chieng’",
              +    "Era": "ndalo",
              +    "Hour": "saa",
              +    "Minute": "dakika",
              +    "Month": "dwe",
              +    "Second": "nyiriri mar saa",
              +    "Time Zone": "kar saa",
              +    "Week": "juma",
              +    "Year": "higa"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/luy/dateres.json b/js/data/locale/luy/dateres.json
              new file mode 100644
              index 0000000000..45978f6e66
              --- /dev/null
              +++ b/js/data/locale/luy/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Vuche/Vwira",
              +    "Day": "Ridiku",
              +    "Era": "Rimenya",
              +    "Hour": "Isaa",
              +    "Minute": "Idagika",
              +    "Month": "Mweri",
              +    "Second": "Sekunde",
              +    "Time Zone": "Havundu",
              +    "Week": "Risiza",
              +    "Year": "Muhiga"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/lv/dateres.json b/js/data/locale/lv/dateres.json
              new file mode 100644
              index 0000000000..4f973e777f
              --- /dev/null
              +++ b/js/data/locale/lv/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "priekšpusdienā/pēcpusdienā",
              +    "Day": "diena",
              +    "Day of Year": "gada diena",
              +    "Era": "ēra",
              +    "Hour": "stundas",
              +    "Minute": "minūtes",
              +    "Month": "mēnesis",
              +    "Second": "sekundes",
              +    "Time Zone": "laika josla",
              +    "Week": "nedēļa",
              +    "Week of Month": "mēneša nedēļa",
              +    "Year": "gads"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/mas/dateres.json b/js/data/locale/mas/dateres.json
              new file mode 100644
              index 0000000000..b498f1f3d0
              --- /dev/null
              +++ b/js/data/locale/mas/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Ɛnkakɛnyá/Ɛndámâ",
              +    "Day": "Ɛnkɔlɔ́ŋ",
              +    "Era": "Ɛnkátá",
              +    "Hour": "Ɛ́sáâ",
              +    "Minute": "Oldákikaè",
              +    "Month": "Ɔlápà",
              +    "Second": "Sekunde",
              +    "Time Zone": "Ɛ́sáâ o inkuapí",
              +    "Week": "Ewíkî",
              +    "Year": "Ɔlárì"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/mer/dateres.json b/js/data/locale/mer/dateres.json
              new file mode 100644
              index 0000000000..5cf9fd2764
              --- /dev/null
              +++ b/js/data/locale/mer/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Mũthenya",
              +    "Day": "Ntukũ",
              +    "Era": "Ĩgita",
              +    "Hour": "Ĩthaa",
              +    "Minute": "Ndagika",
              +    "Month": "Mweri",
              +    "Second": "Sekondi",
              +    "Time Zone": "Gũntũ kwa thaa",
              +    "Week": "Kiumia",
              +    "Year": "Mwaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/mfe/dateres.json b/js/data/locale/mfe/dateres.json
              new file mode 100644
              index 0000000000..e537f8b54e
              --- /dev/null
              +++ b/js/data/locale/mfe/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Peryod dan lazourne",
              +    "Day": "Zour",
              +    "Era": "Lepok",
              +    "Hour": "Ler",
              +    "Minute": "Minit",
              +    "Month": "Mwa",
              +    "Second": "Segonn",
              +    "Time Zone": "Peryod letan",
              +    "Week": "Semenn",
              +    "Year": "Lane"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/mg/dateres.json b/js/data/locale/mg/dateres.json
              new file mode 100644
              index 0000000000..bb13f084b6
              --- /dev/null
              +++ b/js/data/locale/mg/dateres.json
              @@ -0,0 +1,10 @@
              +{
              +    "Day": "Andro",
              +    "Hour": "Ora",
              +    "Minute": "Minitra",
              +    "Month": "Volana",
              +    "Second": "Segondra",
              +    "Time Zone": "Zone",
              +    "Week": "Herinandro",
              +    "Year": "Taona"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/mgh/dateres.json b/js/data/locale/mgh/dateres.json
              new file mode 100644
              index 0000000000..32225d7eeb
              --- /dev/null
              +++ b/js/data/locale/mgh/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day": "nihuku",
              +    "Era": "kal’lai",
              +    "Hour": "isaa",
              +    "Minute": "idakika",
              +    "Month": "mweri",
              +    "Second": "isekunde",
              +    "Time Zone": "Zone",
              +    "Week": "iwiki mocha",
              +    "Year": "yaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/mgo/dateres.json b/js/data/locale/mgo/dateres.json
              new file mode 100644
              index 0000000000..00ae254106
              --- /dev/null
              +++ b/js/data/locale/mgo/dateres.json
              @@ -0,0 +1,8 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day": "anəg",
              +    "Month": "iməg",
              +    "Time Zone": "Zone",
              +    "Week": "nkap",
              +    "Year": "fituʼ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/mi/dateres.json b/js/data/locale/mi/dateres.json
              new file mode 100644
              index 0000000000..12899775c2
              --- /dev/null
              +++ b/js/data/locale/mi/dateres.json
              @@ -0,0 +1,11 @@
              +{
              +    "Day": "rā",
              +    "Era": "wā",
              +    "Hour": "hāora",
              +    "Minute": "meneti",
              +    "Month": "marama",
              +    "Second": "hēkona",
              +    "Time Zone": "rohe wā",
              +    "Week": "wiki",
              +    "Year": "tau"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/mk/dateres.json b/js/data/locale/mk/dateres.json
              new file mode 100644
              index 0000000000..f14164b196
              --- /dev/null
              +++ b/js/data/locale/mk/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "претпладне/попладне",
              +    "Day": "ден",
              +    "Day of Year": "ден од годината",
              +    "Era": "ера",
              +    "Hour": "час",
              +    "Minute": "минута",
              +    "Month": "месец",
              +    "Second": "секунда",
              +    "Time Zone": "временска зона",
              +    "Week": "седмица",
              +    "Week of Month": "седмица од месецот",
              +    "Year": "година"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ml/dateres.json b/js/data/locale/ml/dateres.json
              new file mode 100644
              index 0000000000..fad43735db
              --- /dev/null
              +++ b/js/data/locale/ml/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "ദിവസം",
              +    "Day of Year": "വർഷത്തിലെ ദിവസം",
              +    "Era": "കാലഘട്ടം",
              +    "Hour": "മണിക്കൂർ",
              +    "Minute": "മിനിറ്റ്",
              +    "Month": "മാസം",
              +    "Second": "സെക്കൻഡ്",
              +    "Time Zone": "സമയ മേഖല",
              +    "Week": "ആഴ്ച",
              +    "Week of Month": "മാസത്തിലെ ആഴ്‌ച",
              +    "Year": "വർഷം"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/mn/dateres.json b/js/data/locale/mn/dateres.json
              new file mode 100644
              index 0000000000..f827d4dc68
              --- /dev/null
              +++ b/js/data/locale/mn/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "ү.ө./ү.х.",
              +    "Day": "өдөр",
              +    "Day of Year": "жилийн хоног",
              +    "Era": "эрин",
              +    "Hour": "цаг",
              +    "Minute": "минут",
              +    "Month": "сар",
              +    "Second": "секунд",
              +    "Time Zone": "цагийн бүс",
              +    "Week": "долоо хоног",
              +    "Week of Month": "сарын долоо хоног",
              +    "Year": "жил"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/mr/dateres.json b/js/data/locale/mr/dateres.json
              new file mode 100644
              index 0000000000..119758a167
              --- /dev/null
              +++ b/js/data/locale/mr/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "[म.पू./म.उ.]",
              +    "Day": "दिवस",
              +    "Day of Year": "वर्षातील दिवस",
              +    "Era": "युग",
              +    "Hour": "तास",
              +    "Minute": "मिनिट",
              +    "Month": "महिना",
              +    "Second": "सेकंद",
              +    "Time Zone": "वेळ क्षेत्र",
              +    "Week": "आठवडा",
              +    "Week of Month": "महिन्याचा आठवडा",
              +    "Year": "वर्ष"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ms/dateres.json b/js/data/locale/ms/dateres.json
              new file mode 100644
              index 0000000000..bdd700f246
              --- /dev/null
              +++ b/js/data/locale/ms/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "PG/PTG",
              +    "Day": "hari",
              +    "Era": "era",
              +    "Hour": "jam",
              +    "Minute": "minit",
              +    "Month": "bulan",
              +    "Second": "saat",
              +    "Time Zone": "zon waktu",
              +    "Week": "minggu",
              +    "Year": "tahun"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/mt/dateres.json b/js/data/locale/mt/dateres.json
              new file mode 100644
              index 0000000000..c109487446
              --- /dev/null
              +++ b/js/data/locale/mt/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "Day": "jum",
              +    "Day of Year": "jum tas-sena",
              +    "Hour": "siegħa",
              +    "Minute": "minuta",
              +    "Month": "xahar",
              +    "Second": "sekonda",
              +    "Time Zone": "żona tal-ħin",
              +    "Week": "ġimgħa",
              +    "Week of Month": "ġimgħa tax-xahar",
              +    "Year": "Sena"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/mua/dateres.json b/js/data/locale/mua/dateres.json
              new file mode 100644
              index 0000000000..e5b50004db
              --- /dev/null
              +++ b/js/data/locale/mua/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day": "Zah’nane/ Comme",
              +    "Era": "Syii ma tãa",
              +    "Hour": "Cok comme",
              +    "Minute": "Cok comme ma laŋne",
              +    "Month": "Fĩi",
              +    "Second": "Cok comme ma laŋ tǝ biŋ",
              +    "Time Zone": "Waŋ cok comme",
              +    "Week": "Luma",
              +    "Year": "Syii"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/my/dateres.json b/js/data/locale/my/dateres.json
              new file mode 100644
              index 0000000000..4502d41008
              --- /dev/null
              +++ b/js/data/locale/my/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "နံနက်/ညနေ",
              +    "Day": "ရက်",
              +    "Day of Year": "တစ်နှစ်အတွင်း ရက်ရေတွက်ပုံ",
              +    "Era": "ခေတ်",
              +    "Hour": "နာရီ",
              +    "Minute": "မိနစ်",
              +    "Month": "လ",
              +    "Second": "စက္ကန့်",
              +    "Time Zone": "ဇုန်",
              +    "Week": "ပတ်",
              +    "Week of Month": "တစ်လအတွင်းရှိသီတင်းပတ်",
              +    "Year": "နှစ်"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/mzn/dateres.json b/js/data/locale/mzn/dateres.json
              new file mode 100644
              index 0000000000..2e4654951f
              --- /dev/null
              +++ b/js/data/locale/mzn/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "صواحی/ظُر",
              +    "Day": "روز",
              +    "Era": "تقویم",
              +    "Hour": "ساعِت",
              +    "Minute": "دقیقه",
              +    "Month": "ماه",
              +    "Second": "ثانیه",
              +    "Time Zone": "زمونی منقطه",
              +    "Week": "هفته",
              +    "Year": "سال"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/naq/dateres.json b/js/data/locale/naq/dateres.json
              new file mode 100644
              index 0000000000..5de481a0b1
              --- /dev/null
              +++ b/js/data/locale/naq/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "ǁgoas/ǃuis",
              +    "Day": "Tsees",
              +    "Era": "ǁAeǃgâs",
              +    "Hour": "Iiri",
              +    "Minute": "Haib",
              +    "Month": "ǁKhâb",
              +    "Second": "ǀGâub",
              +    "Time Zone": "ǁAeb ǀharib",
              +    "Week": "Wekheb",
              +    "Year": "Kurib"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/nb/dateres.json b/js/data/locale/nb/dateres.json
              new file mode 100644
              index 0000000000..c4adf087ee
              --- /dev/null
              +++ b/js/data/locale/nb/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "a.m./p.m.",
              +    "Day": "dag",
              +    "Day of Year": "dag i året",
              +    "Era": "tidsalder",
              +    "Hour": "time",
              +    "Minute": "minutt",
              +    "Month": "måned",
              +    "Second": "sekund",
              +    "Time Zone": "tidssone",
              +    "Week": "uke",
              +    "Week of Month": "uke i måneden",
              +    "Year": "år"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/nd/dateres.json b/js/data/locale/nd/dateres.json
              new file mode 100644
              index 0000000000..3979b1eae7
              --- /dev/null
              +++ b/js/data/locale/nd/dateres.json
              @@ -0,0 +1,11 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day": "Ilanga",
              +    "Hour": "Ihola",
              +    "Minute": "Umuzuzu",
              +    "Month": "Inyangacale",
              +    "Second": "Isekendi",
              +    "Time Zone": "Isikhathi",
              +    "Week": "Iviki",
              +    "Year": "Umnyaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/nds/dateres.json b/js/data/locale/nds/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/nds/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ne/dateres.json b/js/data/locale/ne/dateres.json
              new file mode 100644
              index 0000000000..593cc28d9d
              --- /dev/null
              +++ b/js/data/locale/ne/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "पूर्वाह्न / अपराह्न",
              +    "Day": "बार",
              +    "Day of Year": "वर्षको बार",
              +    "Era": "काल",
              +    "Hour": "घण्टा",
              +    "Minute": "मिनेट",
              +    "Month": "महिना",
              +    "Second": "सेकेन्ड",
              +    "Time Zone": "क्षेत्र",
              +    "Week": "हप्ता",
              +    "Week of Month": "महिनाको हप्ता",
              +    "Year": "वर्ष"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/nl/dateres.json b/js/data/locale/nl/dateres.json
              new file mode 100644
              index 0000000000..6f23af20c5
              --- /dev/null
              +++ b/js/data/locale/nl/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "a.m./p.m.",
              +    "Day": "dag",
              +    "Day of Year": "dag van het jaar",
              +    "Era": "tijdperk",
              +    "Hour": "uur",
              +    "Minute": "minuut",
              +    "Month": "maand",
              +    "Second": "seconde",
              +    "Time Zone": "tijdzone",
              +    "Week": "week",
              +    "Week of Month": "week van de maand",
              +    "Year": "jaar"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/nmg/dateres.json b/js/data/locale/nmg/dateres.json
              new file mode 100644
              index 0000000000..9159c7657e
              --- /dev/null
              +++ b/js/data/locale/nmg/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Máná, Muó, Kugú, Bvul",
              +    "Day": "Duö",
              +    "Era": "Pīl/Lahlɛ̄",
              +    "Hour": "Wulā",
              +    "Minute": "Mpálâ",
              +    "Month": "Ngwɛn",
              +    "Second": "Nyiɛl",
              +    "Time Zone": "Nkɛ̌l wulā",
              +    "Week": "Sɔ́ndɔ",
              +    "Year": "Mbvu"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/nn/dateres.json b/js/data/locale/nn/dateres.json
              new file mode 100644
              index 0000000000..f6f931b6c3
              --- /dev/null
              +++ b/js/data/locale/nn/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "f.m./e.m.",
              +    "Day": "dag",
              +    "Day of Year": "dag i året",
              +    "Era": "tidsalder",
              +    "Hour": "time",
              +    "Minute": "minutt",
              +    "Month": "månad",
              +    "Second": "sekund",
              +    "Time Zone": "tidssone",
              +    "Week": "veke",
              +    "Week of Month": "veke i månaden",
              +    "Year": "år"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/nnh/dateres.json b/js/data/locale/nnh/dateres.json
              new file mode 100644
              index 0000000000..23502a30d3
              --- /dev/null
              +++ b/js/data/locale/nnh/dateres.json
              @@ -0,0 +1,8 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day": "lyɛ̌ʼ",
              +    "Era": "tsɔ́ fʉ̀ʼ",
              +    "Hour": "fʉ̀ʼ nèm",
              +    "Time Zone": "Zone",
              +    "Year": "ngùʼ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/nus/dateres.json b/js/data/locale/nus/dateres.json
              new file mode 100644
              index 0000000000..e052b02511
              --- /dev/null
              +++ b/js/data/locale/nus/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day": "Cäŋ",
              +    "Era": "Gua̱a̱th Ruëc",
              +    "Hour": "Thaak",
              +    "Minute": "Minit",
              +    "Month": "Pay",
              +    "Second": "Thɛkɛni",
              +    "Time Zone": "Zone",
              +    "Week": "Jiɔk",
              +    "Year": "Ruɔ̱n"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/nyn/dateres.json b/js/data/locale/nyn/dateres.json
              new file mode 100644
              index 0000000000..fafa51907f
              --- /dev/null
              +++ b/js/data/locale/nyn/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Nyomushana/nyekiro",
              +    "Day": "Eizooba",
              +    "Era": "Obunaku",
              +    "Hour": "Shaaha",
              +    "Minute": "Edakiika",
              +    "Month": "Omwezi",
              +    "Second": "Obucweka/Esekendi",
              +    "Time Zone": "Eshaaha za",
              +    "Week": "Esande",
              +    "Year": "Omwaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/om/dateres.json b/js/data/locale/om/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/om/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/or/dateres.json b/js/data/locale/or/dateres.json
              new file mode 100644
              index 0000000000..a7d85f57ac
              --- /dev/null
              +++ b/js/data/locale/or/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "ପୂର୍ବାହ୍ନ/ଅପରାହ୍ନ",
              +    "Day": "ଦିନ",
              +    "Day of Year": "ବର୍ଷର ଦିନ",
              +    "Era": "ଯୁଗ",
              +    "Hour": "ଘଣ୍ଟା",
              +    "Minute": "ମିନିଟ୍",
              +    "Month": "ମାସ",
              +    "Second": "ସେକେଣ୍ଡ୍",
              +    "Time Zone": "ସମୟ କ୍ଷେତ୍ର",
              +    "Week": "ସପ୍ତାହ",
              +    "Week of Month": "ମାସର ସପ୍ତାହ",
              +    "Year": "ବର୍ଷ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/os/dateres.json b/js/data/locale/os/dateres.json
              new file mode 100644
              index 0000000000..86e3748be0
              --- /dev/null
              +++ b/js/data/locale/os/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Боны период",
              +    "Day": "Бон",
              +    "Era": "Дуг",
              +    "Hour": "Сахат",
              +    "Minute": "Минут",
              +    "Month": "Мӕй",
              +    "Second": "Секунд",
              +    "Time Zone": "Рӕстӕджы зонӕ",
              +    "Week": "Къуыри",
              +    "Year": "Аз"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/pa/Arab/dateres.json b/js/data/locale/pa/Arab/dateres.json
              new file mode 100644
              index 0000000000..d84a463e60
              --- /dev/null
              +++ b/js/data/locale/pa/Arab/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day": "دئن",
              +    "Day of Year": "Day Of Year",
              +    "Hour": "گھنٹا",
              +    "Minute": "منٹ",
              +    "Month": "مہينا",
              +    "Time Zone": "ٹپہ",
              +    "Week": "ہفتہ",
              +    "Week of Month": "Week Of Month",
              +    "Year": "ورھا"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/pa/dateres.json b/js/data/locale/pa/dateres.json
              new file mode 100644
              index 0000000000..c69eae88cf
              --- /dev/null
              +++ b/js/data/locale/pa/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "ਪੂ.ਦੁ./ਬਾ.ਦੁ.",
              +    "Day": "ਦਿਨ",
              +    "Day of Year": "ਸਾਲ ਦਾ ਦਿਨ",
              +    "Era": "ਸੰਮਤ",
              +    "Hour": "ਘੰਟਾ",
              +    "Minute": "ਮਿੰਟ",
              +    "Month": "ਮਹੀਨਾ",
              +    "Second": "ਸਕਿੰਟ",
              +    "Time Zone": "ਇਲਾਕਾਈ ਵੇਲਾ",
              +    "Week": "ਹਫ਼ਤਾ",
              +    "Week of Month": "ਮਹੀਨੇ ਦਾ ਹਫ਼ਤਾ",
              +    "Year": "ਸਾਲ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/pl/dateres.json b/js/data/locale/pl/dateres.json
              new file mode 100644
              index 0000000000..f6cdb2d5d1
              --- /dev/null
              +++ b/js/data/locale/pl/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "rano / po południu / wieczorem",
              +    "Day": "dzień",
              +    "Day of Year": "dzień roku",
              +    "Era": "era",
              +    "Hour": "godzina",
              +    "Minute": "minuta",
              +    "Month": "miesiąc",
              +    "Second": "sekunda",
              +    "Time Zone": "strefa czasowa",
              +    "Week": "tydzień",
              +    "Week of Month": "tydzień miesiąca",
              +    "Year": "rok"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/prg/dateres.json b/js/data/locale/prg/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/prg/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ps/dateres.json b/js/data/locale/ps/dateres.json
              new file mode 100644
              index 0000000000..f0541f0e73
              --- /dev/null
              +++ b/js/data/locale/ps/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "ورځ شېبه",
              +    "Day": "ورځ",
              +    "Day of Year": "د کال ورځ",
              +    "Era": "پېر",
              +    "Hour": "ساعت",
              +    "Minute": "دقيقه",
              +    "Month": "مياشت",
              +    "Second": "ثانيه",
              +    "Time Zone": "وخت سيمه",
              +    "Week": "اونۍ",
              +    "Week of Month": "د مياشتې اونۍ",
              +    "Year": "کال"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/pt/dateres.json b/js/data/locale/pt/dateres.json
              new file mode 100644
              index 0000000000..1223bdf0be
              --- /dev/null
              +++ b/js/data/locale/pt/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "dia",
              +    "Day of Year": "dia do ano",
              +    "Era": "era",
              +    "Hour": "hora",
              +    "Minute": "minuto",
              +    "Month": "mês",
              +    "Second": "segundo",
              +    "Time Zone": "fuso horário",
              +    "Week": "semana",
              +    "Week of Month": "semana do mês",
              +    "Year": "ano"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/qu/dateres.json b/js/data/locale/qu/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/qu/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/rm/dateres.json b/js/data/locale/rm/dateres.json
              new file mode 100644
              index 0000000000..5f9ff7342e
              --- /dev/null
              +++ b/js/data/locale/rm/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "mesadad dal di",
              +    "Day": "Tag",
              +    "Era": "epoca",
              +    "Hour": "ura",
              +    "Minute": "minuta",
              +    "Month": "mais",
              +    "Second": "secunda",
              +    "Time Zone": "zona d’urari",
              +    "Week": "emna",
              +    "Year": "onn"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/rn/dateres.json b/js/data/locale/rn/dateres.json
              new file mode 100644
              index 0000000000..ba65eb02d0
              --- /dev/null
              +++ b/js/data/locale/rn/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "M.s/N.s",
              +    "Day": "Umusi",
              +    "Era": "Igihe",
              +    "Hour": "Isaha",
              +    "Minute": "Umunota",
              +    "Month": "Ukwezi",
              +    "Second": "Isegonda",
              +    "Time Zone": "Isaha yo mukarere",
              +    "Week": "Indwi, Iyinga",
              +    "Year": "Umwaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ro/dateres.json b/js/data/locale/ro/dateres.json
              new file mode 100644
              index 0000000000..00eb7709cf
              --- /dev/null
              +++ b/js/data/locale/ro/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "a.m/p.m.",
              +    "Day": "zi",
              +    "Day of Year": "ziua din an",
              +    "Era": "eră",
              +    "Hour": "oră",
              +    "Minute": "minut",
              +    "Month": "lună",
              +    "Second": "secundă",
              +    "Time Zone": "fus orar",
              +    "Week": "săptămână",
              +    "Week of Month": "săptămâna din lună",
              +    "Year": "an"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/rof/dateres.json b/js/data/locale/rof/dateres.json
              new file mode 100644
              index 0000000000..7733045094
              --- /dev/null
              +++ b/js/data/locale/rof/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Nkwaya",
              +    "Day": "Mfiri",
              +    "Era": "Kacha",
              +    "Hour": "Isaa",
              +    "Minute": "Dakika",
              +    "Month": "Mweri",
              +    "Second": "Sekunde",
              +    "Time Zone": "Mfiri o saa",
              +    "Week": "Iwiki",
              +    "Year": "Muaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ru/dateres.json b/js/data/locale/ru/dateres.json
              new file mode 100644
              index 0000000000..f65cf18fc6
              --- /dev/null
              +++ b/js/data/locale/ru/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "день",
              +    "Day of Year": "день года",
              +    "Era": "эра",
              +    "Hour": "час",
              +    "Minute": "минута",
              +    "Month": "месяц",
              +    "Second": "секунда",
              +    "Time Zone": "часовой пояс",
              +    "Week": "неделя",
              +    "Week of Month": "неделя месяца",
              +    "Year": "год"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/rw/dateres.json b/js/data/locale/rw/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/rw/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/rwk/dateres.json b/js/data/locale/rwk/dateres.json
              new file mode 100644
              index 0000000000..6cb392f9e3
              --- /dev/null
              +++ b/js/data/locale/rwk/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Mfiri o siku",
              +    "Day": "Mfiri",
              +    "Era": "Kacha",
              +    "Hour": "Saa",
              +    "Minute": "Dakyika",
              +    "Month": "Mori",
              +    "Second": "Sekunde",
              +    "Time Zone": "Mfiri o saa",
              +    "Week": "Wiikyi",
              +    "Year": "Maka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/sah/dateres.json b/js/data/locale/sah/dateres.json
              new file mode 100644
              index 0000000000..2f5e45d266
              --- /dev/null
              +++ b/js/data/locale/sah/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "ЭИ/ЭК",
              +    "Day": "Күн",
              +    "Era": "Ээрэ",
              +    "Hour": "Чаас",
              +    "Minute": "Мүнүүтэ",
              +    "Month": "Ый",
              +    "Second": "Сөкүүндэ",
              +    "Time Zone": "Кэм балаһата",
              +    "Week": "Нэдиэлэ",
              +    "Year": "Сыл"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/saq/dateres.json b/js/data/locale/saq/dateres.json
              new file mode 100644
              index 0000000000..3d43b5c6a3
              --- /dev/null
              +++ b/js/data/locale/saq/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "TS/TP",
              +    "Day": "Mpari",
              +    "Era": "Nyamata",
              +    "Hour": "Saai",
              +    "Minute": "Idakika",
              +    "Month": "Lapa",
              +    "Second": "Isekondi",
              +    "Time Zone": "Majira ya saa",
              +    "Week": "Saipa napo",
              +    "Year": "Lari"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/sbp/dateres.json b/js/data/locale/sbp/dateres.json
              new file mode 100644
              index 0000000000..cb77b0d345
              --- /dev/null
              +++ b/js/data/locale/sbp/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Uluhaavi lwa lusiku",
              +    "Day": "Lusiku",
              +    "Era": "Uluhaavi lwa",
              +    "Hour": "Ilisala",
              +    "Minute": "Idakika",
              +    "Month": "Mwesi",
              +    "Second": "Isekunde",
              +    "Time Zone": "Uluhaavi lwa lisaa",
              +    "Week": "Ilijuma",
              +    "Year": "Mwakha"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/sd/dateres.json b/js/data/locale/sd/dateres.json
              new file mode 100644
              index 0000000000..7df14e0980
              --- /dev/null
              +++ b/js/data/locale/sd/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "صبح/شام",
              +    "Day": "ڏينهن",
              +    "Day of Year": "سال جو ڏينهن",
              +    "Era": "دور",
              +    "Hour": "ڪلاڪ",
              +    "Minute": "منٽ",
              +    "Month": "مهينو",
              +    "Second": "سيڪنڊ",
              +    "Time Zone": "ٽائيم زون",
              +    "Week": "هفتو",
              +    "Week of Month": "مهيني جي هفتي",
              +    "Year": "سال"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/se/FI/dateres.json b/js/data/locale/se/FI/dateres.json
              new file mode 100644
              index 0000000000..0fc067cedc
              --- /dev/null
              +++ b/js/data/locale/se/FI/dateres.json
              @@ -0,0 +1,8 @@
              +{
              +    "AM/PM": "ib/eb",
              +    "Day of Year": "jagi beaivi",
              +    "Era": "áigodat",
              +    "Week": "vahkku",
              +    "Week of Month": "mánu vahkku",
              +    "Year": "jahki"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/se/dateres.json b/js/data/locale/se/dateres.json
              new file mode 100644
              index 0000000000..ae9d0c3588
              --- /dev/null
              +++ b/js/data/locale/se/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "beaivi ráidodássi",
              +    "Day": "beaivi",
              +    "Era": "éra",
              +    "Hour": "diibmu",
              +    "Minute": "minuhtta",
              +    "Month": "mánnu",
              +    "Second": "sekunda",
              +    "Time Zone": "áigeavádat",
              +    "Week": "váhkku",
              +    "Year": "jáhki"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/seh/dateres.json b/js/data/locale/seh/dateres.json
              new file mode 100644
              index 0000000000..657a290e9d
              --- /dev/null
              +++ b/js/data/locale/seh/dateres.json
              @@ -0,0 +1,10 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day": "Ntsiku",
              +    "Hour": "Hora",
              +    "Minute": "Minuto",
              +    "Month": "Mwezi",
              +    "Second": "Segundo",
              +    "Time Zone": "Zone",
              +    "Year": "Chaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ses/dateres.json b/js/data/locale/ses/dateres.json
              new file mode 100644
              index 0000000000..f026e05d6d
              --- /dev/null
              +++ b/js/data/locale/ses/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Adduha wala Aluula",
              +    "Day": "Zaari",
              +    "Era": "Zaman",
              +    "Hour": "Guuru",
              +    "Minute": "Miniti",
              +    "Month": "Handu",
              +    "Second": "Miti",
              +    "Time Zone": "Leerazuu",
              +    "Week": "Hebu",
              +    "Year": "Jiiri"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/sg/dateres.json b/js/data/locale/sg/dateres.json
              new file mode 100644
              index 0000000000..42ea3e94e8
              --- /dev/null
              +++ b/js/data/locale/sg/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Na lâ",
              +    "Day": "Lâ",
              +    "Era": "Kùotângo",
              +    "Hour": "Ngbonga",
              +    "Minute": "Ndurü ngbonga",
              +    "Month": "Nze",
              +    "Second": "Nzîna ngbonga",
              +    "Time Zone": "Zukangbonga",
              +    "Week": "Dimâsi",
              +    "Year": "Ngû"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/shi/Latn/dateres.json b/js/data/locale/shi/Latn/dateres.json
              new file mode 100644
              index 0000000000..033cf27fc6
              --- /dev/null
              +++ b/js/data/locale/shi/Latn/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "tizi g wass: tifawt / tadggʷat",
              +    "Day": "ass",
              +    "Era": "tasut",
              +    "Hour": "tasragt",
              +    "Minute": "tusdidt",
              +    "Month": "ayyur",
              +    "Second": "tasint",
              +    "Time Zone": "akud n ugmmaḍ",
              +    "Week": "imalass",
              +    "Year": "asggʷas"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/shi/dateres.json b/js/data/locale/shi/dateres.json
              new file mode 100644
              index 0000000000..01d04e184e
              --- /dev/null
              +++ b/js/data/locale/shi/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "ⵜⵉⵣⵉ ⴳ ⵡⴰⵙⵙ: ⵜⵉⴼⴰⵡⵜ/ⵜⴰⴷⴳⴳⵯⴰⵜ",
              +    "Day": "ⴰⵙⵙ",
              +    "Era": "ⵜⴰⵙⵓⵜ",
              +    "Hour": "ⵜⴰⵙⵔⴰⴳⵜ",
              +    "Minute": "ⵜⵓⵙⴷⵉⴷⵜ",
              +    "Month": "ⴰⵢⵢⵓⵔ",
              +    "Second": "ⵜⴰⵙⵉⵏⵜ",
              +    "Time Zone": "ⴰⴽⵓⴷ ⵏ ⵓⴳⵎⵎⴰⴹ",
              +    "Week": "ⵉⵎⴰⵍⴰⵙⵙ",
              +    "Year": "ⴰⵙⴳⴳⵯⴰⵙ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/si/dateres.json b/js/data/locale/si/dateres.json
              new file mode 100644
              index 0000000000..98f07b47aa
              --- /dev/null
              +++ b/js/data/locale/si/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "පෙ.ව/ප.ව",
              +    "Day": "දිනය",
              +    "Day of Year": "වසරේ දිනය",
              +    "Era": "යුගය",
              +    "Hour": "පැය",
              +    "Minute": "මිනිත්තුව",
              +    "Month": "මාසය",
              +    "Second": "තත්පරය",
              +    "Time Zone": "වේලා කලාපය",
              +    "Week": "සතිය",
              +    "Week of Month": "මාසයේ සතිය",
              +    "Year": "වර්ෂය"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/sk/dateres.json b/js/data/locale/sk/dateres.json
              new file mode 100644
              index 0000000000..e385c13a32
              --- /dev/null
              +++ b/js/data/locale/sk/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "deň",
              +    "Day of Year": "deň roka",
              +    "Era": "letopočet",
              +    "Hour": "hodina",
              +    "Minute": "minúta",
              +    "Month": "mesiac",
              +    "Second": "sekunda",
              +    "Time Zone": "časové pásmo",
              +    "Week": "týždeň",
              +    "Week of Month": "týždeň mesiaca",
              +    "Year": "rok"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/sl/dateres.json b/js/data/locale/sl/dateres.json
              new file mode 100644
              index 0000000000..af221983e3
              --- /dev/null
              +++ b/js/data/locale/sl/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "dop/pop",
              +    "Day": "dan",
              +    "Day of Year": "dan leta",
              +    "Era": "doba",
              +    "Hour": "ura",
              +    "Minute": "minuta",
              +    "Month": "mesec",
              +    "Second": "sekunda",
              +    "Time Zone": "časovni pas",
              +    "Week": "teden",
              +    "Week of Month": "teden meseca",
              +    "Year": "leto"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/smn/dateres.json b/js/data/locale/smn/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/smn/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/sn/dateres.json b/js/data/locale/sn/dateres.json
              new file mode 100644
              index 0000000000..65f7224d96
              --- /dev/null
              +++ b/js/data/locale/sn/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day": "Zuva",
              +    "Era": "Mukore",
              +    "Hour": "Awa",
              +    "Minute": "Mineti",
              +    "Month": "Mwedzi",
              +    "Second": "Sekondi",
              +    "Time Zone": "Nguva",
              +    "Week": "Vhiki",
              +    "Year": "Gore"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/so/dateres.json b/js/data/locale/so/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/so/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/sq/dateres.json b/js/data/locale/sq/dateres.json
              new file mode 100644
              index 0000000000..a5c258794c
              --- /dev/null
              +++ b/js/data/locale/sq/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "paradite/pasdite",
              +    "Day": "ditë",
              +    "Day of Year": "ditë e vitit",
              +    "Era": "erë",
              +    "Hour": "orë",
              +    "Minute": "minutë",
              +    "Month": "muaj",
              +    "Second": "sekondë",
              +    "Time Zone": "brezi orar",
              +    "Week": "javë",
              +    "Week of Month": "javë e muajit",
              +    "Year": "vit"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/sr/Latn/dateres.json b/js/data/locale/sr/Latn/dateres.json
              new file mode 100644
              index 0000000000..e7a4256317
              --- /dev/null
              +++ b/js/data/locale/sr/Latn/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "pre podne/po podne",
              +    "Day": "dan",
              +    "Day of Year": "dan u godini",
              +    "Era": "era",
              +    "Hour": "sat",
              +    "Minute": "minut",
              +    "Month": "mesec",
              +    "Second": "sekund",
              +    "Time Zone": "vremenska zona",
              +    "Week": "nedelja",
              +    "Week of Month": "nedelja u mesecu",
              +    "Year": "godina"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/sr/dateres.json b/js/data/locale/sr/dateres.json
              new file mode 100644
              index 0000000000..76c8f1227b
              --- /dev/null
              +++ b/js/data/locale/sr/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "пре подне/по подне",
              +    "Day": "дан",
              +    "Day of Year": "дан у години",
              +    "Era": "ера",
              +    "Hour": "сат",
              +    "Minute": "минут",
              +    "Month": "месец",
              +    "Second": "секунд",
              +    "Time Zone": "временска зона",
              +    "Week": "недеља",
              +    "Week of Month": "недеља у месецу",
              +    "Year": "година"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/sv/dateres.json b/js/data/locale/sv/dateres.json
              new file mode 100644
              index 0000000000..72bfd16ea3
              --- /dev/null
              +++ b/js/data/locale/sv/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "fm/em",
              +    "Day": "dag",
              +    "Day of Year": "dag under året",
              +    "Era": "era",
              +    "Hour": "timme",
              +    "Minute": "minut",
              +    "Month": "månad",
              +    "Second": "sekund",
              +    "Time Zone": "tidszon",
              +    "Week": "vecka",
              +    "Week of Month": "vecka i månaden",
              +    "Year": "år"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/sw/CD/dateres.json b/js/data/locale/sw/CD/dateres.json
              new file mode 100644
              index 0000000000..becc00185f
              --- /dev/null
              +++ b/js/data/locale/sw/CD/dateres.json
              @@ -0,0 +1,6 @@
              +{
              +    "AM/PM": "Muda wa siku",
              +    "Era": "Wakati",
              +    "Time Zone": "Majira ya saa",
              +    "Week": "Juma"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/sw/dateres.json b/js/data/locale/sw/dateres.json
              new file mode 100644
              index 0000000000..6337b3b756
              --- /dev/null
              +++ b/js/data/locale/sw/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "siku",
              +    "Day of Year": "siku ya mwaka",
              +    "Era": "enzi",
              +    "Hour": "saa",
              +    "Minute": "dakika",
              +    "Month": "mwezi",
              +    "Second": "sekunde",
              +    "Time Zone": "saa za eneo",
              +    "Week": "wiki",
              +    "Week of Month": "wiki ya mwezi",
              +    "Year": "mwaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ta/dateres.json b/js/data/locale/ta/dateres.json
              new file mode 100644
              index 0000000000..78052ba75d
              --- /dev/null
              +++ b/js/data/locale/ta/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "முற்பகல்/பிற்பகல்",
              +    "Day": "நாள்",
              +    "Day of Year": "வருடத்தின் நாள்",
              +    "Era": "காலம்",
              +    "Hour": "மணி",
              +    "Minute": "நிமிடம்",
              +    "Month": "மாதம்",
              +    "Second": "விநாடி",
              +    "Time Zone": "நேர மண்டலம்",
              +    "Week": "வாரம்",
              +    "Week of Month": "மாதத்தின் வாரம்",
              +    "Year": "ஆண்டு"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/te/dateres.json b/js/data/locale/te/dateres.json
              new file mode 100644
              index 0000000000..3fbe5cb5db
              --- /dev/null
              +++ b/js/data/locale/te/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "దినం",
              +    "Day of Year": "సంవత్సరంలో దినం",
              +    "Era": "యుగం",
              +    "Hour": "గంట",
              +    "Minute": "నిమిషము",
              +    "Month": "నెల",
              +    "Second": "సెకను",
              +    "Time Zone": "సమయ మండలి",
              +    "Week": "వారము",
              +    "Week of Month": "నెలలో వారం",
              +    "Year": "సంవత్సరం"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/teo/dateres.json b/js/data/locale/teo/dateres.json
              new file mode 100644
              index 0000000000..a5a1b58fef
              --- /dev/null
              +++ b/js/data/locale/teo/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "TA/EB",
              +    "Day": "Aparan",
              +    "Era": "Enzi",
              +    "Hour": "Esaa",
              +    "Minute": "Idakika",
              +    "Month": "Elap",
              +    "Second": "Isekonde",
              +    "Time Zone": "Majira ya saa",
              +    "Week": "Ewiki",
              +    "Year": "Ekan"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/tg/dateres.json b/js/data/locale/tg/dateres.json
              new file mode 100644
              index 0000000000..5a6adcc353
              --- /dev/null
              +++ b/js/data/locale/tg/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "пе. чо./па. чо.",
              +    "Day": "рӯз",
              +    "Era": "мабдаи таърих",
              +    "Hour": "соат",
              +    "Minute": "дақиқа",
              +    "Month": "моҳ",
              +    "Second": "сония",
              +    "Time Zone": "минтақаи вақт",
              +    "Week": "ҳафта",
              +    "Year": "сол"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/th/dateres.json b/js/data/locale/th/dateres.json
              new file mode 100644
              index 0000000000..227f43a2f8
              --- /dev/null
              +++ b/js/data/locale/th/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "ช่วงวัน",
              +    "Day": "วัน",
              +    "Day of Year": "วันของปี",
              +    "Era": "สมัย",
              +    "Hour": "ชั่วโมง",
              +    "Minute": "นาที",
              +    "Month": "เดือน",
              +    "Second": "วินาที",
              +    "Time Zone": "เขตเวลา",
              +    "Week": "สัปดาห์",
              +    "Week of Month": "สัปดาห์ของเดือน",
              +    "Year": "ปี"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ti/dateres.json b/js/data/locale/ti/dateres.json
              new file mode 100644
              index 0000000000..2f0dabf209
              --- /dev/null
              +++ b/js/data/locale/ti/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "ክፍለ መዓልቲ",
              +    "Day": "መዓልቲ",
              +    "Day of Year": "መዓልቲ ናይ ዓመት",
              +    "Era": "ዘመን",
              +    "Hour": "ሰዓት",
              +    "Minute": "ደቒቕ",
              +    "Month": "ወርሒ",
              +    "Second": "ካልኢት",
              +    "Time Zone": "ክልል",
              +    "Week": "ሰሙን",
              +    "Week of Month": "ሰን ናይ ወርሒ",
              +    "Year": "ዓመት"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/tk/dateres.json b/js/data/locale/tk/dateres.json
              new file mode 100644
              index 0000000000..1f08d98bc3
              --- /dev/null
              +++ b/js/data/locale/tk/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "günortadan öň/günortadan soň",
              +    "Day": "gün",
              +    "Day of Year": "ýylyň güni",
              +    "Era": "era",
              +    "Hour": "sagat",
              +    "Minute": "minut",
              +    "Month": "aý",
              +    "Second": "sekunt",
              +    "Time Zone": "sagat guşaklygy",
              +    "Week": "hepde",
              +    "Week of Month": "aýyň hepdesi",
              +    "Year": "ýyl"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/to/dateres.json b/js/data/locale/to/dateres.json
              new file mode 100644
              index 0000000000..d572b3c32c
              --- /dev/null
              +++ b/js/data/locale/to/dateres.json
              @@ -0,0 +1,13 @@
              +{
              +    "Day": "ʻaho",
              +    "Day of Year": "ʻaho ʻo e taʻu",
              +    "Era": "kuonga",
              +    "Hour": "houa",
              +    "Minute": "miniti",
              +    "Month": "māhina",
              +    "Second": "sekoni",
              +    "Time Zone": "taimi fakavahe",
              +    "Week": "uike",
              +    "Week of Month": "uike ʻo e māhina",
              +    "Year": "taʻu"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/tr/dateres.json b/js/data/locale/tr/dateres.json
              new file mode 100644
              index 0000000000..0ecf6d7361
              --- /dev/null
              +++ b/js/data/locale/tr/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "ÖÖ/ÖS",
              +    "Day": "gün",
              +    "Day of Year": "yılın günü",
              +    "Era": "çağ",
              +    "Hour": "saat",
              +    "Minute": "dakika",
              +    "Month": "ay",
              +    "Second": "saniye",
              +    "Time Zone": "saat dilimi",
              +    "Week": "hafta",
              +    "Week of Month": "ayın haftası",
              +    "Year": "yıl"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/tt/dateres.json b/js/data/locale/tt/dateres.json
              new file mode 100644
              index 0000000000..0ad38716f1
              --- /dev/null
              +++ b/js/data/locale/tt/dateres.json
              @@ -0,0 +1,11 @@
              +{
              +    "Day": "көн",
              +    "Era": "эра",
              +    "Hour": "сәгать",
              +    "Minute": "минут",
              +    "Month": "ай",
              +    "Second": "секунд",
              +    "Time Zone": "вакыт өлкәсе",
              +    "Week": "атна",
              +    "Year": "ел"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/twq/dateres.json b/js/data/locale/twq/dateres.json
              new file mode 100644
              index 0000000000..1c8463120e
              --- /dev/null
              +++ b/js/data/locale/twq/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Subbaahi/Zaarikay banda",
              +    "Day": "Zaari",
              +    "Era": "Zaman",
              +    "Hour": "Guuru",
              +    "Minute": "Miniti",
              +    "Month": "Handu",
              +    "Second": "Miti",
              +    "Time Zone": "Leerazuu",
              +    "Week": "Hebu",
              +    "Year": "Jiiri"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/tzm/dateres.json b/js/data/locale/tzm/dateres.json
              new file mode 100644
              index 0000000000..91ffb07432
              --- /dev/null
              +++ b/js/data/locale/tzm/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Zdat azal/Deffir azal",
              +    "Day": "Ass",
              +    "Era": "Tallit",
              +    "Hour": "Tasragt",
              +    "Minute": "Tusdat",
              +    "Month": "Ayur",
              +    "Second": "Tusnat",
              +    "Time Zone": "Aseglem asergan",
              +    "Week": "Imalass",
              +    "Year": "Asseggas"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ug/dateres.json b/js/data/locale/ug/dateres.json
              new file mode 100644
              index 0000000000..22ec4c3896
              --- /dev/null
              +++ b/js/data/locale/ug/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "چۈشتىن بۇرۇن/چۈشتىن كېيىن",
              +    "Day": "كۈن",
              +    "Era": "مىلادىيە",
              +    "Hour": "سائەت",
              +    "Minute": "مىنۇت",
              +    "Month": "ئاي",
              +    "Second": "سېكۇنت",
              +    "Time Zone": "ۋاقىت رايونى",
              +    "Week": "ھەپتە",
              +    "Year": "يىل"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/uk/dateres.json b/js/data/locale/uk/dateres.json
              new file mode 100644
              index 0000000000..7455deac12
              --- /dev/null
              +++ b/js/data/locale/uk/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "дп/пп",
              +    "Day": "день",
              +    "Day of Year": "день року",
              +    "Era": "ера",
              +    "Hour": "година",
              +    "Minute": "хвилина",
              +    "Month": "місяць",
              +    "Second": "секунда",
              +    "Time Zone": "часовий пояс",
              +    "Week": "тиждень",
              +    "Week of Month": "тиждень місяця",
              +    "Year": "рік"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/ur/dateres.json b/js/data/locale/ur/dateres.json
              new file mode 100644
              index 0000000000..1425798f2c
              --- /dev/null
              +++ b/js/data/locale/ur/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "قبل دوپہر/بعد دوپہر",
              +    "Day": "دن",
              +    "Day of Year": "یوم سال",
              +    "Era": "عہد",
              +    "Hour": "گھنٹہ",
              +    "Minute": "منٹ",
              +    "Month": "مہینہ",
              +    "Second": "سیکنڈ",
              +    "Time Zone": "منطقۂ وقت",
              +    "Week": "ہفتہ",
              +    "Week of Month": "مہینے کا ہفتہ",
              +    "Year": "سال"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/uz/Arab/dateres.json b/js/data/locale/uz/Arab/dateres.json
              new file mode 100644
              index 0000000000..ec809a68ae
              --- /dev/null
              +++ b/js/data/locale/uz/Arab/dateres.json
              @@ -0,0 +1,6 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day of Year": "Day Of Year",
              +    "Time Zone": "Zone",
              +    "Week of Month": "Week Of Month"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/uz/Cyrl/dateres.json b/js/data/locale/uz/Cyrl/dateres.json
              new file mode 100644
              index 0000000000..dc54203973
              --- /dev/null
              +++ b/js/data/locale/uz/Cyrl/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "Кун вақти",
              +    "Day": "Кун",
              +    "Day of Year": "Day Of Year",
              +    "Era": "Эра",
              +    "Hour": "Соат",
              +    "Minute": "Дақиқа",
              +    "Month": "Ой",
              +    "Second": "Сония",
              +    "Time Zone": "Минтақа",
              +    "Week": "Ҳафта",
              +    "Week of Month": "Week Of Month",
              +    "Year": "Йил"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/uz/dateres.json b/js/data/locale/uz/dateres.json
              new file mode 100644
              index 0000000000..96b36f848a
              --- /dev/null
              +++ b/js/data/locale/uz/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "TO/TK",
              +    "Day": "kun",
              +    "Day of Year": "yilning kuni",
              +    "Era": "era",
              +    "Hour": "soat",
              +    "Minute": "daqiqa",
              +    "Month": "oy",
              +    "Second": "soniya",
              +    "Time Zone": "vaqt mintaqasi",
              +    "Week": "hafta",
              +    "Week of Month": "oyning haftasi",
              +    "Year": "yil"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/vai/Latn/dateres.json b/js/data/locale/vai/Latn/dateres.json
              new file mode 100644
              index 0000000000..639567da55
              --- /dev/null
              +++ b/js/data/locale/vai/Latn/dateres.json
              @@ -0,0 +1,9 @@
              +{
              +    "Day": "tele",
              +    "Hour": "hawa",
              +    "Minute": "mini",
              +    "Month": "kalo",
              +    "Second": "jaki-jaka",
              +    "Week": "wiki",
              +    "Year": "saŋ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/vai/dateres.json b/js/data/locale/vai/dateres.json
              new file mode 100644
              index 0000000000..142abbd5bc
              --- /dev/null
              +++ b/js/data/locale/vai/dateres.json
              @@ -0,0 +1,11 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day": "ꔎꔒ",
              +    "Hour": "ꕌꕎ",
              +    "Minute": "ꕆꕇ",
              +    "Month": "ꕪꖃ",
              +    "Second": "ꕧꕃꕧꕪ",
              +    "Time Zone": "Zone",
              +    "Week": "ꔨꔤꕃ",
              +    "Year": "ꕢꘋ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/vi/dateres.json b/js/data/locale/vi/dateres.json
              new file mode 100644
              index 0000000000..418d491afe
              --- /dev/null
              +++ b/js/data/locale/vi/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "SA/CH",
              +    "Day": "Ngày",
              +    "Day of Year": "ngày trong năm",
              +    "Era": "thời đại",
              +    "Hour": "Giờ",
              +    "Minute": "Phút",
              +    "Month": "Tháng",
              +    "Second": "Giây",
              +    "Time Zone": "Múi giờ",
              +    "Week": "Tuần",
              +    "Week of Month": "tuần trong tháng",
              +    "Year": "Năm"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/vo/dateres.json b/js/data/locale/vo/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/vo/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/vun/dateres.json b/js/data/locale/vun/dateres.json
              new file mode 100644
              index 0000000000..6cb392f9e3
              --- /dev/null
              +++ b/js/data/locale/vun/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Mfiri o siku",
              +    "Day": "Mfiri",
              +    "Era": "Kacha",
              +    "Hour": "Saa",
              +    "Minute": "Dakyika",
              +    "Month": "Mori",
              +    "Second": "Sekunde",
              +    "Time Zone": "Mfiri o saa",
              +    "Week": "Wiikyi",
              +    "Year": "Maka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/wae/dateres.json b/js/data/locale/wae/dateres.json
              new file mode 100644
              index 0000000000..28edf7bd0d
              --- /dev/null
              +++ b/js/data/locale/wae/dateres.json
              @@ -0,0 +1,11 @@
              +{
              +    "Day": "Tag",
              +    "Era": "Epoča",
              +    "Hour": "Schtund",
              +    "Minute": "Mínütta",
              +    "Month": "Mánet",
              +    "Second": "Sekunda",
              +    "Time Zone": "Zitzóna",
              +    "Week": "Wuča",
              +    "Year": "Jár"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/wo/dateres.json b/js/data/locale/wo/dateres.json
              new file mode 100644
              index 0000000000..8ef60d8268
              --- /dev/null
              +++ b/js/data/locale/wo/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Sub/Ngo",
              +    "Day": "fan",
              +    "Era": "jamono",
              +    "Hour": "waxtu",
              +    "Minute": "simili",
              +    "Month": "weer",
              +    "Second": "saa",
              +    "Time Zone": "goxu waxtu",
              +    "Week": "ayu-bis",
              +    "Year": "at"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/xh/dateres.json b/js/data/locale/xh/dateres.json
              new file mode 100644
              index 0000000000..e491f37a8e
              --- /dev/null
              +++ b/js/data/locale/xh/dateres.json
              @@ -0,0 +1,4 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Time Zone": "Zone"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/xog/dateres.json b/js/data/locale/xog/dateres.json
              new file mode 100644
              index 0000000000..ec160c4491
              --- /dev/null
              +++ b/js/data/locale/xog/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "munkyo/Eigulo",
              +    "Day": "Olunaku",
              +    "Era": "Emulembe",
              +    "Hour": "Essawa",
              +    "Minute": "Edakiika",
              +    "Month": "Omwezi",
              +    "Second": "Obutikitiki",
              +    "Time Zone": "Essawa edha",
              +    "Week": "Esabiiti",
              +    "Year": "Omwaka"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/yav/dateres.json b/js/data/locale/yav/dateres.json
              new file mode 100644
              index 0000000000..2e2995115d
              --- /dev/null
              +++ b/js/data/locale/yav/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "kiɛmɛ́ɛm,kisɛ́ndɛ",
              +    "Day": "puɔ́sɛ́",
              +    "Era": "kipéŋén",
              +    "Hour": "kisikɛl,",
              +    "Minute": "minít",
              +    "Month": "oóli",
              +    "Second": "síkɛn",
              +    "Time Zone": "kinúki kisikɛl ɔ́ pitɔŋ",
              +    "Week": "sɔ́ndiɛ",
              +    "Year": "yɔɔŋ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/yi/dateres.json b/js/data/locale/yi/dateres.json
              new file mode 100644
              index 0000000000..e8077665ee
              --- /dev/null
              +++ b/js/data/locale/yi/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Dayperiod",
              +    "Day": "טאָג",
              +    "Era": "תקופֿה",
              +    "Hour": "שעה",
              +    "Minute": "מינוט",
              +    "Month": "מאנאַט",
              +    "Second": "סעקונדע",
              +    "Time Zone": "צײַטזאנע",
              +    "Week": "וואך",
              +    "Year": "יאָר"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/yo/BJ/dateres.json b/js/data/locale/yo/BJ/dateres.json
              new file mode 100644
              index 0000000000..48a263b34a
              --- /dev/null
              +++ b/js/data/locale/yo/BJ/dateres.json
              @@ -0,0 +1,8 @@
              +{
              +    "AM/PM": "Àárɔ̀/ɔ̀sán",
              +    "Day": "Ɔjɔ́",
              +    "Minute": "Ìsɛ́jú",
              +    "Second": "Ìsɛ́jú Ààyá",
              +    "Week": "Ɔ̀sè",
              +    "Year": "Ɔdún"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/yo/dateres.json b/js/data/locale/yo/dateres.json
              new file mode 100644
              index 0000000000..297206e1ec
              --- /dev/null
              +++ b/js/data/locale/yo/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "Àárọ̀/ọ̀sán",
              +    "Day": "Ọjọ́",
              +    "Era": "Ìgbà",
              +    "Hour": "wákàtí",
              +    "Minute": "Ìsẹ́jú",
              +    "Month": "Osù",
              +    "Second": "Ìsẹ́jú Ààyá",
              +    "Time Zone": "Ibi Àkókò Àgbáyé",
              +    "Week": "Ọ̀sè",
              +    "Year": "Ọdún"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/yue/Hans/dateres.json b/js/data/locale/yue/Hans/dateres.json
              new file mode 100644
              index 0000000000..21895d7226
              --- /dev/null
              +++ b/js/data/locale/yue/Hans/dateres.json
              @@ -0,0 +1,7 @@
              +{
              +    "Hour": "小时",
              +    "Minute": "分钟",
              +    "Time Zone": "时区",
              +    "Week": "周",
              +    "Week of Month": "月周"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/yue/dateres.json b/js/data/locale/yue/dateres.json
              new file mode 100644
              index 0000000000..d95db4023e
              --- /dev/null
              +++ b/js/data/locale/yue/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "上午/下午",
              +    "Day": "日",
              +    "Day of Year": "年日",
              +    "Era": "年代",
              +    "Hour": "小時",
              +    "Minute": "分鐘",
              +    "Month": "月",
              +    "Second": "秒",
              +    "Time Zone": "時區",
              +    "Week": "週",
              +    "Week of Month": "月週",
              +    "Year": "年"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/zgh/dateres.json b/js/data/locale/zgh/dateres.json
              new file mode 100644
              index 0000000000..01d04e184e
              --- /dev/null
              +++ b/js/data/locale/zgh/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "AM/PM": "ⵜⵉⵣⵉ ⴳ ⵡⴰⵙⵙ: ⵜⵉⴼⴰⵡⵜ/ⵜⴰⴷⴳⴳⵯⴰⵜ",
              +    "Day": "ⴰⵙⵙ",
              +    "Era": "ⵜⴰⵙⵓⵜ",
              +    "Hour": "ⵜⴰⵙⵔⴰⴳⵜ",
              +    "Minute": "ⵜⵓⵙⴷⵉⴷⵜ",
              +    "Month": "ⴰⵢⵢⵓⵔ",
              +    "Second": "ⵜⴰⵙⵉⵏⵜ",
              +    "Time Zone": "ⴰⴽⵓⴷ ⵏ ⵓⴳⵎⵎⴰⴹ",
              +    "Week": "ⵉⵎⴰⵍⴰⵙⵙ",
              +    "Year": "ⴰⵙⴳⴳⵯⴰⵙ"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/zh/Hant/dateres.json b/js/data/locale/zh/Hant/dateres.json
              new file mode 100644
              index 0000000000..484fa6fc55
              --- /dev/null
              +++ b/js/data/locale/zh/Hant/dateres.json
              @@ -0,0 +1,9 @@
              +{
              +    "Day of Year": "年天",
              +    "Era": "年代",
              +    "Hour": "小時",
              +    "Minute": "分鐘",
              +    "Time Zone": "時區",
              +    "Week": "週",
              +    "Week of Month": "週"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/zh/dateres.json b/js/data/locale/zh/dateres.json
              new file mode 100644
              index 0000000000..95700b1225
              --- /dev/null
              +++ b/js/data/locale/zh/dateres.json
              @@ -0,0 +1,14 @@
              +{
              +    "AM/PM": "上午/下午",
              +    "Day": "日",
              +    "Day of Year": "年中日",
              +    "Era": "纪元",
              +    "Hour": "小时",
              +    "Minute": "分钟",
              +    "Month": "月",
              +    "Second": "秒",
              +    "Time Zone": "时区",
              +    "Week": "周",
              +    "Week of Month": "月中周",
              +    "Year": "年"
              +}
              \ No newline at end of file
              diff --git a/js/data/locale/zu/dateres.json b/js/data/locale/zu/dateres.json
              new file mode 100644
              index 0000000000..831eabc0fb
              --- /dev/null
              +++ b/js/data/locale/zu/dateres.json
              @@ -0,0 +1,12 @@
              +{
              +    "Day": "Usuku",
              +    "Era": "Isikhathi",
              +    "Hour": "Ihora",
              +    "Minute": "Iminithi",
              +    "Month": "Inyanga",
              +    "Second": "Isekhondi",
              +    "Time Zone": "Isikhathi sendawo",
              +    "Week": "Iviki",
              +    "Week of Month": "Iviki leNyanga",
              +    "Year": "Unyaka"
              +}
              \ No newline at end of file
              
              From b8734e99ba6c93c1259e96364a3b5e77581b858f Mon Sep 17 00:00:00 2001
              From: Edwin Hoogerbeets 
              Date: Thu, 6 Jun 2019 23:44:57 -0700
              Subject: [PATCH 23/38] Support the placeholder formats
              
              Gleaned from the names of the field. For Arabic script
              or RTL languages or short names, just use the full name.
              For everything else, use abbreviations.
              ---
               js/data/locale/af/dateres.json       | 10 ++++++-
               js/data/locale/agq/dateres.json      | 10 ++++++-
               js/data/locale/ak/dateres.json       | 11 +++++++-
               js/data/locale/am/dateres.json       | 12 +++++++-
               js/data/locale/ar/dateres.json       | 12 +++++++-
               js/data/locale/as/dateres.json       | 12 +++++++-
               js/data/locale/asa/dateres.json      | 10 ++++++-
               js/data/locale/ast/dateres.json      | 10 ++++++-
               js/data/locale/az/dateres.json       | 12 +++++++-
               js/data/locale/bas/dateres.json      | 12 +++++++-
               js/data/locale/be/dateres.json       | 12 +++++++-
               js/data/locale/bem/dateres.json      | 12 +++++++-
               js/data/locale/bez/dateres.json      | 10 ++++++-
               js/data/locale/bg/dateres.json       | 12 +++++++-
               js/data/locale/bm/dateres.json       | 10 ++++++-
               js/data/locale/bn/dateres.json       | 12 +++++++-
               js/data/locale/bo/dateres.json       | 12 +++++++-
               js/data/locale/br/dateres.json       | 11 +++++++-
               js/data/locale/brx/dateres.json      | 12 +++++++-
               js/data/locale/bs/Cyrl/dateres.json  | 12 +++++++-
               js/data/locale/bs/dateres.json       | 10 ++++++-
               js/data/locale/ca/dateres.json       | 10 ++++++-
               js/data/locale/ccp/dateres.json      | 12 +++++++-
               js/data/locale/ce/dateres.json       | 12 +++++++-
               js/data/locale/cgg/dateres.json      | 12 +++++++-
               js/data/locale/chr/dateres.json      | 12 +++++++-
               js/data/locale/cs/dateres.json       | 10 ++++++-
               js/data/locale/cy/dateres.json       | 11 +++++++-
               js/data/locale/da/dateres.json       | 10 ++++++-
               js/data/locale/dateres.json          | 14 +++++++++-
               js/data/locale/dav/dateres.json      | 10 ++++++-
               js/data/locale/de/dateres.json       |  9 +++++-
               js/data/locale/dje/dateres.json      | 12 +++++++-
               js/data/locale/dsb/dateres.json      | 10 ++++++-
               js/data/locale/dua/dateres.json      | 12 +++++++-
               js/data/locale/dyo/dateres.json      |  8 +++++-
               js/data/locale/dz/dateres.json       | 12 +++++++-
               js/data/locale/ebu/dateres.json      | 10 ++++++-
               js/data/locale/ee/dateres.json       | 11 +++++++-
               js/data/locale/el/dateres.json       | 12 +++++++-
               js/data/locale/en/dateres.json       | 10 ++++++-
               js/data/locale/es/DO/dateres.json    | 10 ++++++-
               js/data/locale/es/dateres.json       | 10 ++++++-
               js/data/locale/et/dateres.json       | 10 ++++++-
               js/data/locale/eu/dateres.json       | 10 ++++++-
               js/data/locale/ewo/dateres.json      | 12 +++++++-
               js/data/locale/fa/dateres.json       | 12 +++++++-
               js/data/locale/ff/dateres.json       | 12 +++++++-
               js/data/locale/fi/dateres.json       | 10 ++++++-
               js/data/locale/fil/dateres.json      | 10 ++++++-
               js/data/locale/fo/dateres.json       | 10 ++++++-
               js/data/locale/fr/dateres.json       | 10 ++++++-
               js/data/locale/fur/dateres.json      | 10 ++++++-
               js/data/locale/fy/dateres.json       | 10 ++++++-
               js/data/locale/ga/dateres.json       | 11 +++++++-
               js/data/locale/gd/dateres.json       | 11 +++++++-
               js/data/locale/gl/dateres.json       | 10 ++++++-
               js/data/locale/gsw/dateres.json      | 10 ++++++-
               js/data/locale/gu/dateres.json       | 12 +++++++-
               js/data/locale/guz/dateres.json      | 12 +++++++-
               js/data/locale/ha/dateres.json       | 12 +++++++-
               js/data/locale/he/dateres.json       | 12 +++++++-
               js/data/locale/hi/dateres.json       | 12 +++++++-
               js/data/locale/hr/dateres.json       | 10 ++++++-
               js/data/locale/hsb/dateres.json      | 10 ++++++-
               js/data/locale/hu/dateres.json       | 12 +++++++-
               js/data/locale/hy/dateres.json       | 12 +++++++-
               js/data/locale/ia/dateres.json       | 10 ++++++-
               js/data/locale/id/dateres.json       | 11 +++++++-
               js/data/locale/ig/dateres.json       | 12 +++++++-
               js/data/locale/ii/dateres.json       | 12 +++++++-
               js/data/locale/is/dateres.json       | 10 ++++++-
               js/data/locale/it/dateres.json       | 10 ++++++-
               js/data/locale/ja/dateres.json       | 12 +++++++-
               js/data/locale/jmc/dateres.json      | 10 ++++++-
               js/data/locale/jv/dateres.json       | 11 +++++++-
               js/data/locale/ka/dateres.json       | 12 +++++++-
               js/data/locale/kab/dateres.json      | 12 +++++++-
               js/data/locale/kam/dateres.json      |  9 +++++-
               js/data/locale/kde/dateres.json      | 10 ++++++-
               js/data/locale/kea/dateres.json      |  8 +++++-
               js/data/locale/khq/dateres.json      | 12 +++++++-
               js/data/locale/ki/dateres.json       | 10 ++++++-
               js/data/locale/kk/dateres.json       | 12 +++++++-
               js/data/locale/kln/dateres.json      | 12 +++++++-
               js/data/locale/km/dateres.json       | 12 +++++++-
               js/data/locale/kn/dateres.json       | 12 +++++++-
               js/data/locale/ko/dateres.json       | 12 +++++++-
               js/data/locale/kok/dateres.json      | 12 +++++++-
               js/data/locale/ks/dateres.json       | 12 +++++++-
               js/data/locale/ksb/dateres.json      | 12 +++++++-
               js/data/locale/ksf/dateres.json      | 12 +++++++-
               js/data/locale/ksh/dateres.json      |  8 +++++-
               js/data/locale/ku/dateres.json       | 11 +++++++-
               js/data/locale/ky/dateres.json       | 12 +++++++-
               js/data/locale/lag/dateres.json      | 10 ++++++-
               js/data/locale/lb/dateres.json       |  8 +++++-
               js/data/locale/lg/dateres.json       | 10 ++++++-
               js/data/locale/lkt/dateres.json      | 12 +++++++-
               js/data/locale/ln/dateres.json       | 12 +++++++-
               js/data/locale/lo/dateres.json       | 12 +++++++-
               js/data/locale/lrc/dateres.json      | 12 +++++++-
               js/data/locale/lt/dateres.json       | 10 ++++++-
               js/data/locale/lu/dateres.json       | 10 ++++++-
               js/data/locale/luo/dateres.json      | 12 +++++++-
               js/data/locale/luy/dateres.json      | 10 ++++++-
               js/data/locale/lv/dateres.json       | 10 ++++++-
               js/data/locale/mas/dateres.json      | 12 +++++++-
               js/data/locale/mer/dateres.json      | 10 ++++++-
               js/data/locale/mfe/dateres.json      | 10 ++++++-
               js/data/locale/mg/dateres.json       | 12 +++++++-
               js/data/locale/mgh/dateres.json      | 12 +++++++-
               js/data/locale/mgo/dateres.json      |  8 +++++-
               js/data/locale/mi/dateres.json       | 11 +++++++-
               js/data/locale/mk/dateres.json       | 12 +++++++-
               js/data/locale/ml/dateres.json       | 12 +++++++-
               js/data/locale/mn/dateres.json       | 12 +++++++-
               js/data/locale/mr/dateres.json       | 12 +++++++-
               js/data/locale/ms/dateres.json       | 10 ++++++-
               js/data/locale/mt/dateres.json       | 10 ++++++-
               js/data/locale/mua/dateres.json      | 12 +++++++-
               js/data/locale/my/dateres.json       | 12 +++++++-
               js/data/locale/mzn/dateres.json      | 12 +++++++-
               js/data/locale/naq/dateres.json      | 12 +++++++-
               js/data/locale/nb/dateres.json       | 10 ++++++-
               js/data/locale/nd/dateres.json       | 12 +++++++-
               js/data/locale/ne/dateres.json       | 12 +++++++-
               js/data/locale/nl/dateres.json       | 10 ++++++-
               js/data/locale/nmg/dateres.json      | 10 ++++++-
               js/data/locale/nn/dateres.json       | 10 ++++++-
               js/data/locale/nnh/dateres.json      |  8 +++++-
               js/data/locale/nus/dateres.json      | 12 +++++++-
               js/data/locale/nyn/dateres.json      | 12 +++++++-
               js/data/locale/or/dateres.json       | 12 +++++++-
               js/data/locale/os/dateres.json       | 12 +++++++-
               js/data/locale/pa/Arab/dateres.json  | 11 +++++++-
               js/data/locale/pa/dateres.json       | 12 +++++++-
               js/data/locale/pl/dateres.json       | 10 ++++++-
               js/data/locale/ps/dateres.json       | 12 +++++++-
               js/data/locale/pt/dateres.json       | 10 ++++++-
               js/data/locale/rm/dateres.json       | 10 ++++++-
               js/data/locale/rn/dateres.json       | 12 +++++++-
               js/data/locale/ro/dateres.json       | 10 ++++++-
               js/data/locale/rof/dateres.json      | 10 ++++++-
               js/data/locale/ru/dateres.json       | 12 +++++++-
               js/data/locale/rwk/dateres.json      | 10 ++++++-
               js/data/locale/sah/dateres.json      | 12 +++++++-
               js/data/locale/saq/dateres.json      | 12 +++++++-
               js/data/locale/sbp/dateres.json      | 10 ++++++-
               js/data/locale/sd/dateres.json       | 12 +++++++-
               js/data/locale/se/dateres.json       | 10 ++++++-
               js/data/locale/seh/dateres.json      |  8 +++++-
               js/data/locale/ses/dateres.json      | 12 +++++++-
               js/data/locale/sg/dateres.json       | 12 +++++++-
               js/data/locale/shi/Latn/dateres.json | 12 +++++++-
               js/data/locale/shi/dateres.json      | 12 +++++++-
               js/data/locale/si/dateres.json       | 12 +++++++-
               js/data/locale/sk/dateres.json       | 10 ++++++-
               js/data/locale/sl/dateres.json       | 10 ++++++-
               js/data/locale/sn/dateres.json       | 10 ++++++-
               js/data/locale/sq/dateres.json       | 10 ++++++-
               js/data/locale/sr/Latn/dateres.json  | 12 +++++++-
               js/data/locale/sr/dateres.json       | 12 +++++++-
               js/data/locale/sv/dateres.json       | 10 ++++++-
               js/data/locale/sw/dateres.json       | 11 +++++++-
               js/data/locale/ta/dateres.json       | 12 +++++++-
               js/data/locale/te/dateres.json       | 12 +++++++-
               js/data/locale/teo/dateres.json      | 12 +++++++-
               js/data/locale/tg/dateres.json       | 12 +++++++-
               js/data/locale/th/dateres.json       | 12 +++++++-
               js/data/locale/ti/dateres.json       | 12 +++++++-
               js/data/locale/tk/dateres.json       | 12 +++++++-
               js/data/locale/to/dateres.json       | 10 ++++++-
               js/data/locale/tr/dateres.json       | 11 +++++++-
               js/data/locale/tt/dateres.json       | 12 +++++++-
               js/data/locale/twq/dateres.json      | 12 +++++++-
               js/data/locale/tzm/dateres.json      | 12 +++++++-
               js/data/locale/ug/dateres.json       | 12 +++++++-
               js/data/locale/uk/dateres.json       | 12 +++++++-
               js/data/locale/ur/dateres.json       | 12 +++++++-
               js/data/locale/uz/Cyrl/dateres.json  | 12 +++++++-
               js/data/locale/uz/dateres.json       | 12 +++++++-
               js/data/locale/vai/Latn/dateres.json | 12 +++++++-
               js/data/locale/vai/dateres.json      | 12 +++++++-
               js/data/locale/vi/dateres.json       | 12 +++++++-
               js/data/locale/vun/dateres.json      | 10 ++++++-
               js/data/locale/wae/dateres.json      | 10 ++++++-
               js/data/locale/wo/dateres.json       | 11 +++++++-
               js/data/locale/xog/dateres.json      | 12 +++++++-
               js/data/locale/yav/dateres.json      | 10 ++++++-
               js/data/locale/yi/dateres.json       | 12 +++++++-
               js/data/locale/yo/BJ/dateres.json    |  6 +++-
               js/data/locale/yo/dateres.json       | 12 +++++++-
               js/data/locale/yue/Hans/dateres.json |  4 ++-
               js/data/locale/yue/dateres.json      | 12 +++++++-
               js/data/locale/zgh/dateres.json      | 12 +++++++-
               js/data/locale/zh/Hant/dateres.json  |  4 ++-
               js/data/locale/zh/dateres.json       | 12 +++++++-
               js/data/locale/zu/dateres.json       | 12 +++++++-
               tools/cldr/datefmts.js               | 41 +++++++++++++++++++++++++++-
               200 files changed, 2031 insertions(+), 200 deletions(-)
              
              diff --git a/js/data/locale/af/dateres.json b/js/data/locale/af/dateres.json
              index 542ade8486..109171163d 100644
              --- a/js/data/locale/af/dateres.json
              +++ b/js/data/locale/af/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "tydsone",
                   "Week": "week",
                   "Week of Month": "week van maand",
              -    "Year": "jaar"
              +    "Year": "jaar",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "jj",
              +    "YYYY": "jaar",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "u",
              +    "HH": "uu"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/agq/dateres.json b/js/data/locale/agq/dateres.json
              index 7ebc776dcf..3cd2415806 100644
              --- a/js/data/locale/agq/dateres.json
              +++ b/js/data/locale/agq/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "sɛkɔ̀n",
                   "Time Zone": "dɨŋò kɨ enɨ̀gha",
                   "Week": "ewɨn",
              -    "Year": "kɨnûm"
              +    "Year": "kɨnûm",
              +    "D": "u",
              +    "DD": "uu",
              +    "YY": "kk",
              +    "YYYY": "kkkk",
              +    "M": "n",
              +    "MM": "nn",
              +    "H": "t",
              +    "HH": "tt"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ak/dateres.json b/js/data/locale/ak/dateres.json
              index c505a7137c..e8e3464692 100644
              --- a/js/data/locale/ak/dateres.json
              +++ b/js/data/locale/ak/dateres.json
              @@ -8,5 +8,14 @@
                   "Second": "Sɛkɛnd",
                   "Time Zone": "Bere apaamu",
                   "Week": "Dapɛn",
              -    "Year": "Afe"
              +    "Year": "Afe",
              +    "DD": "Da",
              +    "YY": "AA",
              +    "YYYY": "Afe",
              +    "M": "B",
              +    "MM": "BB",
              +    "H": "D",
              +    "HH": "DD",
              +    "mm": "SS",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/am/dateres.json b/js/data/locale/am/dateres.json
              index d857f0c6b5..26d685c133 100644
              --- a/js/data/locale/am/dateres.json
              +++ b/js/data/locale/am/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "የሰዓት ሰቅ",
                   "Week": "ሳምንት",
                   "Week of Month": "የወሩ ሳምንት",
              -    "Year": "ዓመት"
              +    "Year": "ዓመት",
              +    "D": "ቀ",
              +    "DD": "ቀን",
              +    "YY": "ዓዓ",
              +    "YYYY": "ዓመት",
              +    "M": "ወ",
              +    "MM": "ወር",
              +    "H": "ሰ",
              +    "HH": "ሰሰ",
              +    "mm": "ደደ",
              +    "ss": "ሰሰ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ar/dateres.json b/js/data/locale/ar/dateres.json
              index 02aa82da91..772b15c1de 100644
              --- a/js/data/locale/ar/dateres.json
              +++ b/js/data/locale/ar/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "التوقيت",
                   "Week": "الأسبوع",
                   "Week of Month": "الأسبوع من الشهر",
              -    "Year": "السنة"
              +    "Year": "السنة",
              +    "D": "يوم",
              +    "DD": "يوم",
              +    "YY": "السنة",
              +    "YYYY": "السنة",
              +    "M": "الشهر",
              +    "MM": "الشهر",
              +    "H": "الساعات",
              +    "HH": "الساعات",
              +    "mm": "الدقائق",
              +    "ss": "الثواني"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/as/dateres.json b/js/data/locale/as/dateres.json
              index 76f726e5cd..51757efb57 100644
              --- a/js/data/locale/as/dateres.json
              +++ b/js/data/locale/as/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "সময় ক্ষেত্ৰ",
                   "Week": "সপ্তাহ",
                   "Week of Month": "মাহৰ সপ্তাহ",
              -    "Year": "বছৰ"
              +    "Year": "বছৰ",
              +    "D": "দ",
              +    "DD": "দদ",
              +    "YY": "বব",
              +    "YYYY": "বছৰ",
              +    "M": "ম",
              +    "MM": "মম",
              +    "H": "ঘ",
              +    "HH": "ঘঘ",
              +    "mm": "মম",
              +    "ss": "ছছ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/asa/dateres.json b/js/data/locale/asa/dateres.json
              index a321dab211..6219513532 100644
              --- a/js/data/locale/asa/dateres.json
              +++ b/js/data/locale/asa/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Thekunde",
                   "Time Zone": "Majira Athaa",
                   "Week": "Ndisha",
              -    "Year": "Mwaka"
              +    "Year": "Mwaka",
              +    "D": "T",
              +    "DD": "TT",
              +    "YY": "MM",
              +    "YYYY": "MMMM",
              +    "H": "T",
              +    "HH": "TT",
              +    "mm": "DD",
              +    "ss": "TT"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ast/dateres.json b/js/data/locale/ast/dateres.json
              index 61cae2a0fe..4133ee827a 100644
              --- a/js/data/locale/ast/dateres.json
              +++ b/js/data/locale/ast/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "segundu",
                   "Time Zone": "estaya horaria",
                   "Week": "selmana",
              -    "Year": "añu"
              +    "Year": "añu",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "aa",
              +    "YYYY": "añu",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "h",
              +    "HH": "hh"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/az/dateres.json b/js/data/locale/az/dateres.json
              index 702fdd0191..04464ee3d2 100644
              --- a/js/data/locale/az/dateres.json
              +++ b/js/data/locale/az/dateres.json
              @@ -8,5 +8,15 @@
                   "Time Zone": "Saat Qurşağı",
                   "Week": "Həftə",
                   "Week of Month": "Ayın həftəsi",
              -    "Year": "İl"
              +    "Year": "İl",
              +    "D": "G",
              +    "DD": "GG",
              +    "YY": "İl",
              +    "YYYY": "İl",
              +    "M": "A",
              +    "MM": "Ay",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "DD",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/bas/dateres.json b/js/data/locale/bas/dateres.json
              index 6060bc9d23..5b3354c91e 100644
              --- a/js/data/locale/bas/dateres.json
              +++ b/js/data/locale/bas/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "hìŋgeŋget",
                   "Time Zone": "komboo i ŋgɛŋ",
                   "Week": "sɔndɛ̂",
              -    "Year": "ŋwìi"
              +    "Year": "ŋwìi",
              +    "D": "k",
              +    "DD": "kk",
              +    "YY": "ŋŋ",
              +    "YYYY": "ŋwìi",
              +    "M": "s",
              +    "MM": "ss",
              +    "H": "ŋ",
              +    "HH": "ŋŋ",
              +    "mm": "ŋŋ",
              +    "ss": "hh"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/be/dateres.json b/js/data/locale/be/dateres.json
              index fd0052cddd..474dd51aa6 100644
              --- a/js/data/locale/be/dateres.json
              +++ b/js/data/locale/be/dateres.json
              @@ -9,5 +9,15 @@
                   "Time Zone": "часавы пояс",
                   "Week": "тыд",
                   "Week of Month": "тыдзень месяца",
              -    "Year": "год"
              +    "Year": "год",
              +    "D": "д",
              +    "DD": "дд",
              +    "YY": "гг",
              +    "YYYY": "год",
              +    "M": "м",
              +    "MM": "мм",
              +    "H": "г",
              +    "HH": "гг",
              +    "mm": "хх",
              +    "ss": "сс"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/bem/dateres.json b/js/data/locale/bem/dateres.json
              index 1c25fd505d..4348b9fd5b 100644
              --- a/js/data/locale/bem/dateres.json
              +++ b/js/data/locale/bem/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Sekondi",
                   "Time Zone": "Zone",
                   "Week": "Umulungu",
              -    "Year": "Umwaka"
              +    "Year": "Umwaka",
              +    "D": "U",
              +    "DD": "UU",
              +    "YY": "UU",
              +    "YYYY": "UUUU",
              +    "M": "U",
              +    "MM": "UU",
              +    "H": "I",
              +    "HH": "II",
              +    "mm": "MM",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/bez/dateres.json b/js/data/locale/bez/dateres.json
              index 79c51bb886..bbbc388a04 100644
              --- a/js/data/locale/bez/dateres.json
              +++ b/js/data/locale/bez/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Sekunde",
                   "Time Zone": "Amajira ga saa",
                   "Week": "Mlungu gumamfu",
              -    "Year": "Mwaha"
              +    "Year": "Mwaha",
              +    "D": "S",
              +    "DD": "SS",
              +    "YY": "MM",
              +    "YYYY": "MMMM",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "DD",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/bg/dateres.json b/js/data/locale/bg/dateres.json
              index 2b6ac9c9e4..8d4f942b79 100644
              --- a/js/data/locale/bg/dateres.json
              +++ b/js/data/locale/bg/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "часова зона",
                   "Week": "седмица",
                   "Week of Month": "седмица от месеца",
              -    "Year": "година"
              +    "Year": "година",
              +    "D": "д",
              +    "DD": "дд",
              +    "YY": "гг",
              +    "YYYY": "гггг",
              +    "M": "м",
              +    "MM": "мм",
              +    "H": "ч",
              +    "HH": "чч",
              +    "mm": "мм",
              +    "ss": "сс"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/bm/dateres.json b/js/data/locale/bm/dateres.json
              index 83a34a1e4d..77ce533004 100644
              --- a/js/data/locale/bm/dateres.json
              +++ b/js/data/locale/bm/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "sekondi",
                   "Time Zone": "sigikun tilena",
                   "Week": "dɔgɔkun",
              -    "Year": "san"
              +    "Year": "san",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "ss",
              +    "YYYY": "san",
              +    "M": "k",
              +    "MM": "kk",
              +    "H": "l",
              +    "HH": "ll"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/bn/dateres.json b/js/data/locale/bn/dateres.json
              index f249a1ae9d..312959eb33 100644
              --- a/js/data/locale/bn/dateres.json
              +++ b/js/data/locale/bn/dateres.json
              @@ -9,5 +9,15 @@
                   "Time Zone": "সময় অঞ্চল",
                   "Week": "সপ্তাহ",
                   "Week of Month": "মাসের সপ্তাহ",
              -    "Year": "বছর"
              +    "Year": "বছর",
              +    "D": "দ",
              +    "DD": "দদ",
              +    "YY": "বব",
              +    "YYYY": "বছর",
              +    "M": "ম",
              +    "MM": "মম",
              +    "H": "ঘ",
              +    "HH": "ঘঘ",
              +    "mm": "মম",
              +    "ss": "সস"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/bo/dateres.json b/js/data/locale/bo/dateres.json
              index c406361cf2..f24b3c03d0 100644
              --- a/js/data/locale/bo/dateres.json
              +++ b/js/data/locale/bo/dateres.json
              @@ -6,5 +6,15 @@
                   "Month": "ཟླ་བ་",
                   "Second": "སྐར་ཆ།",
                   "Time Zone": "དུས་ཚོད།",
              -    "Year": "ལོ།"
              +    "Year": "ལོ།",
              +    "D": "ཉ",
              +    "DD": "ཉཉ",
              +    "YY": "ལལ",
              +    "YYYY": "ལོ།",
              +    "M": "ཟ",
              +    "MM": "ཟཟ",
              +    "H": "ཆ",
              +    "HH": "ཆཆ",
              +    "mm": "སས",
              +    "ss": "སས"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/br/dateres.json b/js/data/locale/br/dateres.json
              index 663dd89eb1..397c010b42 100644
              --- a/js/data/locale/br/dateres.json
              +++ b/js/data/locale/br/dateres.json
              @@ -8,5 +8,14 @@
                   "Second": "eilenn",
                   "Time Zone": "takad eur",
                   "Week": "sizhun",
              -    "Year": "bloaz"
              +    "Year": "bloaz",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "bb",
              +    "YYYY": "bbbb",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "e",
              +    "HH": "ee",
              +    "ss": "ee"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/brx/dateres.json b/js/data/locale/brx/dateres.json
              index 9c8a88d7b8..f3a7e42975 100644
              --- a/js/data/locale/brx/dateres.json
              +++ b/js/data/locale/brx/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "सेखेन्द",
                   "Time Zone": "ओनसोल",
                   "Week": "सबथा/हबथा",
              -    "Year": "बोसोर"
              +    "Year": "बोसोर",
              +    "D": "स",
              +    "DD": "सस",
              +    "YY": "बब",
              +    "YYYY": "बबबब",
              +    "M": "द",
              +    "MM": "दद",
              +    "H": "र",
              +    "HH": "रर",
              +    "mm": "मम",
              +    "ss": "सस"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/bs/Cyrl/dateres.json b/js/data/locale/bs/Cyrl/dateres.json
              index d806ac6ba4..079065ee63 100644
              --- a/js/data/locale/bs/Cyrl/dateres.json
              +++ b/js/data/locale/bs/Cyrl/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "зона",
                   "Week": "недеља",
                   "Week of Month": "Week Of Month",
              -    "Year": "година"
              +    "Year": "година",
              +    "D": "д",
              +    "DD": "дд",
              +    "YY": "гг",
              +    "YYYY": "гггг",
              +    "M": "м",
              +    "MM": "мм",
              +    "H": "ч",
              +    "HH": "чч",
              +    "mm": "мм",
              +    "ss": "сс"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/bs/dateres.json b/js/data/locale/bs/dateres.json
              index a21d23f625..3df5324ad3 100644
              --- a/js/data/locale/bs/dateres.json
              +++ b/js/data/locale/bs/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "vremenska zona",
                   "Week": "sedmica",
                   "Week of Month": "sedmica u mjesecu",
              -    "Year": "godina"
              +    "Year": "godina",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "gg",
              +    "YYYY": "gggg",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "s",
              +    "HH": "ss"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ca/dateres.json b/js/data/locale/ca/dateres.json
              index 909b66c3de..6367027908 100644
              --- a/js/data/locale/ca/dateres.json
              +++ b/js/data/locale/ca/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "fus horari",
                   "Week": "setmana",
                   "Week of Month": "setmana del mes",
              -    "Year": "any"
              +    "Year": "any",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "aa",
              +    "YYYY": "any",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "h",
              +    "HH": "hh"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ccp/dateres.json b/js/data/locale/ccp/dateres.json
              index 9e2392d77f..a8e4434277 100644
              --- a/js/data/locale/ccp/dateres.json
              +++ b/js/data/locale/ccp/dateres.json
              @@ -7,5 +7,15 @@
                   "Second": "𑄥𑄬𑄉𑄬𑄚𑄴",
                   "Time Zone": "𑄃𑄧𑄇𑄴𑄖𑄧𑄢𑄴 𑄎𑄉",
                   "Week": "𑄥𑄛𑄴𑄖",
              -    "Year": "𑄝𑄧𑄏𑄧𑄢𑄴"
              +    "Year": "𑄝𑄧𑄏𑄧𑄢𑄴",
              +    "D": "�",
              +    "DD": "��",
              +    "YY": "��",
              +    "YYYY": "����",
              +    "M": "�",
              +    "MM": "��",
              +    "H": "�",
              +    "HH": "��",
              +    "mm": "��",
              +    "ss": "��"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ce/dateres.json b/js/data/locale/ce/dateres.json
              index df46149fed..af855f197b 100644
              --- a/js/data/locale/ce/dateres.json
              +++ b/js/data/locale/ce/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "сахьтан аса",
                   "Week": "кӀира",
                   "Week of Month": "беттан кӀира",
              -    "Year": "шо"
              +    "Year": "шо",
              +    "D": "д",
              +    "DD": "де",
              +    "YY": "шо",
              +    "YYYY": "шо",
              +    "M": "б",
              +    "MM": "бб",
              +    "H": "с",
              +    "HH": "сс",
              +    "mm": "мм",
              +    "ss": "сс"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/cgg/dateres.json b/js/data/locale/cgg/dateres.json
              index b5ca5ba48c..b453938261 100644
              --- a/js/data/locale/cgg/dateres.json
              +++ b/js/data/locale/cgg/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Obucweka/Esekendi",
                   "Time Zone": "Zone",
                   "Week": "Esande",
              -    "Year": "Omwaka"
              +    "Year": "Omwaka",
              +    "D": "E",
              +    "DD": "EE",
              +    "YY": "OO",
              +    "YYYY": "OOOO",
              +    "M": "O",
              +    "MM": "OO",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "EE",
              +    "ss": "OO"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/chr/dateres.json b/js/data/locale/chr/dateres.json
              index ce6dd96fb2..5d6e66228d 100644
              --- a/js/data/locale/chr/dateres.json
              +++ b/js/data/locale/chr/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "ᏂᎬᎾᏛ ᏧᏓᎴᏅᏓ ᏓᏟᎢᎵᏍᏒᎢ",
                   "Week": "ᏒᎾᏙᏓᏆᏍᏗ",
                   "Week of Month": "ᏒᎾᏙᏓᏆᏍᏗ ᎧᎸᎢ",
              -    "Year": "ᎤᏕᏘᏴᏌᏗᏒᎢ"
              +    "Year": "ᎤᏕᏘᏴᏌᏗᏒᎢ",
              +    "D": "Ꭲ",
              +    "DD": "ᎢᎦ",
              +    "YY": "ᎤᎤ",
              +    "YYYY": "ᎤᎤᎤᎤ",
              +    "M": "Ꭷ",
              +    "MM": "ᎧᎧ",
              +    "H": "Ꮡ",
              +    "HH": "ᏑᏑ",
              +    "mm": "ᎢᎢ",
              +    "ss": "ᎠᎠ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/cs/dateres.json b/js/data/locale/cs/dateres.json
              index a1c76beae4..e6a8a9aab1 100644
              --- a/js/data/locale/cs/dateres.json
              +++ b/js/data/locale/cs/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "časové pásmo",
                   "Week": "týden",
                   "Week of Month": "týden v měsíci",
              -    "Year": "rok"
              +    "Year": "rok",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "rr",
              +    "YYYY": "rok",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "h",
              +    "HH": "hh"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/cy/dateres.json b/js/data/locale/cy/dateres.json
              index e3ddaa1596..b2cae5ec90 100644
              --- a/js/data/locale/cy/dateres.json
              +++ b/js/data/locale/cy/dateres.json
              @@ -9,5 +9,14 @@
                   "Time Zone": "cylchfa amser",
                   "Week": "wythnos",
                   "Week of Month": "rhif wythnos yn y mis",
              -    "Year": "blwyddyn"
              +    "Year": "blwyddyn",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "bb",
              +    "YYYY": "bbbb",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "a",
              +    "HH": "aa",
              +    "ss": "ee"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/da/dateres.json b/js/data/locale/da/dateres.json
              index 5d064c8f18..65c9ad5d2f 100644
              --- a/js/data/locale/da/dateres.json
              +++ b/js/data/locale/da/dateres.json
              @@ -9,5 +9,13 @@
                   "Time Zone": "tidszone",
                   "Week": "uge",
                   "Week of Month": "uge i måneden",
              -    "Year": "år"
              +    "Year": "år",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "år",
              +    "YYYY": "år",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "t",
              +    "HH": "tt"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/dateres.json b/js/data/locale/dateres.json
              index e713408074..7717175793 100644
              --- a/js/data/locale/dateres.json
              +++ b/js/data/locale/dateres.json
              @@ -4,11 +4,23 @@
                   "Day of Year": "Day Of Year",
                   "Era": "Era",
                   "Hour": "Hour",
              +    "Millisecond": "Millisecond",
                   "Minute": "Minute",
                   "Month": "Month",
                   "Second": "Second",
                   "Time Zone": "Time Zone",
                   "Week": "Week",
                   "Week of Month": "Week Of Month",
              -    "Year": "Year"
              +    "Year": "Year",
              +    "D": "D",
              +    "DD": "DD",
              +    "YY": "YY",
              +    "YYYY": "YYYY",
              +    "M": "M",
              +    "MM": "MM",
              +    "H": "H",
              +    "HH": "HH",
              +    "mm": "mm",
              +    "ss": "ss",
              +    "ms": "ms"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/dav/dateres.json b/js/data/locale/dav/dateres.json
              index a27c209752..23cc00e879 100644
              --- a/js/data/locale/dav/dateres.json
              +++ b/js/data/locale/dav/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Sekunde",
                   "Time Zone": "Majira ya saa",
                   "Week": "Juma",
              -    "Year": "Mwaka"
              +    "Year": "Mwaka",
              +    "D": "I",
              +    "DD": "II",
              +    "YY": "MM",
              +    "YYYY": "MMMM",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "DD",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/de/dateres.json b/js/data/locale/de/dateres.json
              index 03c042a867..5d9bfd4617 100644
              --- a/js/data/locale/de/dateres.json
              +++ b/js/data/locale/de/dateres.json
              @@ -9,5 +9,12 @@
                   "Time Zone": "Zeitzone",
                   "Week": "Woche",
                   "Week of Month": "Woche des Monats",
              -    "Year": "Jahr"
              +    "Year": "Jahr",
              +    "D": "T",
              +    "DD": "TT",
              +    "YY": "JJ",
              +    "YYYY": "Jahr",
              +    "H": "S",
              +    "HH": "SS",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/dje/dateres.json b/js/data/locale/dje/dateres.json
              index 1c8463120e..b779765111 100644
              --- a/js/data/locale/dje/dateres.json
              +++ b/js/data/locale/dje/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Miti",
                   "Time Zone": "Leerazuu",
                   "Week": "Hebu",
              -    "Year": "Jiiri"
              +    "Year": "Jiiri",
              +    "D": "Z",
              +    "DD": "ZZ",
              +    "YY": "JJ",
              +    "YYYY": "JJJJ",
              +    "M": "H",
              +    "MM": "HH",
              +    "H": "G",
              +    "HH": "GG",
              +    "mm": "MM",
              +    "ss": "MM"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/dsb/dateres.json b/js/data/locale/dsb/dateres.json
              index f8580722ab..7fed00e2e2 100644
              --- a/js/data/locale/dsb/dateres.json
              +++ b/js/data/locale/dsb/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "sekunda",
                   "Time Zone": "casowe pasmo",
                   "Week": "tyźeń",
              -    "Year": "lěto"
              +    "Year": "lěto",
              +    "D": "ź",
              +    "DD": "źź",
              +    "YY": "ll",
              +    "YYYY": "lěto",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "g",
              +    "HH": "gg"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/dua/dateres.json b/js/data/locale/dua/dateres.json
              index 8cc015780e..e95a2ff6ec 100644
              --- a/js/data/locale/dua/dateres.json
              +++ b/js/data/locale/dua/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "píndí",
                   "Time Zone": "Zone",
                   "Week": "disama",
              -    "Year": "mbú"
              +    "Year": "mbú",
              +    "D": "b",
              +    "DD": "bb",
              +    "YY": "mm",
              +    "YYYY": "mbú",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "ŋ",
              +    "HH": "ŋŋ",
              +    "mm": "nn",
              +    "ss": "pp"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/dyo/dateres.json b/js/data/locale/dyo/dateres.json
              index e8c0e3348d..909e9aeb05 100644
              --- a/js/data/locale/dyo/dateres.json
              +++ b/js/data/locale/dyo/dateres.json
              @@ -5,5 +5,11 @@
                   "Month": "Fuleeŋ",
                   "Time Zone": "Zone",
                   "Week": "Lóokuŋ",
              -    "Year": "Emit"
              +    "Year": "Emit",
              +    "D": "Funak",
              +    "DD": "Funak",
              +    "YY": "Emit",
              +    "YYYY": "Emit",
              +    "M": "Fuleeŋ",
              +    "MM": "Fuleeŋ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/dz/dateres.json b/js/data/locale/dz/dateres.json
              index 2874b68ee2..d986833241 100644
              --- a/js/data/locale/dz/dateres.json
              +++ b/js/data/locale/dz/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "སྐར་ཆཱ་",
                   "Time Zone": "དུས་ཀུལ",
                   "Week": "བདུན་ཕྲག",
              -    "Year": "ལོ"
              +    "Year": "ལོ",
              +    "D": "ཚ",
              +    "DD": "ཚཚ",
              +    "YY": "ལོ",
              +    "YYYY": "ལོ",
              +    "M": "ཟ",
              +    "MM": "ཟཟ",
              +    "H": "ཆ",
              +    "HH": "ཆཆ",
              +    "mm": "སས",
              +    "ss": "སས"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ebu/dateres.json b/js/data/locale/ebu/dateres.json
              index f5c705cc0c..bb7e497599 100644
              --- a/js/data/locale/ebu/dateres.json
              +++ b/js/data/locale/ebu/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Sekondi",
                   "Time Zone": "Gĩthaa",
                   "Week": "Kiumia",
              -    "Year": "Mwaka"
              +    "Year": "Mwaka",
              +    "D": "M",
              +    "DD": "MM",
              +    "YY": "MM",
              +    "YYYY": "MMMM",
              +    "H": "I",
              +    "HH": "II",
              +    "mm": "NN",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ee/dateres.json b/js/data/locale/ee/dateres.json
              index 6de1e316e6..40051bc82d 100644
              --- a/js/data/locale/ee/dateres.json
              +++ b/js/data/locale/ee/dateres.json
              @@ -8,5 +8,14 @@
                   "Second": "sekend",
                   "Time Zone": "nutomegaƒoƒo",
                   "Week": "kɔsiɖa ɖeka",
              -    "Year": "ƒe"
              +    "Year": "ƒe",
              +    "D": "ŋ",
              +    "DD": "ŋŋ",
              +    "YY": "ƒe",
              +    "YYYY": "ƒe",
              +    "M": "ɣ",
              +    "MM": "ɣɣ",
              +    "H": "g",
              +    "HH": "gg",
              +    "mm": "aa"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/el/dateres.json b/js/data/locale/el/dateres.json
              index 8dab9028ba..542e60470c 100644
              --- a/js/data/locale/el/dateres.json
              +++ b/js/data/locale/el/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "ζώνη ώρας",
                   "Week": "εβδομάδα",
                   "Week of Month": "εβδομάδα μήνα",
              -    "Year": "έτος"
              +    "Year": "έτος",
              +    "D": "η",
              +    "DD": "ηη",
              +    "YY": "έέ",
              +    "YYYY": "έτος",
              +    "M": "μ",
              +    "MM": "μμ",
              +    "H": "ώ",
              +    "HH": "ώώ",
              +    "mm": "λλ",
              +    "ss": "δδ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/en/dateres.json b/js/data/locale/en/dateres.json
              index acbee02d1e..027f1ceebd 100644
              --- a/js/data/locale/en/dateres.json
              +++ b/js/data/locale/en/dateres.json
              @@ -9,5 +9,13 @@
                   "Time Zone": "time zone",
                   "Week": "week",
                   "Week of Month": "week of month",
              -    "Year": "year"
              +    "Year": "year",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "yy",
              +    "YYYY": "year",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "h",
              +    "HH": "hh"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/es/DO/dateres.json b/js/data/locale/es/DO/dateres.json
              index 6aeb9d66d3..c6ad73eac0 100644
              --- a/js/data/locale/es/DO/dateres.json
              +++ b/js/data/locale/es/DO/dateres.json
              @@ -4,5 +4,13 @@
                   "Month": "Mes",
                   "Second": "Segundo",
                   "Week": "Semana",
              -    "Year": "Año"
              +    "Year": "Año",
              +    "D": "D",
              +    "DD": "DD",
              +    "YY": "AA",
              +    "YYYY": "Año",
              +    "M": "M",
              +    "MM": "MM",
              +    "mm": "MM",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/es/dateres.json b/js/data/locale/es/dateres.json
              index 59333eb5c1..11c24ea783 100644
              --- a/js/data/locale/es/dateres.json
              +++ b/js/data/locale/es/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "zona horaria",
                   "Week": "semana",
                   "Week of Month": "semana del mes",
              -    "Year": "año"
              +    "Year": "año",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "aa",
              +    "YYYY": "año",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "h",
              +    "HH": "hh"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/et/dateres.json b/js/data/locale/et/dateres.json
              index 94835c81db..eb49341859 100644
              --- a/js/data/locale/et/dateres.json
              +++ b/js/data/locale/et/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "ajavöönd",
                   "Week": "nädal",
                   "Week of Month": "kuu nädal",
              -    "Year": "aasta"
              +    "Year": "aasta",
              +    "D": "p",
              +    "DD": "pp",
              +    "YY": "aa",
              +    "YYYY": "aaaa",
              +    "M": "k",
              +    "MM": "kk",
              +    "H": "t",
              +    "HH": "tt"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/eu/dateres.json b/js/data/locale/eu/dateres.json
              index 47d2ea4305..c21cd7bd8e 100644
              --- a/js/data/locale/eu/dateres.json
              +++ b/js/data/locale/eu/dateres.json
              @@ -9,5 +9,13 @@
                   "Time Zone": "ordu-zona",
                   "Week": "astea",
                   "Week of Month": "hileko #. astea",
              -    "Year": "urtea"
              +    "Year": "urtea",
              +    "D": "e",
              +    "DD": "ee",
              +    "YY": "uu",
              +    "YYYY": "uuuu",
              +    "M": "h",
              +    "MM": "hh",
              +    "H": "o",
              +    "HH": "oo"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ewo/dateres.json b/js/data/locale/ewo/dateres.json
              index f26955db13..a83787c477 100644
              --- a/js/data/locale/ewo/dateres.json
              +++ b/js/data/locale/ewo/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Akábəga",
                   "Time Zone": "Nkɔŋ Awola",
                   "Week": "Sɔ́ndɔ",
              -    "Year": "M̀bú"
              +    "Year": "M̀bú",
              +    "D": "A",
              +    "DD": "AA",
              +    "YY": "MM",
              +    "YYYY": "M̀bú",
              +    "M": "N",
              +    "MM": "NN",
              +    "H": "A",
              +    "HH": "AA",
              +    "mm": "EE",
              +    "ss": "AA"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/fa/dateres.json b/js/data/locale/fa/dateres.json
              index d74e2154b9..91e5696b39 100644
              --- a/js/data/locale/fa/dateres.json
              +++ b/js/data/locale/fa/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "منطقهٔ زمانی",
                   "Week": "هفته",
                   "Week of Month": "هفتهٔ ماه",
              -    "Year": "سال"
              +    "Year": "سال",
              +    "D": "روز",
              +    "DD": "روز",
              +    "YY": "سال",
              +    "YYYY": "سال",
              +    "M": "ماه",
              +    "MM": "ماه",
              +    "H": "ساعت",
              +    "HH": "ساعت",
              +    "mm": "دقیقه",
              +    "ss": "ثانیه"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ff/dateres.json b/js/data/locale/ff/dateres.json
              index c97169bd6c..a046a56b18 100644
              --- a/js/data/locale/ff/dateres.json
              +++ b/js/data/locale/ff/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Majaango",
                   "Time Zone": "Diiwaan waktu",
                   "Week": "Yontere",
              -    "Year": "Hitaande"
              +    "Year": "Hitaande",
              +    "D": "Ñ",
              +    "DD": "ÑÑ",
              +    "YY": "HH",
              +    "YYYY": "HHHH",
              +    "M": "L",
              +    "MM": "LL",
              +    "H": "W",
              +    "HH": "WW",
              +    "mm": "HH",
              +    "ss": "MM"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/fi/dateres.json b/js/data/locale/fi/dateres.json
              index ec6dd7e621..345b291a8c 100644
              --- a/js/data/locale/fi/dateres.json
              +++ b/js/data/locale/fi/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "aikavyöhyke",
                   "Week": "viikko",
                   "Week of Month": "kuukauden viikko",
              -    "Year": "vuosi"
              +    "Year": "vuosi",
              +    "D": "p",
              +    "DD": "pp",
              +    "YY": "vv",
              +    "YYYY": "vvvv",
              +    "M": "k",
              +    "MM": "kk",
              +    "H": "t",
              +    "HH": "tt"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/fil/dateres.json b/js/data/locale/fil/dateres.json
              index 935c7bb060..6617c0b213 100644
              --- a/js/data/locale/fil/dateres.json
              +++ b/js/data/locale/fil/dateres.json
              @@ -9,5 +9,13 @@
                   "Time Zone": "time zone",
                   "Week": "linggo",
                   "Week of Month": "linggo ng buwan",
              -    "Year": "taon"
              +    "Year": "taon",
              +    "D": "a",
              +    "DD": "aa",
              +    "YY": "tt",
              +    "YYYY": "taon",
              +    "M": "b",
              +    "MM": "bb",
              +    "H": "o",
              +    "HH": "oo"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/fo/dateres.json b/js/data/locale/fo/dateres.json
              index c3dc059b0a..ab264d5b30 100644
              --- a/js/data/locale/fo/dateres.json
              +++ b/js/data/locale/fo/dateres.json
              @@ -9,5 +9,13 @@
                   "Time Zone": "tíðarøki",
                   "Week": "vika",
                   "Week of Month": "vika í mánaðinum",
              -    "Year": "ár"
              +    "Year": "ár",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "ár",
              +    "YYYY": "ár",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "t",
              +    "HH": "tt"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/fr/dateres.json b/js/data/locale/fr/dateres.json
              index 1988f0284b..5860e1a941 100644
              --- a/js/data/locale/fr/dateres.json
              +++ b/js/data/locale/fr/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "fuseau horaire",
                   "Week": "semaine",
                   "Week of Month": "semaine (mois)",
              -    "Year": "année"
              +    "Year": "année",
              +    "D": "j",
              +    "DD": "jj",
              +    "YY": "aa",
              +    "YYYY": "aaaa",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "h",
              +    "HH": "hh"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/fur/dateres.json b/js/data/locale/fur/dateres.json
              index 8781a1e13a..887c99e479 100644
              --- a/js/data/locale/fur/dateres.json
              +++ b/js/data/locale/fur/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "secont",
                   "Time Zone": "zone",
                   "Week": "setemane",
              -    "Year": "an"
              +    "Year": "an",
              +    "D": "d",
              +    "DD": "dì",
              +    "YY": "an",
              +    "YYYY": "an",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "o",
              +    "HH": "oo"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/fy/dateres.json b/js/data/locale/fy/dateres.json
              index fc485ea062..b09913c5bd 100644
              --- a/js/data/locale/fy/dateres.json
              +++ b/js/data/locale/fy/dateres.json
              @@ -7,5 +7,13 @@
                   "Second": "Sekonde",
                   "Time Zone": "Zone",
                   "Week": "Wike",
              -    "Year": "Jier"
              +    "Year": "Jier",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "JJ",
              +    "YYYY": "Jier",
              +    "H": "o",
              +    "HH": "oo",
              +    "mm": "MM",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ga/dateres.json b/js/data/locale/ga/dateres.json
              index 8eb1ed99a1..ee3594ab15 100644
              --- a/js/data/locale/ga/dateres.json
              +++ b/js/data/locale/ga/dateres.json
              @@ -10,5 +10,14 @@
                   "Time Zone": "Crios Ama",
                   "Week": "Seachtain",
                   "Week of Month": "Seachtain den mhí",
              -    "Year": "Bliain"
              +    "Year": "Bliain",
              +    "D": "L",
              +    "DD": "Lá",
              +    "YY": "BB",
              +    "YYYY": "BBBB",
              +    "MM": "Mí",
              +    "H": "U",
              +    "HH": "UU",
              +    "mm": "NN",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/gd/dateres.json b/js/data/locale/gd/dateres.json
              index b328efa114..f090686de2 100644
              --- a/js/data/locale/gd/dateres.json
              +++ b/js/data/locale/gd/dateres.json
              @@ -10,5 +10,14 @@
                   "Time Zone": "roinn-tìde",
                   "Week": "seachdain",
                   "Week of Month": "seachdain dhen mhìos",
              -    "Year": "bliadhna"
              +    "Year": "bliadhna",
              +    "D": "l",
              +    "DD": "ll",
              +    "YY": "bb",
              +    "YYYY": "bbbb",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "u",
              +    "HH": "uu",
              +    "ss": "dd"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/gl/dateres.json b/js/data/locale/gl/dateres.json
              index 09f0593141..66fa6270ea 100644
              --- a/js/data/locale/gl/dateres.json
              +++ b/js/data/locale/gl/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "fuso horario",
                   "Week": "semana",
                   "Week of Month": "semana do mes",
              -    "Year": "ano"
              +    "Year": "ano",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "aa",
              +    "YYYY": "ano",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "h",
              +    "HH": "hh"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/gsw/dateres.json b/js/data/locale/gsw/dateres.json
              index 5fcc4569b5..23b783e8f4 100644
              --- a/js/data/locale/gsw/dateres.json
              +++ b/js/data/locale/gsw/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Sekunde",
                   "Time Zone": "Zone",
                   "Week": "Wuche",
              -    "Year": "Jaar"
              +    "Year": "Jaar",
              +    "D": "T",
              +    "DD": "TT",
              +    "YY": "JJ",
              +    "YYYY": "Jaar",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "MM",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/gu/dateres.json b/js/data/locale/gu/dateres.json
              index 703467258d..cf4e7ba3e8 100644
              --- a/js/data/locale/gu/dateres.json
              +++ b/js/data/locale/gu/dateres.json
              @@ -9,5 +9,15 @@
                   "Time Zone": "સમય ઝોન",
                   "Week": "અઠવાડિયું",
                   "Week of Month": "મહિનાનું અઠવાડિયું",
              -    "Year": "વર્ષ"
              +    "Year": "વર્ષ",
              +    "D": "દ",
              +    "DD": "દદ",
              +    "YY": "વવ",
              +    "YYYY": "વર્ષ",
              +    "M": "મ",
              +    "MM": "મમ",
              +    "H": "ક",
              +    "HH": "કક",
              +    "mm": "મમ",
              +    "ss": "સસ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/guz/dateres.json b/js/data/locale/guz/dateres.json
              index f9247ac89f..34790613d9 100644
              --- a/js/data/locale/guz/dateres.json
              +++ b/js/data/locale/guz/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Esekendi",
                   "Time Zone": "Chinse ‘chimo",
                   "Week": "Omokubio",
              -    "Year": "Omwaka"
              +    "Year": "Omwaka",
              +    "D": "R",
              +    "DD": "RR",
              +    "YY": "OO",
              +    "YYYY": "OOOO",
              +    "M": "O",
              +    "MM": "OO",
              +    "H": "E",
              +    "HH": "EE",
              +    "mm": "EE",
              +    "ss": "EE"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ha/dateres.json b/js/data/locale/ha/dateres.json
              index 66a742122a..20ae153970 100644
              --- a/js/data/locale/ha/dateres.json
              +++ b/js/data/locale/ha/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Daƙiƙa",
                   "Time Zone": "Agogo",
                   "Week": "Mako",
              -    "Year": "Shekara"
              +    "Year": "Shekara",
              +    "D": "K",
              +    "DD": "KK",
              +    "YY": "SS",
              +    "YYYY": "SSSS",
              +    "M": "W",
              +    "MM": "WW",
              +    "H": "A",
              +    "HH": "AA",
              +    "mm": "MM",
              +    "ss": "DD"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/he/dateres.json b/js/data/locale/he/dateres.json
              index cddfc3231b..de1e5495a4 100644
              --- a/js/data/locale/he/dateres.json
              +++ b/js/data/locale/he/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "אזור",
                   "Week": "שבוע",
                   "Week of Month": "השבוע בחודש",
              -    "Year": "שנה"
              +    "Year": "שנה",
              +    "D": "יום",
              +    "DD": "יום",
              +    "YY": "שנה",
              +    "YYYY": "שנה",
              +    "M": "חודש",
              +    "MM": "חודש",
              +    "H": "שעה",
              +    "HH": "שעה",
              +    "mm": "דקה",
              +    "ss": "שנייה"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/hi/dateres.json b/js/data/locale/hi/dateres.json
              index a92455a1d8..c697076418 100644
              --- a/js/data/locale/hi/dateres.json
              +++ b/js/data/locale/hi/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "समय क्षेत्र",
                   "Week": "सप्ताह",
                   "Week of Month": "माह का सप्ताह",
              -    "Year": "वर्ष"
              +    "Year": "वर्ष",
              +    "D": "द",
              +    "DD": "दद",
              +    "YY": "वव",
              +    "YYYY": "वर्ष",
              +    "M": "म",
              +    "MM": "मम",
              +    "H": "घ",
              +    "HH": "घघ",
              +    "mm": "मम",
              +    "ss": "सस"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/hr/dateres.json b/js/data/locale/hr/dateres.json
              index 9ba4bc39ee..f58fcbcda1 100644
              --- a/js/data/locale/hr/dateres.json
              +++ b/js/data/locale/hr/dateres.json
              @@ -9,5 +9,13 @@
                   "Time Zone": "vremenska zona",
                   "Week": "tjedan",
                   "Week of Month": "tjedan u mjesecu",
              -    "Year": "godina"
              +    "Year": "godina",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "gg",
              +    "YYYY": "gggg",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "s",
              +    "HH": "ss"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/hsb/dateres.json b/js/data/locale/hsb/dateres.json
              index 0755b5f52b..dba8d3a8d2 100644
              --- a/js/data/locale/hsb/dateres.json
              +++ b/js/data/locale/hsb/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "sekunda",
                   "Time Zone": "časowe pasmo",
                   "Week": "tydźeń",
              -    "Year": "lěto"
              +    "Year": "lěto",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "ll",
              +    "YYYY": "lěto",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "h",
              +    "HH": "hh"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/hu/dateres.json b/js/data/locale/hu/dateres.json
              index 466eb505f8..f625332e13 100644
              --- a/js/data/locale/hu/dateres.json
              +++ b/js/data/locale/hu/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "időzóna",
                   "Week": "hét",
                   "Week of Month": "hónap hete",
              -    "Year": "év"
              +    "Year": "év",
              +    "D": "n",
              +    "DD": "nn",
              +    "YY": "év",
              +    "YYYY": "év",
              +    "M": "h",
              +    "MM": "hh",
              +    "H": "ó",
              +    "HH": "óó",
              +    "mm": "pp",
              +    "ss": "mm"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/hy/dateres.json b/js/data/locale/hy/dateres.json
              index 0d95027b7b..70913e4753 100644
              --- a/js/data/locale/hy/dateres.json
              +++ b/js/data/locale/hy/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "ժամային գոտի",
                   "Week": "շաբաթ",
                   "Week of Month": "ամսվա շաբաթ",
              -    "Year": "տարի"
              +    "Year": "տարի",
              +    "D": "օ",
              +    "DD": "օր",
              +    "YY": "տտ",
              +    "YYYY": "տարի",
              +    "M": "ա",
              +    "MM": "աա",
              +    "H": "ժ",
              +    "HH": "ժժ",
              +    "mm": "րր",
              +    "ss": "վվ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ia/dateres.json b/js/data/locale/ia/dateres.json
              index ef7852299d..79faa2ec55 100644
              --- a/js/data/locale/ia/dateres.json
              +++ b/js/data/locale/ia/dateres.json
              @@ -9,5 +9,13 @@
                   "Time Zone": "fuso horari",
                   "Week": "septimana",
                   "Week of Month": "septimana del mense",
              -    "Year": "anno"
              +    "Year": "anno",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "aa",
              +    "YYYY": "anno",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "h",
              +    "HH": "hh"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/id/dateres.json b/js/data/locale/id/dateres.json
              index f398f110c0..bd51623533 100644
              --- a/js/data/locale/id/dateres.json
              +++ b/js/data/locale/id/dateres.json
              @@ -9,5 +9,14 @@
                   "Time Zone": "zona waktu",
                   "Week": "minggu",
                   "Week of Month": "minggu",
              -    "Year": "tahun"
              +    "Year": "tahun",
              +    "D": "h",
              +    "DD": "hh",
              +    "YY": "tt",
              +    "YYYY": "tttt",
              +    "M": "b",
              +    "MM": "bb",
              +    "H": "J",
              +    "HH": "JJ",
              +    "ss": "dd"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ig/dateres.json b/js/data/locale/ig/dateres.json
              index e80d83204d..d2e1536687 100644
              --- a/js/data/locale/ig/dateres.json
              +++ b/js/data/locale/ig/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Nkejinta",
                   "Time Zone": "Mpaghara oge",
                   "Week": "Izu",
              -    "Year": "Afọ"
              +    "Year": "Afọ",
              +    "D": "Ụ",
              +    "DD": "ỤỤ",
              +    "YY": "AA",
              +    "YYYY": "Afọ",
              +    "M": "Ọ",
              +    "MM": "ỌỌ",
              +    "H": "E",
              +    "HH": "EE",
              +    "mm": "NN",
              +    "ss": "NN"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ii/dateres.json b/js/data/locale/ii/dateres.json
              index ccdffb87c5..0ca7c3fd0a 100644
              --- a/js/data/locale/ii/dateres.json
              +++ b/js/data/locale/ii/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "ꇙ",
                   "Time Zone": "ꃅꄷꄮꈉ",
                   "Week": "ꑭꆏ",
              -    "Year": "ꈎ"
              +    "Year": "ꈎ",
              +    "D": "ꑍ",
              +    "DD": "ꑍ",
              +    "YY": "ꈎ",
              +    "YYYY": "ꈎ",
              +    "M": "ꆪ",
              +    "MM": "ꆪ",
              +    "H": "ꄮ",
              +    "HH": "ꄮꈉ",
              +    "mm": "ꃏ",
              +    "ss": "ꇙ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/is/dateres.json b/js/data/locale/is/dateres.json
              index 25b4da056f..a3b217aa8f 100644
              --- a/js/data/locale/is/dateres.json
              +++ b/js/data/locale/is/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "tímabelti",
                   "Week": "vika",
                   "Week of Month": "vika í mánuði",
              -    "Year": "ár"
              +    "Year": "ár",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "ár",
              +    "YYYY": "ár",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "k",
              +    "HH": "kk"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/it/dateres.json b/js/data/locale/it/dateres.json
              index 449c8a63a8..d726b8b388 100644
              --- a/js/data/locale/it/dateres.json
              +++ b/js/data/locale/it/dateres.json
              @@ -9,5 +9,13 @@
                   "Time Zone": "fuso orario",
                   "Week": "settimana",
                   "Week of Month": "settimana del mese",
              -    "Year": "anno"
              +    "Year": "anno",
              +    "D": "g",
              +    "DD": "gg",
              +    "YY": "aa",
              +    "YYYY": "anno",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "o",
              +    "HH": "oo"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ja/dateres.json b/js/data/locale/ja/dateres.json
              index 8c35b386be..1a99412a60 100644
              --- a/js/data/locale/ja/dateres.json
              +++ b/js/data/locale/ja/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "タイムゾーン",
                   "Week": "週",
                   "Week of Month": "月の週番号",
              -    "Year": "年"
              +    "Year": "年",
              +    "D": "日",
              +    "DD": "日",
              +    "YY": "年",
              +    "YYYY": "年",
              +    "M": "月",
              +    "MM": "月",
              +    "H": "時",
              +    "HH": "時",
              +    "mm": "分",
              +    "ss": "秒"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/jmc/dateres.json b/js/data/locale/jmc/dateres.json
              index 6cb392f9e3..981532f936 100644
              --- a/js/data/locale/jmc/dateres.json
              +++ b/js/data/locale/jmc/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Sekunde",
                   "Time Zone": "Mfiri o saa",
                   "Week": "Wiikyi",
              -    "Year": "Maka"
              +    "Year": "Maka",
              +    "D": "M",
              +    "DD": "MM",
              +    "YY": "MM",
              +    "YYYY": "Maka",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "DD",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/jv/dateres.json b/js/data/locale/jv/dateres.json
              index bacc99cfab..cf685ea9f8 100644
              --- a/js/data/locale/jv/dateres.json
              +++ b/js/data/locale/jv/dateres.json
              @@ -8,5 +8,14 @@
                   "Second": "detik",
                   "Time Zone": "zona wektu",
                   "Week": "pekan",
              -    "Year": "taun"
              +    "Year": "taun",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "tt",
              +    "YYYY": "taun",
              +    "M": "s",
              +    "MM": "ss",
              +    "H": "j",
              +    "HH": "jj",
              +    "ss": "dd"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ka/dateres.json b/js/data/locale/ka/dateres.json
              index 074deac3cb..add34146fc 100644
              --- a/js/data/locale/ka/dateres.json
              +++ b/js/data/locale/ka/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "დროის სარტყელი",
                   "Week": "კვირა",
                   "Week of Month": "თვის კვირა",
              -    "Year": "წელი"
              +    "Year": "წელი",
              +    "D": "დ",
              +    "DD": "დდ",
              +    "YY": "წწ",
              +    "YYYY": "წელი",
              +    "M": "თ",
              +    "MM": "თთ",
              +    "H": "ს",
              +    "HH": "სს",
              +    "mm": "წწ",
              +    "ss": "წწ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/kab/dateres.json b/js/data/locale/kab/dateres.json
              index 26d07b6285..598775daca 100644
              --- a/js/data/locale/kab/dateres.json
              +++ b/js/data/locale/kab/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Tasint",
                   "Time Zone": "Aseglem asergan",
                   "Week": "Ddurt",
              -    "Year": "Aseggas"
              +    "Year": "Aseggas",
              +    "D": "A",
              +    "DD": "AA",
              +    "YY": "AA",
              +    "YYYY": "AAAA",
              +    "M": "A",
              +    "MM": "AA",
              +    "H": "T",
              +    "HH": "TT",
              +    "mm": "TT",
              +    "ss": "TT"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/kam/dateres.json b/js/data/locale/kam/dateres.json
              index 944af6c735..602f07f7d4 100644
              --- a/js/data/locale/kam/dateres.json
              +++ b/js/data/locale/kam/dateres.json
              @@ -8,5 +8,12 @@
                   "Second": "sekondi",
                   "Time Zone": "Kĩsio kya ĩsaa",
                   "Week": "Kyumwa",
              -    "Year": "Mwaka"
              +    "Year": "Mwaka",
              +    "D": "M",
              +    "DD": "MM",
              +    "YY": "MM",
              +    "YYYY": "MMMM",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "NN"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/kde/dateres.json b/js/data/locale/kde/dateres.json
              index 4f1be55c32..388dd599ea 100644
              --- a/js/data/locale/kde/dateres.json
              +++ b/js/data/locale/kde/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Sekunde",
                   "Time Zone": "Npanda wa muda",
                   "Week": "Lijuma",
              -    "Year": "Mwaka"
              +    "Year": "Mwaka",
              +    "D": "L",
              +    "DD": "LL",
              +    "YY": "MM",
              +    "YYYY": "MMMM",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "DD",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/kea/dateres.json b/js/data/locale/kea/dateres.json
              index f719f909e5..8ec2354ef5 100644
              --- a/js/data/locale/kea/dateres.json
              +++ b/js/data/locale/kea/dateres.json
              @@ -7,5 +7,11 @@
                   "Second": "Sigundu",
                   "Time Zone": "Ora lokal",
                   "Week": "Simana",
              -    "Year": "Anu"
              +    "Year": "Anu",
              +    "YY": "AA",
              +    "YYYY": "Anu",
              +    "H": "O",
              +    "HH": "OO",
              +    "mm": "MM",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/khq/dateres.json b/js/data/locale/khq/dateres.json
              index 62efc40805..ab3760aee4 100644
              --- a/js/data/locale/khq/dateres.json
              +++ b/js/data/locale/khq/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Miti",
                   "Time Zone": "Leerazuu",
                   "Week": "Hebu",
              -    "Year": "Jiiri"
              +    "Year": "Jiiri",
              +    "D": "J",
              +    "DD": "JJ",
              +    "YY": "JJ",
              +    "YYYY": "JJJJ",
              +    "M": "H",
              +    "MM": "HH",
              +    "H": "G",
              +    "HH": "GG",
              +    "mm": "MM",
              +    "ss": "MM"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ki/dateres.json b/js/data/locale/ki/dateres.json
              index 575f11a8d2..8ad7910c5d 100644
              --- a/js/data/locale/ki/dateres.json
              +++ b/js/data/locale/ki/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Sekunde",
                   "Time Zone": "Mũcooro wa mathaa",
                   "Week": "Kiumia",
              -    "Year": "Mwaka"
              +    "Year": "Mwaka",
              +    "D": "M",
              +    "DD": "MM",
              +    "YY": "MM",
              +    "YYYY": "MMMM",
              +    "H": "I",
              +    "HH": "II",
              +    "mm": "NN",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/kk/dateres.json b/js/data/locale/kk/dateres.json
              index 39c1a3f0cc..8a85a3fc9b 100644
              --- a/js/data/locale/kk/dateres.json
              +++ b/js/data/locale/kk/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "уақыт белдеуі",
                   "Week": "апта",
                   "Week of Month": "айдағы апта",
              -    "Year": "жыл"
              +    "Year": "жыл",
              +    "D": "к",
              +    "DD": "кк",
              +    "YY": "жж",
              +    "YYYY": "жыл",
              +    "M": "а",
              +    "MM": "ай",
              +    "H": "с",
              +    "HH": "сс",
              +    "mm": "мм",
              +    "ss": "сс"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/kln/dateres.json b/js/data/locale/kln/dateres.json
              index 39cf5ab305..e71e4ca596 100644
              --- a/js/data/locale/kln/dateres.json
              +++ b/js/data/locale/kln/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Sekondit",
                   "Time Zone": "Saitab sonit",
                   "Week": "Wikit",
              -    "Year": "Kenyit"
              +    "Year": "Kenyit",
              +    "D": "B",
              +    "DD": "BB",
              +    "YY": "KK",
              +    "YYYY": "KKKK",
              +    "M": "A",
              +    "MM": "AA",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "MM",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/km/dateres.json b/js/data/locale/km/dateres.json
              index 32fe145224..7d43e04700 100644
              --- a/js/data/locale/km/dateres.json
              +++ b/js/data/locale/km/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "ល្វែងម៉ោង",
                   "Week": "សប្ដាហ៍",
                   "Week of Month": "សប្ដាហ៍នៃខែ",
              -    "Year": "ឆ្នាំ"
              +    "Year": "ឆ្នាំ",
              +    "D": "ថ",
              +    "DD": "ថថ",
              +    "YY": "ឆឆ",
              +    "YYYY": "ឆឆឆឆ",
              +    "M": "ខ",
              +    "MM": "ខែ",
              +    "H": "ម",
              +    "HH": "មម",
              +    "mm": "នន",
              +    "ss": "វវ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/kn/dateres.json b/js/data/locale/kn/dateres.json
              index 4c68acf0ed..45d3ca780e 100644
              --- a/js/data/locale/kn/dateres.json
              +++ b/js/data/locale/kn/dateres.json
              @@ -9,5 +9,15 @@
                   "Time Zone": "ಸಮಯ ವಲಯ",
                   "Week": "ವಾರ",
                   "Week of Month": "ತಿಂಗಳ ವಾರ",
              -    "Year": "ವರ್ಷ"
              +    "Year": "ವರ್ಷ",
              +    "D": "ದ",
              +    "DD": "ದದ",
              +    "YY": "ವವ",
              +    "YYYY": "ವರ್ಷ",
              +    "M": "ತ",
              +    "MM": "ತತ",
              +    "H": "ಗ",
              +    "HH": "ಗಗ",
              +    "mm": "ನನ",
              +    "ss": "ಸಸ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ko/dateres.json b/js/data/locale/ko/dateres.json
              index a1f8c3df89..43b69263e6 100644
              --- a/js/data/locale/ko/dateres.json
              +++ b/js/data/locale/ko/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "시간대",
                   "Week": "주",
                   "Week of Month": "월의 주",
              -    "Year": "년"
              +    "Year": "년",
              +    "D": "일",
              +    "DD": "일",
              +    "YY": "년",
              +    "YYYY": "년",
              +    "M": "월",
              +    "MM": "월",
              +    "H": "시",
              +    "HH": "시",
              +    "mm": "분",
              +    "ss": "초"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/kok/dateres.json b/js/data/locale/kok/dateres.json
              index e54a3a14d8..026a097470 100644
              --- a/js/data/locale/kok/dateres.json
              +++ b/js/data/locale/kok/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "झोन",
                   "Week": "सप्तक",
                   "Week of Month": "म्हयन्यातलो सप्तक",
              -    "Year": "वर्स"
              +    "Year": "वर्स",
              +    "D": "द",
              +    "DD": "दद",
              +    "YY": "वव",
              +    "YYYY": "वर्स",
              +    "M": "म",
              +    "MM": "मम",
              +    "H": "व",
              +    "HH": "वर",
              +    "mm": "मम",
              +    "ss": "सस"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ks/dateres.json b/js/data/locale/ks/dateres.json
              index 79989c5ecb..a7f7d428d9 100644
              --- a/js/data/locale/ks/dateres.json
              +++ b/js/data/locale/ks/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "سٮ۪کَنڑ",
                   "Time Zone": "زون",
                   "Week": "ہفتہٕ",
              -    "Year": "ؤری"
              +    "Year": "ؤری",
              +    "D": "دۄہ",
              +    "DD": "دۄہ",
              +    "YY": "ؤری",
              +    "YYYY": "ؤری",
              +    "M": "رٮ۪تھ",
              +    "MM": "رٮ۪تھ",
              +    "H": "گٲنٛٹہٕ",
              +    "HH": "گٲنٛٹہٕ",
              +    "mm": "مِنَٹ",
              +    "ss": "سٮ۪کَنڑ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ksb/dateres.json b/js/data/locale/ksb/dateres.json
              index e292c8e809..894a4ca1fe 100644
              --- a/js/data/locale/ksb/dateres.json
              +++ b/js/data/locale/ksb/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Sekunde",
                   "Time Zone": "Majila",
                   "Week": "Niki",
              -    "Year": "Ng’waka"
              +    "Year": "Ng’waka",
              +    "D": "S",
              +    "DD": "SS",
              +    "YY": "NN",
              +    "YYYY": "NNNN",
              +    "M": "N",
              +    "MM": "NN",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "DD",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ksf/dateres.json b/js/data/locale/ksf/dateres.json
              index 855262e490..7b9f2c3d8b 100644
              --- a/js/data/locale/ksf/dateres.json
              +++ b/js/data/locale/ksf/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Háu",
                   "Time Zone": "Wáas",
                   "Week": "Sɔ́ndǝ",
              -    "Year": "Bǝk"
              +    "Year": "Bǝk",
              +    "D": "Ŋ",
              +    "DD": "ŊŊ",
              +    "YY": "BB",
              +    "YYYY": "Bǝk",
              +    "M": "Ŋ",
              +    "MM": "ŊŊ",
              +    "H": "C",
              +    "HH": "CC",
              +    "mm": "MM",
              +    "ss": "HH"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ksh/dateres.json b/js/data/locale/ksh/dateres.json
              index 4421282a93..87bd6ef515 100644
              --- a/js/data/locale/ksh/dateres.json
              +++ b/js/data/locale/ksh/dateres.json
              @@ -8,5 +8,11 @@
                   "Second": "Sekond",
                   "Time Zone": "Zickzohn",
                   "Week": "Woch",
              -    "Year": "Johr"
              +    "Year": "Johr",
              +    "YY": "JJ",
              +    "YYYY": "Johr",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "MM",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ku/dateres.json b/js/data/locale/ku/dateres.json
              index a3bdeb5f8f..3f25aabf0d 100644
              --- a/js/data/locale/ku/dateres.json
              +++ b/js/data/locale/ku/dateres.json
              @@ -8,5 +8,14 @@
                   "Second": "saniye",
                   "Time Zone": "Zone",
                   "Week": "hefte",
              -    "Year": "sal"
              +    "Year": "sal",
              +    "D": "r",
              +    "DD": "rr",
              +    "YY": "ss",
              +    "YYYY": "sal",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "s",
              +    "HH": "ss",
              +    "mm": "dd"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ky/dateres.json b/js/data/locale/ky/dateres.json
              index efb9bf1791..8b0466eb82 100644
              --- a/js/data/locale/ky/dateres.json
              +++ b/js/data/locale/ky/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "убакыт алкагы",
                   "Week": "апта",
                   "Week of Month": "айдын жумасы",
              -    "Year": "жыл"
              +    "Year": "жыл",
              +    "D": "күн",
              +    "DD": "күн",
              +    "YY": "жыл",
              +    "YYYY": "жыл",
              +    "M": "ай",
              +    "MM": "ай",
              +    "H": "саат",
              +    "HH": "саат",
              +    "mm": "мүнөт",
              +    "ss": "секунд"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/lag/dateres.json b/js/data/locale/lag/dateres.json
              index 89c1397459..f527a82a9e 100644
              --- a/js/data/locale/lag/dateres.json
              +++ b/js/data/locale/lag/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Sekúunde",
                   "Time Zone": "Mpɨɨndɨ ja mɨɨtʉ",
                   "Week": "Wíiki",
              -    "Year": "Mwaáka"
              +    "Year": "Mwaáka",
              +    "D": "S",
              +    "DD": "SS",
              +    "YY": "MM",
              +    "YYYY": "MMMM",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "DD",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/lb/dateres.json b/js/data/locale/lb/dateres.json
              index eeca8ae0a5..17130a0f4a 100644
              --- a/js/data/locale/lb/dateres.json
              +++ b/js/data/locale/lb/dateres.json
              @@ -8,5 +8,11 @@
                   "Second": "Sekonn",
                   "Time Zone": "Zäitzon",
                   "Week": "Woch",
              -    "Year": "Joer"
              +    "Year": "Joer",
              +    "YY": "JJ",
              +    "YYYY": "Joer",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "MM",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/lg/dateres.json b/js/data/locale/lg/dateres.json
              index 017f6cba42..e1cc445a53 100644
              --- a/js/data/locale/lg/dateres.json
              +++ b/js/data/locale/lg/dateres.json
              @@ -7,5 +7,13 @@
                   "Second": "Kasikonda",
                   "Time Zone": "Ssaawa za:",
                   "Week": "Sabbiiti",
              -    "Year": "Mwaka"
              +    "Year": "Mwaka",
              +    "D": "L",
              +    "DD": "LL",
              +    "YY": "MM",
              +    "YYYY": "MMMM",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "DD",
              +    "ss": "KK"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/lkt/dateres.json b/js/data/locale/lkt/dateres.json
              index c6a1d3e6fc..186240d932 100644
              --- a/js/data/locale/lkt/dateres.json
              +++ b/js/data/locale/lkt/dateres.json
              @@ -7,5 +7,15 @@
                   "Second": "Okpí",
                   "Time Zone": "Zone",
                   "Week": "Okó",
              -    "Year": "Ómakȟa"
              +    "Year": "Ómakȟa",
              +    "D": "A",
              +    "DD": "AA",
              +    "YY": "ÓÓ",
              +    "YYYY": "ÓÓÓÓ",
              +    "M": "W",
              +    "MM": "Wí",
              +    "H": "O",
              +    "HH": "OO",
              +    "mm": "OO",
              +    "ss": "OO"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ln/dateres.json b/js/data/locale/ln/dateres.json
              index 3046a0bc8a..b794c9096c 100644
              --- a/js/data/locale/ln/dateres.json
              +++ b/js/data/locale/ln/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Sɛkɔ́ndɛ",
                   "Time Zone": "Ntáká ya ngonga",
                   "Week": "Pɔ́sɔ",
              -    "Year": "Mobú"
              +    "Year": "Mobú",
              +    "D": "M",
              +    "DD": "MM",
              +    "YY": "MM",
              +    "YYYY": "Mobú",
              +    "M": "S",
              +    "MM": "SS",
              +    "H": "N",
              +    "HH": "NN",
              +    "mm": "MM",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/lo/dateres.json b/js/data/locale/lo/dateres.json
              index b0d0152614..3e9efee338 100644
              --- a/js/data/locale/lo/dateres.json
              +++ b/js/data/locale/lo/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "ເຂດເວລາ",
                   "Week": "ອາທິດ",
                   "Week of Month": "ອາທິດຂອງເດືອນ",
              -    "Year": "ປີ"
              +    "Year": "ປີ",
              +    "D": "ມ",
              +    "DD": "ມມ",
              +    "YY": "ປີ",
              +    "YYYY": "ປີ",
              +    "M": "ເ",
              +    "MM": "ເເ",
              +    "H": "ຊ",
              +    "HH": "ຊຊ",
              +    "mm": "ນນ",
              +    "ss": "ວວ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/lrc/dateres.json b/js/data/locale/lrc/dateres.json
              index 06d288093a..f11129db54 100644
              --- a/js/data/locale/lrc/dateres.json
              +++ b/js/data/locale/lrc/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "ثانیە",
                   "Time Zone": "راساگە",
                   "Week": "ھأفتە",
              -    "Year": "سال"
              +    "Year": "سال",
              +    "D": "ر",
              +    "DD": "رر",
              +    "YY": "سس",
              +    "YYYY": "سال",
              +    "M": "م",
              +    "MM": "ما",
              +    "H": "س",
              +    "HH": "سس",
              +    "mm": "دد",
              +    "ss": "ثث"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/lt/dateres.json b/js/data/locale/lt/dateres.json
              index fac8dc4bb1..5ada41057c 100644
              --- a/js/data/locale/lt/dateres.json
              +++ b/js/data/locale/lt/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "laiko juosta",
                   "Week": "savaitė",
                   "Week of Month": "mėnesio savaitė",
              -    "Year": "metai"
              +    "Year": "metai",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "mm",
              +    "YYYY": "mmmm",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "v",
              +    "HH": "vv"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/lu/dateres.json b/js/data/locale/lu/dateres.json
              index 31018ecb0f..886062da1d 100644
              --- a/js/data/locale/lu/dateres.json
              +++ b/js/data/locale/lu/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Kasunsukusu",
                   "Time Zone": "Nzeepu",
                   "Week": "Lubingu",
              -    "Year": "Tshidimu"
              +    "Year": "Tshidimu",
              +    "YY": "TT",
              +    "YYYY": "TTTT",
              +    "M": "N",
              +    "MM": "NN",
              +    "H": "D",
              +    "HH": "DD",
              +    "mm": "KK",
              +    "ss": "KK"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/luo/dateres.json b/js/data/locale/luo/dateres.json
              index 273396a2b3..2616eb4b05 100644
              --- a/js/data/locale/luo/dateres.json
              +++ b/js/data/locale/luo/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "nyiriri mar saa",
                   "Time Zone": "kar saa",
                   "Week": "juma",
              -    "Year": "higa"
              +    "Year": "higa",
              +    "D": "c",
              +    "DD": "cc",
              +    "YY": "hh",
              +    "YYYY": "higa",
              +    "M": "d",
              +    "MM": "dd",
              +    "H": "s",
              +    "HH": "ss",
              +    "mm": "dd",
              +    "ss": "nn"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/luy/dateres.json b/js/data/locale/luy/dateres.json
              index 45978f6e66..fcaec557fd 100644
              --- a/js/data/locale/luy/dateres.json
              +++ b/js/data/locale/luy/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Sekunde",
                   "Time Zone": "Havundu",
                   "Week": "Risiza",
              -    "Year": "Muhiga"
              +    "Year": "Muhiga",
              +    "D": "R",
              +    "DD": "RR",
              +    "YY": "MM",
              +    "YYYY": "MMMM",
              +    "H": "I",
              +    "HH": "II",
              +    "mm": "II",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/lv/dateres.json b/js/data/locale/lv/dateres.json
              index 4f973e777f..81bb033a3b 100644
              --- a/js/data/locale/lv/dateres.json
              +++ b/js/data/locale/lv/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "laika josla",
                   "Week": "nedēļa",
                   "Week of Month": "mēneša nedēļa",
              -    "Year": "gads"
              +    "Year": "gads",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "gg",
              +    "YYYY": "gads",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "s",
              +    "HH": "ss"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/mas/dateres.json b/js/data/locale/mas/dateres.json
              index b498f1f3d0..5b39d028c3 100644
              --- a/js/data/locale/mas/dateres.json
              +++ b/js/data/locale/mas/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Sekunde",
                   "Time Zone": "Ɛ́sáâ o inkuapí",
                   "Week": "Ewíkî",
              -    "Year": "Ɔlárì"
              +    "Year": "Ɔlárì",
              +    "D": "Ɛ",
              +    "DD": "ƐƐ",
              +    "YY": "ƆƆ",
              +    "YYYY": "ƆƆƆƆ",
              +    "M": "Ɔ",
              +    "MM": "ƆƆ",
              +    "H": "Ɛ",
              +    "HH": "ƐƐ",
              +    "mm": "OO",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/mer/dateres.json b/js/data/locale/mer/dateres.json
              index 5cf9fd2764..37b5babfb4 100644
              --- a/js/data/locale/mer/dateres.json
              +++ b/js/data/locale/mer/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Sekondi",
                   "Time Zone": "Gũntũ kwa thaa",
                   "Week": "Kiumia",
              -    "Year": "Mwaka"
              +    "Year": "Mwaka",
              +    "D": "N",
              +    "DD": "NN",
              +    "YY": "MM",
              +    "YYYY": "MMMM",
              +    "H": "Ĩ",
              +    "HH": "ĨĨ",
              +    "mm": "NN",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/mfe/dateres.json b/js/data/locale/mfe/dateres.json
              index e537f8b54e..74d84494f4 100644
              --- a/js/data/locale/mfe/dateres.json
              +++ b/js/data/locale/mfe/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Segonn",
                   "Time Zone": "Peryod letan",
                   "Week": "Semenn",
              -    "Year": "Lane"
              +    "Year": "Lane",
              +    "D": "Z",
              +    "DD": "ZZ",
              +    "YY": "LL",
              +    "YYYY": "Lane",
              +    "H": "L",
              +    "HH": "LL",
              +    "mm": "MM",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/mg/dateres.json b/js/data/locale/mg/dateres.json
              index bb13f084b6..c76ef148ea 100644
              --- a/js/data/locale/mg/dateres.json
              +++ b/js/data/locale/mg/dateres.json
              @@ -6,5 +6,15 @@
                   "Second": "Segondra",
                   "Time Zone": "Zone",
                   "Week": "Herinandro",
              -    "Year": "Taona"
              +    "Year": "Taona",
              +    "D": "A",
              +    "DD": "AA",
              +    "YY": "TT",
              +    "YYYY": "TTTT",
              +    "M": "V",
              +    "MM": "VV",
              +    "H": "O",
              +    "HH": "OO",
              +    "mm": "MM",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/mgh/dateres.json b/js/data/locale/mgh/dateres.json
              index 32225d7eeb..300ee7e4e9 100644
              --- a/js/data/locale/mgh/dateres.json
              +++ b/js/data/locale/mgh/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "isekunde",
                   "Time Zone": "Zone",
                   "Week": "iwiki mocha",
              -    "Year": "yaka"
              +    "Year": "yaka",
              +    "D": "n",
              +    "DD": "nn",
              +    "YY": "yy",
              +    "YYYY": "yaka",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "i",
              +    "HH": "ii",
              +    "mm": "ii",
              +    "ss": "ii"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/mgo/dateres.json b/js/data/locale/mgo/dateres.json
              index 00ae254106..b5fe5e95e8 100644
              --- a/js/data/locale/mgo/dateres.json
              +++ b/js/data/locale/mgo/dateres.json
              @@ -4,5 +4,11 @@
                   "Month": "iməg",
                   "Time Zone": "Zone",
                   "Week": "nkap",
              -    "Year": "fituʼ"
              +    "Year": "fituʼ",
              +    "D": "a",
              +    "DD": "aa",
              +    "YY": "ff",
              +    "YYYY": "ffff",
              +    "M": "i",
              +    "MM": "ii"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/mi/dateres.json b/js/data/locale/mi/dateres.json
              index 12899775c2..f4ebdfa6b5 100644
              --- a/js/data/locale/mi/dateres.json
              +++ b/js/data/locale/mi/dateres.json
              @@ -7,5 +7,14 @@
                   "Second": "hēkona",
                   "Time Zone": "rohe wā",
                   "Week": "wiki",
              -    "Year": "tau"
              +    "Year": "tau",
              +    "D": "r",
              +    "DD": "rā",
              +    "YY": "tt",
              +    "YYYY": "tau",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "h",
              +    "HH": "hh",
              +    "ss": "hh"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/mk/dateres.json b/js/data/locale/mk/dateres.json
              index f14164b196..a2e9de9933 100644
              --- a/js/data/locale/mk/dateres.json
              +++ b/js/data/locale/mk/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "временска зона",
                   "Week": "седмица",
                   "Week of Month": "седмица од месецот",
              -    "Year": "година"
              +    "Year": "година",
              +    "D": "д",
              +    "DD": "дд",
              +    "YY": "гг",
              +    "YYYY": "гггг",
              +    "M": "м",
              +    "MM": "мм",
              +    "H": "ч",
              +    "HH": "чч",
              +    "mm": "мм",
              +    "ss": "сс"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ml/dateres.json b/js/data/locale/ml/dateres.json
              index fad43735db..bb88125aa3 100644
              --- a/js/data/locale/ml/dateres.json
              +++ b/js/data/locale/ml/dateres.json
              @@ -9,5 +9,15 @@
                   "Time Zone": "സമയ മേഖല",
                   "Week": "ആഴ്ച",
                   "Week of Month": "മാസത്തിലെ ആഴ്‌ച",
              -    "Year": "വർഷം"
              +    "Year": "വർഷം",
              +    "D": "ദ",
              +    "DD": "ദദ",
              +    "YY": "വവ",
              +    "YYYY": "വർഷം",
              +    "M": "മ",
              +    "MM": "മമ",
              +    "H": "മ",
              +    "HH": "മമ",
              +    "mm": "മമ",
              +    "ss": "സസ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/mn/dateres.json b/js/data/locale/mn/dateres.json
              index f827d4dc68..0131f0f295 100644
              --- a/js/data/locale/mn/dateres.json
              +++ b/js/data/locale/mn/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "цагийн бүс",
                   "Week": "долоо хоног",
                   "Week of Month": "сарын долоо хоног",
              -    "Year": "жил"
              +    "Year": "жил",
              +    "D": "ө",
              +    "DD": "өө",
              +    "YY": "жж",
              +    "YYYY": "жил",
              +    "M": "с",
              +    "MM": "сс",
              +    "H": "ц",
              +    "HH": "цц",
              +    "mm": "мм",
              +    "ss": "сс"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/mr/dateres.json b/js/data/locale/mr/dateres.json
              index 119758a167..9f428293f3 100644
              --- a/js/data/locale/mr/dateres.json
              +++ b/js/data/locale/mr/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "वेळ क्षेत्र",
                   "Week": "आठवडा",
                   "Week of Month": "महिन्याचा आठवडा",
              -    "Year": "वर्ष"
              +    "Year": "वर्ष",
              +    "D": "द",
              +    "DD": "दद",
              +    "YY": "वव",
              +    "YYYY": "वर्ष",
              +    "M": "म",
              +    "MM": "मम",
              +    "H": "त",
              +    "HH": "तत",
              +    "mm": "मम",
              +    "ss": "सस"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ms/dateres.json b/js/data/locale/ms/dateres.json
              index bdd700f246..d2b439edb5 100644
              --- a/js/data/locale/ms/dateres.json
              +++ b/js/data/locale/ms/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "saat",
                   "Time Zone": "zon waktu",
                   "Week": "minggu",
              -    "Year": "tahun"
              +    "Year": "tahun",
              +    "D": "h",
              +    "DD": "hh",
              +    "YY": "tt",
              +    "YYYY": "tttt",
              +    "M": "b",
              +    "MM": "bb",
              +    "H": "j",
              +    "HH": "jj"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/mt/dateres.json b/js/data/locale/mt/dateres.json
              index c109487446..10afbc5dc5 100644
              --- a/js/data/locale/mt/dateres.json
              +++ b/js/data/locale/mt/dateres.json
              @@ -8,5 +8,13 @@
                   "Time Zone": "żona tal-ħin",
                   "Week": "ġimgħa",
                   "Week of Month": "ġimgħa tax-xahar",
              -    "Year": "Sena"
              +    "Year": "Sena",
              +    "D": "j",
              +    "DD": "jj",
              +    "YY": "SS",
              +    "YYYY": "Sena",
              +    "M": "x",
              +    "MM": "xx",
              +    "H": "s",
              +    "HH": "ss"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/mua/dateres.json b/js/data/locale/mua/dateres.json
              index e5b50004db..f06e4af37a 100644
              --- a/js/data/locale/mua/dateres.json
              +++ b/js/data/locale/mua/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Cok comme ma laŋ tǝ biŋ",
                   "Time Zone": "Waŋ cok comme",
                   "Week": "Luma",
              -    "Year": "Syii"
              +    "Year": "Syii",
              +    "D": "Z",
              +    "DD": "ZZ",
              +    "YY": "SS",
              +    "YYYY": "Syii",
              +    "M": "F",
              +    "MM": "FF",
              +    "H": "C",
              +    "HH": "CC",
              +    "mm": "CC",
              +    "ss": "CC"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/my/dateres.json b/js/data/locale/my/dateres.json
              index 4502d41008..cd476eddf9 100644
              --- a/js/data/locale/my/dateres.json
              +++ b/js/data/locale/my/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "ဇုန်",
                   "Week": "ပတ်",
                   "Week of Month": "တစ်လအတွင်းရှိသီတင်းပတ်",
              -    "Year": "နှစ်"
              +    "Year": "နှစ်",
              +    "D": "ရ",
              +    "DD": "ရရ",
              +    "YY": "နန",
              +    "YYYY": "နှစ်",
              +    "M": "လ",
              +    "MM": "လ",
              +    "H": "န",
              +    "HH": "နန",
              +    "mm": "မမ",
              +    "ss": "စစ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/mzn/dateres.json b/js/data/locale/mzn/dateres.json
              index 2e4654951f..ba58adda66 100644
              --- a/js/data/locale/mzn/dateres.json
              +++ b/js/data/locale/mzn/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "ثانیه",
                   "Time Zone": "زمونی منقطه",
                   "Week": "هفته",
              -    "Year": "سال"
              +    "Year": "سال",
              +    "D": "ر",
              +    "DD": "رر",
              +    "YY": "سس",
              +    "YYYY": "سال",
              +    "M": "م",
              +    "MM": "مم",
              +    "H": "س",
              +    "HH": "سس",
              +    "mm": "دد",
              +    "ss": "ثث"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/naq/dateres.json b/js/data/locale/naq/dateres.json
              index 5de481a0b1..80ad20975c 100644
              --- a/js/data/locale/naq/dateres.json
              +++ b/js/data/locale/naq/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "ǀGâub",
                   "Time Zone": "ǁAeb ǀharib",
                   "Week": "Wekheb",
              -    "Year": "Kurib"
              +    "Year": "Kurib",
              +    "D": "T",
              +    "DD": "TT",
              +    "YY": "KK",
              +    "YYYY": "KKKK",
              +    "M": "ǁ",
              +    "MM": "ǁǁ",
              +    "H": "I",
              +    "HH": "II",
              +    "mm": "HH",
              +    "ss": "ǀǀ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/nb/dateres.json b/js/data/locale/nb/dateres.json
              index c4adf087ee..014b2a4a9f 100644
              --- a/js/data/locale/nb/dateres.json
              +++ b/js/data/locale/nb/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "tidssone",
                   "Week": "uke",
                   "Week of Month": "uke i måneden",
              -    "Year": "år"
              +    "Year": "år",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "år",
              +    "YYYY": "år",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "t",
              +    "HH": "tt"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/nd/dateres.json b/js/data/locale/nd/dateres.json
              index 3979b1eae7..b4318e9a4d 100644
              --- a/js/data/locale/nd/dateres.json
              +++ b/js/data/locale/nd/dateres.json
              @@ -7,5 +7,15 @@
                   "Second": "Isekendi",
                   "Time Zone": "Isikhathi",
                   "Week": "Iviki",
              -    "Year": "Umnyaka"
              +    "Year": "Umnyaka",
              +    "D": "I",
              +    "DD": "II",
              +    "YY": "UU",
              +    "YYYY": "UUUU",
              +    "M": "I",
              +    "MM": "II",
              +    "H": "I",
              +    "HH": "II",
              +    "mm": "UU",
              +    "ss": "II"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ne/dateres.json b/js/data/locale/ne/dateres.json
              index 593cc28d9d..ef469ca96e 100644
              --- a/js/data/locale/ne/dateres.json
              +++ b/js/data/locale/ne/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "क्षेत्र",
                   "Week": "हप्ता",
                   "Week of Month": "महिनाको हप्ता",
              -    "Year": "वर्ष"
              +    "Year": "वर्ष",
              +    "D": "ब",
              +    "DD": "बब",
              +    "YY": "वव",
              +    "YYYY": "वर्ष",
              +    "M": "म",
              +    "MM": "मम",
              +    "H": "घ",
              +    "HH": "घघ",
              +    "mm": "मम",
              +    "ss": "सस"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/nl/dateres.json b/js/data/locale/nl/dateres.json
              index 6f23af20c5..1e740d6a78 100644
              --- a/js/data/locale/nl/dateres.json
              +++ b/js/data/locale/nl/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "tijdzone",
                   "Week": "week",
                   "Week of Month": "week van de maand",
              -    "Year": "jaar"
              +    "Year": "jaar",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "jj",
              +    "YYYY": "jaar",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "u",
              +    "HH": "uu"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/nmg/dateres.json b/js/data/locale/nmg/dateres.json
              index 9159c7657e..06b8d7ddf3 100644
              --- a/js/data/locale/nmg/dateres.json
              +++ b/js/data/locale/nmg/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Nyiɛl",
                   "Time Zone": "Nkɛ̌l wulā",
                   "Week": "Sɔ́ndɔ",
              -    "Year": "Mbvu"
              +    "Year": "Mbvu",
              +    "YY": "MM",
              +    "YYYY": "Mbvu",
              +    "M": "N",
              +    "MM": "NN",
              +    "H": "W",
              +    "HH": "WW",
              +    "mm": "MM",
              +    "ss": "NN"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/nn/dateres.json b/js/data/locale/nn/dateres.json
              index f6f931b6c3..a4645ec168 100644
              --- a/js/data/locale/nn/dateres.json
              +++ b/js/data/locale/nn/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "tidssone",
                   "Week": "veke",
                   "Week of Month": "veke i månaden",
              -    "Year": "år"
              +    "Year": "år",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "år",
              +    "YYYY": "år",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "t",
              +    "HH": "tt"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/nnh/dateres.json b/js/data/locale/nnh/dateres.json
              index 23502a30d3..c1219b60ee 100644
              --- a/js/data/locale/nnh/dateres.json
              +++ b/js/data/locale/nnh/dateres.json
              @@ -4,5 +4,11 @@
                   "Era": "tsɔ́ fʉ̀ʼ",
                   "Hour": "fʉ̀ʼ nèm",
                   "Time Zone": "Zone",
              -    "Year": "ngùʼ"
              +    "Year": "ngùʼ",
              +    "D": "l",
              +    "DD": "ll",
              +    "YY": "nn",
              +    "YYYY": "ngùʼ",
              +    "H": "f",
              +    "HH": "ff"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/nus/dateres.json b/js/data/locale/nus/dateres.json
              index e052b02511..74492900be 100644
              --- a/js/data/locale/nus/dateres.json
              +++ b/js/data/locale/nus/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Thɛkɛni",
                   "Time Zone": "Zone",
                   "Week": "Jiɔk",
              -    "Year": "Ruɔ̱n"
              +    "Year": "Ruɔ̱n",
              +    "D": "C",
              +    "DD": "CC",
              +    "YY": "RR",
              +    "YYYY": "RRRR",
              +    "M": "P",
              +    "MM": "PP",
              +    "H": "T",
              +    "HH": "TT",
              +    "mm": "MM",
              +    "ss": "TT"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/nyn/dateres.json b/js/data/locale/nyn/dateres.json
              index fafa51907f..632ba53ee7 100644
              --- a/js/data/locale/nyn/dateres.json
              +++ b/js/data/locale/nyn/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Obucweka/Esekendi",
                   "Time Zone": "Eshaaha za",
                   "Week": "Esande",
              -    "Year": "Omwaka"
              +    "Year": "Omwaka",
              +    "D": "E",
              +    "DD": "EE",
              +    "YY": "OO",
              +    "YYYY": "OOOO",
              +    "M": "O",
              +    "MM": "OO",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "EE",
              +    "ss": "OO"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/or/dateres.json b/js/data/locale/or/dateres.json
              index a7d85f57ac..471f142a5f 100644
              --- a/js/data/locale/or/dateres.json
              +++ b/js/data/locale/or/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "ସମୟ କ୍ଷେତ୍ର",
                   "Week": "ସପ୍ତାହ",
                   "Week of Month": "ମାସର ସପ୍ତାହ",
              -    "Year": "ବର୍ଷ"
              +    "Year": "ବର୍ଷ",
              +    "D": "ଦ",
              +    "DD": "ଦଦ",
              +    "YY": "ବବ",
              +    "YYYY": "ବର୍ଷ",
              +    "M": "ମ",
              +    "MM": "ମମ",
              +    "H": "ଘ",
              +    "HH": "ଘଘ",
              +    "mm": "ମମ",
              +    "ss": "ସସ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/os/dateres.json b/js/data/locale/os/dateres.json
              index 86e3748be0..76c920c0a1 100644
              --- a/js/data/locale/os/dateres.json
              +++ b/js/data/locale/os/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Секунд",
                   "Time Zone": "Рӕстӕджы зонӕ",
                   "Week": "Къуыри",
              -    "Year": "Аз"
              +    "Year": "Аз",
              +    "D": "Б",
              +    "DD": "ББ",
              +    "YY": "Аз",
              +    "YYYY": "Аз",
              +    "M": "М",
              +    "MM": "ММ",
              +    "H": "С",
              +    "HH": "СС",
              +    "mm": "ММ",
              +    "ss": "СС"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/pa/Arab/dateres.json b/js/data/locale/pa/Arab/dateres.json
              index d84a463e60..5cfce7cc1c 100644
              --- a/js/data/locale/pa/Arab/dateres.json
              +++ b/js/data/locale/pa/Arab/dateres.json
              @@ -8,5 +8,14 @@
                   "Time Zone": "ٹپہ",
                   "Week": "ہفتہ",
                   "Week of Month": "Week Of Month",
              -    "Year": "ورھا"
              +    "Year": "ورھا",
              +    "D": "دئن",
              +    "DD": "دئن",
              +    "YY": "ورھا",
              +    "YYYY": "ورھا",
              +    "M": "مہينا",
              +    "MM": "مہينا",
              +    "H": "گھنٹا",
              +    "HH": "گھنٹا",
              +    "mm": "منٹ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/pa/dateres.json b/js/data/locale/pa/dateres.json
              index c69eae88cf..731659a4f1 100644
              --- a/js/data/locale/pa/dateres.json
              +++ b/js/data/locale/pa/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "ਇਲਾਕਾਈ ਵੇਲਾ",
                   "Week": "ਹਫ਼ਤਾ",
                   "Week of Month": "ਮਹੀਨੇ ਦਾ ਹਫ਼ਤਾ",
              -    "Year": "ਸਾਲ"
              +    "Year": "ਸਾਲ",
              +    "D": "ਦ",
              +    "DD": "ਦਦ",
              +    "YY": "ਸਸ",
              +    "YYYY": "ਸਾਲ",
              +    "M": "ਮ",
              +    "MM": "ਮਮ",
              +    "H": "ਘ",
              +    "HH": "ਘਘ",
              +    "mm": "ਮਮ",
              +    "ss": "ਸਸ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/pl/dateres.json b/js/data/locale/pl/dateres.json
              index f6cdb2d5d1..7aab8dcc7f 100644
              --- a/js/data/locale/pl/dateres.json
              +++ b/js/data/locale/pl/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "strefa czasowa",
                   "Week": "tydzień",
                   "Week of Month": "tydzień miesiąca",
              -    "Year": "rok"
              +    "Year": "rok",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "rr",
              +    "YYYY": "rok",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "g",
              +    "HH": "gg"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ps/dateres.json b/js/data/locale/ps/dateres.json
              index f0541f0e73..69d9415934 100644
              --- a/js/data/locale/ps/dateres.json
              +++ b/js/data/locale/ps/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "وخت سيمه",
                   "Week": "اونۍ",
                   "Week of Month": "د مياشتې اونۍ",
              -    "Year": "کال"
              +    "Year": "کال",
              +    "D": "ورځ",
              +    "DD": "ورځ",
              +    "YY": "کال",
              +    "YYYY": "کال",
              +    "M": "مياشت",
              +    "MM": "مياشت",
              +    "H": "ساعت",
              +    "HH": "ساعت",
              +    "mm": "دقيقه",
              +    "ss": "ثانيه"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/pt/dateres.json b/js/data/locale/pt/dateres.json
              index 1223bdf0be..da522187b0 100644
              --- a/js/data/locale/pt/dateres.json
              +++ b/js/data/locale/pt/dateres.json
              @@ -9,5 +9,13 @@
                   "Time Zone": "fuso horário",
                   "Week": "semana",
                   "Week of Month": "semana do mês",
              -    "Year": "ano"
              +    "Year": "ano",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "aa",
              +    "YYYY": "ano",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "h",
              +    "HH": "hh"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/rm/dateres.json b/js/data/locale/rm/dateres.json
              index 5f9ff7342e..6797e7cdd8 100644
              --- a/js/data/locale/rm/dateres.json
              +++ b/js/data/locale/rm/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "secunda",
                   "Time Zone": "zona d’urari",
                   "Week": "emna",
              -    "Year": "onn"
              +    "Year": "onn",
              +    "D": "T",
              +    "DD": "TT",
              +    "YY": "oo",
              +    "YYYY": "onn",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "u",
              +    "HH": "uu"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/rn/dateres.json b/js/data/locale/rn/dateres.json
              index ba65eb02d0..9efdc485bc 100644
              --- a/js/data/locale/rn/dateres.json
              +++ b/js/data/locale/rn/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Isegonda",
                   "Time Zone": "Isaha yo mukarere",
                   "Week": "Indwi, Iyinga",
              -    "Year": "Umwaka"
              +    "Year": "Umwaka",
              +    "D": "U",
              +    "DD": "UU",
              +    "YY": "UU",
              +    "YYYY": "UUUU",
              +    "M": "U",
              +    "MM": "UU",
              +    "H": "I",
              +    "HH": "II",
              +    "mm": "UU",
              +    "ss": "II"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ro/dateres.json b/js/data/locale/ro/dateres.json
              index 00eb7709cf..c6a8e05f09 100644
              --- a/js/data/locale/ro/dateres.json
              +++ b/js/data/locale/ro/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "fus orar",
                   "Week": "săptămână",
                   "Week of Month": "săptămâna din lună",
              -    "Year": "an"
              +    "Year": "an",
              +    "D": "z",
              +    "DD": "zi",
              +    "YY": "an",
              +    "YYYY": "an",
              +    "M": "l",
              +    "MM": "ll",
              +    "H": "o",
              +    "HH": "oo"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/rof/dateres.json b/js/data/locale/rof/dateres.json
              index 7733045094..68d8083e2e 100644
              --- a/js/data/locale/rof/dateres.json
              +++ b/js/data/locale/rof/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Sekunde",
                   "Time Zone": "Mfiri o saa",
                   "Week": "Iwiki",
              -    "Year": "Muaka"
              +    "Year": "Muaka",
              +    "D": "M",
              +    "DD": "MM",
              +    "YY": "MM",
              +    "YYYY": "MMMM",
              +    "H": "I",
              +    "HH": "II",
              +    "mm": "DD",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ru/dateres.json b/js/data/locale/ru/dateres.json
              index f65cf18fc6..e5afce75ce 100644
              --- a/js/data/locale/ru/dateres.json
              +++ b/js/data/locale/ru/dateres.json
              @@ -9,5 +9,15 @@
                   "Time Zone": "часовой пояс",
                   "Week": "неделя",
                   "Week of Month": "неделя месяца",
              -    "Year": "год"
              +    "Year": "год",
              +    "D": "д",
              +    "DD": "дд",
              +    "YY": "гг",
              +    "YYYY": "год",
              +    "M": "м",
              +    "MM": "мм",
              +    "H": "ч",
              +    "HH": "чч",
              +    "mm": "мм",
              +    "ss": "сс"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/rwk/dateres.json b/js/data/locale/rwk/dateres.json
              index 6cb392f9e3..981532f936 100644
              --- a/js/data/locale/rwk/dateres.json
              +++ b/js/data/locale/rwk/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Sekunde",
                   "Time Zone": "Mfiri o saa",
                   "Week": "Wiikyi",
              -    "Year": "Maka"
              +    "Year": "Maka",
              +    "D": "M",
              +    "DD": "MM",
              +    "YY": "MM",
              +    "YYYY": "Maka",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "DD",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/sah/dateres.json b/js/data/locale/sah/dateres.json
              index 2f5e45d266..86c2da6f26 100644
              --- a/js/data/locale/sah/dateres.json
              +++ b/js/data/locale/sah/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Сөкүүндэ",
                   "Time Zone": "Кэм балаһата",
                   "Week": "Нэдиэлэ",
              -    "Year": "Сыл"
              +    "Year": "Сыл",
              +    "D": "К",
              +    "DD": "КК",
              +    "YY": "СС",
              +    "YYYY": "Сыл",
              +    "M": "Ы",
              +    "MM": "Ый",
              +    "H": "Ч",
              +    "HH": "ЧЧ",
              +    "mm": "ММ",
              +    "ss": "СС"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/saq/dateres.json b/js/data/locale/saq/dateres.json
              index 3d43b5c6a3..4f63b1327f 100644
              --- a/js/data/locale/saq/dateres.json
              +++ b/js/data/locale/saq/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Isekondi",
                   "Time Zone": "Majira ya saa",
                   "Week": "Saipa napo",
              -    "Year": "Lari"
              +    "Year": "Lari",
              +    "D": "M",
              +    "DD": "MM",
              +    "YY": "LL",
              +    "YYYY": "Lari",
              +    "M": "L",
              +    "MM": "LL",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "II",
              +    "ss": "II"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/sbp/dateres.json b/js/data/locale/sbp/dateres.json
              index cb77b0d345..8f53dc8321 100644
              --- a/js/data/locale/sbp/dateres.json
              +++ b/js/data/locale/sbp/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Isekunde",
                   "Time Zone": "Uluhaavi lwa lisaa",
                   "Week": "Ilijuma",
              -    "Year": "Mwakha"
              +    "Year": "Mwakha",
              +    "D": "L",
              +    "DD": "LL",
              +    "YY": "MM",
              +    "YYYY": "MMMM",
              +    "H": "I",
              +    "HH": "II",
              +    "mm": "II",
              +    "ss": "II"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/sd/dateres.json b/js/data/locale/sd/dateres.json
              index 7df14e0980..b1c9dbe5d8 100644
              --- a/js/data/locale/sd/dateres.json
              +++ b/js/data/locale/sd/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "ٽائيم زون",
                   "Week": "هفتو",
                   "Week of Month": "مهيني جي هفتي",
              -    "Year": "سال"
              +    "Year": "سال",
              +    "D": "ڏينهن",
              +    "DD": "ڏينهن",
              +    "YY": "سال",
              +    "YYYY": "سال",
              +    "M": "مهينو",
              +    "MM": "مهينو",
              +    "H": "ڪلاڪ",
              +    "HH": "ڪلاڪ",
              +    "mm": "منٽ",
              +    "ss": "سيڪنڊ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/se/dateres.json b/js/data/locale/se/dateres.json
              index ae9d0c3588..83545f0c25 100644
              --- a/js/data/locale/se/dateres.json
              +++ b/js/data/locale/se/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "sekunda",
                   "Time Zone": "áigeavádat",
                   "Week": "váhkku",
              -    "Year": "jáhki"
              +    "Year": "jáhki",
              +    "D": "b",
              +    "DD": "bb",
              +    "YY": "jj",
              +    "YYYY": "jjjj",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "d",
              +    "HH": "dd"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/seh/dateres.json b/js/data/locale/seh/dateres.json
              index 657a290e9d..ef47d85ab4 100644
              --- a/js/data/locale/seh/dateres.json
              +++ b/js/data/locale/seh/dateres.json
              @@ -6,5 +6,11 @@
                   "Month": "Mwezi",
                   "Second": "Segundo",
                   "Time Zone": "Zone",
              -    "Year": "Chaka"
              +    "Year": "Chaka",
              +    "D": "N",
              +    "DD": "NN",
              +    "YY": "CC",
              +    "YYYY": "CCCC",
              +    "mm": "MM",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ses/dateres.json b/js/data/locale/ses/dateres.json
              index f026e05d6d..e85b44dcbf 100644
              --- a/js/data/locale/ses/dateres.json
              +++ b/js/data/locale/ses/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Miti",
                   "Time Zone": "Leerazuu",
                   "Week": "Hebu",
              -    "Year": "Jiiri"
              +    "Year": "Jiiri",
              +    "D": "Z",
              +    "DD": "ZZ",
              +    "YY": "JJ",
              +    "YYYY": "JJJJ",
              +    "M": "H",
              +    "MM": "HH",
              +    "H": "G",
              +    "HH": "GG",
              +    "mm": "MM",
              +    "ss": "MM"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/sg/dateres.json b/js/data/locale/sg/dateres.json
              index 42ea3e94e8..17ed1e165a 100644
              --- a/js/data/locale/sg/dateres.json
              +++ b/js/data/locale/sg/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Nzîna ngbonga",
                   "Time Zone": "Zukangbonga",
                   "Week": "Dimâsi",
              -    "Year": "Ngû"
              +    "Year": "Ngû",
              +    "D": "L",
              +    "DD": "Lâ",
              +    "YY": "NN",
              +    "YYYY": "Ngû",
              +    "M": "N",
              +    "MM": "NN",
              +    "H": "N",
              +    "HH": "NN",
              +    "mm": "NN",
              +    "ss": "NN"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/shi/Latn/dateres.json b/js/data/locale/shi/Latn/dateres.json
              index 033cf27fc6..49ef39c05a 100644
              --- a/js/data/locale/shi/Latn/dateres.json
              +++ b/js/data/locale/shi/Latn/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "tasint",
                   "Time Zone": "akud n ugmmaḍ",
                   "Week": "imalass",
              -    "Year": "asggʷas"
              +    "Year": "asggʷas",
              +    "D": "a",
              +    "DD": "aa",
              +    "YY": "aa",
              +    "YYYY": "aaaa",
              +    "M": "a",
              +    "MM": "aa",
              +    "H": "t",
              +    "HH": "tt",
              +    "mm": "tt",
              +    "ss": "tt"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/shi/dateres.json b/js/data/locale/shi/dateres.json
              index 01d04e184e..7ebc7c8423 100644
              --- a/js/data/locale/shi/dateres.json
              +++ b/js/data/locale/shi/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "ⵜⴰⵙⵉⵏⵜ",
                   "Time Zone": "ⴰⴽⵓⴷ ⵏ ⵓⴳⵎⵎⴰⴹ",
                   "Week": "ⵉⵎⴰⵍⴰⵙⵙ",
              -    "Year": "ⴰⵙⴳⴳⵯⴰⵙ"
              +    "Year": "ⴰⵙⴳⴳⵯⴰⵙ",
              +    "D": "ⴰ",
              +    "DD": "ⴰⴰ",
              +    "YY": "ⴰⴰ",
              +    "YYYY": "ⴰⴰⴰⴰ",
              +    "M": "ⴰ",
              +    "MM": "ⴰⴰ",
              +    "H": "ⵜ",
              +    "HH": "ⵜⵜ",
              +    "mm": "ⵜⵜ",
              +    "ss": "ⵜⵜ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/si/dateres.json b/js/data/locale/si/dateres.json
              index 98f07b47aa..8235da4a82 100644
              --- a/js/data/locale/si/dateres.json
              +++ b/js/data/locale/si/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "වේලා කලාපය",
                   "Week": "සතිය",
                   "Week of Month": "මාසයේ සතිය",
              -    "Year": "වර්ෂය"
              +    "Year": "වර්ෂය",
              +    "D": "ද",
              +    "DD": "දද",
              +    "YY": "වව",
              +    "YYYY": "වවවව",
              +    "M": "ම",
              +    "MM": "මම",
              +    "H": "ප",
              +    "HH": "පප",
              +    "mm": "මම",
              +    "ss": "තත"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/sk/dateres.json b/js/data/locale/sk/dateres.json
              index e385c13a32..54cd43be63 100644
              --- a/js/data/locale/sk/dateres.json
              +++ b/js/data/locale/sk/dateres.json
              @@ -9,5 +9,13 @@
                   "Time Zone": "časové pásmo",
                   "Week": "týždeň",
                   "Week of Month": "týždeň mesiaca",
              -    "Year": "rok"
              +    "Year": "rok",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "rr",
              +    "YYYY": "rok",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "h",
              +    "HH": "hh"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/sl/dateres.json b/js/data/locale/sl/dateres.json
              index af221983e3..dd0b04b797 100644
              --- a/js/data/locale/sl/dateres.json
              +++ b/js/data/locale/sl/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "časovni pas",
                   "Week": "teden",
                   "Week of Month": "teden meseca",
              -    "Year": "leto"
              +    "Year": "leto",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "ll",
              +    "YYYY": "leto",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "u",
              +    "HH": "uu"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/sn/dateres.json b/js/data/locale/sn/dateres.json
              index 65f7224d96..7413ea1d39 100644
              --- a/js/data/locale/sn/dateres.json
              +++ b/js/data/locale/sn/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Sekondi",
                   "Time Zone": "Nguva",
                   "Week": "Vhiki",
              -    "Year": "Gore"
              +    "Year": "Gore",
              +    "D": "Z",
              +    "DD": "ZZ",
              +    "YY": "GG",
              +    "YYYY": "Gore",
              +    "H": "A",
              +    "HH": "AA",
              +    "mm": "MM",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/sq/dateres.json b/js/data/locale/sq/dateres.json
              index a5c258794c..390e6a14b3 100644
              --- a/js/data/locale/sq/dateres.json
              +++ b/js/data/locale/sq/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "brezi orar",
                   "Week": "javë",
                   "Week of Month": "javë e muajit",
              -    "Year": "vit"
              +    "Year": "vit",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "vv",
              +    "YYYY": "vit",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "o",
              +    "HH": "oo"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/sr/Latn/dateres.json b/js/data/locale/sr/Latn/dateres.json
              index e7a4256317..3b1ef3fe93 100644
              --- a/js/data/locale/sr/Latn/dateres.json
              +++ b/js/data/locale/sr/Latn/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "vremenska zona",
                   "Week": "nedelja",
                   "Week of Month": "nedelja u mesecu",
              -    "Year": "godina"
              +    "Year": "godina",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "gg",
              +    "YYYY": "gggg",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "s",
              +    "HH": "ss",
              +    "mm": "mm",
              +    "ss": "ss"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/sr/dateres.json b/js/data/locale/sr/dateres.json
              index 76c8f1227b..fc06d74fcb 100644
              --- a/js/data/locale/sr/dateres.json
              +++ b/js/data/locale/sr/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "временска зона",
                   "Week": "недеља",
                   "Week of Month": "недеља у месецу",
              -    "Year": "година"
              +    "Year": "година",
              +    "D": "д",
              +    "DD": "дд",
              +    "YY": "гг",
              +    "YYYY": "гггг",
              +    "M": "м",
              +    "MM": "мм",
              +    "H": "с",
              +    "HH": "сс",
              +    "mm": "мм",
              +    "ss": "сс"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/sv/dateres.json b/js/data/locale/sv/dateres.json
              index 72bfd16ea3..b57d3a1cf3 100644
              --- a/js/data/locale/sv/dateres.json
              +++ b/js/data/locale/sv/dateres.json
              @@ -10,5 +10,13 @@
                   "Time Zone": "tidszon",
                   "Week": "vecka",
                   "Week of Month": "vecka i månaden",
              -    "Year": "år"
              +    "Year": "år",
              +    "D": "d",
              +    "DD": "dd",
              +    "YY": "år",
              +    "YYYY": "år",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "t",
              +    "HH": "tt"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/sw/dateres.json b/js/data/locale/sw/dateres.json
              index 6337b3b756..46d0cda9d9 100644
              --- a/js/data/locale/sw/dateres.json
              +++ b/js/data/locale/sw/dateres.json
              @@ -9,5 +9,14 @@
                   "Time Zone": "saa za eneo",
                   "Week": "wiki",
                   "Week of Month": "wiki ya mwezi",
              -    "Year": "mwaka"
              +    "Year": "mwaka",
              +    "D": "s",
              +    "DD": "ss",
              +    "YY": "mm",
              +    "YYYY": "mmmm",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "s",
              +    "HH": "ss",
              +    "mm": "dd"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ta/dateres.json b/js/data/locale/ta/dateres.json
              index 78052ba75d..7f60d8dca5 100644
              --- a/js/data/locale/ta/dateres.json
              +++ b/js/data/locale/ta/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "நேர மண்டலம்",
                   "Week": "வாரம்",
                   "Week of Month": "மாதத்தின் வாரம்",
              -    "Year": "ஆண்டு"
              +    "Year": "ஆண்டு",
              +    "D": "ந",
              +    "DD": "நந",
              +    "YY": "ஆஆ",
              +    "YYYY": "ஆஆஆஆ",
              +    "M": "ம",
              +    "MM": "மம",
              +    "H": "ம",
              +    "HH": "மம",
              +    "mm": "நந",
              +    "ss": "வவ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/te/dateres.json b/js/data/locale/te/dateres.json
              index 3fbe5cb5db..767bcef36e 100644
              --- a/js/data/locale/te/dateres.json
              +++ b/js/data/locale/te/dateres.json
              @@ -9,5 +9,15 @@
                   "Time Zone": "సమయ మండలి",
                   "Week": "వారము",
                   "Week of Month": "నెలలో వారం",
              -    "Year": "సంవత్సరం"
              +    "Year": "సంవత్సరం",
              +    "D": "ద",
              +    "DD": "దద",
              +    "YY": "సస",
              +    "YYYY": "సససస",
              +    "M": "న",
              +    "MM": "నన",
              +    "H": "గ",
              +    "HH": "గగ",
              +    "mm": "నన",
              +    "ss": "సస"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/teo/dateres.json b/js/data/locale/teo/dateres.json
              index a5a1b58fef..9e57bc0c80 100644
              --- a/js/data/locale/teo/dateres.json
              +++ b/js/data/locale/teo/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Isekonde",
                   "Time Zone": "Majira ya saa",
                   "Week": "Ewiki",
              -    "Year": "Ekan"
              +    "Year": "Ekan",
              +    "D": "A",
              +    "DD": "AA",
              +    "YY": "EE",
              +    "YYYY": "Ekan",
              +    "M": "E",
              +    "MM": "EE",
              +    "H": "E",
              +    "HH": "EE",
              +    "mm": "II",
              +    "ss": "II"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/tg/dateres.json b/js/data/locale/tg/dateres.json
              index 5a6adcc353..abfdea1aac 100644
              --- a/js/data/locale/tg/dateres.json
              +++ b/js/data/locale/tg/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "сония",
                   "Time Zone": "минтақаи вақт",
                   "Week": "ҳафта",
              -    "Year": "сол"
              +    "Year": "сол",
              +    "D": "рӯз",
              +    "DD": "рӯз",
              +    "YY": "сол",
              +    "YYYY": "сол",
              +    "M": "моҳ",
              +    "MM": "моҳ",
              +    "H": "соат",
              +    "HH": "соат",
              +    "mm": "дақиқа",
              +    "ss": "сония"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/th/dateres.json b/js/data/locale/th/dateres.json
              index 227f43a2f8..c27a7918f2 100644
              --- a/js/data/locale/th/dateres.json
              +++ b/js/data/locale/th/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "เขตเวลา",
                   "Week": "สัปดาห์",
                   "Week of Month": "สัปดาห์ของเดือน",
              -    "Year": "ปี"
              +    "Year": "ปี",
              +    "D": "ว",
              +    "DD": "วว",
              +    "YY": "ปี",
              +    "YYYY": "ปี",
              +    "M": "เ",
              +    "MM": "เเ",
              +    "H": "ช",
              +    "HH": "ชช",
              +    "mm": "นน",
              +    "ss": "วว"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ti/dateres.json b/js/data/locale/ti/dateres.json
              index 2f0dabf209..88f784663d 100644
              --- a/js/data/locale/ti/dateres.json
              +++ b/js/data/locale/ti/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "ክልል",
                   "Week": "ሰሙን",
                   "Week of Month": "ሰን ናይ ወርሒ",
              -    "Year": "ዓመት"
              +    "Year": "ዓመት",
              +    "D": "መ",
              +    "DD": "መመ",
              +    "YY": "ዓዓ",
              +    "YYYY": "ዓመት",
              +    "M": "ወ",
              +    "MM": "ወወ",
              +    "H": "ሰ",
              +    "HH": "ሰሰ",
              +    "mm": "ደደ",
              +    "ss": "ካካ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/tk/dateres.json b/js/data/locale/tk/dateres.json
              index 1f08d98bc3..b8a4bb6b5f 100644
              --- a/js/data/locale/tk/dateres.json
              +++ b/js/data/locale/tk/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "sagat guşaklygy",
                   "Week": "hepde",
                   "Week of Month": "aýyň hepdesi",
              -    "Year": "ýyl"
              +    "Year": "ýyl",
              +    "D": "gün",
              +    "DD": "gün",
              +    "YY": "ýyl",
              +    "YYYY": "ýyl",
              +    "M": "aý",
              +    "MM": "aý",
              +    "H": "sagat",
              +    "HH": "sagat",
              +    "mm": "minut",
              +    "ss": "sekunt"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/to/dateres.json b/js/data/locale/to/dateres.json
              index d572b3c32c..5e57e25a20 100644
              --- a/js/data/locale/to/dateres.json
              +++ b/js/data/locale/to/dateres.json
              @@ -9,5 +9,13 @@
                   "Time Zone": "taimi fakavahe",
                   "Week": "uike",
                   "Week of Month": "uike ʻo e māhina",
              -    "Year": "taʻu"
              +    "Year": "taʻu",
              +    "D": "ʻ",
              +    "DD": "ʻʻ",
              +    "YY": "tt",
              +    "YYYY": "taʻu",
              +    "M": "m",
              +    "MM": "mm",
              +    "H": "h",
              +    "HH": "hh"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/tr/dateres.json b/js/data/locale/tr/dateres.json
              index 0ecf6d7361..b2d05241a8 100644
              --- a/js/data/locale/tr/dateres.json
              +++ b/js/data/locale/tr/dateres.json
              @@ -10,5 +10,14 @@
                   "Time Zone": "saat dilimi",
                   "Week": "hafta",
                   "Week of Month": "ayın haftası",
              -    "Year": "yıl"
              +    "Year": "yıl",
              +    "D": "g",
              +    "DD": "gg",
              +    "YY": "yy",
              +    "YYYY": "yıl",
              +    "M": "a",
              +    "MM": "ay",
              +    "H": "s",
              +    "HH": "ss",
              +    "mm": "dd"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/tt/dateres.json b/js/data/locale/tt/dateres.json
              index 0ad38716f1..41f1a53852 100644
              --- a/js/data/locale/tt/dateres.json
              +++ b/js/data/locale/tt/dateres.json
              @@ -7,5 +7,15 @@
                   "Second": "секунд",
                   "Time Zone": "вакыт өлкәсе",
                   "Week": "атна",
              -    "Year": "ел"
              +    "Year": "ел",
              +    "D": "к",
              +    "DD": "кк",
              +    "YY": "ел",
              +    "YYYY": "ел",
              +    "M": "а",
              +    "MM": "ай",
              +    "H": "с",
              +    "HH": "сс",
              +    "mm": "мм",
              +    "ss": "сс"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/twq/dateres.json b/js/data/locale/twq/dateres.json
              index 1c8463120e..b779765111 100644
              --- a/js/data/locale/twq/dateres.json
              +++ b/js/data/locale/twq/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Miti",
                   "Time Zone": "Leerazuu",
                   "Week": "Hebu",
              -    "Year": "Jiiri"
              +    "Year": "Jiiri",
              +    "D": "Z",
              +    "DD": "ZZ",
              +    "YY": "JJ",
              +    "YYYY": "JJJJ",
              +    "M": "H",
              +    "MM": "HH",
              +    "H": "G",
              +    "HH": "GG",
              +    "mm": "MM",
              +    "ss": "MM"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/tzm/dateres.json b/js/data/locale/tzm/dateres.json
              index 91ffb07432..dd6b798444 100644
              --- a/js/data/locale/tzm/dateres.json
              +++ b/js/data/locale/tzm/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Tusnat",
                   "Time Zone": "Aseglem asergan",
                   "Week": "Imalass",
              -    "Year": "Asseggas"
              +    "Year": "Asseggas",
              +    "D": "A",
              +    "DD": "AA",
              +    "YY": "AA",
              +    "YYYY": "AAAA",
              +    "M": "A",
              +    "MM": "AA",
              +    "H": "T",
              +    "HH": "TT",
              +    "mm": "TT",
              +    "ss": "TT"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ug/dateres.json b/js/data/locale/ug/dateres.json
              index 22ec4c3896..df892b8582 100644
              --- a/js/data/locale/ug/dateres.json
              +++ b/js/data/locale/ug/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "سېكۇنت",
                   "Time Zone": "ۋاقىت رايونى",
                   "Week": "ھەپتە",
              -    "Year": "يىل"
              +    "Year": "يىل",
              +    "D": "كۈن",
              +    "DD": "كۈن",
              +    "YY": "يىل",
              +    "YYYY": "يىل",
              +    "M": "ئاي",
              +    "MM": "ئاي",
              +    "H": "سائەت",
              +    "HH": "سائەت",
              +    "mm": "مىنۇت",
              +    "ss": "سېكۇنت"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/uk/dateres.json b/js/data/locale/uk/dateres.json
              index 7455deac12..0e691299b5 100644
              --- a/js/data/locale/uk/dateres.json
              +++ b/js/data/locale/uk/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "часовий пояс",
                   "Week": "тиждень",
                   "Week of Month": "тиждень місяця",
              -    "Year": "рік"
              +    "Year": "рік",
              +    "D": "д",
              +    "DD": "дд",
              +    "YY": "рр",
              +    "YYYY": "рік",
              +    "M": "м",
              +    "MM": "мм",
              +    "H": "г",
              +    "HH": "гг",
              +    "mm": "хх",
              +    "ss": "сс"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/ur/dateres.json b/js/data/locale/ur/dateres.json
              index 1425798f2c..1ee103abaf 100644
              --- a/js/data/locale/ur/dateres.json
              +++ b/js/data/locale/ur/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "منطقۂ وقت",
                   "Week": "ہفتہ",
                   "Week of Month": "مہینے کا ہفتہ",
              -    "Year": "سال"
              +    "Year": "سال",
              +    "D": "دن",
              +    "DD": "دن",
              +    "YY": "سال",
              +    "YYYY": "سال",
              +    "M": "مہینہ",
              +    "MM": "مہینہ",
              +    "H": "گھنٹہ",
              +    "HH": "گھنٹہ",
              +    "mm": "منٹ",
              +    "ss": "سیکنڈ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/uz/Cyrl/dateres.json b/js/data/locale/uz/Cyrl/dateres.json
              index dc54203973..0be921a749 100644
              --- a/js/data/locale/uz/Cyrl/dateres.json
              +++ b/js/data/locale/uz/Cyrl/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "Минтақа",
                   "Week": "Ҳафта",
                   "Week of Month": "Week Of Month",
              -    "Year": "Йил"
              +    "Year": "Йил",
              +    "D": "Кун",
              +    "DD": "Кун",
              +    "YY": "Йил",
              +    "YYYY": "Йил",
              +    "M": "Ой",
              +    "MM": "Ой",
              +    "H": "Соат",
              +    "HH": "Соат",
              +    "mm": "Дақиқа",
              +    "ss": "Сония"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/uz/dateres.json b/js/data/locale/uz/dateres.json
              index 96b36f848a..32d1b3634b 100644
              --- a/js/data/locale/uz/dateres.json
              +++ b/js/data/locale/uz/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "vaqt mintaqasi",
                   "Week": "hafta",
                   "Week of Month": "oyning haftasi",
              -    "Year": "yil"
              +    "Year": "yil",
              +    "D": "kun",
              +    "DD": "kun",
              +    "YY": "yil",
              +    "YYYY": "yil",
              +    "M": "oy",
              +    "MM": "oy",
              +    "H": "soat",
              +    "HH": "soat",
              +    "mm": "daqiqa",
              +    "ss": "soniya"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/vai/Latn/dateres.json b/js/data/locale/vai/Latn/dateres.json
              index 639567da55..57df76747d 100644
              --- a/js/data/locale/vai/Latn/dateres.json
              +++ b/js/data/locale/vai/Latn/dateres.json
              @@ -5,5 +5,15 @@
                   "Month": "kalo",
                   "Second": "jaki-jaka",
                   "Week": "wiki",
              -    "Year": "saŋ"
              +    "Year": "saŋ",
              +    "D": "t",
              +    "DD": "tt",
              +    "YY": "ss",
              +    "YYYY": "saŋ",
              +    "M": "k",
              +    "MM": "kk",
              +    "H": "h",
              +    "HH": "hh",
              +    "mm": "mm",
              +    "ss": "jj"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/vai/dateres.json b/js/data/locale/vai/dateres.json
              index 142abbd5bc..17d56dc31b 100644
              --- a/js/data/locale/vai/dateres.json
              +++ b/js/data/locale/vai/dateres.json
              @@ -7,5 +7,15 @@
                   "Second": "ꕧꕃꕧꕪ",
                   "Time Zone": "Zone",
                   "Week": "ꔨꔤꕃ",
              -    "Year": "ꕢꘋ"
              +    "Year": "ꕢꘋ",
              +    "D": "ꔎ",
              +    "DD": "ꔎꔒ",
              +    "YY": "ꕢꘋ",
              +    "YYYY": "ꕢꘋ",
              +    "M": "ꕪ",
              +    "MM": "ꕪꖃ",
              +    "H": "ꕌ",
              +    "HH": "ꕌꕎ",
              +    "mm": "ꕆꕇ",
              +    "ss": "ꕧꕧ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/vi/dateres.json b/js/data/locale/vi/dateres.json
              index 418d491afe..84d0b4b787 100644
              --- a/js/data/locale/vi/dateres.json
              +++ b/js/data/locale/vi/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "Múi giờ",
                   "Week": "Tuần",
                   "Week of Month": "tuần trong tháng",
              -    "Year": "Năm"
              +    "Year": "Năm",
              +    "D": "N",
              +    "DD": "NN",
              +    "YY": "NN",
              +    "YYYY": "Năm",
              +    "M": "T",
              +    "MM": "TT",
              +    "H": "G",
              +    "HH": "GG",
              +    "mm": "PP",
              +    "ss": "GG"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/vun/dateres.json b/js/data/locale/vun/dateres.json
              index 6cb392f9e3..981532f936 100644
              --- a/js/data/locale/vun/dateres.json
              +++ b/js/data/locale/vun/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "Sekunde",
                   "Time Zone": "Mfiri o saa",
                   "Week": "Wiikyi",
              -    "Year": "Maka"
              +    "Year": "Maka",
              +    "D": "M",
              +    "DD": "MM",
              +    "YY": "MM",
              +    "YYYY": "Maka",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "DD",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/wae/dateres.json b/js/data/locale/wae/dateres.json
              index 28edf7bd0d..bdb6e149c3 100644
              --- a/js/data/locale/wae/dateres.json
              +++ b/js/data/locale/wae/dateres.json
              @@ -7,5 +7,13 @@
                   "Second": "Sekunda",
                   "Time Zone": "Zitzóna",
                   "Week": "Wuča",
              -    "Year": "Jár"
              +    "Year": "Jár",
              +    "D": "T",
              +    "DD": "TT",
              +    "YY": "JJ",
              +    "YYYY": "Jár",
              +    "H": "S",
              +    "HH": "SS",
              +    "mm": "MM",
              +    "ss": "SS"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/wo/dateres.json b/js/data/locale/wo/dateres.json
              index 8ef60d8268..9ab9bf1183 100644
              --- a/js/data/locale/wo/dateres.json
              +++ b/js/data/locale/wo/dateres.json
              @@ -8,5 +8,14 @@
                   "Second": "saa",
                   "Time Zone": "goxu waxtu",
                   "Week": "ayu-bis",
              -    "Year": "at"
              +    "Year": "at",
              +    "D": "f",
              +    "DD": "ff",
              +    "YY": "at",
              +    "YYYY": "at",
              +    "M": "w",
              +    "MM": "ww",
              +    "H": "w",
              +    "HH": "ww",
              +    "mm": "ss"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/xog/dateres.json b/js/data/locale/xog/dateres.json
              index ec160c4491..0605a61f23 100644
              --- a/js/data/locale/xog/dateres.json
              +++ b/js/data/locale/xog/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Obutikitiki",
                   "Time Zone": "Essawa edha",
                   "Week": "Esabiiti",
              -    "Year": "Omwaka"
              +    "Year": "Omwaka",
              +    "D": "O",
              +    "DD": "OO",
              +    "YY": "OO",
              +    "YYYY": "OOOO",
              +    "M": "O",
              +    "MM": "OO",
              +    "H": "E",
              +    "HH": "EE",
              +    "mm": "EE",
              +    "ss": "OO"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/yav/dateres.json b/js/data/locale/yav/dateres.json
              index 2e2995115d..f9f6478fc4 100644
              --- a/js/data/locale/yav/dateres.json
              +++ b/js/data/locale/yav/dateres.json
              @@ -8,5 +8,13 @@
                   "Second": "síkɛn",
                   "Time Zone": "kinúki kisikɛl ɔ́ pitɔŋ",
                   "Week": "sɔ́ndiɛ",
              -    "Year": "yɔɔŋ"
              +    "Year": "yɔɔŋ",
              +    "D": "p",
              +    "DD": "pp",
              +    "YY": "yy",
              +    "YYYY": "yɔɔŋ",
              +    "M": "o",
              +    "MM": "oo",
              +    "H": "k",
              +    "HH": "kk"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/yi/dateres.json b/js/data/locale/yi/dateres.json
              index e8077665ee..599a641662 100644
              --- a/js/data/locale/yi/dateres.json
              +++ b/js/data/locale/yi/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "סעקונדע",
                   "Time Zone": "צײַטזאנע",
                   "Week": "וואך",
              -    "Year": "יאָר"
              +    "Year": "יאָר",
              +    "D": "טאָג",
              +    "DD": "טאָג",
              +    "YY": "יאָר",
              +    "YYYY": "יאָר",
              +    "M": "מאנאַט",
              +    "MM": "מאנאַט",
              +    "H": "שעה",
              +    "HH": "שעה",
              +    "mm": "מינוט",
              +    "ss": "סעקונדע"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/yo/BJ/dateres.json b/js/data/locale/yo/BJ/dateres.json
              index 48a263b34a..1f16ad7b7b 100644
              --- a/js/data/locale/yo/BJ/dateres.json
              +++ b/js/data/locale/yo/BJ/dateres.json
              @@ -4,5 +4,9 @@
                   "Minute": "Ìsɛ́jú",
                   "Second": "Ìsɛ́jú Ààyá",
                   "Week": "Ɔ̀sè",
              -    "Year": "Ɔdún"
              +    "Year": "Ɔdún",
              +    "D": "Ɔ",
              +    "DD": "ƆƆ",
              +    "YY": "ƆƆ",
              +    "YYYY": "Ɔdún"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/yo/dateres.json b/js/data/locale/yo/dateres.json
              index 297206e1ec..068d46a7c1 100644
              --- a/js/data/locale/yo/dateres.json
              +++ b/js/data/locale/yo/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "Ìsẹ́jú Ààyá",
                   "Time Zone": "Ibi Àkókò Àgbáyé",
                   "Week": "Ọ̀sè",
              -    "Year": "Ọdún"
              +    "Year": "Ọdún",
              +    "D": "Ọ",
              +    "DD": "ỌỌ",
              +    "YY": "ỌỌ",
              +    "YYYY": "Ọdún",
              +    "M": "O",
              +    "MM": "OO",
              +    "H": "w",
              +    "HH": "ww",
              +    "mm": "ÌÌ",
              +    "ss": "ÌÌ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/yue/Hans/dateres.json b/js/data/locale/yue/Hans/dateres.json
              index 21895d7226..26e03de5d3 100644
              --- a/js/data/locale/yue/Hans/dateres.json
              +++ b/js/data/locale/yue/Hans/dateres.json
              @@ -3,5 +3,7 @@
                   "Minute": "分钟",
                   "Time Zone": "时区",
                   "Week": "周",
              -    "Week of Month": "月周"
              +    "Week of Month": "月周",
              +    "HH": "小时",
              +    "mm": "分钟"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/yue/dateres.json b/js/data/locale/yue/dateres.json
              index d95db4023e..757531e78b 100644
              --- a/js/data/locale/yue/dateres.json
              +++ b/js/data/locale/yue/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "時區",
                   "Week": "週",
                   "Week of Month": "月週",
              -    "Year": "年"
              +    "Year": "年",
              +    "D": "日",
              +    "DD": "日",
              +    "YY": "年",
              +    "YYYY": "年",
              +    "M": "月",
              +    "MM": "月",
              +    "H": "小",
              +    "HH": "小時",
              +    "mm": "分鐘",
              +    "ss": "秒"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/zgh/dateres.json b/js/data/locale/zgh/dateres.json
              index 01d04e184e..7ebc7c8423 100644
              --- a/js/data/locale/zgh/dateres.json
              +++ b/js/data/locale/zgh/dateres.json
              @@ -8,5 +8,15 @@
                   "Second": "ⵜⴰⵙⵉⵏⵜ",
                   "Time Zone": "ⴰⴽⵓⴷ ⵏ ⵓⴳⵎⵎⴰⴹ",
                   "Week": "ⵉⵎⴰⵍⴰⵙⵙ",
              -    "Year": "ⴰⵙⴳⴳⵯⴰⵙ"
              +    "Year": "ⴰⵙⴳⴳⵯⴰⵙ",
              +    "D": "ⴰ",
              +    "DD": "ⴰⴰ",
              +    "YY": "ⴰⴰ",
              +    "YYYY": "ⴰⴰⴰⴰ",
              +    "M": "ⴰ",
              +    "MM": "ⴰⴰ",
              +    "H": "ⵜ",
              +    "HH": "ⵜⵜ",
              +    "mm": "ⵜⵜ",
              +    "ss": "ⵜⵜ"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/zh/Hant/dateres.json b/js/data/locale/zh/Hant/dateres.json
              index 484fa6fc55..0af99c706d 100644
              --- a/js/data/locale/zh/Hant/dateres.json
              +++ b/js/data/locale/zh/Hant/dateres.json
              @@ -5,5 +5,7 @@
                   "Minute": "分鐘",
                   "Time Zone": "時區",
                   "Week": "週",
              -    "Week of Month": "週"
              +    "Week of Month": "週",
              +    "HH": "小時",
              +    "mm": "分鐘"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/zh/dateres.json b/js/data/locale/zh/dateres.json
              index 95700b1225..ec6023f1ee 100644
              --- a/js/data/locale/zh/dateres.json
              +++ b/js/data/locale/zh/dateres.json
              @@ -10,5 +10,15 @@
                   "Time Zone": "时区",
                   "Week": "周",
                   "Week of Month": "月中周",
              -    "Year": "年"
              +    "Year": "年",
              +    "D": "日",
              +    "DD": "日",
              +    "YY": "年",
              +    "YYYY": "年",
              +    "M": "月",
              +    "MM": "月",
              +    "H": "小",
              +    "HH": "小时",
              +    "mm": "分钟",
              +    "ss": "秒"
               }
              \ No newline at end of file
              diff --git a/js/data/locale/zu/dateres.json b/js/data/locale/zu/dateres.json
              index 831eabc0fb..2269b5fc73 100644
              --- a/js/data/locale/zu/dateres.json
              +++ b/js/data/locale/zu/dateres.json
              @@ -8,5 +8,15 @@
                   "Time Zone": "Isikhathi sendawo",
                   "Week": "Iviki",
                   "Week of Month": "Iviki leNyanga",
              -    "Year": "Unyaka"
              +    "Year": "Unyaka",
              +    "D": "U",
              +    "DD": "UU",
              +    "YY": "UU",
              +    "YYYY": "UUUU",
              +    "M": "I",
              +    "MM": "II",
              +    "H": "I",
              +    "HH": "II",
              +    "mm": "II",
              +    "ss": "II"
               }
              \ No newline at end of file
              diff --git a/tools/cldr/datefmts.js b/tools/cldr/datefmts.js
              index 8becc5642e..1bd2be2c39 100644
              --- a/tools/cldr/datefmts.js
              +++ b/tools/cldr/datefmts.js
              @@ -2121,13 +2121,25 @@ module.exports = {
                           "Day of Year": "Day Of Year",
                           "Era": "Era",
                           "Hour": "Hour",
              +            "Millisecond": "Millisecond",
                           "Minute": "Minute",
                           "Month": "Month",
                           "Second": "Second",
                           "Time Zone": "Time Zone",
                           "Week": "Week",
                           "Week of Month": "Week Of Month",
              -            "Year": "Year"
              +            "Year": "Year",
              +            "D": "D",
              +            "DD": "DD",
              +            "YY": "YY",
              +            "YYYY": "YYYY",
              +            "M": "M",
              +            "MM": "MM",
              +            "H": "H",
              +            "HH": "HH",
              +            "mm": "mm",
              +            "ss": "ss",  
              +            "ms": "ms"  
                       };
                   },
               
              @@ -2156,6 +2168,33 @@ module.exports = {
                           }
                       }
               
              +        var placeholders = {
              +            "D": "Day",
              +            "DD": "Day",
              +            "YY": "Year",
              +            "YYYY": "Year",
              +            "M": "Month",
              +            "MM": "Month",
              +            "H": "Hour",
              +            "HH": "Hour",
              +            "mm": "Minute",
              +            "ss": "Second"
              +        };
              +        
              +        for (var ph in placeholders) {
              +            var name = formats[placeholders[ph]];
              +            if (name) {
              +                if (name.length <= ph.length || rtlLanguages.indexOf(language) > -1 || rtlScripts.indexOf(script) > -1) {
              +                    // if it's short or if it's using the Arabic script, just use the full name of the field
              +                    formats[ph] = name;
              +                } else {
              +                    // else if it's not certain scripts, use the abbreviation
              +                    var initial = name[0]; 
              +                    formats[ph] = ph.replace(/./g, initial); 
              +                }
              +            } 
              +        }
              +
                       return formats;
                   }
               };
              
              From 6bfb1aa488cd992cde7835a4ae89f812c3f6d83f Mon Sep 17 00:00:00 2001
              From: Edwin Hoogerbeets 
              Date: Fri, 7 Jun 2019 10:40:51 -0700
              Subject: [PATCH 24/38] Checkpoint commit
              
              Much more work needed
              ---
               js/lib/DateFmt.js                             |  767 +----
               js/lib/DateFmtInfo.js                         | 1013 +++++++
               js/lib/metafiles/ilib-demo-webpack.js         |    1 +
               js/lib/metafiles/ilib-full-webpack.js         |    1 +
               js/lib/metafiles/ilib-ut-webpack.js           |    1 +
               js/test/date/testMeridiems.js                 | 2597 ++++++++++-------
               js/test/date/testSuiteFiles.js                |    2 +-
               js/test/date/testdatefmt.js                   |  525 ----
               js/test/date/testdatefmtasync.js              |   11 +-
               ...estgetformatinfo.js => testdatefmtinfo.js} |  187 +-
               10 files changed, 2811 insertions(+), 2294 deletions(-)
               create mode 100644 js/lib/DateFmtInfo.js
               rename js/test/date/{testgetformatinfo.js => testdatefmtinfo.js} (76%)
              
              diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js
              index e5bb694473..0cbd625207 100644
              --- a/js/lib/DateFmt.js
              +++ b/js/lib/DateFmt.js
              @@ -1,7 +1,7 @@
               /*
                * DateFmt.js - Date formatter definition
                *
              - * Copyright © 2012-2015, 2018, JEDLSoft
              + * Copyright © 2012-2015, 2018-2019, JEDLSoft
                *
                * Licensed under the Apache License, Version 2.0 (the "License");
                * you may not use this file except in compliance with the License.
              @@ -579,6 +579,7 @@ DateFmt.weekDayLenMap = {
                *
                * @static
                * @public
              + * @deprecated Use DateFmtInfo.getMeridiemsRange() instead
                * @param {Object} options options governing the way this date formatter instance works for getting meridiems range
                * @return {Array.<{name:string,start:string,end:string}>}
                */
              @@ -930,6 +931,7 @@ DateFmt.prototype = {
                    * CLDR frequently, and possible orderings cannot be predicted. Your code should
                    * support all 6 possibilities, just in case.
                    *
              +     * @deprecated Use DateFmtInfo.getDateComponentOrder() instead
                    * @return {string} a string giving the date component order
                    */
                   getDateComponentOrder: function() {
              @@ -1013,12 +1015,13 @@ DateFmt.prototype = {
               
                   /**
                    * Return the meridiems range in current locale.
              +     * @deprecated Use DateFmtInfo.getMeridiemsRange() instead
                    * @return {Array.<{name:string,start:string,end:string}>} the range of available meridiems
                    */
                   getMeridiemsRange: function () {
                       var result;
                       var _getSysString = function (key) {
              -            return (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)).toString();
              +            return (this.sysres.getStringJS(undefined, key + "-" + this.calName) || this.sysres.getStringJS(undefined, key)).toString();
                       };
               
                       switch (this.meridiems) {
              @@ -1133,6 +1136,7 @@ DateFmt.prototype = {
                    * the months have different names depending if that year is a leap year or not.
                    * 
                    *
              +     * @deprecated Use DateFmtInfo.getMonthsOfYear() instead
                    * @param  {Object=} options an object-literal that contains any of the above properties
                    * @return {Array} an array of the names of all of the months of the year in the current calendar
                    */
              @@ -1161,7 +1165,7 @@ DateFmt.prototype = {
               
                       monthCount = this.cal.getNumMonths(date.getYears());
                       for (var i = 1; i <= monthCount; i++) {
              -            months[i] = this.sysres.getString(this._getTemplate(template + i, this.cal.getType())).toString();
              +            months[i] = this.sysres.getStringJS(this._getTemplate(template + i, this.cal.getType())).toString();
                       }
                       return months;
                   },
              @@ -1176,6 +1180,8 @@ DateFmt.prototype = {
                    * 
            • length - length of the names of the months being sought. This may be one of * "short", "medium", "long", or "full" * + * + * @deprecated Use DateFmtInfo.getDaysOfWeek() instead * @param {Object=} options an object-literal that contains one key * "length" with the standard length strings * @return {Array} an array of all of the names of the days of the week @@ -1185,7 +1191,7 @@ DateFmt.prototype = { template = DateFmt.weekDayLenMap[length], days = []; for (var i = 0; i < 7; i++) { - days[i] = this.sysres.getString(this._getTemplate(template + i, this.cal.getType())).toString(); + days[i] = this.sysres.getStringJS(this._getTemplate(template + i, this.cal.getType())).toString(); } return days; }, @@ -1306,7 +1312,7 @@ DateFmt.prototype = { case 'LLL': case 'LLLL': key = templateArr[i] + (date.month || 1); - str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); + str += (this.sysres.getStringJS(undefined, key + "-" + this.calName) || this.sysres.getStringJS(undefined, key)); break; case 'E': @@ -1319,7 +1325,7 @@ DateFmt.prototype = { case 'cccc': key = templateArr[i] + date.getDayOfWeek(); //console.log("finding " + key + " in the resources"); - str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); + str += (this.sysres.getStringJS(undefined, key + "-" + this.calName) || this.sysres.getStringJS(undefined, key)); break; case 'a': @@ -1359,7 +1365,7 @@ DateFmt.prototype = { break; } //console.log("finding " + key + " in the resources"); - str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); + str += (this.sysres.getStringJS(undefined, key + "-" + this.calName) || this.sysres.getStringJS(undefined, key)); break; case 'w': @@ -1384,7 +1390,7 @@ DateFmt.prototype = { case 'G': key = "G" + date.getEra(); - str += (this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); + str += (this.sysres.getStringJS(undefined, key + "-" + this.calName) || this.sysres.getStringJS(undefined, key)); break; case 'O': @@ -1606,749 +1612,4 @@ DateFmt.prototype = { } }; -/** - * @private - */ -DateFmt.prototype._mapFormatInfo = function(year, rb, tzinfo) { - function sequence(start, end, pad) { - var constraint = []; - for (var i = start; i <= end; i++) { - constraint.push(pad ? JSUtils.pad(i, 2) : String(i)); - } - return constraint; - } - - var isLeap = this.cal.isLeapYear(year); - var dateStr = rb.getStringJS("Date"); // i18n: date input form label for the day of the month field - var yearStr = rb.getStringJS("Year"); // i18n: date input form label for the year field - var monthStr = rb.getStringJS("Month"); // i18n: date input form label for the months field - var hourStr = rb.getStringJS("Hour"); // i18n: date input form label for the hours field - var minuteStr = rb.getStringJS("Minute"); // i18n: date input form label for the minutes field - var secondStr = rb.getStringJS("Second"); // i18n: date input form label for the seconds field - var milliStr = rb.getStringJS("Millisecond"); // i18n: date input form label for the milliseconds field - var woyStr = rb.getStringJS("Week of Year"); // i18n: date input form label for a week of the year field - var doyStr = rb.getStringJS("Day of Year"); // i18n: date input form label for the day of the year field - - return this.templateArr.map(ilib.bind(this, function(component) { - switch (component) { - case 'd': - return { - component: "day", - label: dateStr, - placeholder: rb.getStringJS("D"), // i18n: date format placeholder string for 1 digit date - constraint: { - "1": [1, 31], - "2": [1, isLeap ? 29 : 28], - "3": [1, 31], - "4": [1, 30], - "5": [1, 31], - "6": [1, 30], - "7": [1, 31], - "8": [1, 31], - "9": [1, 30], - "10": [1, 31], - "11": [1, 30], - "12": [1, 31] - }, - validation: "\\d{1,2}" - }; - - case 'dd': - return { - component: "day", - label: dateStr, - placeholder: rb.getStringJS("DD"), // i18n: date format placeholder string for 2 digit date - constraint: { - "1": sequence(1, 31, true), - "2": sequence(1, isLeap ? 29 : 28, true), - "3": sequence(1, 31, true), - "4": sequence(1, 30, true), - "5": sequence(1, 31, true), - "6": sequence(1, 30, true), - "7": sequence(1, 31, true), - "8": sequence(1, 31, true), - "9": sequence(1, 30, true), - "10": sequence(1, 31, true), - "11": sequence(1, 30, true), - "12": sequence(1, 31, true) - }, - validation: "\\d{1,2}" - }; - - case 'yy': - return { - component: "year", - label: yearStr, - placeholder: rb.getStringJS("YY"), // i18n: date format placeholder string for 2 digit year - constraint: "[0-9]{2}", - validation: "\\d{2}" - }; - - case 'yyyy': - return { - component: "year", - label: yearStr, - placeholder: rb.getStringJS("YYYY"), // i18n: date format placeholder string for 4 digit year - constraint: "[0-9]{4}", - validation: "\\d{4}" - }; - - case 'M': - return { - component: "month", - label: monthStr, - placeholder: rb.getStringJS("M"), // i18n: date format placeholder string for 1 digit month - constraint: [1, 12], - validation: "\\d{1,2}" - }; - - case 'MM': - return { - component: "month", - label: monthStr, - placeholder: rb.getStringJS("MM"), // i18n: date format placeholder string for 2 digit month - constraint: "[0-9]+", - validation: "\\d{2}" - }; - - case 'h': - return { - component: "hour", - label: hourStr, - placeholder: rb.getStringJS("H"), // i18n: date format placeholder string for 1 digit hour - constraint: ["12"].concat(sequence(1, 11)), - validation: "\\d{1,2}" - }; - - case 'hh': - return { - component: "hour", - label: hourStr, - placeholder: rb.getStringJS("HH"), // i18n: date format placeholder string for 2 digit hour, - constraint: ["12"].concat(sequence(1, 11, true)), - validation: "\\d{2}" - }; - - - case 'K': - return { - component: "hour", - label: hourStr, - placeholder: rb.getStringJS("H"), // i18n: date format placeholder string for 1 digit hour - constraint: concat(sequence(0, 11)), - validation: "\\d{1,2}" - }; - - case 'KK': - return { - component: "hour", - label: hourStr, - placeholder: rb.getStringJS("HH"), // i18n: date format placeholder string for 2 digit hour, - constraint: concat(sequence(0, 11, true)), - validation: "\\d{2}" - }; - - case 'H': - return { - component: "hour", - label: hourStr, - placeholder: rb.getStringJS("H"), // i18n: date format placeholder string for 1 digit hour - constraint: [0, 23], - validation: "\\d{1,2}" - }; - - case 'HH': - return { - component: "hour", - label: hourStr, - placeholder: rb.getStringJS("HH"), // i18n: date format placeholder string for 2 digit hour - constraint: concat(sequence(0, 23, true)), - validation: "\\d{1,2}" - }; - - case 'k': - return { - component: "hour", - label: hourStr, - placeholder: rb.getStringJS("H"), // i18n: date format placeholder string for 1 digit hour - constraint: ["24"].concat(sequence(0, 23)), - validation: "\\d{1,2}" - }; - - case 'kk': - return { - component: "hour", - label: hourStr, - placeholder: rb.getStringJS("H"), // i18n: date format placeholder string for 1 digit hour - constraint: ["24"].concat(sequence(0, 23, true)), - validation: "\\d{1,2}" - }; - - case 'm': - return { - component: "minute", - label: minuteStr, - placeholder: rb.getStringJS("mm"), // i18n: date format placeholder string for 2 digit minute - constraint: [0, 59], - validation: "\\d{1,2}" - }; - - case 'mm': - return { - component: "minute", - label: minuteStr, - placeholder: rb.getStringJS("mm"), // i18n: date format placeholder string for 2 digit minute - constraint: sequence(0, 59, true), - validation: "\\d{2}" - }; - - case 's': - return { - component: "second", - label: secondStr, - placeholder: rb.getStringJS("ss"), // i18n: date format placeholder string for 2 digit second - constraint: [0, 59], - validation: "\\d{1,2}" - }; - - case 'ss': - return { - component: "second", - label: secondStr, - placeholder: rb.getStringJS("ss"), // i18n: date format placeholder string for 2 digit second - constraint: sequence(0, 59, true), - validation: "\\d{2}" - }; - - case 'S': - return { - component: "millisecond", - label: milliStr, - placeholder: rb.getStringJS("ms"), // i18n: date format placeholder string for 2 digit millisecond - constraint: [0, 999], - validation: "\\d{1,3}" - }; - - case 'SSS': - return { - component: "millisecond", - label: milliStr, - placeholder: rb.getStringJS("ms"), // i18n: date format placeholder string for 2 digit millisecond - constraint: sequence(0, 999, true), - validation: "\\d{3}" - }; - - case 'N': - case 'NN': - case 'MMM': - case 'MMMM': - case 'L': - case 'LL': - case 'LLL': - case 'LLLL': - return { - component: "month", - label: monthStr, - constraint: (function() { - var ret = []; - var months = this.cal.getNumMonths(year); - for (var i = 1; i < months; i++) { - var key = component + i; - ret.push({ - label: this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key), - value: i - }); - } - return ret; - })() - }; - - case 'E': - case 'EE': - case 'EEE': - case 'EEEE': - case 'c': - case 'cc': - case 'ccc': - case 'cccc': - return { - component: "dayofweek", - label: rb.getStringJS("Day of Week"), // i18n: date input form label for the day of the week field - constraint: ilib.bind(this, function(date) { - var d = date.getJSDate(); - var key = component.replace(/c/g, 'E') + d.getDay(); - if (this.calName !== "gregorian") { - key += '-' + this.calName; - } - return this.sysres.getString(undefined, key); - }) - }; - break; - - case 'a': - var ret = { - component: "meridiem", - label: rb.getStringJS("AM/PM"), // i18n: date input form label for the meridiem field - constraint: [] - }; - switch (this.meridiems) { - case "chinese": - for (var i = 0; i < 7; i++) { - var key = "azh" + i; - ret.constraint.push(this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); - } - break; - case "ethiopic": - for (var i = 0; i < 7; i++) { - var key = "a" + i + "-ethiopic"; - ret.constraint.push(this.sysres.getString(undefined, key + "-" + this.calName) || this.sysres.getString(undefined, key)); - } - break; - default: - ret.constraint.push(this.sysres.getString(undefined, "a0-" + this.calName) || this.sysres.getString(undefined, "a0")); - ret.constraint.push(this.sysres.getString(undefined, "a1-" + this.calName) || this.sysres.getString(undefined, "a1")); - break; - } - return ret; - - case 'w': - return { - label: woyStr, - value: function(date) { - return date.getDayOfYear(); - } - }; - - case 'ww': - return { - label: woyStr, - value: function(date) { - var temp = date.getWeekOfYear(); - return JSUtils.pad(temp, 2) - } - }; - - case 'D': - return { - label: doyStr, - value: function(date) { - return date.getDayOfYear(); - } - }; - - case 'DD': - return { - label: doyStr, - value: function(date) { - var temp = date.getDayOfYear(); - return JSUtils.pad(temp, 2) - } - }; - - case 'DDD': - return { - label: doyStr, - value: function(date) { - var temp = date.getDayOfYear(); - return JSUtils.pad(temp, 3) - } - }; - - case 'W': - return { - label: rb.getStringJS("Week of Month"), // i18n: date input form label for the week of the month field - value: function(date) { - return date.getWeekOfMonth(); - } - }; - - case 'G': - var ret = { - component: "era", - label: rb.getString("Era"), // i18n: date input form label for the era field - constraint: [] - }; - ret.constraint.push(this.sysres.getString(undefined, "G0-" + this.calName) || this.sysres.getString(undefined, "G0")); - ret.constraint.push(this.sysres.getString(undefined, "G1-" + this.calName) || this.sysres.getString(undefined, "G1")); - return ret; - - case 'z': // general time zone - case 'Z': // RFC 822 time zone - return { - component: "timezone", - label: rb.getString("Time Zone"), // i18n: date input form label for the time zone field - constraint: tzinfo - }; - - default: - return { - label: component - }; - } - })); -}; - -/** - * Return information about the date format that can be used - * by UI frameworks to display a locale-sensitive input form.

              - * - * The options parameter is an object that can contain any of - * the following properties: - * - *

                - *
              • locale - the locale to translate the labels - * to. If not given, the locale of the formatter will be used. - * The locale of the formatter specifies the format of the - * date input and which components are available and in what - * order, whereas this locale property only specifies the language - * used for the labels. - * - *
              • year - the year for which the formats are being sought. - * For some calendars such as the Hebrew calendar, the number of - * and the length of the months depends upon the year. Even in the - * Gregorian calendar, the length of February changes in leap - * years, though the number of months or their names do not - * change. If not specified, the default is the current year. - * - *
              • sync - if true, this method should load the data - * synchronously. If false, load the data asynchronously and - * call the onLoad callback function when it is done. The onLoad - * parameter must be specified in order to receive the data. - * - *
              • onLoad - a callback function to call when the data is fully - * loaded. When the onLoad option is given, this method will attempt to - * load any missing locale data using the ilib loader callback. - * When this method is done (even if the data is already preassembled), the - * onLoad function is called with the results as a parameter, so this - * callback can be used with preassembled or dynamic data loading or a - * mix of the two. - * - *
              • loadParams - an object containing parameters to pass to the - * loader callback function when locale data is missing. The parameters are not - * interpretted or modified in any way. They are simply passed along. The object - * may contain any property/value pairs as long as the calling code is in - * agreement with the loader callback function as to what those parameters mean. - *
              - * - * The results object returned by this method or passed to the onLoad - * callback is an array of date - * format components. Each format component is an object - * that contains information that can be used to display - * a field in an input form. - * The list of possible properties on each component object are: - * - *
                - *
              • component - if this component describes a part - * of the date format which can be entered by the user (as opposed - * to the fixed parts which cannot), then this property gives - * the name of that component when the value is used - * with the DateFactory() function to construct an IDate instance. - * For example, if the value of "component" is "year", - * then the value of the input field can be used as the "year" - * property when calling DateFactory(). - *
              • label - a localized text to display for this - * component as a label. The text is localized to the given - * locale. If a locale is not given, then it uses the locale - * of the formatter. - *
              • placeholder - the localized placeholder text to - * display in a free-form, empty text input field, which gives - * the user a hint as to what to enter in that field. The text - * is localized to the given - * locale. If a locale is not given, then it uses the locale - * of the formatter. - *
              • validation - a regular expression or function - * that validates the input value of a free-form text input - * field. When the validation property is a regular expression, - * the expression matches when the value of the field is valid. - * When the validation property is a function, the function - * would take a single parameter which is the value of - * the input field. It returns a boolean value: true if the - * input is valid, and false otherwise. - *
              • constraint - a rule that describes the constraints - * on valid values for this component. This is intended to be - * used with input fields such as drop-down boxes. - *
              • value - a function that this the value of - * a calculated field. (See the description below.) - *
              - * - * Field separators such as slashes or dots, etc., are given - * as a object with no "component" property. They only contain - * a "label" property with a string value. A user interface - * may choose to use these purely formatting components or ignore - * them as needed.

              - * - * User interfaces can construct two different types of input - * forms: constrained or free-form. In a constrained form, - * components such as the month are displayed as - * as a drop-down box containing a fixed list of month names. - * The user may only choose from that list and it is therefore - * impossible to choose an invalid value. In a free-form - * form, the user is presented with text input fields where - * they can type whatever they want. The resulting value should - * be validated using the validation rules before submitting - * the form. The getFormatInfo - * method returns information that can be used to create either - * type of form. It is up to the caller to - * decide which type of form to present to the user.

              - * - * For a constrained form element, the input value - * must conform to a particular pattern, range, or a fixed - * list of possible values. The rule for this is given in - * the "constraint" property. - * The values of the constraint property can be one of the - * following types: - * - *

                - *
                  array[2]<number> - an array of size 2 of numbers - * that gives the start and end of a numeric range. The input must - * be between the start and end of the range, inclusive. - *
                    array[2]<string> - an array of strings gives - * the exact range of values possible for this field. The input must - * be one of these values. This is mainly intended for use in - * drop-down boxes. The value of the chosen element is the value - * that should be returned for the field. - *
                      array<object> - an array of valid string values - * given as objects that have "label" and "value" properties. The - * label is intended to be displayed to the user and the value - * is to be used to construct the new date object when the - * user has finished selecting the components and the form is - * being evaluated or submitted. - *
              - * - * For a free-form form, the user interface must validate the - * values that the user has typed into the text field. To aid - * with this, this method returns a "validation" property which - * contains either a regular expression or a function. The - * regular expression tests whether or not what the user has - * entered is valid. If the validation property is set to - * a function, this function would take a single - * parameter which is the text value of the input field, and - * it returns a boolean value: true if the input is valid, - * and false otherwise. If it does not make sense for a - * particular date format component to be free-form, such - * as the "AM/PM" choice for a meridiem, then the validation - * property will be left off. Only the given choices are - * valid. UI builders should only allow - * free-form fields for those components that have a - * "validation" property. Otherwise, use a constrained - * input form element instead.

              - * - * Some date format components do not represent values that - * a user may enter, but instead values that are calculated - * based on other date format components. For example, the - * day of the week is a property that is calculated based - * on the date the user has entered. It would not - * make sense for the user to be able to choose a day of - * the week that does not correspond to the day, month, and - * year they have already chosen. To handle calculated - * date format components, this method returns a "value" - * property which is a function which returns - * the calculated value of the field. Its parameter is a date - * object that has been created from the other date format - * components. Its single parameter is an object that contains - * the other date input components, similar to what you might - * pass to the DateFactory function.

              - * - * @example Here is what the result would look like for a US short - * date/time format for a leap year. This includes the components - * of day of the week, date, month, year, hour, minute, and meridiem: - * - *

              - * [
              - *   {
              - *     "label": "Day of Week",   // optional label
              - *     "value": function(date) { returns the calculated, localized day of week name }
              - *   },
              - *   {
              - *     "label": " "              // fixed field (optionally displayed in the UI)
              - *   },
              - *   {
              - *     "component": "month",     // property name to use when calling DateFactory() for this field
              - *     "label": "Month",         // label describing this field, in this case translated to English/US
              - *     "placeholder": "M",       // the placeholder text for this field
              - *     "constraint": [1, 12],    // constraint rules for a drop-down box for the month
              - *     "validation": "\\d{1,2}"  // validation rule for a free-form text input
              - *   },
              - *   {
              - *     "label": "/"              // fixed field (optionally displayed in the UI)
              - *   },
              - *   {
              - *     "component": "day",
              - *     "label": "Date",
              - *     "placeholder": "DD",
              - *     "constraint": {
              - *       // if the given years is a leap year use these constraints
              - *       "1": [1, 31],
              - *       "2": [1, 29],
              - *       "3": [1, 31],
              - *       "4": [1, 30],
              - *       "5": [1, 31],
              - *       "6": [1, 30],
              - *       "7": [1, 31],
              - *       "8": [1, 31],
              - *       "9": [1, 30],
              - *       "10": [1, 31],
              - *       "11": [1, 30],
              - *       "12": [1, 31]
              - *     },
              - *     "validation": "\\d{1,2}"
              - *   },
              - *   {
              - *     "label": "/"
              - *   },
              - *   {
              - *     "component": "year",
              - *     "label": "Year",
              - *     "placeholder": "YYYY",
              - *     "validation": "[0-9]+"
              - *   },
              - *   {
              - *     "label": " at "
              - *   },
              - *   {
              - *     "component": "hour",
              - *     "label": "Hour",
              - *     "placeholder": "H",
              - *     "constraint": [1, 12],
              - *     "validation": "\\d{1,2}"
              - *   },
              - *   {
              - *     "label": ":"
              - *   },
              - *   {
              - *     "component": "minute",
              - *     "label": "Minute",
              - *     "constraint": [
              - *       "00",                   // note that these are strings so that they can be zero-padded
              - *       "01",
              - *       "02",
              - *       "03",
              - *       "04",
              - *       "05",
              - *       "06",
              - *       "07",
              - *       "08",
              - *       "09",
              - *       "10",
              - *       "11",
              - *       ...
              - *       "59"
              - *     ],
              - *     "placeholder": "mm",
              - *     "validation": "\\d{2}"
              - *   },
              - *   {
              - *     "label": " "
              - *   },
              - *   {
              - *     "component": "meridiem",
              - *     "label": "AM/PM",
              - *     "placeholder": "AM/PM",
              - *     "constraint": ["AM", "PM"]
              - *   }
              - * ]
              - * 
              - *

              - * Note that the "minute" component comes with a preformatted list of values - * as strings, even though the minute is really a number. The preformatting - * ensures that the leading zero is not lost for minutes less than 10. - * - * @example Example of calling the getFormatInfo method - * - * // the DateFmt should be created with the locale of the date you - * // would like the user to enter. - * new DateFmt({ - * locale: 'nl-NL', // for dates in the Netherlands - * year: 2019, - * onLoad: ilib.bind(this, function(fmt) { - * // The following is the locale of the UI you would like to see the labels - * // like "Year" and "Minute" translated to. In this example, we - * // are showing an input form for Dutch dates, but the labels are - * // written in US English. - * fmt.getFormatInfo({ - * locale: "en-US", - * sync: true, - * callback: ilib.bind(this, function(components) { - * // here you should iterate through the component array and dynamically create the input - * // elements with the given labels and placeholders and such, and install - * // the appropriate validators - * })); - * }) - * }); - * - * @param {Object} options option to control this function. (See the description - * above.) - * @returns {Array.} An array of date components - */ -DateFmt.prototype.getFormatInfo = function(options) { - var locale, sync = true, callback, loadParams, year; - - if (options) { - locale = options.locale; - sync = !!options.sync; - callback = options.onLoad; - loadParams = options.loadParams; - year = options.year; - } - var info; - var loc = new Locale(this.locale); - if (locale) { - if (typeof(locale) === "string") { - locale = new Locale(locale); - } - loc.language = locale.getLanguage(); - loc.spec = undefined; - } - - if (!year) { - var now = DateFactory({ - type: this.calName - }); - year = now.getYear(); - } - - new ResBundle({ - locale: loc, - name: "dateres", - sync: sync, - loadParams: loadParams, - onLoad: ilib.bind(this, function (rb) { - var info, zone = false; - for (var i = 0; i < this.templateArr.length; i++) { - if (this.templateArr[i] === "z" || this.templateArr[i] === "Z") { - zone = true; - break; - } - } - - if (zone) { - TimeZone.getAvailableIds(undefined, sync, ilib.bind(this, function(tzinfo) { - var set = new ISet(tzinfo); - set.add("Etc/UTC"); - set.add("Etc/GMT"); - for (var j = 1; j < 13; j++) { - set.add("Etc/GMT+" + j); - set.add("Etc/GMT-" + j); - } - set.add("Etc/GMT-13"); - set.add("Etc/GMT-14"); - - info = this._mapFormatInfo(year, rb, set.asArray().sort()); - if (callback && typeof(callback) === "function") { - callback(info); - } - })); - } else { - info = this._mapFormatInfo(year, rb); - if (callback && typeof(callback) === "function") { - callback(info); - } - } - }) - }); - - return info; -}; - - module.exports = DateFmt; diff --git a/js/lib/DateFmtInfo.js b/js/lib/DateFmtInfo.js new file mode 100644 index 0000000000..a273087f32 --- /dev/null +++ b/js/lib/DateFmtInfo.js @@ -0,0 +1,1013 @@ +/* + * DateFmtInfo.js - Information about a date formatter + * + * Copyright © 2019, 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. + */ + +// !data dateres + +var DateFmt = require("./DateFmt.js"); + +var ilib = require("../index.js"); +var JSUtils = require("./JSUtils.js"); +var Locale = require("./Locale.js"); +var DateFactory = require("./DateFactory.js"); +var ResBundle = require("./ResBundle.js"); +var TimeZone = require("./TimeZone.js"); +var ISet = require("./ISet.js"); + +/** + * @class + * Create a new date formatter info instance. This instance gives information about + * a particular date formatter that can be used by UI builders to construct + * input form elements based on the formatter.

              + * + * The options may contain any of the properties that are valid to create a date + * formatter (q.v.), plus the following: + * + *

                + *
              • uiLocale - locale of the user interface. This may be different than + * the locale of the formatter which is given in the "locale" property. The uiLocale + * specifies the language for translations of things like names of months or days + * of the week, whereas the locale of the formatter specifies the actual date + * format, time zone, calendar, etc. of the formatter. + *
              + * + * @constructor + * @param {Object} options options governing the way this date formatter info + * instance works + */ +var DateFmtInfo = function(options) { + if (!options || options.sync) { + this.fmt = new DateFmt(options); + this._init(options); + } else { + var newOptions = {}; + var callback = options.onLoad; + JSUtils.shallowCopy(options, newOptions); + newOptions.onLoad = ilib.bind(this, function(fmt) { + this.fmt = fmt; + this._init(options); + }); + new DateFmt(newOptions); + } +}; + +DateFmtInfo.prototype = { + /** + * + */ + _init: function(options) { + var locale, sync = true, callback, loadParams; + + if (options) { + locale = options.uiLocale || options.locale; + sync = !!options.sync; + callback = options.onLoad; + loadParams = options.loadParams; + } + var loc = this.fmt.locale; + if (locale) { + if (typeof(locale) === "string") { + locale = new Locale(locale); + } + locale = new Locale(locale.getLanguage(), loc.getRegion(), loc.getVariant(), loc.getScript()); + } + new ResBundle({ + locale: locale, + name: "dateres", + sync: sync, + loadParams: loadParams, + onLoad: ilib.bind(this, function (rb) { + this.rb = rb; + if (callback && typeof(callback) === "function") { + callback(this); + } + }) + }); + }, + + /** + * Return the order of the year, month, and date components for the current locale.

              + * + * When implementing a date input widget in a UI, it would be useful to know what + * order to put the year, month, and date input fields so that it conforms to the + * user expectations for the locale. This method gives that order by returning a + * string that has a single "y", "m", and "d" character in it in the correct + * order.

              + * + * For example, the return value "ymd" means that this locale formats the year first, + * the month second, and the date third, and "mdy" means that the month is first, + * the date is second, and the year is third. Four of the 6 possible permutations + * of the three letters have at least one locale that uses that ordering, though some + * combinations are far more likely than others. The ones that are not used by any + * locales are "dym" and "myd", though new locales are still being added to + * CLDR frequently, and possible orderings cannot be predicted. Your code should + * support all 6 possibilities, just in case. + * + * @return {string} a string giving the date component order + */ + getDateComponentOrder: function() { + return this.fmt.componentOrder; + }, + + /** + * @private + */ + _getSysString: function (key) { + return (this.fmt.sysres.getStringJS(undefined, key + "-" + this.fmt.calName) || this.fmt.sysres.getStringJS(undefined, key)).toString(); + }, + + /** + * Return the meridiems range in current locale. + * @return {Array.<{name:string,start:string,end:string}>} the range of available meridiems + */ + getMeridiemsRange: function () { + var result; + + switch (this.fmt.meridiems) { + case "chinese": + result = [ + { + name: this._getSysString("azh0"), + start: "00:00", + end: "05:59" + }, + { + name: this._getSysString("azh1"), + start: "06:00", + end: "08:59" + }, + { + name: this._getSysString("azh2"), + start: "09:00", + end: "11:59" + }, + { + name: this._getSysString("azh3"), + start: "12:00", + end: "12:59" + }, + { + name: this._getSysString("azh4"), + start: "13:00", + end: "17:59" + }, + { + name: this._getSysString("azh5"), + start: "18:00", + end: "20:59" + }, + { + name: this._getSysString("azh6"), + start: "21:00", + end: "23:59" + } + ]; + break; + case "ethiopic": + result = [ + { + name: this._getSysString("a0-ethiopic"), + start: "00:00", + end: "05:59" + }, + { + name: this._getSysString("a1-ethiopic"), + start: "06:00", + end: "06:00" + }, + { + name: this._getSysString("a2-ethiopic"), + start: "06:01", + end: "11:59" + }, + { + name: this._getSysString("a3-ethiopic"), + start: "12:00", + end: "17:59" + }, + { + name: this._getSysString("a4-ethiopic"), + start: "18:00", + end: "23:59" + } + ]; + break; + default: + result = [ + { + name: this._getSysString("a0"), + start: "00:00", + end: "11:59" + }, + { + name: this._getSysString("a1"), + start: "12:00", + end: "23:59" + } + ]; + break; + } + + return result; + }, + + /** + * Returns an array of the months of the year, formatted to the optional length specified. + * i.e. ...getMonthsOfYear() OR ...getMonthsOfYear({length: "short"}) + *

              + * The options parameter may contain any of the following properties: + * + *

                + *
              • length - length of the names of the months being sought. This may be one of + * "short", "medium", "long", or "full" + *
              • date - retrieve the names of the months in the date of the given date + *
              • year - retrieve the names of the months in the given year. In some calendars, + * the months have different names depending if that year is a leap year or not. + *
              + * + * @param {Object=} options an object-literal that contains any of the above properties + * @return {Array} an array of the names of all of the months of the year in the current calendar + */ + getMonthsOfYear: function(options) { + var length = (options && options.length) || this.fmt.getLength(), + template = DateFmt.monthNameLenMap[length], + months = [undefined], + date, + monthCount; + + if (options) { + if (options.date) { + date = DateFactory._dateToIlib(options.date); + } + + if (options.year) { + date = DateFactory({year: options.year, month: 1, day: 1, type: this.fmt.cal.getType()}); + } + } + + if (!date) { + date = DateFactory({ + calendar: this.fmt.cal.getType() + }); + } + + monthCount = this.fmt.cal.getNumMonths(date.getYears()); + for (var i = 1; i <= monthCount; i++) { + months[i] = this.fmt.sysres.getStringJS(this.fmt._getTemplate(template + i, this.fmt.cal.getType())).toString(); + } + return months; + }, + + /** + * Returns an array of the days of the week, formatted to the optional length specified. + * i.e. ...getDaysOfWeek() OR ...getDaysOfWeek({length: "short"}) + *

              + * The options parameter may contain any of the following properties: + * + *

                + *
              • length - length of the names of the months being sought. This may be one of + * "short", "medium", "long", or "full" + *
              + * @param {Object=} options an object-literal that contains one key + * "length" with the standard length strings + * @return {Array} an array of all of the names of the days of the week + */ + getDaysOfWeek: function(options) { + var length = (options && options.length) || this.fmt.getLength(), + template = DateFmt.weekDayLenMap[length], + days = []; + for (var i = 0; i < 7; i++) { + days[i] = this.fmt.sysres.getStringJS(this.fmt._getTemplate(template + i, this.fmt.cal.getType())).toString(); + } + return days; + }, + + /** + * @private + */ + _mapFormatInfo: function(year, RB, tzinfo) { + function sequence(start, end, pad) { + var constraint = []; + for (var i = start; i <= end; i++) { + constraint.push(pad ? JSUtils.pad(i, 2) : String(i)); + } + return constraint; + } + + var isLeap = this.fmt.cal.isLeapYear(year); + var dateStr = RB.getStringJS("Date"); // i18n: date input form label for the day of the month field + var yearStr = RB.getStringJS("Year"); // i18n: date input form label for the year field + var monthStr = RB.getStringJS("Month"); // i18n: date input form label for the months field + var hourStr = RB.getStringJS("Hour"); // i18n: date input form label for the hours field + var minuteStr = RB.getStringJS("Minute"); // i18n: date input form label for the minutes field + var secondStr = RB.getStringJS("Second"); // i18n: date input form label for the seconds field + var milliStr = RB.getStringJS("Millisecond"); // i18n: date input form label for the milliseconds field + var woyStr = RB.getStringJS("Week of Year"); // i18n: date input form label for a week of the year field + var doyStr = RB.getStringJS("Day of Year"); // i18n: date input form label for the day of the year field + var ret, i; + + return this.fmt.templateArr.map(ilib.bind(this, function(component) { + switch (component) { + case 'd': + ret = { + component: "day", + label: dateStr, + placeholder: RB.getStringJS("D"), // i18n: date format placeholder string for 1 digit date + constraint: {}, + validation: "\\d{1,2}" + }; + var months = this.fmt.cal.getNumMonths(year); + for (i = 1; i <= months; i++) { + ret.constraint[String(i)] = [1, this.fmt.cal.getMonLength(i, year)]; + } + return ret; + + case 'dd': + ret = { + component: "day", + label: dateStr, + placeholder: RB.getStringJS("DD"), // i18n: date format placeholder string for 2 digit date + constraint: {}, + validation: "\\d{1,2}" + }; + var months = this.fmt.cal.getNumMonths(year); + for (i = 1; i <= months; i++) { + ret.constraint[String(i)] = sequence(1, this.fmt.cal.getMonLength(i, year)); + } + return ret; + + case 'yy': + return { + component: "year", + label: yearStr, + placeholder: RB.getStringJS("YY"), // i18n: date format placeholder string for 2 digit year + constraint: "[0-9]{2}", + validation: "\\d{2}" + }; + + case 'yyyy': + return { + component: "year", + label: yearStr, + placeholder: RB.getStringJS("YYYY"), // i18n: date format placeholder string for 4 digit year + constraint: "[0-9]{4}", + validation: "\\d{4}" + }; + + case 'M': + ret = { + component: "month", + label: monthStr, + placeholder: RB.getStringJS("M"), // i18n: date format placeholder string for 1 digit month + constraint: [1, this.fmt.cal.getNumMonths(year)], + validation: "\\d{1,2}" + }; + return ret; + + case 'MM': + ret = { + component: "month", + label: monthStr, + placeholder: RB.getStringJS("MM"), // i18n: date format placeholder string for 2 digit month + constraint: sequence(1, this.fmt.cal.getNumMonths(year)), + validation: "\\d{2}" + }; + return ret; + + case 'h': + return { + component: "hour", + label: hourStr, + placeholder: RB.getStringJS("H"), // i18n: date format placeholder string for 1 digit hour + constraint: ["12"].concat(sequence(1, 11)), + validation: "\\d{1,2}" + }; + + case 'hh': + return { + component: "hour", + label: hourStr, + placeholder: RB.getStringJS("HH"), // i18n: date format placeholder string for 2 digit hour, + constraint: ["12"].concat(sequence(1, 11, true)), + validation: "\\d{2}" + }; + + + case 'K': + return { + component: "hour", + label: hourStr, + placeholder: RB.getStringJS("H"), // i18n: date format placeholder string for 1 digit hour + constraint: sequence(0, 11), + validation: "\\d{1,2}" + }; + + case 'KK': + return { + component: "hour", + label: hourStr, + placeholder: RB.getStringJS("HH"), // i18n: date format placeholder string for 2 digit hour, + constraint: sequence(0, 11, true), + validation: "\\d{2}" + }; + + case 'H': + return { + component: "hour", + label: hourStr, + placeholder: RB.getStringJS("H"), // i18n: date format placeholder string for 1 digit hour + constraint: [0, 23], + validation: "\\d{1,2}" + }; + + case 'HH': + return { + component: "hour", + label: hourStr, + placeholder: RB.getStringJS("HH"), // i18n: date format placeholder string for 2 digit hour + constraint: sequence(0, 23, true), + validation: "\\d{1,2}" + }; + + case 'k': + return { + component: "hour", + label: hourStr, + placeholder: RB.getStringJS("H"), // i18n: date format placeholder string for 1 digit hour + constraint: ["24"].concat(sequence(0, 23)), + validation: "\\d{1,2}" + }; + + case 'kk': + return { + component: "hour", + label: hourStr, + placeholder: RB.getStringJS("H"), // i18n: date format placeholder string for 1 digit hour + constraint: ["24"].concat(sequence(0, 23, true)), + validation: "\\d{1,2}" + }; + + case 'm': + return { + component: "minute", + label: minuteStr, + placeholder: RB.getStringJS("mm"), // i18n: date format placeholder string for 2 digit minute + constraint: [0, 59], + validation: "\\d{1,2}" + }; + + case 'mm': + return { + component: "minute", + label: minuteStr, + placeholder: RB.getStringJS("mm"), // i18n: date format placeholder string for 2 digit minute + constraint: sequence(0, 59, true), + validation: "\\d{2}" + }; + + case 's': + return { + component: "second", + label: secondStr, + placeholder: RB.getStringJS("ss"), // i18n: date format placeholder string for 2 digit second + constraint: [0, 59], + validation: "\\d{1,2}" + }; + + case 'ss': + return { + component: "second", + label: secondStr, + placeholder: RB.getStringJS("ss"), // i18n: date format placeholder string for 2 digit second + constraint: sequence(0, 59, true), + validation: "\\d{2}" + }; + + case 'S': + return { + component: "millisecond", + label: milliStr, + placeholder: RB.getStringJS("ms"), // i18n: date format placeholder string for 2 digit millisecond + constraint: [0, 999], + validation: "\\d{1,3}" + }; + + case 'SSS': + return { + component: "millisecond", + label: milliStr, + placeholder: RB.getStringJS("ms"), // i18n: date format placeholder string for 2 digit millisecond + constraint: sequence(0, 999, true), + validation: "\\d{3}" + }; + + case 'N': + case 'NN': + case 'MMM': + case 'MMMM': + case 'L': + case 'LL': + case 'LLL': + case 'LLLL': + return { + component: "month", + label: monthStr, + constraint: (ilib.bind(this, function() { + var ret = []; + var months = this.fmt.cal.getNumMonths(year); + for (i = 1; i <= months; i++) { + var key = component + i; + ret.push({ + label: this.fmt.sysres.getStringJS(undefined, key + "-" + this.fmt.calName) || this.fmt.sysres.getStringJS(undefined, key), + value: i + }); + } + return ret; + }))() + }; + + case 'E': + case 'EE': + case 'EEE': + case 'EEEE': + case 'c': + case 'cc': + case 'ccc': + case 'cccc': + return { + component: "dayofweek", + label: RB.getStringJS("Day of Week"), // i18n: date input form label for the day of the week field + constraint: ilib.bind(this, function(date) { + var d = date.getJSDate(); + var key = component.replace(/c/g, 'E') + d.getDay(); + if (this.fmt.calName !== "gregorian") { + key += '-' + this.fmt.calName; + } + return this.fmt.sysres.getStringJS(undefined, key); + }) + }; + break; + + case 'a': + var ret = { + component: "meridiem", + label: RB.getStringJS("AM/PM"), // i18n: date input form label for the meridiem field + constraint: [] + }; + switch (this.fmt.meridiems) { + case "chinese": + for (var i = 0; i < 7; i++) { + var key = "azh" + i; + ret.constraint.push(this.fmt.sysres.getStringJS(undefined, key + "-" + this.fmt.calName) || this.fmt.sysres.getStringJS(undefined, key)); + } + break; + case "ethiopic": + for (var i = 0; i < 7; i++) { + var key = "a" + i + "-ethiopic"; + ret.constraint.push(this.fmt.sysres.getStringJS(undefined, key + "-" + this.fmt.calName) || this.fmt.sysres.getStringJS(undefined, key)); + } + break; + default: + ret.constraint.push(this.fmt.sysres.getStringJS(undefined, "a0-" + this.fmt.calName) || this.fmt.sysres.getStringJS(undefined, "a0")); + ret.constraint.push(this.fmt.sysres.getStringJS(undefined, "a1-" + this.fmt.calName) || this.fmt.sysres.getStringJS(undefined, "a1")); + break; + } + return ret; + + case 'w': + return { + label: woyStr, + value: function(date) { + return date.getDayOfYear(); + } + }; + + case 'ww': + return { + label: woyStr, + value: function(date) { + var temp = date.getWeekOfYear(); + return JSUtils.pad(temp, 2) + } + }; + + case 'D': + return { + label: doyStr, + value: function(date) { + return date.getDayOfYear(); + } + }; + + case 'DD': + return { + label: doyStr, + value: function(date) { + var temp = date.getDayOfYear(); + return JSUtils.pad(temp, 2) + } + }; + + case 'DDD': + return { + label: doyStr, + value: function(date) { + var temp = date.getDayOfYear(); + return JSUtils.pad(temp, 3) + } + }; + + case 'W': + return { + label: RB.getStringJS("Week of Month"), // i18n: date input form label for the week of the month field + value: function(date) { + return date.getWeekOfMonth(); + } + }; + + case 'G': + var ret = { + component: "era", + label: RB.getStringJS("Era"), // i18n: date input form label for the era field + constraint: [] + }; + ret.constraint.push(this.fmt.sysres.getStringJS(undefined, "G0-" + this.fmt.calName) || this.fmt.sysres.getStringJS(undefined, "G0")); + ret.constraint.push(this.fmt.sysres.getStringJS(undefined, "G1-" + this.fmt.calName) || this.fmt.sysres.getStringJS(undefined, "G1")); + return ret; + + case 'z': // general time zone + case 'Z': // RFC 822 time zone + return { + component: "timezone", + label: RB.getStringJS("Time Zone"), // i18n: date input form label for the time zone field + constraint: tzinfo + }; + + default: + return { + label: component + }; + } + })); + }, + + /** + * Return information about the date format that can be used + * by UI frameworks to display a locale-sensitive input form.

              + * + * The options parameter is an object that can contain any of + * the following properties: + * + *

                + *
              • locale - the locale to translate the labels + * to. If not given, the locale of the formatter will be used. + * The locale of the formatter specifies the format of the + * date input and which components are available and in what + * order, whereas this locale property only specifies the language + * used for the labels. + * + *
              • year - the year for which the formats are being sought. + * For some calendars such as the Hebrew calendar, the number of + * and the length of the months depends upon the year. Even in the + * Gregorian calendar, the length of February changes in leap + * years, though the number of months or their names do not + * change. If not specified, the default is the current year. + * + *
              • sync - if true, this method should load the data + * synchronously. If false, load the data asynchronously and + * call the onLoad callback function when it is done. The onLoad + * parameter must be specified in order to receive the data. + * + *
              • onLoad - a callback function to call when the data is fully + * loaded. When the onLoad option is given, this method will attempt to + * load any missing locale data using the ilib loader callback. + * When this method is done (even if the data is already preassembled), the + * onLoad function is called with the results as a parameter, so this + * callback can be used with preassembled or dynamic data loading or a + * mix of the two. + * + *
              • loadParams - an object containing parameters to pass to the + * loader callback function when locale data is missing. The parameters are not + * interpretted or modified in any way. They are simply passed along. The object + * may contain any property/value pairs as long as the calling code is in + * agreement with the loader callback function as to what those parameters mean. + *
              + * + * The results object returned by this method or passed to the onLoad + * callback is an array of date + * format components. Each format component is an object + * that contains information that can be used to display + * a field in an input form. + * The list of possible properties on each component object are: + * + *
                + *
              • component - if this component describes a part + * of the date format which can be entered by the user (as opposed + * to the fixed parts which cannot), then this property gives + * the name of that component when the value is used + * with the DateFactory() function to construct an IDate instance. + * For example, if the value of "component" is "year", + * then the value of the input field can be used as the "year" + * property when calling DateFactory(). + *
              • label - a localized text to display for this + * component as a label. The text is localized to the given + * locale. If a locale is not given, then it uses the locale + * of the formatter. + *
              • placeholder - the localized placeholder text to + * display in a free-form, empty text input field, which gives + * the user a hint as to what to enter in that field. The text + * is localized to the given + * locale. If a locale is not given, then it uses the locale + * of the formatter. + *
              • validation - a regular expression or function + * that validates the input value of a free-form text input + * field. When the validation property is a regular expression, + * the expression matches when the value of the field is valid. + * When the validation property is a function, the function + * would take a single parameter which is the value of + * the input field. It returns a boolean value: true if the + * input is valid, and false otherwise. + *
              • constraint - a rule that describes the constraints + * on valid values for this component. This is intended to be + * used with input fields such as drop-down boxes. + *
              • value - a function that this the value of + * a calculated field. (See the description below.) + *
              + * + * Field separators such as slashes or dots, etc., are given + * as a object with no "component" property. They only contain + * a "label" property with a string value. A user interface + * may choose to use these purely formatting components or ignore + * them as needed.

              + * + * User interfaces can construct two different types of input + * forms: constrained or free-form. In a constrained form, + * components such as the month are displayed as + * as a drop-down box containing a fixed list of month names. + * The user may only choose from that list and it is therefore + * impossible to choose an invalid value. In a free-form + * form, the user is presented with text input fields where + * they can type whatever they want. The resulting value should + * be validated using the validation rules before submitting + * the form. The getFormatInfo + * method returns information that can be used to create either + * type of form. It is up to the caller to + * decide which type of form to present to the user.

              + * + * For a constrained form element, the input value + * must conform to a particular pattern, range, or a fixed + * list of possible values. The rule for this is given in + * the "constraint" property. + * The values of the constraint property can be one of the + * following types: + * + *

                + *
                  array[2]<number> - an array of size 2 of numbers + * that gives the start and end of a numeric range. The input must + * be between the start and end of the range, inclusive. + *
                    array[2]<string> - an array of strings gives + * the exact range of values possible for this field. The input must + * be one of these values. This is mainly intended for use in + * drop-down boxes. The value of the chosen element is the value + * that should be returned for the field. + *
                      array<object> - an array of valid string values + * given as objects that have "label" and "value" properties. The + * label is intended to be displayed to the user and the value + * is to be used to construct the new date object when the + * user has finished selecting the components and the form is + * being evaluated or submitted. + *
              + * + * For a free-form form, the user interface must validate the + * values that the user has typed into the text field. To aid + * with this, this method returns a "validation" property which + * contains either a regular expression or a function. The + * regular expression tests whether or not what the user has + * entered is valid. If the validation property is set to + * a function, this function would take a single + * parameter which is the text value of the input field, and + * it returns a boolean value: true if the input is valid, + * and false otherwise. If it does not make sense for a + * particular date format component to be free-form, such + * as the "AM/PM" choice for a meridiem, then the validation + * property will be left off. Only the given choices are + * valid. UI builders should only allow + * free-form fields for those components that have a + * "validation" property. Otherwise, use a constrained + * input form element instead.

              + * + * Some date format components do not represent values that + * a user may enter, but instead values that are calculated + * based on other date format components. For example, the + * day of the week is a property that is calculated based + * on the date the user has entered. It would not + * make sense for the user to be able to choose a day of + * the week that does not correspond to the day, month, and + * year they have already chosen. To handle calculated + * date format components, this method returns a "value" + * property which is a function which returns + * the calculated value of the field. Its parameter is a date + * object that has been created from the other date format + * components. Its single parameter is an object that contains + * the other date input components, similar to what you might + * pass to the DateFactory function.

              + * + * @example Here is what the result would look like for a US short + * date/time format for a leap year. This includes the components + * of day of the week, date, month, year, hour, minute, and meridiem: + * + *

              +     * [
              +     *   {
              +     *     "label": "Day of Week",   // optional label
              +     *     "value": function(date) { returns the calculated, localized day of week name }
              +     *   },
              +     *   {
              +     *     "label": " "              // fixed field (optionally displayed in the UI)
              +     *   },
              +     *   {
              +     *     "component": "month",     // property name to use when calling DateFactory() for this field
              +     *     "label": "Month",         // label describing this field, in this case translated to English/US
              +     *     "placeholder": "M",       // the placeholder text for this field
              +     *     "constraint": [1, 12],    // constraint rules for a drop-down box for the month
              +     *     "validation": "\\d{1,2}"  // validation rule for a free-form text input
              +     *   },
              +     *   {
              +     *     "label": "/"              // fixed field (optionally displayed in the UI)
              +     *   },
              +     *   {
              +     *     "component": "day",
              +     *     "label": "Date",
              +     *     "placeholder": "DD",
              +     *     "constraint": {
              +     *       "1": [1, 31],       // range from 1 to 31 inclusive
              +     *       "2": [1, 29],
              +     *       "3": [1, 31],
              +     *       "4": [1, 30],
              +     *       "5": [1, 31],
              +     *       "6": [1, 30],
              +     *       "7": [1, 31],
              +     *       "8": [1, 31],
              +     *       "9": [1, 30],
              +     *       "10": [1, 31],
              +     *       "11": [1, 30],
              +     *       "12": [1, 31]
              +     *     },
              +     *     "validation": "\\d{1,2}"
              +     *   },
              +     *   {
              +     *     "label": "/"
              +     *   },
              +     *   {
              +     *     "component": "year",
              +     *     "label": "Year",
              +     *     "placeholder": "YYYY",
              +     *     "validation": "[0-9]+"
              +     *   },
              +     *   {
              +     *     "label": " at "
              +     *   },
              +     *   {
              +     *     "component": "hour",
              +     *     "label": "Hour",
              +     *     "placeholder": "H",
              +     *     "constraint": [1, 12],
              +     *     "validation": "\\d{1,2}"
              +     *   },
              +     *   {
              +     *     "label": ":"
              +     *   },
              +     *   {
              +     *     "component": "minute",
              +     *     "label": "Minute",
              +     *     "constraint": [
              +     *       "00",                   // note that these are strings so that they can be zero-padded
              +     *       "01",
              +     *       "02",
              +     *       "03",
              +     *       "04",
              +     *       "05",
              +     *       "06",
              +     *       "07",
              +     *       "08",
              +     *       "09",
              +     *       "10",
              +     *       "11",
              +     *       ...
              +     *       "59"
              +     *     ],
              +     *     "placeholder": "mm",
              +     *     "validation": "\\d{2}"
              +     *   },
              +     *   {
              +     *     "label": " "
              +     *   },
              +     *   {
              +     *     "component": "meridiem",
              +     *     "label": "AM/PM",
              +     *     "placeholder": "AM/PM",
              +     *     "constraint": ["AM", "PM"]
              +     *   }
              +     * ]
              +     * 
              + *

              + * Note that the "minute" component comes with a preformatted list of values + * as strings, even though the minute is really a number. The preformatting + * ensures that the leading zero is not lost for minutes less than 10. + * + * @example Example of calling the getFormatInfo method + * + * // the DateFmt should be created with the locale of the date you + * // would like the user to enter. + * new DateFmt({ + * locale: 'nl-NL', // for dates in the Netherlands + * year: 2019, + * onLoad: ilib.bind(this, function(fmt) { + * // The following is the locale of the UI you would like to see the labels + * // like "Year" and "Minute" translated to. In this example, we + * // are showing an input form for Dutch dates, but the labels are + * // written in US English. + * fmt.getFormatInfo({ + * locale: "en-US", + * sync: true, + * callback: ilib.bind(this, function(components) { + * // here you should iterate through the component array and dynamically create the input + * // elements with the given labels and placeholders and such, and install + * // the appropriate validators + * })); + * }) + * }); + * + * @param {Object} options option to control this function. (See the description + * above.) + * @returns {Array.} An array of date components + */ + getFormatInfo: function(options) { + var locale, sync = true, callback, loadParams, year; + + if (options) { + sync = !!options.sync; + callback = options.onLoad; + loadParams = options.loadParams; + year = options.year; + } + + if (!year) { + var now = DateFactory({ + type: this.fmt.calName + }); + year = now.getYear(); + } + + var info, zone = false; + for (var i = 0; i < this.fmt.templateArr.length; i++) { + if (this.fmt.templateArr[i] === "z" || this.fmt.templateArr[i] === "Z") { + zone = true; + break; + } + } + + if (zone) { + TimeZone.getAvailableIds(undefined, sync, ilib.bind(this, function(tzinfo) { + var set = new ISet(tzinfo); + set.add("Etc/UTC"); + set.add("Etc/GMT"); + for (var j = 1; j < 13; j++) { + set.add("Etc/GMT+" + j); + set.add("Etc/GMT-" + j); + } + set.add("Etc/GMT-13"); + set.add("Etc/GMT-14"); + + info = this._mapFormatInfo(year, this.rb, set.asArray().sort()); + if (callback && typeof(callback) === "function") { + callback(info); + } + })); + } else { + info = this._mapFormatInfo(year, this.rb); + if (callback && typeof(callback) === "function") { + callback(info); + } + } + + return info; + } +}; + +module.exports = DateFmtInfo; diff --git a/js/lib/metafiles/ilib-demo-webpack.js b/js/lib/metafiles/ilib-demo-webpack.js index d19143191a..a5f8cc0ba9 100644 --- a/js/lib/metafiles/ilib-demo-webpack.js +++ b/js/lib/metafiles/ilib-demo-webpack.js @@ -48,6 +48,7 @@ ilib.INumber = require("../INumber.js"); ilib.NumFmt = require("../NumFmt.js"); ilib.JulianDay = require("../JulianDay.js"); ilib.DateFmt = require("../DateFmt.js"); +ilib.DateFmtInfo = require("../DateFmtInfo.js"); ilib.Calendar = require("../Calendar.js"); ilib.CalendarFactory = require("../CalendarFactory.js"); ilib.Utils = require("../Utils.js"); diff --git a/js/lib/metafiles/ilib-full-webpack.js b/js/lib/metafiles/ilib-full-webpack.js index 391897c65c..428297c77a 100644 --- a/js/lib/metafiles/ilib-full-webpack.js +++ b/js/lib/metafiles/ilib-full-webpack.js @@ -47,6 +47,7 @@ ilib.INumber = require("../INumber.js"); ilib.NumFmt = require("../NumFmt.js"); ilib.JulianDay = require("../JulianDay.js"); ilib.DateFmt = require("../DateFmt.js"); +ilib.DateFmtInfo = require("../DateFmtInfo.js"); ilib.Calendar = require("../Calendar.js"); ilib.CalendarFactory = require("../CalendarFactory.js"); ilib.Utils = require("../Utils.js"); diff --git a/js/lib/metafiles/ilib-ut-webpack.js b/js/lib/metafiles/ilib-ut-webpack.js index 201f449d3a..12bd1e06bb 100644 --- a/js/lib/metafiles/ilib-ut-webpack.js +++ b/js/lib/metafiles/ilib-ut-webpack.js @@ -48,6 +48,7 @@ ilib.INumber = require("../INumber.js"); ilib.NumFmt = require("../NumFmt.js"); ilib.JulianDay = require("../JulianDay.js"); ilib.DateFmt = require("../DateFmt.js"); +ilib.DateFmtInfo = require("../DateFmtInfo.js"); ilib.Calendar = require("../Calendar.js"); ilib.CalendarFactory = require("../CalendarFactory.js"); ilib.Utils = require("../Utils.js"); diff --git a/js/test/date/testMeridiems.js b/js/test/date/testMeridiems.js index 2a5d963e45..6152913aa5 100644 --- a/js/test/date/testMeridiems.js +++ b/js/test/date/testMeridiems.js @@ -17,1951 +17,2590 @@ * limitations under the License. */ -if (typeof(DateFmt) === "undefined") { - var DateFmt = require("../../lib/DateFmt.js"); +if (typeof(DateFmtInfo) === "undefined") { + var DateFmtInfo = require("../../lib/DateFmtInfo.js"); } + module.exports.testmeridiems = { testMeridiem_ar_EG: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-EG"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-EG"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); - test.done(); }, testMeridiem_ar_IQ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-IQ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-IQ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); - test.done(); }, testMeridiem_ar_MA: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-MA"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-MA"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); - test.done(); }, testMeridiem_as_IN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"as-IN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "as-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "পূৰ্বাহ্ন"); + test.equal(range[1].name, "অপৰাহ্ন"); - test.equal(fmt[0].name, "পূৰ্বাহ্ন"); - test.equal(fmt[1].name, "অপৰাহ্ন"); - test.done(); }, testMeridiem_bg_BG: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"bg-BG"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "bg-BG"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "пр.об."); + test.equal(range[1].name, "сл.об."); - test.equal(fmt[0].name, "пр.об."); - test.equal(fmt[1].name, "сл.об."); - test.done(); }, testMeridiem_bn_IN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"bn-IN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "bn-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_bs_Latn_BA: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"bs-Latn-BA"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "bs-Latn-BA"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "prijepodne"); + test.equal(range[1].name, "popodne"); - test.equal(fmt[0].name, "prijepodne"); - test.equal(fmt[1].name, "popodne"); - test.done(); }, testMeridiem_bs_Latn_ME: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"bs-Latn-ME"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "bs-Latn-ME"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "prijepodne"); + test.equal(range[1].name, "popodne"); - test.equal(fmt[0].name, "prijepodne"); - test.equal(fmt[1].name, "popodne"); - test.done(); }, testMeridiem_cs_CZ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"cs-CZ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "cs-CZ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "dop."); + test.equal(range[1].name, "odp."); - test.equal(fmt[0].name, "dop."); - test.equal(fmt[1].name, "odp."); - test.done(); }, testMeridiem_da_DK: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"da-DK"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "da-DK"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_de_AT: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"de-AT"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "de-AT"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); //// CLDR 34 change + test.equal(range[1].name, "PM"); //// CLDR 34 change - test.equal(fmt[0].name, "AM"); //// CLDR 34 change - test.equal(fmt[1].name, "PM"); //// CLDR 34 change - test.done(); }, testMeridiem_de_CH: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"de-CH"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "de-CH"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_de_DE: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"de-DE"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "de-DE"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_de_LU: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"de-LU"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "de-LU"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_el_CY: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"el-CY"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "el-CY"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "π.μ."); + test.equal(range[1].name, "μ.μ."); - test.equal(fmt[0].name, "π.μ."); - test.equal(fmt[1].name, "μ.μ."); - test.done(); }, testMeridiem_el_GR: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"el-GR"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "el-GR"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "π.μ."); + test.equal(range[1].name, "μ.μ."); - test.equal(fmt[0].name, "π.μ."); - test.equal(fmt[1].name, "μ.μ."); - test.done(); }, testMeridiem_en_AM: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-AM"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-AM"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_en_AU: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-AU"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-AU"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_AZ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-AZ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-AZ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_en_CA: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-CA"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-CA"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a.m."); + test.equal(range[1].name, "p.m."); - test.equal(fmt[0].name, "a.m."); - test.equal(fmt[1].name, "p.m."); - test.done(); }, testMeridiem_en_GB: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-GB"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-GB"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_GH: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-GH"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-GH"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_HK: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-HK"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-HK"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_IE: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-IE"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-IE"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a.m."); + test.equal(range[1].name, "p.m."); - test.equal(fmt[0].name, "a.m."); - test.equal(fmt[1].name, "p.m."); - test.done(); }, testMeridiem_en_IN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-IN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_IS: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-IS"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-IS"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_en_JP: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-JP"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-JP"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_en_KE: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-KE"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-KE"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_KR: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-KR"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-KR"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_en_LK: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-LK"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-LK"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_en_MM: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-MM"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-MM"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_en_MW: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-MW"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-MW"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_MY: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-MY"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-MY"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_NG: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-NG"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-NG"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_NZ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-NZ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-NZ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_PH: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-PH"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-PH"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_PR: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-PR"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-PR"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_en_SG: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-SG"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-SG"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_US: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-US"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-US"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_en_UG: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-UG"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-UG"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_ZA: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-ZA"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-ZA"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_ZM: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-ZM"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-ZM"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_es_AR: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-AR"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-AR"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_BO: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-BO"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-BO"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_CL: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-CL"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-CL"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_CO: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-CO"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-CO"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_DO: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-DO"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-DO"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_EC: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-EC"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-EC"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_ES: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-ES"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-ES"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_GT: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-GT"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-GT"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_HN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-HN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-HN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_MX: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-MX"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-MX"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_NI: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-NI"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-NI"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_PA: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-PA"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-PA"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_PE: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-PE"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-PE"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_PR: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-PR"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-PR"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_PY: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-PY"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-PY"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_SV: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-SV"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-SV"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_US: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-US"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-US"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_UY: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-UY"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-UY"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_VE: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-VE"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-VE"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_et_EE: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"et-EE"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "et-EE"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fa_AF: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fa-AF"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fa-AF"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "قبل‌ازظهر"); + test.equal(range[1].name, "بعدازظهر"); - test.equal(fmt[0].name, "قبل‌ازظهر"); - test.equal(fmt[1].name, "بعدازظهر"); - test.done(); }, testMeridiem_fa_IR: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fa-IR"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fa-IR"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "قبل‌ازظهر"); + test.equal(range[1].name, "بعدازظهر"); - test.equal(fmt[0].name, "قبل‌ازظهر"); - test.equal(fmt[1].name, "بعدازظهر"); - test.done(); }, testMeridiem_fi_FI: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fi-FI"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fi-FI"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ap."); + test.equal(range[1].name, "ip."); - test.equal(fmt[0].name, "ap."); - test.equal(fmt[1].name, "ip."); - test.done(); }, testMeridiem_fr_BE: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-BE"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-BE"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_CA: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-CA"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-CA"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a.m."); + test.equal(range[1].name, "p.m."); - test.equal(fmt[0].name, "a.m."); - test.equal(fmt[1].name, "p.m."); - test.done(); }, testMeridiem_fr_CH: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-CH"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-CH"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_FR: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-FR"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-FR"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_LU: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-LU"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-LU"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_ga_IE: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ga-IE"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ga-IE"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "r.n."); + test.equal(range[1].name, "i.n."); - test.equal(fmt[0].name, "r.n."); - test.equal(fmt[1].name, "i.n."); - test.done(); }, testMeridiem_gu_IN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"gu-IN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "gu-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_he_IL: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"he-IL"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "he-IL"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "לפנה״צ"); + test.equal(range[1].name, "אחה״צ"); - test.equal(fmt[0].name, "לפנה״צ"); - test.equal(fmt[1].name, "אחה״צ"); - test.done(); }, testMeridiem_hi_IN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"hi-IN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "पूर्वाह्न"); - test.equal(fmt[1].name, "अपराह्न"); + var fmtinfo = new DateFmtInfo({locale: "hi-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "पूर्वाह्न"); + test.equal(range[1].name, "अपराह्न"); test.done(); }, testMeridiem_hr_HR: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"hr-HR"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "hr-HR"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_hr_ME: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"hr-ME"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "hr-ME"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_hr_HU: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"hr-HU"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "hr-HU"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_id_ID: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"id-ID"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "id-ID"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_is_IS: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"is-IS"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "is-IS"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "f.h."); + test.equal(range[1].name, "e.h."); - test.equal(fmt[0].name, "f.h."); - test.equal(fmt[1].name, "e.h."); - test.done(); }, testMeridiem_it_CH: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"it-CH"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "it-CH"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_it_IT: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"it-IT"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "it-IT"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_ja_JP: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ja-JP"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ja-JP"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "午前"); + test.equal(range[1].name, "午後"); - test.equal(fmt[0].name, "午前"); - test.equal(fmt[1].name, "午後"); - test.done(); }, testMeridiem_kk_KZ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"kk-KZ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "kk-KZ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_kn_IN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"kn-IN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "ಪೂರ್ವಾಹ್ನ"); - test.equal(fmt[1].name, "ಅಪರಾಹ್ನ"); + var fmtinfo = new DateFmtInfo({locale: "kn-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ಪೂರ್ವಾಹ್ನ"); + test.equal(range[1].name, "ಅಪರಾಹ್ನ"); test.done(); }, testMeridiem_ko_KR: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ko-KR"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ko-KR"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "오전"); + test.equal(range[1].name, "오후"); - test.equal(fmt[0].name, "오전"); - test.equal(fmt[1].name, "오후"); - test.done(); }, testMeridiem_ku_IQ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ku-IQ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ku-IQ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ب.ن"); + test.equal(range[1].name, "د.ن"); - test.equal(fmt[0].name, "ب.ن"); - test.equal(fmt[1].name, "د.ن"); - test.done(); }, testMeridiem_lt_LT: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"lt-LT"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "lt-LT"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "priešpiet"); + test.equal(range[1].name, "popiet"); - test.equal(fmt[0].name, "priešpiet"); - test.equal(fmt[1].name, "popiet"); - test.done(); }, testMeridiem_lv_LV: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"lv-LV"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "lv-LV"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "priekšpusdienā"); + test.equal(range[1].name, "pēcpusdienā"); - test.equal(fmt[0].name, "priekšpusdienā"); - test.equal(fmt[1].name, "pēcpusdienā"); - test.done(); }, testMeridiem_mk_MK: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"mk-MK"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "mk-MK"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "претпладне"); + test.equal(range[1].name, "попладне"); - test.equal(fmt[0].name, "претпладне"); - test.equal(fmt[1].name, "попладне"); - test.done(); }, testMeridiem_ml_IN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ml-IN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ml-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_mr_IN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"mr-IN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "mr-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "म.पू."); + test.equal(range[1].name, "म.उ."); - test.equal(fmt[0].name, "म.पू."); - test.equal(fmt[1].name, "म.उ."); - test.done(); }, testMeridiem_ms_MY: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ms-MY"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ms-MY"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "PG"); + test.equal(range[1].name, "PTG"); - test.equal(fmt[0].name, "PG"); - test.equal(fmt[1].name, "PTG"); - test.done(); }, testMeridiem_nb_NO: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"nb-NO"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "nb-NO"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a.m."); + test.equal(range[1].name, "p.m."); - test.equal(fmt[0].name, "a.m."); - test.equal(fmt[1].name, "p.m."); - test.done(); }, testMeridiem_nl_BE: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"nl-BE"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "nl-BE"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a.m."); + test.equal(range[1].name, "p.m."); - test.equal(fmt[0].name, "a.m."); - test.equal(fmt[1].name, "p.m."); - test.done(); }, testMeridiem_nl_NL: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"nl-NL"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "nl-NL"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a.m."); + test.equal(range[1].name, "p.m."); - test.equal(fmt[0].name, "a.m."); - test.equal(fmt[1].name, "p.m."); - test.done(); }, testMeridiem_pa_Guru_IN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"pa-Guru-IN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "pa-Guru-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ਪੂ.ਦੁ."); + test.equal(range[1].name, "ਬਾ.ਦੁ."); - test.equal(fmt[0].name, "ਪੂ.ਦੁ."); - test.equal(fmt[1].name, "ਬਾ.ਦੁ."); - test.done(); }, testMeridiem_pl_PL: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"pl-PL"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "pl-PL"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_pt_BR: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"pt-BR"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "pt-BR"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_pt_PT: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"pt-PT"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "pt-PT"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "da manhã"); + test.equal(range[1].name, "da tarde"); - test.equal(fmt[0].name, "da manhã"); - test.equal(fmt[1].name, "da tarde"); - test.done(); }, testMeridiem_ro_RO: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ro-RO"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ro-RO"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a.m."); + test.equal(range[1].name, "p.m."); - test.equal(fmt[0].name, "a.m."); - test.equal(fmt[1].name, "p.m."); - test.done(); }, testMeridiem_sr_Cyrl_RS: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"sr-Cyrl-RS"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "sr-Cyrl-RS"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "пре подне"); + test.equal(range[1].name, "по подне"); - test.equal(fmt[0].name, "пре подне"); - test.equal(fmt[1].name, "по подне"); - test.done(); }, testMeridiem_sr_Latn_RS: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"sr-Latn-RS"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "sr-Latn-RS"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "pre podne"); + test.equal(range[1].name, "po podne"); - test.equal(fmt[0].name, "pre podne"); - test.equal(fmt[1].name, "po podne"); - test.done(); }, testMeridiem_ru_BY: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ru-BY"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ru-BY"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_ru_KG: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ru-KG"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ru-KG"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_ru_KZ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ru-KZ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ru-KZ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_ru_GE: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ru-GE"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ru-GE"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_ru_RU: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ru-RU"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ru-RU"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_ru_UA: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ru-UA"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ru-UA"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_sk_SK: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"sk-SK"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "sk-SK"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_sl_SI: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"sl-SI"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "sl-SI"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "dop."); + test.equal(range[1].name, "pop."); - test.equal(fmt[0].name, "dop."); - test.equal(fmt[1].name, "pop."); - test.done(); }, testMeridiem_sq_AL: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"sq-AL"}); - test.ok(fmt !== null); - test.equal(fmt[0].name, "e paradites"); - test.equal(fmt[1].name, "e pasdites"); - + var fmtinfo = new DateFmtInfo({locale: "sq-AL"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + test.equal(range[0].name, "e paradites"); + test.equal(range[1].name, "e pasdites"); + test.done(); }, testMeridiem_sq_ME: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"sq-ME"}); - test.ok(fmt !== null); - test.equal(fmt[0].name, "e paradites"); - test.equal(fmt[1].name, "e pasdites"); - + var fmtinfo = new DateFmtInfo({locale: "sq-ME"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + test.equal(range[0].name, "e paradites"); + test.equal(range[1].name, "e pasdites"); + test.done(); }, testMeridiem_sv_FI: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"sv-FI"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "sv-FI"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "fm"); + test.equal(range[1].name, "em"); - test.equal(fmt[0].name, "fm"); - test.equal(fmt[1].name, "em"); - test.done(); }, testMeridiem_sv_SE: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"sv-SE"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "sv-SE"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "fm"); + test.equal(range[1].name, "em"); - test.equal(fmt[0].name, "fm"); - test.equal(fmt[1].name, "em"); - test.done(); }, testMeridiem_ta_IN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ta-IN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ta-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "முற்பகல்"); + test.equal(range[1].name, "பிற்பகல்"); - test.equal(fmt[0].name, "முற்பகல்"); - test.equal(fmt[1].name, "பிற்பகல்"); - test.done(); }, testMeridiem_te_IN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"te-IN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "te-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_th_TH: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"th-TH"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "th-TH"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ก่อนเที่ยง"); + test.equal(range[1].name, "หลังเที่ยง"); - test.equal(fmt[0].name, "ก่อนเที่ยง"); - test.equal(fmt[1].name, "หลังเที่ยง"); - test.done(); }, testMeridiem_tr_AM: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"tr-AM"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "tr-AM"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ÖÖ"); + test.equal(range[1].name, "ÖS"); - test.equal(fmt[0].name, "ÖÖ"); - test.equal(fmt[1].name, "ÖS"); - test.done(); }, testMeridiem_tr_AZ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"tr-AZ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "tr-AZ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ÖÖ"); + test.equal(range[1].name, "ÖS"); - test.equal(fmt[0].name, "ÖÖ"); - test.equal(fmt[1].name, "ÖS"); - test.done(); }, testMeridiem_tr_CY: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"tr-CY"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "tr-CY"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ÖÖ"); + test.equal(range[1].name, "ÖS"); - test.equal(fmt[0].name, "ÖÖ"); - test.equal(fmt[1].name, "ÖS"); - test.done(); }, testMeridiem_tr_TR: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"tr-TR"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "tr-TR"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ÖÖ"); + test.equal(range[1].name, "ÖS"); - test.equal(fmt[0].name, "ÖÖ"); - test.equal(fmt[1].name, "ÖS"); - test.done(); }, testMeridiem_uk_UA: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"uk-UA"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "uk-UA"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "дп"); + test.equal(range[1].name, "пп"); - test.equal(fmt[0].name, "дп"); - test.equal(fmt[1].name, "пп"); - test.done(); }, testMeridiem_ur_IN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ur-IN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ur-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_uz_Latn_UZ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"uz-Latn-UZ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "uz-Latn-UZ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "TO"); + test.equal(range[1].name, "TK"); - test.equal(fmt[0].name, "TO"); - test.equal(fmt[1].name, "TK"); - test.done(); }, testMeridiem_vi_VN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"vi-VN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "vi-VN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "SA"); + test.equal(range[1].name, "CH"); - test.equal(fmt[0].name, "SA"); - test.equal(fmt[1].name, "CH"); - test.done(); }, testMeridiem_zh_Hans_CN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"zh-Hans-CN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "zh-Hans-CN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "上午"); + test.equal(range[1].name, "下午"); - test.equal(fmt[0].name, "上午"); - test.equal(fmt[1].name, "下午"); - test.done(); }, testMeridiem_zh_Hant_HK: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"zh-Hant-HK"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "zh-Hant-HK"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "上午"); + test.equal(range[1].name, "下午"); - test.equal(fmt[0].name, "上午"); - test.equal(fmt[1].name, "下午"); - test.done(); }, testMeridiem_zh_Hant_TW: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"zh-Hant-TW"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "zh-Hant-TW"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "上午"); + test.equal(range[1].name, "下午"); - test.equal(fmt[0].name, "上午"); - test.equal(fmt[1].name, "下午"); - test.done(); }, testMeridiem_en_GE: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-GE"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-GE"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_en_CN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-CN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-CN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_en_MX: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-MX"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-MX"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_en_TW: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-TW"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-TW"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_mn_MN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"mn-MN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "mn-MN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ү.ө."); + test.equal(range[1].name, "ү.х."); - test.equal(fmt[0].name, "ү.ө."); - test.equal(fmt[1].name, "ү.х."); - test.done(); }, testMeridiem_es_CA: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-CA"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-CA"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_af_ZA: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"af-ZA"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "af-ZA"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "vm."); + test.equal(range[1].name, "nm."); - test.equal(fmt[0].name, "vm."); - test.equal(fmt[1].name, "nm."); - test.done(); }, testMeridiem_am_ET: function(test) { test.expect(16); - var fmt = DateFmt.getMeridiemsRange({locale:"am-ET", meridiems: "ethiopic"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "am-ET", meridiems: "ethiopic"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ጥዋት"); + test.equal(range[0].start, "00:00"); + test.equal(range[0].end, "05:59"); - test.equal(fmt[0].name, "ጥዋት"); - test.equal(fmt[0].start, "00:00"); - test.equal(fmt[0].end, "05:59"); + test.equal(range[1].name, "ቀትር"); + test.equal(range[1].start, "06:00"); + test.equal(range[1].end, "06:00"); - test.equal(fmt[1].name, "ቀትር"); - test.equal(fmt[1].start, "06:00"); - test.equal(fmt[1].end, "06:00"); + test.equal(range[2].name, "ከሰዓት"); + test.equal(range[2].start, "06:01"); + test.equal(range[2].end, "11:59"); - test.equal(fmt[2].name, "ከሰዓት"); - test.equal(fmt[2].start, "06:01"); - test.equal(fmt[2].end, "11:59"); + test.equal(range[3].name, "ከምሽቱ"); + test.equal(range[3].start, "12:00"); + test.equal(range[3].end, "17:59"); - test.equal(fmt[3].name, "ከምሽቱ"); - test.equal(fmt[3].start, "12:00"); - test.equal(fmt[3].end, "17:59"); + test.equal(range[4].name, "ከሌሊቱ"); + test.equal(range[4].start, "18:00"); + test.equal(range[4].end, "23:59"); - test.equal(fmt[4].name, "ከሌሊቱ"); - test.equal(fmt[4].start, "18:00"); - test.equal(fmt[4].end, "23:59"); - test.done(); }, testMeridiem_ha_Latn_NG: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ha-Latn-NG"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ha-Latn-NG"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_or_IN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"or-IN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "or-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_az_Latn_AZ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"az-Latn-AZ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "az-Latn-AZ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_km_KH: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"km-KH"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "km-KH"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_si_LK: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"si-LK"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "si-LK"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "පෙ.ව."); + test.equal(range[1].name, "ප.ව."); - test.equal(fmt[0].name, "පෙ.ව."); - test.equal(fmt[1].name, "ප.ව."); - test.done(); }, testMeridiem_ar_AE: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-AE"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-AE"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); - test.done(); }, testMeridiem_ar_BH: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-BH"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-BH"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); - test.done(); }, testMeridiem_ar_DJ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-DJ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-DJ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); - test.done(); }, testMeridiem_ar_DZ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-DZ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-DZ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); - test.done(); }, testMeridiem_ar_JO: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-JO"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-JO"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); - test.done(); }, testMeridiem_ar_KW: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-KW"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-KW"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); - test.done(); }, testMeridiem_ar_LB: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-LB"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-LB"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); - test.done(); }, testMeridiem_ar_LY: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-LY"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-LY"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); - test.done(); }, testMeridiem_ar_MR: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-MR"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-MR"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); - test.done(); }, testMeridiem_ar_OM: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-OM"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-OM"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); - test.done(); }, testMeridiem_ar_QA: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-QA"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-QA"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); - test.done(); }, testMeridiem_ar_SA: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-SA"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-SA"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); test.done(); }, testMeridiem_ar_SD: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-SD"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-SD"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); - test.done(); }, testMeridiem_ar_SY: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-SY"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-SY"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); - test.done(); }, testMeridiem_ar_TN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-TN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-TN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); test.done(); }, testMeridiem_ar_YE: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ar-YE"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ar-YE"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); - test.equal(fmt[0].name, "ص"); - test.equal(fmt[1].name, "م"); + test.equal(range[0].name, "ص"); + test.equal(range[1].name, "م"); test.done(); }, testMeridiem_en_ET: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-ET"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-ET"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_en_GM: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-GM"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-GM"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_LR: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-LR"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-LR"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_PK: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-PK"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-PK"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_RW: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-RW"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-RW"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_SD: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-SD"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-SD"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_SL: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-SL"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-SL"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_en_TZ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"en-TZ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "en-TZ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); - test.equal(fmt[0].name, "am"); - test.equal(fmt[1].name, "pm"); - test.done(); }, testMeridiem_es_CR: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-CR"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-CR"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_GQ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-GQ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-GQ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_es_PH: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"es-PH"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "es-PH"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); - test.done(); }, testMeridiem_fr_BF: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-BF"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-BF"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_BJ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-BJ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-BJ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_CD: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-CD"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-CD"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_CF: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-CF"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-CF"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_CG: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-CG"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-CG"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_CI: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-CI"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-CI"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_CM: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-CM"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-CM"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "matin"); + test.equal(range[1].name, "soir"); - test.equal(fmt[0].name, "matin"); - test.equal(fmt[1].name, "soir"); - test.done(); }, testMeridiem_fr_GQ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-GQ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-GQ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_DJ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-DJ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-DJ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_DZ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-DZ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-DZ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_GA: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-GA"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-GA"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_GN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-GN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-GN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_LB: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-LB"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-LB"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_ML: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-ML"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-ML"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_RW: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-RW"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-RW"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_SN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-SN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-SN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_fr_TG: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"fr-TG"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "fr-TG"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_ms_SG: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ms-SG"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ms-SG"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "PG"); + test.equal(range[1].name, "PTG"); - test.equal(fmt[0].name, "PG"); - test.equal(fmt[1].name, "PTG"); - test.done(); }, testMeridiem_pa_PK: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"pa-PK"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "ਪੂ.ਦੁ."); - test.equal(fmt[1].name, "ਬਾ.ਦੁ."); - + var fmtinfo = new DateFmtInfo({locale: "pa-PK"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ਪੂ.ਦੁ."); + test.equal(range[1].name, "ਬਾ.ਦੁ."); + test.done(); }, testMeridiem_pt_AO: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"pt-AO"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "pt-AO"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "da manhã"); + test.equal(range[1].name, "da tarde"); - test.equal(fmt[0].name, "da manhã"); - test.equal(fmt[1].name, "da tarde"); - test.done(); }, testMeridiem_pt_GQ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"pt-GQ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "pt-GQ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "da manhã"); + test.equal(range[1].name, "da tarde"); - test.equal(fmt[0].name, "da manhã"); - test.equal(fmt[1].name, "da tarde"); - test.done(); }, testMeridiem_pt_CV: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"pt-CV"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "pt-CV"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "da manhã"); + test.equal(range[1].name, "da tarde"); - test.equal(fmt[0].name, "da manhã"); - test.equal(fmt[1].name, "da tarde"); - test.done(); }, testMeridiem_ur_PK: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ur-PK"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ur-PK"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); }, testMeridiem_zh_Hans_SG: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"zh-Hans-SG"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "zh-Hans-SG"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "上午"); + test.equal(range[1].name, "下午"); - test.equal(fmt[0].name, "上午"); - test.equal(fmt[1].name, "下午"); - test.done(); }, testMeridiem_zh_Hans_MY: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"zh-Hans-MY"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "zh-Hans-MY"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "上午"); + test.equal(range[1].name, "下午"); + + test.done(); + }, + + testGetMeridiemsRangeLength_with_am_ET_locale: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "am-ET"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range.length, 5); + test.done(); + }, + + testGetMeridiemsRangeName_with_am_ET_locale: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "am-ET"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ጥዋት"); + test.done(); + }, + + testGetMeridiemsRangeStart_with_am_ET_locale: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "am-ET"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); - test.equal(fmt[0].name, "上午"); - test.equal(fmt[1].name, "下午"); - + test.equal(range[0].start, "00:00"); test.done(); - } + }, + + testGetMeridiemsRangeEnd_with_am_ET_locale: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "am-ET"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].end, "05:59"); + test.done(); + }, + + testGetMeridiemsRangeLength_with_am_ET_locale_gregorian_meridiems: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "am-ET", meridiems: "gregorian"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range.length, 2); + test.done(); + }, + + testGetMeridiemsRangeName_with_am_ET_locale_gregorian_meridiems: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "am-ET", meridiems: "gregorian"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ጥዋት"); + test.done(); + }, + + testGetMeridiemsRangeStart_with_am_ET_locale_gregorian_meridiems: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "am-ET", meridiems: "gregorian"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].start, "00:00"); + test.done(); + }, + + testGetMeridiemsRangeEnd_with_am_ET_locale_gregorian_meridiems: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "am-ET", meridiems: "gregorian"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].end, "11:59"); + test.done(); + }, + + testGetMeridiemsRangeLength_with_am_ET_locale_ethiopic_meridiems: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "am-ET", meridiems: "ethiopic"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range.length, 5); + test.done(); + }, + + testGetMeridiemsRangeName_with_am_ET_locale_ethiopic_meridiems: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "am-ET", meridiems: "ethiopic"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ጥዋት"); + test.done(); + }, + + testGetMeridiemsRangeStart_with_am_ET_locale_ethiopic_meridiems: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "am-ET", meridiems: "ethiopic"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].start, "00:00"); + test.done(); + }, + + testGetMeridiemsRangeEnd_with_am_ET_locale_ethiopic_meridiems: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "am-ET", meridiems: "ethiopic"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].end, "05:59"); + test.done(); + }, + + testGetMeridiemsRangeLength_with_zh_CN_locale: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "zh-CN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range.length, 2); + test.done(); + }, + + testGetMeridiemsRangeName_with_zh_CN_locale: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "zh-CN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "上午"); + test.done(); + }, + + testGetMeridiemsRangeStart_with_zh_CN_locale: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "zh-CN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].start, "00:00"); + test.done(); + }, + + testGetMeridiemsRangeEnd_with_zh_CN_locale: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "zh-CN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].end, "11:59"); + test.done(); + }, + + testGetMeridiemsRangeLength_with_zh_CN_locale_gregorian_meridiems: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "zh-CN", meridiems: "gregorian"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range.length, 2); + test.done(); + }, + + testGetMeridiemsRangeName_with_zh_CN_locale_gregorian_meridiems: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "zh-CN", meridiems: "gregorian"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "上午"); + test.done(); + }, + + testGetMeridiemsRangeStart_with_zh_CN_locale_gregorian_meridiems: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "zh-CN", meridiems: "gregorian"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].start, "00:00"); + test.done(); + }, + + testGetMeridiemsRangeEnd_with_zh_CN_locale_gregorian_meridiems: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "zh-CN", meridiems: "gregorian"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].end, "11:59"); + test.done(); + }, + + testGetMeridiemsRangeLength_with_zh_CN_locale_chinese_meridiems: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "zh-CN", meridiems: "chinese"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range.length, 7); + test.done(); + }, + + testGetMeridiemsRangeName_with_zh_CN_locale_chinese_meridiems: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "zh-CN", meridiems: "chinese"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "凌晨"); + test.done(); + }, + + testGetMeridiemsRangeStart_with_zh_CN_locale_chinese_meridiems: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "zh-CN", meridiems: "chinese"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].start, "00:00"); + test.done(); + }, + + testGetMeridiemsRangeEnd_with_zh_CN_locale_chinese_meridiems: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "zh-CN", meridiems: "chinese"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].end, "05:59"); + test.done(); + }, + + testGetMeridiemsRangeLength_with_en_US_locale: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "en-US"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range.length, 2); + test.done(); + }, + + testGetMeridiemsRangeName_with_en_US_locale: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "en-US"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.done(); + }, + + testGetMeridiemsRangeStart_with_en_US_locale: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "en-US"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].start, "00:00"); + test.done(); + }, + + testGetMeridiemsRangeEnd_with_en_US_locale: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({locale: "en-US"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].end, "11:59"); + test.done(); + }, + + testGetMeridiemsRangeName_with_bn_IN_locale: function(test) { + test.expect(3); + var fmtinfo = new DateFmtInfo({locale: "bn-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); + test.done(); + }, + + testGetMeridiemsRangeName_with_gu_IN_locale: function(test) { + test.expect(3); + var fmtinfo = new DateFmtInfo({locale: "gu-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); + test.done(); + }, + testGetMeridiemsRangeName_with_kn_IN_locale: function(test) { + test.expect(3); + var fmtinfo = new DateFmtInfo({locale: "kn-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ಪೂರ್ವಾಹ್ನ"); + test.equal(range[1].name, "ಅಪರಾಹ್ನ"); + test.done(); + }, + testGetMeridiemsRangeName_with_ml_IN_locale: function(test) { + test.expect(3); + var fmtinfo = new DateFmtInfo({locale: "ml-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); + test.done(); + }, + testGetMeridiemsRangeName_with_mr_IN_locale: function(test) { + test.expect(3); + var fmtinfo = new DateFmtInfo({locale: "mr-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "म.पू."); + test.equal(range[1].name, "म.उ."); + test.done(); + }, + testGetMeridiemsRangeName_with_or_IN_locale: function(test) { + test.expect(3); + var fmtinfo = new DateFmtInfo({locale: "or-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); + test.done(); + }, + testGetMeridiemsRangeName_with_pa_IN_locale: function(test) { + test.expect(3); + var fmtinfo = new DateFmtInfo({locale: "pa-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "ਪੂ.ਦੁ."); + test.equal(range[1].name, "ਬਾ.ਦੁ."); + test.done(); + }, + testGetMeridiemsRangeName_with_ta_IN_locale: function(test) { + test.expect(3); + var fmtinfo = new DateFmtInfo({locale: "ta-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "முற்பகல்"); + test.equal(range[1].name, "பிற்பகல்"); + test.done(); + }, + testGetMeridiemsRangeName_with_te_IN_locale: function(test) { + test.expect(3); + var fmtinfo = new DateFmtInfo({locale: "te-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); + test.done(); + }, + testGetMeridiemsRangeName_with_ur_IN_locale: function(test) { + test.expect(3); + var fmtinfo = new DateFmtInfo({locale: "ur-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); + test.done(); + }, + testGetMeridiemsRangeName_with_as_IN_locale: function(test) { + test.expect(3); + var fmtinfo = new DateFmtInfo({locale: "as-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, 'পূৰ্বাহ্ন'); + test.equal(range[1].name, 'অপৰাহ্ন'); + test.done(); + }, + testGetMeridiemsRangeName_with_hi_IN_locale: function(test) { + test.expect(3); + var fmtinfo = new DateFmtInfo({locale: "hi-IN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "पूर्वाह्न"); + test.equal(range[1].name, "अपराह्न"); + test.done(); + }, + + testGetMeridiemsRangeName_with_ur_PK_locale: function(test) { + test.expect(3); + var fmtinfo = new DateFmtInfo({locale: "ur-PK"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range !== null); + + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); + test.done(); + }, + + testGetMeridiemsRange_with_noArgument: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo(); + test.ok(fmtinfo !== null); + var mdRange = fmtinfo.getMeridiemsRange(); + // if locale is not specified, DateFmt takes default locale. + test.ok("getMeridiemsRange should return length value greater than 0", mdRange.length > 0); + test.done(); + }, + + testGetMeridiemsRange_with_undefined_locale: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({ locale: undefined }); + test.ok(fmtinfo !== null); + + var mdRange = fmtinfo.getMeridiemsRange(); + // if locale is not specified, DateFmt takes default locale. + test.ok("getMeridiemsRange should return length value greater than 0", mdRange.length > 0); + test.done(); + }, + + testGetMeridiemsRange_with_wrong_locale: function(test) { + test.expect(2); + var fmtinfo = new DateFmtInfo({ locale: "wrong" }); + test.ok(fmtinfo !== null); + + var mdRange = fmtinfo.getMeridiemsRange(); + // if locale is specified wrong value, DateFmt takes default locale. + test.ok("getMeridiemsRange should return length value greater than 0", mdRange.length > 0); + test.done(); + }, } diff --git a/js/test/date/testSuiteFiles.js b/js/test/date/testSuiteFiles.js index 560c1493c0..cae45bb5fd 100644 --- a/js/test/date/testSuiteFiles.js +++ b/js/test/date/testSuiteFiles.js @@ -18,7 +18,7 @@ */ module.exports.files = [ - "testgetformatinfo.js", + "testdatefmtinfo.js", "testclock.js", "testcalendar.js", "testdate.js", diff --git a/js/test/date/testdatefmt.js b/js/test/date/testdatefmt.js index bf8bc2f2bf..339fbcad4d 100644 --- a/js/test/date/testdatefmt.js +++ b/js/test/date/testdatefmt.js @@ -972,127 +972,6 @@ module.exports.testdatefmt = { test.done(); }, - testDateFmtGetMonthsOfYear1: function(test) { - test.expect(2); - var fmt = new DateFmt({locale: "en-US"}); - test.ok(fmt !== null); - - var arrMonths = fmt.getMonthsOfYear(); - var expected = [undefined, "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]; - test.deepEqual(arrMonths, expected); - test.done(); - }, - - testDateFmtGetMonthsOfYear2: function(test) { - test.expect(2); - var fmt = new DateFmt({locale: "en-US"}); - test.ok(fmt !== null); - - var arrMonths = fmt.getMonthsOfYear({length: "long"}); - var expected = [undefined, "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; - test.deepEqual(arrMonths, expected); - test.done(); - }, - - testDateFmtGetMonthsOfYearThai: function(test) { - test.expect(2); - // uses ThaiSolar calendar - var fmt = new DateFmt({locale: "th-TH"}); - test.ok(fmt !== null); - - var arrMonths = fmt.getMonthsOfYear({length: "long"}); - - var expected = [undefined, "ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."]; - test.deepEqual(arrMonths, expected); - test.done(); - }, - - testDateFmtGetMonthsOfYearLeapYear: function(test) { - test.expect(2); - var d = DateFactory({type: "hebrew", locale: "en-US", year: 5774, month: 1, day: 1}); - var fmt = new DateFmt({date: "en-US", calendar: "hebrew"}); - test.ok(fmt !== null); - - var arrMonths = fmt.getMonthsOfYear({length: "long", date: d}); - - var expected = [undefined, "Nis", "Iyy", "Siv", "Tam", "Av", "Elu", "Tis", "Ḥes", "Kis", "Tev", "She", "Ada", "Ad2"]; - test.deepEqual(arrMonths, expected); - test.done(); - }, - - testDateFmtGetMonthsOfYearNonLeapYear: function(test) { - test.expect(2); - var d = DateFactory({type: "hebrew", locale: "en-US", year: 5775, month: 1, day: 1}); - var fmt = new DateFmt({date: "en-US", calendar: "hebrew"}); - test.ok(fmt !== null); - - var arrMonths = fmt.getMonthsOfYear({length: "long", date: d}); - - var expected = [undefined, "Nis", "Iyy", "Siv", "Tam", "Av", "Elu", "Tis", "Ḥes", "Kis", "Tev", "She", "Ada"]; - test.deepEqual(arrMonths, expected); - test.done(); - }, - - testDateFmtGetDaysOfWeek1: function(test) { - test.expect(2); - var fmt = new DateFmt({locale: "en-US"}); - test.ok(fmt !== null); - - var arrDays = fmt.getDaysOfWeek(); - - var expected = ["S", "M", "T", "W", "T", "F", "S"]; - test.deepEqual(arrDays, expected); - test.done(); - }, - - testDateFmtGetDaysOfWeek2: function(test) { - test.expect(2); - var fmt = new DateFmt({locale: "en-US"}); - test.ok(fmt !== null); - - var arrDays = fmt.getDaysOfWeek({length: 'long'}); - var expected = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; - test.deepEqual(arrDays, expected); - test.done(); - }, - - testDateFmtGetDaysOfWeekOtherCalendar: function(test) { - test.expect(2); - var fmt = new DateFmt({locale: "en-US", calendar: "hebrew"}); - test.ok(fmt !== null); - - var arrDays = fmt.getDaysOfWeek({length: 'long'}); - - var expected = ["ris", "she", "shl", "rvi", "ḥam", "shi", "sha"]; - test.deepEqual(arrDays, expected); - test.done(); - }, - - testDateFmtGetDaysOfWeekThai: function(test) { - test.expect(2); - var fmt = new DateFmt({locale: "th-TH", calendar: "thaisolar"}); - test.ok(fmt !== null); - - var arrDays = fmt.getDaysOfWeek({length: 'long'}); - - var expected = ["อา.", "จ.", "อ.", "พ.", "พฤ.", "ศ.", "ส."]; - test.deepEqual(arrDays, expected); - test.done(); - }, - - testDateFmtGetDaysOfWeekThaiInEnglish: function(test) { - test.expect(2); - var fmt = new DateFmt({locale: "en-US", calendar: "thaisolar"}); - test.ok(fmt !== null); - - var arrDays = fmt.getDaysOfWeek({length: 'long'}); - - var expected = ["ath", "cha", "ang", "phu", "phr", "suk", "sao"]; - test.deepEqual(arrDays, expected); - test.done(); - }, - - testDateFmtWeekYear1: function(test) { test.expect(2); var fmt = new DateFmt({template: "w"}); @@ -3285,410 +3164,6 @@ module.exports.testdatefmt = { test.done(); }, - testDateFmtGetMeridiemsRangeLength_with_am_ET_locale: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET"}); - test.ok(fmt !== null); - - test.equal(fmt.length, 5); - test.done(); - }, - - testDateFmtGetMeridiemsRangeName_with_am_ET_locale: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "ጥዋት"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeStart_with_am_ET_locale: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET"}); - test.ok(fmt !== null); - - test.equal(fmt[0].start, "00:00"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeEnd_with_am_ET_locale: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET"}); - test.ok(fmt !== null); - - test.equal(fmt[0].end, "05:59"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeLength_with_am_ET_locale_gregorian_meridiems: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "gregorian"}); - test.ok(fmt !== null); - - test.equal(fmt.length, 2); - test.done(); - }, - - testDateFmtGetMeridiemsRangeName_with_am_ET_locale_gregorian_meridiems: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "gregorian"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "ጥዋት"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeStart_with_am_ET_locale_gregorian_meridiems: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "gregorian"}); - test.ok(fmt !== null); - - test.equal(fmt[0].start, "00:00"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeEnd_with_am_ET_locale_gregorian_meridiems: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "gregorian"}); - test.ok(fmt !== null); - - test.equal(fmt[0].end, "11:59"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeLength_with_am_ET_locale_ethiopic_meridiems: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "ethiopic"}); - test.ok(fmt !== null); - - test.equal(fmt.length, 5); - test.done(); - }, - - testDateFmtGetMeridiemsRangeName_with_am_ET_locale_ethiopic_meridiems: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "ethiopic"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "ጥዋት"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeStart_with_am_ET_locale_ethiopic_meridiems: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "ethiopic"}); - test.ok(fmt !== null); - - test.equal(fmt[0].start, "00:00"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeEnd_with_am_ET_locale_ethiopic_meridiems: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "am-ET", meridiems: "ethiopic"}); - test.ok(fmt !== null); - - test.equal(fmt[0].end, "05:59"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeLength_with_zh_CN_locale: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN"}); - test.ok(fmt !== null); - - test.equal(fmt.length, 2); - test.done(); - }, - - testDateFmtGetMeridiemsRangeName_with_zh_CN_locale: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "上午"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeStart_with_zh_CN_locale: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].start, "00:00"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeEnd_with_zh_CN_locale: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].end, "11:59"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeLength_with_zh_CN_locale_gregorian_meridiems: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "gregorian"}); - test.ok(fmt !== null); - - test.equal(fmt.length, 2); - test.done(); - }, - - testDateFmtGetMeridiemsRangeName_with_zh_CN_locale_gregorian_meridiems: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "gregorian"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "上午"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeStart_with_zh_CN_locale_gregorian_meridiems: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "gregorian"}); - test.ok(fmt !== null); - - test.equal(fmt[0].start, "00:00"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeEnd_with_zh_CN_locale_gregorian_meridiems: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "gregorian"}); - test.ok(fmt !== null); - - test.equal(fmt[0].end, "11:59"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeLength_with_zh_CN_locale_chinese_meridiems: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "chinese"}); - test.ok(fmt !== null); - - test.equal(fmt.length, 7); - test.done(); - }, - - testDateFmtGetMeridiemsRangeName_with_zh_CN_locale_chinese_meridiems: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "chinese"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "凌晨"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeStart_with_zh_CN_locale_chinese_meridiems: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "chinese"}); - test.ok(fmt !== null); - - test.equal(fmt[0].start, "00:00"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeEnd_with_zh_CN_locale_chinese_meridiems: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "zh-CN", meridiems: "chinese"}); - test.ok(fmt !== null); - - test.equal(fmt[0].end, "05:59"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeLength_with_en_US_locale: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "en-US"}); - test.ok(fmt !== null); - - test.equal(fmt.length, 2); - test.done(); - }, - - testDateFmtGetMeridiemsRangeName_with_en_US_locale: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "en-US"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "AM"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeStart_with_en_US_locale: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({ locale: "en-US"}); - test.ok(fmt !== null); - - test.equal(fmt[0].start, "00:00"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeEnd_with_en_US_locale: function(test) { - test.expect(2); - var fmt = DateFmt.getMeridiemsRange({locale: "en-US"}); - test.ok(fmt !== null); - - test.equal(fmt[0].end, "11:59"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeName_with_bn_IN_locale: function(test) { - test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale: "bn-IN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeName_with_gu_IN_locale: function(test) { - test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale: "gu-IN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); - }, - testDateFmtGetMeridiemsRangeName_with_kn_IN_locale: function(test) { - test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale: "kn-IN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "ಪೂರ್ವಾಹ್ನ"); - test.equal(fmt[1].name, "ಅಪರಾಹ್ನ"); - test.done(); - }, - testDateFmtGetMeridiemsRangeName_with_ml_IN_locale: function(test) { - test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale: "ml-IN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); - }, - testDateFmtGetMeridiemsRangeName_with_mr_IN_locale: function(test) { - test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale: "mr-IN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "म.पू."); - test.equal(fmt[1].name, "म.उ."); - test.done(); - }, - testDateFmtGetMeridiemsRangeName_with_or_IN_locale: function(test) { - test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale: "or-IN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); - }, - testDateFmtGetMeridiemsRangeName_with_pa_IN_locale: function(test) { - test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale: "pa-IN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "ਪੂ.ਦੁ."); - test.equal(fmt[1].name, "ਬਾ.ਦੁ."); - test.done(); - }, - testDateFmtGetMeridiemsRangeName_with_ta_IN_locale: function(test) { - test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale: "ta-IN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "முற்பகல்"); - test.equal(fmt[1].name, "பிற்பகல்"); - test.done(); - }, - testDateFmtGetMeridiemsRangeName_with_te_IN_locale: function(test) { - test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale: "te-IN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); - }, - testDateFmtGetMeridiemsRangeName_with_ur_IN_locale: function(test) { - test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale: "ur-IN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); - }, - testDateFmtGetMeridiemsRangeName_with_as_IN_locale: function(test) { - test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale: "as-IN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, 'পূৰ্বাহ্ন'); - test.equal(fmt[1].name, 'অপৰাহ্ন'); - test.done(); - }, - testDateFmtGetMeridiemsRangeName_with_hi_IN_locale: function(test) { - test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale: "hi-IN"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "पूर्वाह्न"); - test.equal(fmt[1].name, "अपराह्न"); - test.done(); - }, - - testDateFmtGetMeridiemsRangeName_with_ur_PK_locale: function(test) { - test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale: "ur-PK"}); - test.ok(fmt !== null); - - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); - test.done(); - }, - - testDateFmtGetMeridiemsRange_with_noArgument: function(test) { - test.expect(2); - var fmt = new DateFmt(); - test.ok(fmt !== null); - - var mdRange = fmt.getMeridiemsRange(); - // if locale is not specified, DateFmt takes default locale. - test.ok("getMeridiemsRange should return length value greater than 0", mdRange.length > 0); - test.done(); - }, - - testDateFmtGetMeridiemsRange_with_undefined_locale: function(test) { - test.expect(2); - var fmt = new DateFmt({ locale: undefined }); - test.ok(fmt !== null); - - var mdRange = fmt.getMeridiemsRange(); - // if locale is not specified, DateFmt takes default locale. - test.ok("getMeridiemsRange should return length value greater than 0", mdRange.length > 0); - test.done(); - }, - - testDateFmtGetMeridiemsRange_with_wrong_locale: function(test) { - test.expect(2); - var fmt = new DateFmt({ locale: "wrong" }); - test.ok(fmt !== null); - - var mdRange = fmt.getMeridiemsRange(); - // if locale is specified wrong value, DateFmt takes default locale. - test.ok("getMeridiemsRange should return length value greater than 0", mdRange.length > 0); - test.done(); - }, testDateFmtTimeTemplate_mms: function(test) { test.expect(2); diff --git a/js/test/date/testdatefmtasync.js b/js/test/date/testdatefmtasync.js index c7a1f61a3f..4ec4fd3dfe 100644 --- a/js/test/date/testdatefmtasync.js +++ b/js/test/date/testdatefmtasync.js @@ -41,6 +41,9 @@ if (typeof(JulianDate) === "undefined") { if (typeof(DateFmt) === "undefined") { var DateFmt = require("../../lib/DateFmt.js"); } +if (typeof(DateFmtInfo) === "undefined") { + var DateFmtInfo = require("../../lib/DateFmtInfo.js"); +} if (typeof(DateFactory) === "undefined") { var DateFactory = require("../../lib/DateFactory.js"); } @@ -305,11 +308,11 @@ module.exports.testdatefmtasync = { } }); }, - + testDateFmtGetFormatInfoUSShortAsync: function(test) { test.expect(16); - var fmt = new DateFmt({ + var fmt = new DateFmtInfo({ locale: "en-US", type: "date", date: "short" @@ -359,11 +362,11 @@ module.exports.testdatefmtasync = { }); }, - + testDateFmtGetFormatInfoGregorianTranslatedAsync: function(test) { test.expect(16); - var fmt = new DateFmt({ + var fmt = new DateFmtInfo({ locale: "en-US", type: "date", date: "full" diff --git a/js/test/date/testgetformatinfo.js b/js/test/date/testdatefmtinfo.js similarity index 76% rename from js/test/date/testgetformatinfo.js rename to js/test/date/testdatefmtinfo.js index 2120e1a40a..1a60119026 100644 --- a/js/test/date/testgetformatinfo.js +++ b/js/test/date/testdatefmtinfo.js @@ -1,5 +1,5 @@ /* - * testgetformatinfo.js - test the date formatter object's + * testgetformatinfo.js - test the date formatter object's * getFormatInfo call * * Copyright © 2019 JEDLSoft @@ -21,8 +21,11 @@ if (typeof(ilib) === "undefined") { var ilib = require("../../lib/ilib.js"); } -if (typeof(DateFmt) === "undefined") { - var DateFmt = require("../../lib/DateFmt.js"); +if (typeof(DateFactory) === "undefined") { + var DateFactory = require("../../lib/DateFactory.js"); +} +if (typeof(DateFmtInfo) === "undefined") { + var DateFmtInfo = require("../../lib/DateFmtInfo.js"); } module.exports.testdategetformatinfo = { @@ -31,10 +34,10 @@ module.exports.testdategetformatinfo = { callback(); }, - testDateFmtGetFormatInfoUSShort: function(test) { + testDateFmtInfoGetFormatInfoUSShort: function(test) { test.expect(16); - var fmt = new DateFmt({ + var fmt = new DateFmtInfo({ locale: "en-US", type: "date", date: "short" @@ -85,10 +88,10 @@ module.exports.testdategetformatinfo = { test.done(); }, - testDateFmtGetFormatInfoUSShortLeapYear: function(test) { + testDateFmtInfoGetFormatInfoUSShortLeapYear: function(test) { test.expect(16); - var fmt = new DateFmt({ + var fmt = new DateFmtInfo({ locale: "en-US", type: "date", date: "short" @@ -139,13 +142,13 @@ module.exports.testdategetformatinfo = { test.done(); }, - testDateFmtGetFormatInfoUSFull: function(test) { + testDateFmtInfoGetFormatInfoUSFull: function(test) { test.expect(16); - var fmt = new DateFmt({ + var fmt = new DateFmtInfo({ locale: "en-US", type: "date", - date: "full" + length: "full" }); test.ok(fmt !== null); @@ -206,18 +209,18 @@ module.exports.testdategetformatinfo = { test.done(); }, - testDateFmtGetFormatInfoGregorianTranslated: function(test) { + testDateFmtInfoGetFormatInfoGregorianTranslated: function(test) { test.expect(16); - var fmt = new DateFmt({ + var fmt = new DateFmtInfo({ locale: "en-US", type: "date", - date: "full" + length: "full", + uiLocale: "de-DE" }); test.ok(fmt !== null); fmt.getFormatInfo({ - locale: "de-DE", year: 2019, sync: true, onLoad: function(info) { @@ -273,14 +276,14 @@ module.exports.testdategetformatinfo = { test.done(); }, - - testDateFmtGetFormatInfoUSShortAllFields: function(test) { - test.expect(16); - var fmt = new DateFmt({ + testDateFmtInfoGetFormatInfoUSShortAllFields: function(test) { + test.expect(165); + + var fmt = new DateFmtInfo({ locale: "en-US", type: "datetime", - date: "short", + length: "short", date: "wmdy", time: "ahmsz" }); @@ -375,13 +378,13 @@ module.exports.testdategetformatinfo = { test.done(); }, - testDateFmtGetFormatInfoDayOfWeekCalculator: function(test) { + testDateFmtInfoGetFormatInfoDayOfWeekCalculator: function(test) { test.expect(16); - var fmt = new DateFmt({ + var fmt = new DateFmtInfo({ locale: "en-US", type: "datetime", - date: "short", + length: "short", date: "wmdy", }); test.ok(fmt !== null); @@ -404,13 +407,13 @@ module.exports.testdategetformatinfo = { }, - testDateFmtGetFormatInfoHebrewCalendarNonLeap: function(test) { + testDateFmtInfoGetFormatInfoHebrewCalendarNonLeap: function(test) { test.expect(16); - var fmt = new DateFmt({ + var fmt = new DateFmtInfo({ locale: "en-US", type: "date", - date: "full", + length: "full", calendar: "hebrew" }); test.ok(fmt !== null); @@ -472,13 +475,13 @@ module.exports.testdategetformatinfo = { test.done(); }, - testDateFmtGetFormatInfoHebrewCalendarLeap: function(test) { + testDateFmtInfoGetFormatInfoHebrewCalendarLeap: function(test) { test.expect(16); - var fmt = new DateFmt({ + var fmt = new DateFmtInfo({ locale: "en-US", type: "date", - date: "full", + length: "full", calendar: "hebrew" }); test.ok(fmt !== null); @@ -541,14 +544,14 @@ module.exports.testdategetformatinfo = { test.done(); }, - - testDateFmtGetFormatInfoHebrewCalendarInHebrew: function(test) { + + testDateFmtInfoGetFormatInfoHebrewCalendarInHebrew: function(test) { test.expect(16); - var fmt = new DateFmt({ + var fmt = new DateFmtInfo({ locale: "he-IL", type: "date", - date: "full", + length: "full", calendar: "hebrew" }); test.ok(fmt !== null); @@ -607,6 +610,126 @@ module.exports.testdategetformatinfo = { } }); + test.done(); + }, + + testDateFmtInfoGetMonthsOfYear1: function(test) { + test.expect(2); + var fmt = new DateFmtInfo({locale: "en-US"}); + test.ok(fmt !== null); + + var arrMonths = fmt.getMonthsOfYear(); + var expected = [undefined, "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]; + test.deepEqual(arrMonths, expected); + test.done(); + }, + + testDateFmtInfoGetMonthsOfYear2: function(test) { + test.expect(2); + var fmt = new DateFmtInfo({locale: "en-US"}); + test.ok(fmt !== null); + + var arrMonths = fmt.getMonthsOfYear({length: "long"}); + var expected = [undefined, "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + test.deepEqual(arrMonths, expected); + test.done(); + }, + + testDateFmtInfoGetMonthsOfYearThai: function(test) { + test.expect(2); + // uses ThaiSolar calendar + var fmt = new DateFmtInfo({locale: "th-TH"}); + test.ok(fmt !== null); + + var arrMonths = fmt.getMonthsOfYear({length: "long"}); + + var expected = [undefined, "ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."]; + test.deepEqual(arrMonths, expected); + test.done(); + }, + + testDateFmtInfoGetMonthsOfYearLeapYear: function(test) { + test.expect(2); + var d = DateFactory({type: "hebrew", locale: "en-US", year: 5774, month: 1, day: 1}); + var fmt = new DateFmtInfo({date: "en-US", calendar: "hebrew"}); + test.ok(fmt !== null); + + var arrMonths = fmt.getMonthsOfYear({length: "long", date: d}); + + var expected = [undefined, "Nis", "Iyy", "Siv", "Tam", "Av", "Elu", "Tis", "Ḥes", "Kis", "Tev", "She", "Ada", "Ad2"]; + test.deepEqual(arrMonths, expected); + test.done(); + }, + + testDateFmtInfoGetMonthsOfYearNonLeapYear: function(test) { + test.expect(2); + var d = DateFactory({type: "hebrew", locale: "en-US", year: 5775, month: 1, day: 1}); + var fmt = new DateFmtInfo({date: "en-US", calendar: "hebrew"}); + test.ok(fmt !== null); + + var arrMonths = fmt.getMonthsOfYear({length: "long", date: d}); + + var expected = [undefined, "Nis", "Iyy", "Siv", "Tam", "Av", "Elu", "Tis", "Ḥes", "Kis", "Tev", "She", "Ada"]; + test.deepEqual(arrMonths, expected); + test.done(); + }, + + testDateFmtInfoGetDaysOfWeek1: function(test) { + test.expect(2); + var fmt = new DateFmtInfo({locale: "en-US"}); + test.ok(fmt !== null); + + var arrDays = fmt.getDaysOfWeek(); + + var expected = ["S", "M", "T", "W", "T", "F", "S"]; + test.deepEqual(arrDays, expected); + test.done(); + }, + + testDateFmtInfoGetDaysOfWeek2: function(test) { + test.expect(2); + var fmt = new DateFmtInfo({locale: "en-US"}); + test.ok(fmt !== null); + + var arrDays = fmt.getDaysOfWeek({length: 'long'}); + var expected = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; + test.deepEqual(arrDays, expected); + test.done(); + }, + + testDateFmtInfoGetDaysOfWeekOtherCalendar: function(test) { + test.expect(2); + var fmt = new DateFmtInfo({locale: "en-US", calendar: "hebrew"}); + test.ok(fmt !== null); + + var arrDays = fmt.getDaysOfWeek({length: 'long'}); + + var expected = ["ris", "she", "shl", "rvi", "ḥam", "shi", "sha"]; + test.deepEqual(arrDays, expected); + test.done(); + }, + + testDateFmtInfoGetDaysOfWeekThai: function(test) { + test.expect(2); + var fmt = new DateFmtInfo({locale: "th-TH", calendar: "thaisolar"}); + test.ok(fmt !== null); + + var arrDays = fmt.getDaysOfWeek({length: 'long'}); + + var expected = ["อา.", "จ.", "อ.", "พ.", "พฤ.", "ศ.", "ส."]; + test.deepEqual(arrDays, expected); + test.done(); + }, + + testDateFmtInfoGetDaysOfWeekThaiInEnglish: function(test) { + test.expect(2); + var fmt = new DateFmtInfo({locale: "en-US", calendar: "thaisolar"}); + test.ok(fmt !== null); + + var arrDays = fmt.getDaysOfWeek({length: 'long'}); + + var expected = ["ath", "cha", "ang", "phu", "phr", "suk", "sao"]; + test.deepEqual(arrDays, expected); test.done(); } }; From 6289731d3daea3ad37353447dd71a312850ac50b Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Mon, 10 Jun 2019 22:18:30 -0700 Subject: [PATCH 25/38] Fixed various unit tests Still need to fix more though --- js/data/locale/af/dateres.json | 34 +++++------- js/data/locale/agq/dateres.json | 16 +++--- js/data/locale/ak/dateres.json | 8 +-- js/data/locale/am/dateres.json | 4 +- js/data/locale/asa/dateres.json | 4 +- js/data/locale/ast/dateres.json | 10 +--- js/data/locale/az/dateres.json | 11 ++-- js/data/locale/bas/dateres.json | 16 +++--- js/data/locale/be/dateres.json | 16 +++--- js/data/locale/bem/dateres.json | 4 +- js/data/locale/bez/dateres.json | 3 +- js/data/locale/bg/dateres.json | 16 +++--- js/data/locale/bm/dateres.json | 14 ++--- js/data/locale/br/dateres.json | 30 +++++----- js/data/locale/bs/Cyrl/dateres.json | 16 +++--- js/data/locale/bs/dateres.json | 12 ++-- js/data/locale/ca/dateres.json | 10 +--- js/data/locale/ce/dateres.json | 16 +++--- js/data/locale/cgg/dateres.json | 4 +- js/data/locale/chr/dateres.json | 6 +- js/data/locale/cs/dateres.json | 10 +--- js/data/locale/cy/dateres.json | 34 +++++------- js/data/locale/da/dateres.json | 12 ++-- js/data/locale/dav/dateres.json | 3 +- js/data/locale/de/dateres.json | 5 +- js/data/locale/dje/dateres.json | 3 +- js/data/locale/dsb/dateres.json | 14 ++--- js/data/locale/dua/dateres.json | 14 ++--- js/data/locale/dyo/dateres.json | 12 ++-- js/data/locale/ebu/dateres.json | 3 +- js/data/locale/ee/dateres.json | 16 +++--- js/data/locale/el/dateres.json | 40 +++++++------- js/data/locale/en/dateres.json | 22 +------- js/data/locale/es/DO/dateres.json | 10 +--- js/data/locale/es/dateres.json | 10 +--- js/data/locale/et/dateres.json | 16 +++--- js/data/locale/eu/dateres.json | 16 +++--- js/data/locale/ewo/dateres.json | 6 +- js/data/locale/ff/dateres.json | 4 +- js/data/locale/fi/dateres.json | 16 +++--- js/data/locale/fil/dateres.json | 16 +++--- js/data/locale/fo/dateres.json | 12 ++-- js/data/locale/fr/dateres.json | 12 ++-- js/data/locale/fur/dateres.json | 14 ++--- js/data/locale/fy/dateres.json | 10 +--- js/data/locale/ga/dateres.json | 10 ++-- js/data/locale/gd/dateres.json | 14 ++--- js/data/locale/gl/dateres.json | 10 +--- js/data/locale/gsw/dateres.json | 6 +- js/data/locale/gu/dateres.json | 2 +- js/data/locale/guz/dateres.json | 4 +- js/data/locale/ha/dateres.json | 3 +- js/data/locale/hi/dateres.json | 2 +- js/data/locale/hr/dateres.json | 12 ++-- js/data/locale/hsb/dateres.json | 10 +--- js/data/locale/hu/dateres.json | 16 +++--- js/data/locale/hy/dateres.json | 16 +++--- js/data/locale/ia/dateres.json | 10 +--- js/data/locale/id/dateres.json | 29 +++++----- js/data/locale/ig/dateres.json | 6 +- js/data/locale/ii/dateres.json | 2 +- js/data/locale/is/dateres.json | 12 ++-- js/data/locale/it/dateres.json | 14 ++--- js/data/locale/jmc/dateres.json | 5 +- js/data/locale/jv/dateres.json | 14 ++--- js/data/locale/ka/dateres.json | 16 +++--- js/data/locale/kab/dateres.json | 4 +- js/data/locale/kam/dateres.json | 2 +- js/data/locale/kde/dateres.json | 3 +- js/data/locale/kea/dateres.json | 6 +- js/data/locale/khq/dateres.json | 3 +- js/data/locale/ki/dateres.json | 3 +- js/data/locale/kk/dateres.json | 16 +++--- js/data/locale/kln/dateres.json | 4 +- js/data/locale/km/dateres.json | 2 +- js/data/locale/kn/dateres.json | 2 +- js/data/locale/kok/dateres.json | 4 +- js/data/locale/ksb/dateres.json | 3 +- js/data/locale/ksf/dateres.json | 5 +- js/data/locale/ksh/dateres.json | 6 +- js/data/locale/ku/dateres.json | 14 ++--- js/data/locale/ky/dateres.json | 16 +++--- js/data/locale/lag/dateres.json | 3 +- js/data/locale/lb/dateres.json | 6 +- js/data/locale/lg/dateres.json | 4 +- js/data/locale/lkt/dateres.json | 8 +-- js/data/locale/ln/dateres.json | 6 +- js/data/locale/lrc/dateres.json | 2 +- js/data/locale/lt/dateres.json | 12 ++-- js/data/locale/lu/dateres.json | 4 +- js/data/locale/luo/dateres.json | 16 +++--- js/data/locale/luy/dateres.json | 3 +- js/data/locale/lv/dateres.json | 12 ++-- js/data/locale/mas/dateres.json | 3 +- js/data/locale/mer/dateres.json | 3 +- js/data/locale/mfe/dateres.json | 6 +- js/data/locale/mg/dateres.json | 4 +- js/data/locale/mgh/dateres.json | 12 ++-- js/data/locale/mgo/dateres.json | 12 ++-- js/data/locale/mi/dateres.json | 12 ++-- js/data/locale/mk/dateres.json | 16 +++--- js/data/locale/ml/dateres.json | 2 +- js/data/locale/mn/dateres.json | 16 +++--- js/data/locale/mr/dateres.json | 2 +- js/data/locale/ms/dateres.json | 33 ++++++----- js/data/locale/mt/dateres.json | 14 ++--- js/data/locale/mua/dateres.json | 6 +- js/data/locale/my/dateres.json | 2 +- js/data/locale/naq/dateres.json | 2 +- js/data/locale/nb/dateres.json | 12 ++-- js/data/locale/nd/dateres.json | 4 +- js/data/locale/ne/dateres.json | 2 +- js/data/locale/nl/dateres.json | 12 ++-- js/data/locale/nmg/dateres.json | 5 +- js/data/locale/nn/dateres.json | 12 ++-- js/data/locale/nnh/dateres.json | 12 ++-- js/data/locale/nus/dateres.json | 3 +- js/data/locale/nyn/dateres.json | 4 +- js/data/locale/or/dateres.json | 2 +- js/data/locale/os/dateres.json | 8 +-- js/data/locale/pl/dateres.json | 12 ++-- js/data/locale/pt/dateres.json | 31 ++++------- js/data/locale/rm/dateres.json | 10 ++-- js/data/locale/rn/dateres.json | 4 +- js/data/locale/ro/dateres.json | 16 +++--- js/data/locale/rof/dateres.json | 3 +- js/data/locale/ru/dateres.json | 16 +++--- js/data/locale/rwk/dateres.json | 5 +- js/data/locale/sah/dateres.json | 10 ++-- js/data/locale/saq/dateres.json | 6 +- js/data/locale/sbp/dateres.json | 4 +- js/data/locale/se/dateres.json | 14 ++--- js/data/locale/seh/dateres.json | 4 +- js/data/locale/ses/dateres.json | 3 +- js/data/locale/sg/dateres.json | 10 ++-- js/data/locale/shi/Latn/dateres.json | 16 +++--- js/data/locale/sk/dateres.json | 10 +--- js/data/locale/sl/dateres.json | 12 ++-- js/data/locale/sn/dateres.json | 6 +- js/data/locale/sq/dateres.json | 12 ++-- js/data/locale/sr/Latn/dateres.json | 16 +++--- js/data/locale/sr/dateres.json | 16 +++--- js/data/locale/sv/dateres.json | 12 ++-- js/data/locale/sw/dateres.json | 14 ++--- js/data/locale/teo/dateres.json | 6 +- js/data/locale/tg/dateres.json | 16 +++--- js/data/locale/tk/dateres.json | 16 +++--- js/data/locale/to/dateres.json | 8 +-- js/data/locale/tr/dateres.json | 15 +++-- js/data/locale/tt/dateres.json | 16 +++--- js/data/locale/twq/dateres.json | 3 +- js/data/locale/tzm/dateres.json | 4 +- js/data/locale/uk/dateres.json | 16 +++--- js/data/locale/uz/Cyrl/dateres.json | 16 +++--- js/data/locale/uz/dateres.json | 16 +++--- js/data/locale/vai/Latn/dateres.json | 16 +++--- js/data/locale/vai/dateres.json | 6 +- js/data/locale/vi/dateres.json | 6 +- js/data/locale/vun/dateres.json | 5 +- js/data/locale/wae/dateres.json | 6 +- js/data/locale/wo/dateres.json | 16 +++--- js/data/locale/xog/dateres.json | 4 +- js/data/locale/yav/dateres.json | 14 ++--- js/data/locale/yo/BJ/dateres.json | 2 +- js/data/locale/yo/dateres.json | 10 ++-- js/data/locale/yue/Hans/dateres.json | 1 + js/data/locale/yue/dateres.json | 2 +- js/data/locale/zh/Hant/dateres.json | 1 + js/data/locale/zh/dateres.json | 2 +- js/data/locale/zu/dateres.json | 4 +- js/lib/DateFmtInfo.js | 54 +++++++++++------- js/test/date/testdatefmtasync.js | 10 ++-- js/test/date/testdatefmtinfo.js | 24 ++++---- tools/cldr/datefmts.js | 82 ++++++++++++++++++++++++++-- 174 files changed, 845 insertions(+), 997 deletions(-) diff --git a/js/data/locale/af/dateres.json b/js/data/locale/af/dateres.json index 109171163d..fe44f9847d 100644 --- a/js/data/locale/af/dateres.json +++ b/js/data/locale/af/dateres.json @@ -1,22 +1,16 @@ { - "AM/PM": "vm./nm.", - "Day": "dag", - "Day of Year": "dag van jaar", - "Era": "era", - "Hour": "uur", - "Minute": "minuut", - "Month": "maand", - "Second": "sekonde", - "Time Zone": "tydsone", - "Week": "week", - "Week of Month": "week van maand", - "Year": "jaar", - "D": "d", - "DD": "dd", - "YY": "jj", - "YYYY": "jaar", - "M": "m", - "MM": "mm", - "H": "u", - "HH": "uu" + "AM/PM": "Vm./nm.", + "Day": "Dag", + "Day of Year": "Dag van jaar", + "Hour": "Uur", + "Minute": "Minuut", + "Month": "Maand", + "Second": "Sekonde", + "Time Zone": "Tydsone", + "Week of Month": "Week van maand", + "Year": "Jaar", + "YY": "JJ", + "YYYY": "JJJJ", + "H": "U", + "HH": "UU" } \ No newline at end of file diff --git a/js/data/locale/agq/dateres.json b/js/data/locale/agq/dateres.json index 3cd2415806..0d8bd629f4 100644 --- a/js/data/locale/agq/dateres.json +++ b/js/data/locale/agq/dateres.json @@ -9,12 +9,12 @@ "Time Zone": "dɨŋò kɨ enɨ̀gha", "Week": "ewɨn", "Year": "kɨnûm", - "D": "u", - "DD": "uu", - "YY": "kk", - "YYYY": "kkkk", - "M": "n", - "MM": "nn", - "H": "t", - "HH": "tt" + "D": "U", + "DD": "UU", + "YY": "KK", + "YYYY": "KKKK", + "M": "N", + "MM": "NN", + "H": "T", + "HH": "TT" } \ No newline at end of file diff --git a/js/data/locale/ak/dateres.json b/js/data/locale/ak/dateres.json index e8e3464692..8683bbbf1b 100644 --- a/js/data/locale/ak/dateres.json +++ b/js/data/locale/ak/dateres.json @@ -9,13 +9,13 @@ "Time Zone": "Bere apaamu", "Week": "Dapɛn", "Year": "Afe", - "DD": "Da", + "D": "DA", + "DD": "DA", "YY": "AA", - "YYYY": "Afe", + "YYYY": "AFE", "M": "B", "MM": "BB", "H": "D", "HH": "DD", - "mm": "SS", - "ss": "SS" + "mm": "ss" } \ No newline at end of file diff --git a/js/data/locale/am/dateres.json b/js/data/locale/am/dateres.json index 26d685c133..04e49144a5 100644 --- a/js/data/locale/am/dateres.json +++ b/js/data/locale/am/dateres.json @@ -11,11 +11,11 @@ "Week": "ሳምንት", "Week of Month": "የወሩ ሳምንት", "Year": "ዓመት", - "D": "ቀ", + "D": "ቀን", "DD": "ቀን", "YY": "ዓዓ", "YYYY": "ዓመት", - "M": "ወ", + "M": "ወር", "MM": "ወር", "H": "ሰ", "HH": "ሰሰ", diff --git a/js/data/locale/asa/dateres.json b/js/data/locale/asa/dateres.json index 6219513532..ced0b342f6 100644 --- a/js/data/locale/asa/dateres.json +++ b/js/data/locale/asa/dateres.json @@ -15,6 +15,6 @@ "YYYY": "MMMM", "H": "T", "HH": "TT", - "mm": "DD", - "ss": "TT" + "mm": "dd", + "ss": "tt" } \ No newline at end of file diff --git a/js/data/locale/ast/dateres.json b/js/data/locale/ast/dateres.json index 4133ee827a..f1afca62a3 100644 --- a/js/data/locale/ast/dateres.json +++ b/js/data/locale/ast/dateres.json @@ -9,12 +9,6 @@ "Time Zone": "estaya horaria", "Week": "selmana", "Year": "añu", - "D": "d", - "DD": "dd", - "YY": "aa", - "YYYY": "añu", - "M": "m", - "MM": "mm", - "H": "h", - "HH": "hh" + "YY": "AA", + "YYYY": "AÑU" } \ No newline at end of file diff --git a/js/data/locale/az/dateres.json b/js/data/locale/az/dateres.json index 04464ee3d2..531f2e7196 100644 --- a/js/data/locale/az/dateres.json +++ b/js/data/locale/az/dateres.json @@ -11,12 +11,11 @@ "Year": "İl", "D": "G", "DD": "GG", - "YY": "İl", - "YYYY": "İl", - "M": "A", - "MM": "Ay", + "YY": "İL", + "YYYY": "İL", + "M": "AY", + "MM": "AY", "H": "S", "HH": "SS", - "mm": "DD", - "ss": "SS" + "mm": "dd" } \ No newline at end of file diff --git a/js/data/locale/bas/dateres.json b/js/data/locale/bas/dateres.json index 5b3354c91e..243238bab3 100644 --- a/js/data/locale/bas/dateres.json +++ b/js/data/locale/bas/dateres.json @@ -9,14 +9,14 @@ "Time Zone": "komboo i ŋgɛŋ", "Week": "sɔndɛ̂", "Year": "ŋwìi", - "D": "k", - "DD": "kk", - "YY": "ŋŋ", - "YYYY": "ŋwìi", - "M": "s", - "MM": "ss", - "H": "ŋ", - "HH": "ŋŋ", + "D": "K", + "DD": "KK", + "YY": "ŊŊ", + "YYYY": "ŊŊŊŊ", + "M": "S", + "MM": "SS", + "H": "Ŋ", + "HH": "ŊŊ", "mm": "ŋŋ", "ss": "hh" } \ No newline at end of file diff --git a/js/data/locale/be/dateres.json b/js/data/locale/be/dateres.json index 474dd51aa6..4f84ba5f7c 100644 --- a/js/data/locale/be/dateres.json +++ b/js/data/locale/be/dateres.json @@ -10,14 +10,14 @@ "Week": "тыд", "Week of Month": "тыдзень месяца", "Year": "год", - "D": "д", - "DD": "дд", - "YY": "гг", - "YYYY": "год", - "M": "м", - "MM": "мм", - "H": "г", - "HH": "гг", + "D": "Д", + "DD": "ДД", + "YY": "ГГ", + "YYYY": "ГОД", + "M": "М", + "MM": "ММ", + "H": "Г", + "HH": "ГГ", "mm": "хх", "ss": "сс" } \ No newline at end of file diff --git a/js/data/locale/bem/dateres.json b/js/data/locale/bem/dateres.json index 4348b9fd5b..f9623eadd3 100644 --- a/js/data/locale/bem/dateres.json +++ b/js/data/locale/bem/dateres.json @@ -16,7 +16,5 @@ "M": "U", "MM": "UU", "H": "I", - "HH": "II", - "mm": "MM", - "ss": "SS" + "HH": "II" } \ No newline at end of file diff --git a/js/data/locale/bez/dateres.json b/js/data/locale/bez/dateres.json index bbbc388a04..2331a92fc5 100644 --- a/js/data/locale/bez/dateres.json +++ b/js/data/locale/bez/dateres.json @@ -15,6 +15,5 @@ "YYYY": "MMMM", "H": "S", "HH": "SS", - "mm": "DD", - "ss": "SS" + "mm": "dd" } \ No newline at end of file diff --git a/js/data/locale/bg/dateres.json b/js/data/locale/bg/dateres.json index 8d4f942b79..bc5d811284 100644 --- a/js/data/locale/bg/dateres.json +++ b/js/data/locale/bg/dateres.json @@ -11,14 +11,14 @@ "Week": "седмица", "Week of Month": "седмица от месеца", "Year": "година", - "D": "д", - "DD": "дд", - "YY": "гг", - "YYYY": "гггг", - "M": "м", - "MM": "мм", - "H": "ч", - "HH": "чч", + "D": "Д", + "DD": "ДД", + "YY": "ГГ", + "YYYY": "ГГГГ", + "M": "М", + "MM": "ММ", + "H": "Ч", + "HH": "ЧЧ", "mm": "мм", "ss": "сс" } \ No newline at end of file diff --git a/js/data/locale/bm/dateres.json b/js/data/locale/bm/dateres.json index 77ce533004..88e8112751 100644 --- a/js/data/locale/bm/dateres.json +++ b/js/data/locale/bm/dateres.json @@ -9,12 +9,10 @@ "Time Zone": "sigikun tilena", "Week": "dɔgɔkun", "Year": "san", - "D": "d", - "DD": "dd", - "YY": "ss", - "YYYY": "san", - "M": "k", - "MM": "kk", - "H": "l", - "HH": "ll" + "YY": "SS", + "YYYY": "SAN", + "M": "K", + "MM": "KK", + "H": "L", + "HH": "LL" } \ No newline at end of file diff --git a/js/data/locale/br/dateres.json b/js/data/locale/br/dateres.json index 397c010b42..b6da7d8ba9 100644 --- a/js/data/locale/br/dateres.json +++ b/js/data/locale/br/dateres.json @@ -1,21 +1,17 @@ { "AM/PM": "AM/GM", - "Day": "deiz", - "Era": "amzervezh", - "Hour": "eur", - "Minute": "munut", - "Month": "miz", - "Second": "eilenn", - "Time Zone": "takad eur", - "Week": "sizhun", - "Year": "bloaz", - "D": "d", - "DD": "dd", - "YY": "bb", - "YYYY": "bbbb", - "M": "m", - "MM": "mm", - "H": "e", - "HH": "ee", + "Day": "Deiz", + "Era": "Amzervezh", + "Hour": "Eur", + "Minute": "Munut", + "Month": "Miz", + "Second": "Eilenn", + "Time Zone": "Takad eur", + "Week": "Sizhun", + "Year": "Bloaz", + "YY": "BB", + "YYYY": "BBBB", + "H": "E", + "HH": "EE", "ss": "ee" } \ No newline at end of file diff --git a/js/data/locale/bs/Cyrl/dateres.json b/js/data/locale/bs/Cyrl/dateres.json index 079065ee63..e61f5f02c8 100644 --- a/js/data/locale/bs/Cyrl/dateres.json +++ b/js/data/locale/bs/Cyrl/dateres.json @@ -11,14 +11,14 @@ "Week": "недеља", "Week of Month": "Week Of Month", "Year": "година", - "D": "д", - "DD": "дд", - "YY": "гг", - "YYYY": "гггг", - "M": "м", - "MM": "мм", - "H": "ч", - "HH": "чч", + "D": "Д", + "DD": "ДД", + "YY": "ГГ", + "YYYY": "ГГГГ", + "M": "М", + "MM": "ММ", + "H": "Ч", + "HH": "ЧЧ", "mm": "мм", "ss": "сс" } \ No newline at end of file diff --git a/js/data/locale/bs/dateres.json b/js/data/locale/bs/dateres.json index 3df5324ad3..0a6829dc18 100644 --- a/js/data/locale/bs/dateres.json +++ b/js/data/locale/bs/dateres.json @@ -11,12 +11,8 @@ "Week": "sedmica", "Week of Month": "sedmica u mjesecu", "Year": "godina", - "D": "d", - "DD": "dd", - "YY": "gg", - "YYYY": "gggg", - "M": "m", - "MM": "mm", - "H": "s", - "HH": "ss" + "YY": "GG", + "YYYY": "GGGG", + "H": "S", + "HH": "SS" } \ No newline at end of file diff --git a/js/data/locale/ca/dateres.json b/js/data/locale/ca/dateres.json index 6367027908..524c54e3e5 100644 --- a/js/data/locale/ca/dateres.json +++ b/js/data/locale/ca/dateres.json @@ -11,12 +11,6 @@ "Week": "setmana", "Week of Month": "setmana del mes", "Year": "any", - "D": "d", - "DD": "dd", - "YY": "aa", - "YYYY": "any", - "M": "m", - "MM": "mm", - "H": "h", - "HH": "hh" + "YY": "AA", + "YYYY": "ANY" } \ No newline at end of file diff --git a/js/data/locale/ce/dateres.json b/js/data/locale/ce/dateres.json index af855f197b..55b2251fb9 100644 --- a/js/data/locale/ce/dateres.json +++ b/js/data/locale/ce/dateres.json @@ -11,14 +11,14 @@ "Week": "кӀира", "Week of Month": "беттан кӀира", "Year": "шо", - "D": "д", - "DD": "де", - "YY": "шо", - "YYYY": "шо", - "M": "б", - "MM": "бб", - "H": "с", - "HH": "сс", + "D": "ДЕ", + "DD": "ДЕ", + "YY": "ШО", + "YYYY": "ШО", + "M": "Б", + "MM": "ББ", + "H": "С", + "HH": "СС", "mm": "мм", "ss": "сс" } \ No newline at end of file diff --git a/js/data/locale/cgg/dateres.json b/js/data/locale/cgg/dateres.json index b453938261..7f1bd1630d 100644 --- a/js/data/locale/cgg/dateres.json +++ b/js/data/locale/cgg/dateres.json @@ -17,6 +17,6 @@ "MM": "OO", "H": "S", "HH": "SS", - "mm": "EE", - "ss": "OO" + "mm": "ee", + "ss": "oo" } \ No newline at end of file diff --git a/js/data/locale/chr/dateres.json b/js/data/locale/chr/dateres.json index 5d6e66228d..18461485fc 100644 --- a/js/data/locale/chr/dateres.json +++ b/js/data/locale/chr/dateres.json @@ -11,7 +11,7 @@ "Week": "ᏒᎾᏙᏓᏆᏍᏗ", "Week of Month": "ᏒᎾᏙᏓᏆᏍᏗ ᎧᎸᎢ", "Year": "ᎤᏕᏘᏴᏌᏗᏒᎢ", - "D": "Ꭲ", + "D": "ᎢᎦ", "DD": "ᎢᎦ", "YY": "ᎤᎤ", "YYYY": "ᎤᎤᎤᎤ", @@ -19,6 +19,6 @@ "MM": "ᎧᎧ", "H": "Ꮡ", "HH": "ᏑᏑ", - "mm": "ᎢᎢ", - "ss": "ᎠᎠ" + "mm": "ꭲꭲ", + "ss": "ꭰꭰ" } \ No newline at end of file diff --git a/js/data/locale/cs/dateres.json b/js/data/locale/cs/dateres.json index e6a8a9aab1..bd4f679e4b 100644 --- a/js/data/locale/cs/dateres.json +++ b/js/data/locale/cs/dateres.json @@ -11,12 +11,6 @@ "Week": "týden", "Week of Month": "týden v měsíci", "Year": "rok", - "D": "d", - "DD": "dd", - "YY": "rr", - "YYYY": "rok", - "M": "m", - "MM": "mm", - "H": "h", - "HH": "hh" + "YY": "RR", + "YYYY": "ROK" } \ No newline at end of file diff --git a/js/data/locale/cy/dateres.json b/js/data/locale/cy/dateres.json index b2cae5ec90..8173c9e6dc 100644 --- a/js/data/locale/cy/dateres.json +++ b/js/data/locale/cy/dateres.json @@ -1,22 +1,18 @@ { - "Day": "diwrnod", - "Day of Year": "rhif y dydd yn y flwyddyn", - "Era": "oes", - "Hour": "awr", - "Minute": "munud", - "Month": "mis", - "Second": "eiliad", - "Time Zone": "cylchfa amser", - "Week": "wythnos", - "Week of Month": "rhif wythnos yn y mis", - "Year": "blwyddyn", - "D": "d", - "DD": "dd", - "YY": "bb", - "YYYY": "bbbb", - "M": "m", - "MM": "mm", - "H": "a", - "HH": "aa", + "Day": "Diwrnod", + "Day of Year": "Rhif y dydd yn y flwyddyn", + "Era": "Oes", + "Hour": "Awr", + "Minute": "Munud", + "Month": "Mis", + "Second": "Eiliad", + "Time Zone": "Cylchfa amser", + "Week": "Wythnos", + "Week of Month": "Rhif wythnos yn y mis", + "Year": "Blwyddyn", + "YY": "BB", + "YYYY": "BBBB", + "H": "A", + "HH": "AA", "ss": "ee" } \ No newline at end of file diff --git a/js/data/locale/da/dateres.json b/js/data/locale/da/dateres.json index 65c9ad5d2f..b137e45d61 100644 --- a/js/data/locale/da/dateres.json +++ b/js/data/locale/da/dateres.json @@ -10,12 +10,8 @@ "Week": "uge", "Week of Month": "uge i måneden", "Year": "år", - "D": "d", - "DD": "dd", - "YY": "år", - "YYYY": "år", - "M": "m", - "MM": "mm", - "H": "t", - "HH": "tt" + "YY": "ÅR", + "YYYY": "ÅR", + "H": "T", + "HH": "TT" } \ No newline at end of file diff --git a/js/data/locale/dav/dateres.json b/js/data/locale/dav/dateres.json index 23cc00e879..500ba617c7 100644 --- a/js/data/locale/dav/dateres.json +++ b/js/data/locale/dav/dateres.json @@ -15,6 +15,5 @@ "YYYY": "MMMM", "H": "S", "HH": "SS", - "mm": "DD", - "ss": "SS" + "mm": "dd" } \ No newline at end of file diff --git a/js/data/locale/de/dateres.json b/js/data/locale/de/dateres.json index 5d9bfd4617..f9b89a2bcf 100644 --- a/js/data/locale/de/dateres.json +++ b/js/data/locale/de/dateres.json @@ -13,8 +13,7 @@ "D": "T", "DD": "TT", "YY": "JJ", - "YYYY": "Jahr", + "YYYY": "JJJJ", "H": "S", - "HH": "SS", - "ss": "SS" + "HH": "SS" } \ No newline at end of file diff --git a/js/data/locale/dje/dateres.json b/js/data/locale/dje/dateres.json index b779765111..2601bf41d6 100644 --- a/js/data/locale/dje/dateres.json +++ b/js/data/locale/dje/dateres.json @@ -17,6 +17,5 @@ "MM": "HH", "H": "G", "HH": "GG", - "mm": "MM", - "ss": "MM" + "ss": "mm" } \ No newline at end of file diff --git a/js/data/locale/dsb/dateres.json b/js/data/locale/dsb/dateres.json index 7fed00e2e2..366f0f3905 100644 --- a/js/data/locale/dsb/dateres.json +++ b/js/data/locale/dsb/dateres.json @@ -9,12 +9,10 @@ "Time Zone": "casowe pasmo", "Week": "tyźeń", "Year": "lěto", - "D": "ź", - "DD": "źź", - "YY": "ll", - "YYYY": "lěto", - "M": "m", - "MM": "mm", - "H": "g", - "HH": "gg" + "D": "Ź", + "DD": "ŹŹ", + "YY": "LL", + "YYYY": "LLLL", + "H": "G", + "HH": "GG" } \ No newline at end of file diff --git a/js/data/locale/dua/dateres.json b/js/data/locale/dua/dateres.json index e95a2ff6ec..97ca46f56a 100644 --- a/js/data/locale/dua/dateres.json +++ b/js/data/locale/dua/dateres.json @@ -9,14 +9,12 @@ "Time Zone": "Zone", "Week": "disama", "Year": "mbú", - "D": "b", - "DD": "bb", - "YY": "mm", - "YYYY": "mbú", - "M": "m", - "MM": "mm", - "H": "ŋ", - "HH": "ŋŋ", + "D": "B", + "DD": "BB", + "YY": "MM", + "YYYY": "MBÚ", + "H": "Ŋ", + "HH": "ŊŊ", "mm": "nn", "ss": "pp" } \ No newline at end of file diff --git a/js/data/locale/dyo/dateres.json b/js/data/locale/dyo/dateres.json index 909e9aeb05..2b87f4aef2 100644 --- a/js/data/locale/dyo/dateres.json +++ b/js/data/locale/dyo/dateres.json @@ -6,10 +6,10 @@ "Time Zone": "Zone", "Week": "Lóokuŋ", "Year": "Emit", - "D": "Funak", - "DD": "Funak", - "YY": "Emit", - "YYYY": "Emit", - "M": "Fuleeŋ", - "MM": "Fuleeŋ" + "D": "FUNAK", + "DD": "FUNAK", + "YY": "EMIT", + "YYYY": "EMIT", + "M": "FULEEŊ", + "MM": "FULEEŊ" } \ No newline at end of file diff --git a/js/data/locale/ebu/dateres.json b/js/data/locale/ebu/dateres.json index bb7e497599..04a827eaa1 100644 --- a/js/data/locale/ebu/dateres.json +++ b/js/data/locale/ebu/dateres.json @@ -15,6 +15,5 @@ "YYYY": "MMMM", "H": "I", "HH": "II", - "mm": "NN", - "ss": "SS" + "mm": "nn" } \ No newline at end of file diff --git a/js/data/locale/ee/dateres.json b/js/data/locale/ee/dateres.json index 40051bc82d..797d09739b 100644 --- a/js/data/locale/ee/dateres.json +++ b/js/data/locale/ee/dateres.json @@ -9,13 +9,13 @@ "Time Zone": "nutomegaƒoƒo", "Week": "kɔsiɖa ɖeka", "Year": "ƒe", - "D": "ŋ", - "DD": "ŋŋ", - "YY": "ƒe", - "YYYY": "ƒe", - "M": "ɣ", - "MM": "ɣɣ", - "H": "g", - "HH": "gg", + "D": "Ŋ", + "DD": "ŊŊ", + "YY": "ƑE", + "YYYY": "ƑE", + "M": "Ɣ", + "MM": "ƔƔ", + "H": "G", + "HH": "GG", "mm": "aa" } \ No newline at end of file diff --git a/js/data/locale/el/dateres.json b/js/data/locale/el/dateres.json index 542e60470c..297c417e74 100644 --- a/js/data/locale/el/dateres.json +++ b/js/data/locale/el/dateres.json @@ -1,24 +1,24 @@ { - "AM/PM": "π.μ./μ.μ.", - "Day": "ημέρα", - "Day of Year": "ημέρα έτους", - "Era": "περίοδος", - "Hour": "ώρα", - "Minute": "λεπτό", - "Month": "μήνας", - "Second": "δευτερόλεπτο", - "Time Zone": "ζώνη ώρας", - "Week": "εβδομάδα", - "Week of Month": "εβδομάδα μήνα", - "Year": "έτος", - "D": "η", - "DD": "ηη", - "YY": "έέ", - "YYYY": "έτος", - "M": "μ", - "MM": "μμ", - "H": "ώ", - "HH": "ώώ", + "AM/PM": "Π.μ./μ.μ.", + "Day": "Ημέρα", + "Day of Year": "Ημέρα έτους", + "Era": "Περίοδος", + "Hour": "Ώρα", + "Minute": "Λεπτό", + "Month": "Μήνας", + "Second": "Δευτερόλεπτο", + "Time Zone": "Ζώνη ώρας", + "Week": "Εβδομάδα", + "Week of Month": "Εβδομάδα μήνα", + "Year": "Έτος", + "D": "Η", + "DD": "ΗΗ", + "YY": "ΈΈ", + "YYYY": "ΈΈΈΈ", + "M": "Μ", + "MM": "ΜΜ", + "H": "Ώ", + "HH": "ΏΏ", "mm": "λλ", "ss": "δδ" } \ No newline at end of file diff --git a/js/data/locale/en/dateres.json b/js/data/locale/en/dateres.json index 027f1ceebd..9d6f2e5a37 100644 --- a/js/data/locale/en/dateres.json +++ b/js/data/locale/en/dateres.json @@ -1,21 +1,5 @@ { - "Day": "day", - "Day of Year": "day of year", - "Era": "era", - "Hour": "hour", - "Minute": "minute", - "Month": "month", - "Second": "second", - "Time Zone": "time zone", - "Week": "week", - "Week of Month": "week of month", - "Year": "year", - "D": "d", - "DD": "dd", - "YY": "yy", - "YYYY": "year", - "M": "m", - "MM": "mm", - "H": "h", - "HH": "hh" + "Day of Year": "Day of year", + "Time Zone": "Time zone", + "Week of Month": "Week of month" } \ No newline at end of file diff --git a/js/data/locale/es/DO/dateres.json b/js/data/locale/es/DO/dateres.json index c6ad73eac0..6aeb9d66d3 100644 --- a/js/data/locale/es/DO/dateres.json +++ b/js/data/locale/es/DO/dateres.json @@ -4,13 +4,5 @@ "Month": "Mes", "Second": "Segundo", "Week": "Semana", - "Year": "Año", - "D": "D", - "DD": "DD", - "YY": "AA", - "YYYY": "Año", - "M": "M", - "MM": "MM", - "mm": "MM", - "ss": "SS" + "Year": "Año" } \ No newline at end of file diff --git a/js/data/locale/es/dateres.json b/js/data/locale/es/dateres.json index 11c24ea783..95c06439c0 100644 --- a/js/data/locale/es/dateres.json +++ b/js/data/locale/es/dateres.json @@ -11,12 +11,6 @@ "Week": "semana", "Week of Month": "semana del mes", "Year": "año", - "D": "d", - "DD": "dd", - "YY": "aa", - "YYYY": "año", - "M": "m", - "MM": "mm", - "H": "h", - "HH": "hh" + "YY": "AA", + "YYYY": "AÑO" } \ No newline at end of file diff --git a/js/data/locale/et/dateres.json b/js/data/locale/et/dateres.json index eb49341859..c5da8ccf63 100644 --- a/js/data/locale/et/dateres.json +++ b/js/data/locale/et/dateres.json @@ -11,12 +11,12 @@ "Week": "nädal", "Week of Month": "kuu nädal", "Year": "aasta", - "D": "p", - "DD": "pp", - "YY": "aa", - "YYYY": "aaaa", - "M": "k", - "MM": "kk", - "H": "t", - "HH": "tt" + "D": "P", + "DD": "PP", + "YY": "AA", + "YYYY": "AAAA", + "M": "K", + "MM": "KK", + "H": "T", + "HH": "TT" } \ No newline at end of file diff --git a/js/data/locale/eu/dateres.json b/js/data/locale/eu/dateres.json index c21cd7bd8e..62240c38ce 100644 --- a/js/data/locale/eu/dateres.json +++ b/js/data/locale/eu/dateres.json @@ -10,12 +10,12 @@ "Week": "astea", "Week of Month": "hileko #. astea", "Year": "urtea", - "D": "e", - "DD": "ee", - "YY": "uu", - "YYYY": "uuuu", - "M": "h", - "MM": "hh", - "H": "o", - "HH": "oo" + "D": "E", + "DD": "EE", + "YY": "UU", + "YYYY": "UUUU", + "M": "H", + "MM": "HH", + "H": "O", + "HH": "OO" } \ No newline at end of file diff --git a/js/data/locale/ewo/dateres.json b/js/data/locale/ewo/dateres.json index a83787c477..e44f271ce3 100644 --- a/js/data/locale/ewo/dateres.json +++ b/js/data/locale/ewo/dateres.json @@ -12,11 +12,11 @@ "D": "A", "DD": "AA", "YY": "MM", - "YYYY": "M̀bú", + "YYYY": "MMMM", "M": "N", "MM": "NN", "H": "A", "HH": "AA", - "mm": "EE", - "ss": "AA" + "mm": "ee", + "ss": "aa" } \ No newline at end of file diff --git a/js/data/locale/ff/dateres.json b/js/data/locale/ff/dateres.json index a046a56b18..332e3f6041 100644 --- a/js/data/locale/ff/dateres.json +++ b/js/data/locale/ff/dateres.json @@ -17,6 +17,6 @@ "MM": "LL", "H": "W", "HH": "WW", - "mm": "HH", - "ss": "MM" + "mm": "hh", + "ss": "mm" } \ No newline at end of file diff --git a/js/data/locale/fi/dateres.json b/js/data/locale/fi/dateres.json index 345b291a8c..837df772c5 100644 --- a/js/data/locale/fi/dateres.json +++ b/js/data/locale/fi/dateres.json @@ -11,12 +11,12 @@ "Week": "viikko", "Week of Month": "kuukauden viikko", "Year": "vuosi", - "D": "p", - "DD": "pp", - "YY": "vv", - "YYYY": "vvvv", - "M": "k", - "MM": "kk", - "H": "t", - "HH": "tt" + "D": "P", + "DD": "PP", + "YY": "VV", + "YYYY": "VVVV", + "M": "K", + "MM": "KK", + "H": "T", + "HH": "TT" } \ No newline at end of file diff --git a/js/data/locale/fil/dateres.json b/js/data/locale/fil/dateres.json index 6617c0b213..b343b92d67 100644 --- a/js/data/locale/fil/dateres.json +++ b/js/data/locale/fil/dateres.json @@ -10,12 +10,12 @@ "Week": "linggo", "Week of Month": "linggo ng buwan", "Year": "taon", - "D": "a", - "DD": "aa", - "YY": "tt", - "YYYY": "taon", - "M": "b", - "MM": "bb", - "H": "o", - "HH": "oo" + "D": "A", + "DD": "AA", + "YY": "TT", + "YYYY": "TTTT", + "M": "B", + "MM": "BB", + "H": "O", + "HH": "OO" } \ No newline at end of file diff --git a/js/data/locale/fo/dateres.json b/js/data/locale/fo/dateres.json index ab264d5b30..2b300575c2 100644 --- a/js/data/locale/fo/dateres.json +++ b/js/data/locale/fo/dateres.json @@ -10,12 +10,8 @@ "Week": "vika", "Week of Month": "vika í mánaðinum", "Year": "ár", - "D": "d", - "DD": "dd", - "YY": "ár", - "YYYY": "ár", - "M": "m", - "MM": "mm", - "H": "t", - "HH": "tt" + "YY": "ÁR", + "YYYY": "ÁR", + "H": "T", + "HH": "TT" } \ No newline at end of file diff --git a/js/data/locale/fr/dateres.json b/js/data/locale/fr/dateres.json index 5860e1a941..e9d548e144 100644 --- a/js/data/locale/fr/dateres.json +++ b/js/data/locale/fr/dateres.json @@ -11,12 +11,8 @@ "Week": "semaine", "Week of Month": "semaine (mois)", "Year": "année", - "D": "j", - "DD": "jj", - "YY": "aa", - "YYYY": "aaaa", - "M": "m", - "MM": "mm", - "H": "h", - "HH": "hh" + "D": "J", + "DD": "JJ", + "YY": "AA", + "YYYY": "AAAA" } \ No newline at end of file diff --git a/js/data/locale/fur/dateres.json b/js/data/locale/fur/dateres.json index 887c99e479..983d442313 100644 --- a/js/data/locale/fur/dateres.json +++ b/js/data/locale/fur/dateres.json @@ -9,12 +9,10 @@ "Time Zone": "zone", "Week": "setemane", "Year": "an", - "D": "d", - "DD": "dì", - "YY": "an", - "YYYY": "an", - "M": "m", - "MM": "mm", - "H": "o", - "HH": "oo" + "D": "DÌ", + "DD": "DÌ", + "YY": "AN", + "YYYY": "AN", + "H": "O", + "HH": "OO" } \ No newline at end of file diff --git a/js/data/locale/fy/dateres.json b/js/data/locale/fy/dateres.json index b09913c5bd..cc7c2ca0dd 100644 --- a/js/data/locale/fy/dateres.json +++ b/js/data/locale/fy/dateres.json @@ -8,12 +8,8 @@ "Time Zone": "Zone", "Week": "Wike", "Year": "Jier", - "D": "d", - "DD": "dd", "YY": "JJ", - "YYYY": "Jier", - "H": "o", - "HH": "oo", - "mm": "MM", - "ss": "SS" + "YYYY": "JJJJ", + "H": "O", + "HH": "OO" } \ No newline at end of file diff --git a/js/data/locale/ga/dateres.json b/js/data/locale/ga/dateres.json index ee3594ab15..eb482071fc 100644 --- a/js/data/locale/ga/dateres.json +++ b/js/data/locale/ga/dateres.json @@ -11,13 +11,13 @@ "Week": "Seachtain", "Week of Month": "Seachtain den mhí", "Year": "Bliain", - "D": "L", - "DD": "Lá", + "D": "LÁ", + "DD": "LÁ", "YY": "BB", "YYYY": "BBBB", - "MM": "Mí", + "M": "MÍ", + "MM": "MÍ", "H": "U", "HH": "UU", - "mm": "NN", - "ss": "SS" + "mm": "nn" } \ No newline at end of file diff --git a/js/data/locale/gd/dateres.json b/js/data/locale/gd/dateres.json index f090686de2..38fa8a78cf 100644 --- a/js/data/locale/gd/dateres.json +++ b/js/data/locale/gd/dateres.json @@ -11,13 +11,11 @@ "Week": "seachdain", "Week of Month": "seachdain dhen mhìos", "Year": "bliadhna", - "D": "l", - "DD": "ll", - "YY": "bb", - "YYYY": "bbbb", - "M": "m", - "MM": "mm", - "H": "u", - "HH": "uu", + "D": "L", + "DD": "LL", + "YY": "BB", + "YYYY": "BBBB", + "H": "U", + "HH": "UU", "ss": "dd" } \ No newline at end of file diff --git a/js/data/locale/gl/dateres.json b/js/data/locale/gl/dateres.json index 66fa6270ea..74952f8c14 100644 --- a/js/data/locale/gl/dateres.json +++ b/js/data/locale/gl/dateres.json @@ -11,12 +11,6 @@ "Week": "semana", "Week of Month": "semana do mes", "Year": "ano", - "D": "d", - "DD": "dd", - "YY": "aa", - "YYYY": "ano", - "M": "m", - "MM": "mm", - "H": "h", - "HH": "hh" + "YY": "AA", + "YYYY": "ANO" } \ No newline at end of file diff --git a/js/data/locale/gsw/dateres.json b/js/data/locale/gsw/dateres.json index 23b783e8f4..1f6c33a859 100644 --- a/js/data/locale/gsw/dateres.json +++ b/js/data/locale/gsw/dateres.json @@ -12,9 +12,7 @@ "D": "T", "DD": "TT", "YY": "JJ", - "YYYY": "Jaar", + "YYYY": "JJJJ", "H": "S", - "HH": "SS", - "mm": "MM", - "ss": "SS" + "HH": "SS" } \ No newline at end of file diff --git a/js/data/locale/gu/dateres.json b/js/data/locale/gu/dateres.json index cf4e7ba3e8..1afdb61711 100644 --- a/js/data/locale/gu/dateres.json +++ b/js/data/locale/gu/dateres.json @@ -13,7 +13,7 @@ "D": "દ", "DD": "દદ", "YY": "વવ", - "YYYY": "વર્ષ", + "YYYY": "વવવવ", "M": "મ", "MM": "મમ", "H": "ક", diff --git a/js/data/locale/guz/dateres.json b/js/data/locale/guz/dateres.json index 34790613d9..998f01249a 100644 --- a/js/data/locale/guz/dateres.json +++ b/js/data/locale/guz/dateres.json @@ -17,6 +17,6 @@ "MM": "OO", "H": "E", "HH": "EE", - "mm": "EE", - "ss": "EE" + "mm": "ee", + "ss": "ee" } \ No newline at end of file diff --git a/js/data/locale/ha/dateres.json b/js/data/locale/ha/dateres.json index 20ae153970..754cd648c6 100644 --- a/js/data/locale/ha/dateres.json +++ b/js/data/locale/ha/dateres.json @@ -17,6 +17,5 @@ "MM": "WW", "H": "A", "HH": "AA", - "mm": "MM", - "ss": "DD" + "ss": "dd" } \ No newline at end of file diff --git a/js/data/locale/hi/dateres.json b/js/data/locale/hi/dateres.json index c697076418..d6f4075947 100644 --- a/js/data/locale/hi/dateres.json +++ b/js/data/locale/hi/dateres.json @@ -14,7 +14,7 @@ "D": "द", "DD": "दद", "YY": "वव", - "YYYY": "वर्ष", + "YYYY": "वववव", "M": "म", "MM": "मम", "H": "घ", diff --git a/js/data/locale/hr/dateres.json b/js/data/locale/hr/dateres.json index f58fcbcda1..e7db6b8aae 100644 --- a/js/data/locale/hr/dateres.json +++ b/js/data/locale/hr/dateres.json @@ -10,12 +10,8 @@ "Week": "tjedan", "Week of Month": "tjedan u mjesecu", "Year": "godina", - "D": "d", - "DD": "dd", - "YY": "gg", - "YYYY": "gggg", - "M": "m", - "MM": "mm", - "H": "s", - "HH": "ss" + "YY": "GG", + "YYYY": "GGGG", + "H": "S", + "HH": "SS" } \ No newline at end of file diff --git a/js/data/locale/hsb/dateres.json b/js/data/locale/hsb/dateres.json index dba8d3a8d2..ac3ee959b9 100644 --- a/js/data/locale/hsb/dateres.json +++ b/js/data/locale/hsb/dateres.json @@ -9,12 +9,6 @@ "Time Zone": "časowe pasmo", "Week": "tydźeń", "Year": "lěto", - "D": "d", - "DD": "dd", - "YY": "ll", - "YYYY": "lěto", - "M": "m", - "MM": "mm", - "H": "h", - "HH": "hh" + "YY": "LL", + "YYYY": "LLLL" } \ No newline at end of file diff --git a/js/data/locale/hu/dateres.json b/js/data/locale/hu/dateres.json index f625332e13..54f209ed7b 100644 --- a/js/data/locale/hu/dateres.json +++ b/js/data/locale/hu/dateres.json @@ -11,14 +11,14 @@ "Week": "hét", "Week of Month": "hónap hete", "Year": "év", - "D": "n", - "DD": "nn", - "YY": "év", - "YYYY": "év", - "M": "h", - "MM": "hh", - "H": "ó", - "HH": "óó", + "D": "N", + "DD": "NN", + "YY": "ÉV", + "YYYY": "ÉV", + "M": "H", + "MM": "HH", + "H": "Ó", + "HH": "ÓÓ", "mm": "pp", "ss": "mm" } \ No newline at end of file diff --git a/js/data/locale/hy/dateres.json b/js/data/locale/hy/dateres.json index 70913e4753..c192ee8666 100644 --- a/js/data/locale/hy/dateres.json +++ b/js/data/locale/hy/dateres.json @@ -11,14 +11,14 @@ "Week": "շաբաթ", "Week of Month": "ամսվա շաբաթ", "Year": "տարի", - "D": "օ", - "DD": "օր", - "YY": "տտ", - "YYYY": "տարի", - "M": "ա", - "MM": "աա", - "H": "ժ", - "HH": "ժժ", + "D": "ՕՐ", + "DD": "ՕՐ", + "YY": "ՏՏ", + "YYYY": "ՏՏՏՏ", + "M": "Ա", + "MM": "ԱԱ", + "H": "Ժ", + "HH": "ԺԺ", "mm": "րր", "ss": "վվ" } \ No newline at end of file diff --git a/js/data/locale/ia/dateres.json b/js/data/locale/ia/dateres.json index 79faa2ec55..b76dda02f8 100644 --- a/js/data/locale/ia/dateres.json +++ b/js/data/locale/ia/dateres.json @@ -10,12 +10,6 @@ "Week": "septimana", "Week of Month": "septimana del mense", "Year": "anno", - "D": "d", - "DD": "dd", - "YY": "aa", - "YYYY": "anno", - "M": "m", - "MM": "mm", - "H": "h", - "HH": "hh" + "YY": "AA", + "YYYY": "AAAA" } \ No newline at end of file diff --git a/js/data/locale/id/dateres.json b/js/data/locale/id/dateres.json index bd51623533..c8834670f1 100644 --- a/js/data/locale/id/dateres.json +++ b/js/data/locale/id/dateres.json @@ -1,21 +1,20 @@ { - "Day": "hari", + "Day": "Hari", "Day of Year": "Hari dalam Setahun", - "Era": "era", "Hour": "Jam", - "Minute": "menit", - "Month": "bulan", - "Second": "detik", - "Time Zone": "zona waktu", - "Week": "minggu", - "Week of Month": "minggu", - "Year": "tahun", - "D": "h", - "DD": "hh", - "YY": "tt", - "YYYY": "tttt", - "M": "b", - "MM": "bb", + "Minute": "Menit", + "Month": "Bulan", + "Second": "Detik", + "Time Zone": "Zona waktu", + "Week": "Minggu", + "Week of Month": "Minggu", + "Year": "Tahun", + "D": "H", + "DD": "HH", + "YY": "TT", + "YYYY": "TTTT", + "M": "B", + "MM": "BB", "H": "J", "HH": "JJ", "ss": "dd" diff --git a/js/data/locale/ig/dateres.json b/js/data/locale/ig/dateres.json index d2e1536687..93eeab56bf 100644 --- a/js/data/locale/ig/dateres.json +++ b/js/data/locale/ig/dateres.json @@ -12,11 +12,11 @@ "D": "Ụ", "DD": "ỤỤ", "YY": "AA", - "YYYY": "Afọ", + "YYYY": "AFỌ", "M": "Ọ", "MM": "ỌỌ", "H": "E", "HH": "EE", - "mm": "NN", - "ss": "NN" + "mm": "nn", + "ss": "nn" } \ No newline at end of file diff --git a/js/data/locale/ii/dateres.json b/js/data/locale/ii/dateres.json index 0ca7c3fd0a..8f65ca918b 100644 --- a/js/data/locale/ii/dateres.json +++ b/js/data/locale/ii/dateres.json @@ -15,7 +15,7 @@ "YYYY": "ꈎ", "M": "ꆪ", "MM": "ꆪ", - "H": "ꄮ", + "H": "ꄮꈉ", "HH": "ꄮꈉ", "mm": "ꃏ", "ss": "ꇙ" diff --git a/js/data/locale/is/dateres.json b/js/data/locale/is/dateres.json index a3b217aa8f..1f2a124cd0 100644 --- a/js/data/locale/is/dateres.json +++ b/js/data/locale/is/dateres.json @@ -11,12 +11,8 @@ "Week": "vika", "Week of Month": "vika í mánuði", "Year": "ár", - "D": "d", - "DD": "dd", - "YY": "ár", - "YYYY": "ár", - "M": "m", - "MM": "mm", - "H": "k", - "HH": "kk" + "YY": "ÁR", + "YYYY": "ÁR", + "H": "K", + "HH": "KK" } \ No newline at end of file diff --git a/js/data/locale/it/dateres.json b/js/data/locale/it/dateres.json index d726b8b388..171c419217 100644 --- a/js/data/locale/it/dateres.json +++ b/js/data/locale/it/dateres.json @@ -10,12 +10,10 @@ "Week": "settimana", "Week of Month": "settimana del mese", "Year": "anno", - "D": "g", - "DD": "gg", - "YY": "aa", - "YYYY": "anno", - "M": "m", - "MM": "mm", - "H": "o", - "HH": "oo" + "D": "G", + "DD": "GG", + "YY": "AA", + "YYYY": "AAAA", + "H": "O", + "HH": "OO" } \ No newline at end of file diff --git a/js/data/locale/jmc/dateres.json b/js/data/locale/jmc/dateres.json index 981532f936..1afbc89c0f 100644 --- a/js/data/locale/jmc/dateres.json +++ b/js/data/locale/jmc/dateres.json @@ -12,9 +12,8 @@ "D": "M", "DD": "MM", "YY": "MM", - "YYYY": "Maka", + "YYYY": "MMMM", "H": "S", "HH": "SS", - "mm": "DD", - "ss": "SS" + "mm": "dd" } \ No newline at end of file diff --git a/js/data/locale/jv/dateres.json b/js/data/locale/jv/dateres.json index cf685ea9f8..61045792fd 100644 --- a/js/data/locale/jv/dateres.json +++ b/js/data/locale/jv/dateres.json @@ -9,13 +9,11 @@ "Time Zone": "zona wektu", "Week": "pekan", "Year": "taun", - "D": "d", - "DD": "dd", - "YY": "tt", - "YYYY": "taun", - "M": "s", - "MM": "ss", - "H": "j", - "HH": "jj", + "YY": "TT", + "YYYY": "TTTT", + "M": "S", + "MM": "SS", + "H": "J", + "HH": "JJ", "ss": "dd" } \ No newline at end of file diff --git a/js/data/locale/ka/dateres.json b/js/data/locale/ka/dateres.json index add34146fc..c6aa160601 100644 --- a/js/data/locale/ka/dateres.json +++ b/js/data/locale/ka/dateres.json @@ -11,14 +11,14 @@ "Week": "კვირა", "Week of Month": "თვის კვირა", "Year": "წელი", - "D": "დ", - "DD": "დდ", - "YY": "წწ", - "YYYY": "წელი", - "M": "თ", - "MM": "თთ", - "H": "ს", - "HH": "სს", + "D": "Დ", + "DD": "ᲓᲓ", + "YY": "ᲬᲬ", + "YYYY": "ᲬᲬᲬᲬ", + "M": "Თ", + "MM": "ᲗᲗ", + "H": "Ს", + "HH": "ᲡᲡ", "mm": "წწ", "ss": "წწ" } \ No newline at end of file diff --git a/js/data/locale/kab/dateres.json b/js/data/locale/kab/dateres.json index 598775daca..9e90c2b4ad 100644 --- a/js/data/locale/kab/dateres.json +++ b/js/data/locale/kab/dateres.json @@ -17,6 +17,6 @@ "MM": "AA", "H": "T", "HH": "TT", - "mm": "TT", - "ss": "TT" + "mm": "tt", + "ss": "tt" } \ No newline at end of file diff --git a/js/data/locale/kam/dateres.json b/js/data/locale/kam/dateres.json index 602f07f7d4..1558139ce2 100644 --- a/js/data/locale/kam/dateres.json +++ b/js/data/locale/kam/dateres.json @@ -15,5 +15,5 @@ "YYYY": "MMMM", "H": "S", "HH": "SS", - "mm": "NN" + "mm": "nn" } \ No newline at end of file diff --git a/js/data/locale/kde/dateres.json b/js/data/locale/kde/dateres.json index 388dd599ea..8060e37ab8 100644 --- a/js/data/locale/kde/dateres.json +++ b/js/data/locale/kde/dateres.json @@ -15,6 +15,5 @@ "YYYY": "MMMM", "H": "S", "HH": "SS", - "mm": "DD", - "ss": "SS" + "mm": "dd" } \ No newline at end of file diff --git a/js/data/locale/kea/dateres.json b/js/data/locale/kea/dateres.json index 8ec2354ef5..e952c01958 100644 --- a/js/data/locale/kea/dateres.json +++ b/js/data/locale/kea/dateres.json @@ -9,9 +9,7 @@ "Week": "Simana", "Year": "Anu", "YY": "AA", - "YYYY": "Anu", + "YYYY": "ANU", "H": "O", - "HH": "OO", - "mm": "MM", - "ss": "SS" + "HH": "OO" } \ No newline at end of file diff --git a/js/data/locale/khq/dateres.json b/js/data/locale/khq/dateres.json index ab3760aee4..dcab771b88 100644 --- a/js/data/locale/khq/dateres.json +++ b/js/data/locale/khq/dateres.json @@ -17,6 +17,5 @@ "MM": "HH", "H": "G", "HH": "GG", - "mm": "MM", - "ss": "MM" + "ss": "mm" } \ No newline at end of file diff --git a/js/data/locale/ki/dateres.json b/js/data/locale/ki/dateres.json index 8ad7910c5d..69649aa70e 100644 --- a/js/data/locale/ki/dateres.json +++ b/js/data/locale/ki/dateres.json @@ -15,6 +15,5 @@ "YYYY": "MMMM", "H": "I", "HH": "II", - "mm": "NN", - "ss": "SS" + "mm": "nn" } \ No newline at end of file diff --git a/js/data/locale/kk/dateres.json b/js/data/locale/kk/dateres.json index 8a85a3fc9b..ff6d099fea 100644 --- a/js/data/locale/kk/dateres.json +++ b/js/data/locale/kk/dateres.json @@ -11,14 +11,14 @@ "Week": "апта", "Week of Month": "айдағы апта", "Year": "жыл", - "D": "к", - "DD": "кк", - "YY": "жж", - "YYYY": "жыл", - "M": "а", - "MM": "ай", - "H": "с", - "HH": "сс", + "D": "К", + "DD": "КК", + "YY": "ЖЖ", + "YYYY": "ЖЫЛ", + "M": "АЙ", + "MM": "АЙ", + "H": "С", + "HH": "СС", "mm": "мм", "ss": "сс" } \ No newline at end of file diff --git a/js/data/locale/kln/dateres.json b/js/data/locale/kln/dateres.json index e71e4ca596..6ec4d662aa 100644 --- a/js/data/locale/kln/dateres.json +++ b/js/data/locale/kln/dateres.json @@ -16,7 +16,5 @@ "M": "A", "MM": "AA", "H": "S", - "HH": "SS", - "mm": "MM", - "ss": "SS" + "HH": "SS" } \ No newline at end of file diff --git a/js/data/locale/km/dateres.json b/js/data/locale/km/dateres.json index 7d43e04700..72fd52dd51 100644 --- a/js/data/locale/km/dateres.json +++ b/js/data/locale/km/dateres.json @@ -15,7 +15,7 @@ "DD": "ថថ", "YY": "ឆឆ", "YYYY": "ឆឆឆឆ", - "M": "ខ", + "M": "ខែ", "MM": "ខែ", "H": "ម", "HH": "មម", diff --git a/js/data/locale/kn/dateres.json b/js/data/locale/kn/dateres.json index 45d3ca780e..c7830c6f14 100644 --- a/js/data/locale/kn/dateres.json +++ b/js/data/locale/kn/dateres.json @@ -13,7 +13,7 @@ "D": "ದ", "DD": "ದದ", "YY": "ವವ", - "YYYY": "ವರ್ಷ", + "YYYY": "ವವವವ", "M": "ತ", "MM": "ತತ", "H": "ಗ", diff --git a/js/data/locale/kok/dateres.json b/js/data/locale/kok/dateres.json index 026a097470..7f58c576da 100644 --- a/js/data/locale/kok/dateres.json +++ b/js/data/locale/kok/dateres.json @@ -14,10 +14,10 @@ "D": "द", "DD": "दद", "YY": "वव", - "YYYY": "वर्स", + "YYYY": "वववव", "M": "म", "MM": "मम", - "H": "व", + "H": "वर", "HH": "वर", "mm": "मम", "ss": "सस" diff --git a/js/data/locale/ksb/dateres.json b/js/data/locale/ksb/dateres.json index 894a4ca1fe..7f0820fc9a 100644 --- a/js/data/locale/ksb/dateres.json +++ b/js/data/locale/ksb/dateres.json @@ -17,6 +17,5 @@ "MM": "NN", "H": "S", "HH": "SS", - "mm": "DD", - "ss": "SS" + "mm": "dd" } \ No newline at end of file diff --git a/js/data/locale/ksf/dateres.json b/js/data/locale/ksf/dateres.json index 7b9f2c3d8b..0f7d895e5e 100644 --- a/js/data/locale/ksf/dateres.json +++ b/js/data/locale/ksf/dateres.json @@ -12,11 +12,10 @@ "D": "Ŋ", "DD": "ŊŊ", "YY": "BB", - "YYYY": "Bǝk", + "YYYY": "BƎK", "M": "Ŋ", "MM": "ŊŊ", "H": "C", "HH": "CC", - "mm": "MM", - "ss": "HH" + "ss": "hh" } \ No newline at end of file diff --git a/js/data/locale/ksh/dateres.json b/js/data/locale/ksh/dateres.json index 87bd6ef515..01e3c4682c 100644 --- a/js/data/locale/ksh/dateres.json +++ b/js/data/locale/ksh/dateres.json @@ -10,9 +10,7 @@ "Week": "Woch", "Year": "Johr", "YY": "JJ", - "YYYY": "Johr", + "YYYY": "JJJJ", "H": "S", - "HH": "SS", - "mm": "MM", - "ss": "SS" + "HH": "SS" } \ No newline at end of file diff --git a/js/data/locale/ku/dateres.json b/js/data/locale/ku/dateres.json index 3f25aabf0d..b0f680cc67 100644 --- a/js/data/locale/ku/dateres.json +++ b/js/data/locale/ku/dateres.json @@ -9,13 +9,11 @@ "Time Zone": "Zone", "Week": "hefte", "Year": "sal", - "D": "r", - "DD": "rr", - "YY": "ss", - "YYYY": "sal", - "M": "m", - "MM": "mm", - "H": "s", - "HH": "ss", + "D": "R", + "DD": "RR", + "YY": "SS", + "YYYY": "SAL", + "H": "S", + "HH": "SS", "mm": "dd" } \ No newline at end of file diff --git a/js/data/locale/ky/dateres.json b/js/data/locale/ky/dateres.json index 8b0466eb82..a311e20e8e 100644 --- a/js/data/locale/ky/dateres.json +++ b/js/data/locale/ky/dateres.json @@ -11,14 +11,14 @@ "Week": "апта", "Week of Month": "айдын жумасы", "Year": "жыл", - "D": "күн", - "DD": "күн", - "YY": "жыл", - "YYYY": "жыл", - "M": "ай", - "MM": "ай", - "H": "саат", - "HH": "саат", + "D": "КҮН", + "DD": "КҮН", + "YY": "ЖЫЛ", + "YYYY": "ЖЫЛ", + "M": "АЙ", + "MM": "АЙ", + "H": "СААТ", + "HH": "СААТ", "mm": "мүнөт", "ss": "секунд" } \ No newline at end of file diff --git a/js/data/locale/lag/dateres.json b/js/data/locale/lag/dateres.json index f527a82a9e..9bc76432fd 100644 --- a/js/data/locale/lag/dateres.json +++ b/js/data/locale/lag/dateres.json @@ -15,6 +15,5 @@ "YYYY": "MMMM", "H": "S", "HH": "SS", - "mm": "DD", - "ss": "SS" + "mm": "dd" } \ No newline at end of file diff --git a/js/data/locale/lb/dateres.json b/js/data/locale/lb/dateres.json index 17130a0f4a..b7e8ae6546 100644 --- a/js/data/locale/lb/dateres.json +++ b/js/data/locale/lb/dateres.json @@ -10,9 +10,7 @@ "Week": "Woch", "Year": "Joer", "YY": "JJ", - "YYYY": "Joer", + "YYYY": "JJJJ", "H": "S", - "HH": "SS", - "mm": "MM", - "ss": "SS" + "HH": "SS" } \ No newline at end of file diff --git a/js/data/locale/lg/dateres.json b/js/data/locale/lg/dateres.json index e1cc445a53..46cc947110 100644 --- a/js/data/locale/lg/dateres.json +++ b/js/data/locale/lg/dateres.json @@ -14,6 +14,6 @@ "YYYY": "MMMM", "H": "S", "HH": "SS", - "mm": "DD", - "ss": "KK" + "mm": "dd", + "ss": "kk" } \ No newline at end of file diff --git a/js/data/locale/lkt/dateres.json b/js/data/locale/lkt/dateres.json index 186240d932..c2a059ecc0 100644 --- a/js/data/locale/lkt/dateres.json +++ b/js/data/locale/lkt/dateres.json @@ -12,10 +12,10 @@ "DD": "AA", "YY": "ÓÓ", "YYYY": "ÓÓÓÓ", - "M": "W", - "MM": "Wí", + "M": "WÍ", + "MM": "WÍ", "H": "O", "HH": "OO", - "mm": "OO", - "ss": "OO" + "mm": "oo", + "ss": "oo" } \ No newline at end of file diff --git a/js/data/locale/ln/dateres.json b/js/data/locale/ln/dateres.json index b794c9096c..d495b7358b 100644 --- a/js/data/locale/ln/dateres.json +++ b/js/data/locale/ln/dateres.json @@ -12,11 +12,9 @@ "D": "M", "DD": "MM", "YY": "MM", - "YYYY": "Mobú", + "YYYY": "MMMM", "M": "S", "MM": "SS", "H": "N", - "HH": "NN", - "mm": "MM", - "ss": "SS" + "HH": "NN" } \ No newline at end of file diff --git a/js/data/locale/lrc/dateres.json b/js/data/locale/lrc/dateres.json index f11129db54..56518aaf52 100644 --- a/js/data/locale/lrc/dateres.json +++ b/js/data/locale/lrc/dateres.json @@ -13,7 +13,7 @@ "DD": "رر", "YY": "سس", "YYYY": "سال", - "M": "م", + "M": "ما", "MM": "ما", "H": "س", "HH": "سس", diff --git a/js/data/locale/lt/dateres.json b/js/data/locale/lt/dateres.json index 5ada41057c..3b596ca83d 100644 --- a/js/data/locale/lt/dateres.json +++ b/js/data/locale/lt/dateres.json @@ -11,12 +11,8 @@ "Week": "savaitė", "Week of Month": "mėnesio savaitė", "Year": "metai", - "D": "d", - "DD": "dd", - "YY": "mm", - "YYYY": "mmmm", - "M": "m", - "MM": "mm", - "H": "v", - "HH": "vv" + "YY": "MM", + "YYYY": "MMMM", + "H": "V", + "HH": "VV" } \ No newline at end of file diff --git a/js/data/locale/lu/dateres.json b/js/data/locale/lu/dateres.json index 886062da1d..dfc18f7c35 100644 --- a/js/data/locale/lu/dateres.json +++ b/js/data/locale/lu/dateres.json @@ -15,6 +15,6 @@ "MM": "NN", "H": "D", "HH": "DD", - "mm": "KK", - "ss": "KK" + "mm": "kk", + "ss": "kk" } \ No newline at end of file diff --git a/js/data/locale/luo/dateres.json b/js/data/locale/luo/dateres.json index 2616eb4b05..497f73d756 100644 --- a/js/data/locale/luo/dateres.json +++ b/js/data/locale/luo/dateres.json @@ -9,14 +9,14 @@ "Time Zone": "kar saa", "Week": "juma", "Year": "higa", - "D": "c", - "DD": "cc", - "YY": "hh", - "YYYY": "higa", - "M": "d", - "MM": "dd", - "H": "s", - "HH": "ss", + "D": "C", + "DD": "CC", + "YY": "HH", + "YYYY": "HHHH", + "M": "D", + "MM": "DD", + "H": "S", + "HH": "SS", "mm": "dd", "ss": "nn" } \ No newline at end of file diff --git a/js/data/locale/luy/dateres.json b/js/data/locale/luy/dateres.json index fcaec557fd..805b317f11 100644 --- a/js/data/locale/luy/dateres.json +++ b/js/data/locale/luy/dateres.json @@ -15,6 +15,5 @@ "YYYY": "MMMM", "H": "I", "HH": "II", - "mm": "II", - "ss": "SS" + "mm": "ii" } \ No newline at end of file diff --git a/js/data/locale/lv/dateres.json b/js/data/locale/lv/dateres.json index 81bb033a3b..a365d97d2c 100644 --- a/js/data/locale/lv/dateres.json +++ b/js/data/locale/lv/dateres.json @@ -11,12 +11,8 @@ "Week": "nedēļa", "Week of Month": "mēneša nedēļa", "Year": "gads", - "D": "d", - "DD": "dd", - "YY": "gg", - "YYYY": "gads", - "M": "m", - "MM": "mm", - "H": "s", - "HH": "ss" + "YY": "GG", + "YYYY": "GGGG", + "H": "S", + "HH": "SS" } \ No newline at end of file diff --git a/js/data/locale/mas/dateres.json b/js/data/locale/mas/dateres.json index 5b39d028c3..eeff29d2b1 100644 --- a/js/data/locale/mas/dateres.json +++ b/js/data/locale/mas/dateres.json @@ -17,6 +17,5 @@ "MM": "ƆƆ", "H": "Ɛ", "HH": "ƐƐ", - "mm": "OO", - "ss": "SS" + "mm": "oo" } \ No newline at end of file diff --git a/js/data/locale/mer/dateres.json b/js/data/locale/mer/dateres.json index 37b5babfb4..386f5faab0 100644 --- a/js/data/locale/mer/dateres.json +++ b/js/data/locale/mer/dateres.json @@ -15,6 +15,5 @@ "YYYY": "MMMM", "H": "Ĩ", "HH": "ĨĨ", - "mm": "NN", - "ss": "SS" + "mm": "nn" } \ No newline at end of file diff --git a/js/data/locale/mfe/dateres.json b/js/data/locale/mfe/dateres.json index 74d84494f4..eaecba268c 100644 --- a/js/data/locale/mfe/dateres.json +++ b/js/data/locale/mfe/dateres.json @@ -12,9 +12,7 @@ "D": "Z", "DD": "ZZ", "YY": "LL", - "YYYY": "Lane", + "YYYY": "LLLL", "H": "L", - "HH": "LL", - "mm": "MM", - "ss": "SS" + "HH": "LL" } \ No newline at end of file diff --git a/js/data/locale/mg/dateres.json b/js/data/locale/mg/dateres.json index c76ef148ea..72a1fe6cfa 100644 --- a/js/data/locale/mg/dateres.json +++ b/js/data/locale/mg/dateres.json @@ -14,7 +14,5 @@ "M": "V", "MM": "VV", "H": "O", - "HH": "OO", - "mm": "MM", - "ss": "SS" + "HH": "OO" } \ No newline at end of file diff --git a/js/data/locale/mgh/dateres.json b/js/data/locale/mgh/dateres.json index 300ee7e4e9..f2f7e07c65 100644 --- a/js/data/locale/mgh/dateres.json +++ b/js/data/locale/mgh/dateres.json @@ -9,14 +9,10 @@ "Time Zone": "Zone", "Week": "iwiki mocha", "Year": "yaka", - "D": "n", - "DD": "nn", - "YY": "yy", - "YYYY": "yaka", - "M": "m", - "MM": "mm", - "H": "i", - "HH": "ii", + "D": "N", + "DD": "NN", + "H": "I", + "HH": "II", "mm": "ii", "ss": "ii" } \ No newline at end of file diff --git a/js/data/locale/mgo/dateres.json b/js/data/locale/mgo/dateres.json index b5fe5e95e8..2baa1c2e6f 100644 --- a/js/data/locale/mgo/dateres.json +++ b/js/data/locale/mgo/dateres.json @@ -5,10 +5,10 @@ "Time Zone": "Zone", "Week": "nkap", "Year": "fituʼ", - "D": "a", - "DD": "aa", - "YY": "ff", - "YYYY": "ffff", - "M": "i", - "MM": "ii" + "D": "A", + "DD": "AA", + "YY": "FF", + "YYYY": "FFFF", + "M": "I", + "MM": "II" } \ No newline at end of file diff --git a/js/data/locale/mi/dateres.json b/js/data/locale/mi/dateres.json index f4ebdfa6b5..2018493790 100644 --- a/js/data/locale/mi/dateres.json +++ b/js/data/locale/mi/dateres.json @@ -8,13 +8,9 @@ "Time Zone": "rohe wā", "Week": "wiki", "Year": "tau", - "D": "r", - "DD": "rā", - "YY": "tt", - "YYYY": "tau", - "M": "m", - "MM": "mm", - "H": "h", - "HH": "hh", + "D": "RĀ", + "DD": "RĀ", + "YY": "TT", + "YYYY": "TAU", "ss": "hh" } \ No newline at end of file diff --git a/js/data/locale/mk/dateres.json b/js/data/locale/mk/dateres.json index a2e9de9933..d7f291044e 100644 --- a/js/data/locale/mk/dateres.json +++ b/js/data/locale/mk/dateres.json @@ -11,14 +11,14 @@ "Week": "седмица", "Week of Month": "седмица од месецот", "Year": "година", - "D": "д", - "DD": "дд", - "YY": "гг", - "YYYY": "гггг", - "M": "м", - "MM": "мм", - "H": "ч", - "HH": "чч", + "D": "Д", + "DD": "ДД", + "YY": "ГГ", + "YYYY": "ГГГГ", + "M": "М", + "MM": "ММ", + "H": "Ч", + "HH": "ЧЧ", "mm": "мм", "ss": "сс" } \ No newline at end of file diff --git a/js/data/locale/ml/dateres.json b/js/data/locale/ml/dateres.json index bb88125aa3..595da3a061 100644 --- a/js/data/locale/ml/dateres.json +++ b/js/data/locale/ml/dateres.json @@ -13,7 +13,7 @@ "D": "ദ", "DD": "ദദ", "YY": "വവ", - "YYYY": "വർഷം", + "YYYY": "വവവവ", "M": "മ", "MM": "മമ", "H": "മ", diff --git a/js/data/locale/mn/dateres.json b/js/data/locale/mn/dateres.json index 0131f0f295..61f33357d9 100644 --- a/js/data/locale/mn/dateres.json +++ b/js/data/locale/mn/dateres.json @@ -11,14 +11,14 @@ "Week": "долоо хоног", "Week of Month": "сарын долоо хоног", "Year": "жил", - "D": "ө", - "DD": "өө", - "YY": "жж", - "YYYY": "жил", - "M": "с", - "MM": "сс", - "H": "ц", - "HH": "цц", + "D": "Ө", + "DD": "ӨӨ", + "YY": "ЖЖ", + "YYYY": "ЖИЛ", + "M": "С", + "MM": "СС", + "H": "Ц", + "HH": "ЦЦ", "mm": "мм", "ss": "сс" } \ No newline at end of file diff --git a/js/data/locale/mr/dateres.json b/js/data/locale/mr/dateres.json index 9f428293f3..a2dbc594ea 100644 --- a/js/data/locale/mr/dateres.json +++ b/js/data/locale/mr/dateres.json @@ -14,7 +14,7 @@ "D": "द", "DD": "दद", "YY": "वव", - "YYYY": "वर्ष", + "YYYY": "वववव", "M": "म", "MM": "मम", "H": "त", diff --git a/js/data/locale/ms/dateres.json b/js/data/locale/ms/dateres.json index d2b439edb5..a7736b7f65 100644 --- a/js/data/locale/ms/dateres.json +++ b/js/data/locale/ms/dateres.json @@ -1,20 +1,19 @@ { "AM/PM": "PG/PTG", - "Day": "hari", - "Era": "era", - "Hour": "jam", - "Minute": "minit", - "Month": "bulan", - "Second": "saat", - "Time Zone": "zon waktu", - "Week": "minggu", - "Year": "tahun", - "D": "h", - "DD": "hh", - "YY": "tt", - "YYYY": "tttt", - "M": "b", - "MM": "bb", - "H": "j", - "HH": "jj" + "Day": "Hari", + "Hour": "Jam", + "Minute": "Minit", + "Month": "Bulan", + "Second": "Saat", + "Time Zone": "Zon waktu", + "Week": "Minggu", + "Year": "Tahun", + "D": "H", + "DD": "HH", + "YY": "TT", + "YYYY": "TTTT", + "M": "B", + "MM": "BB", + "H": "J", + "HH": "JJ" } \ No newline at end of file diff --git a/js/data/locale/mt/dateres.json b/js/data/locale/mt/dateres.json index 10afbc5dc5..6929387056 100644 --- a/js/data/locale/mt/dateres.json +++ b/js/data/locale/mt/dateres.json @@ -9,12 +9,12 @@ "Week": "ġimgħa", "Week of Month": "ġimgħa tax-xahar", "Year": "Sena", - "D": "j", - "DD": "jj", + "D": "J", + "DD": "JJ", "YY": "SS", - "YYYY": "Sena", - "M": "x", - "MM": "xx", - "H": "s", - "HH": "ss" + "YYYY": "SSSS", + "M": "X", + "MM": "XX", + "H": "S", + "HH": "SS" } \ No newline at end of file diff --git a/js/data/locale/mua/dateres.json b/js/data/locale/mua/dateres.json index f06e4af37a..c2985c7484 100644 --- a/js/data/locale/mua/dateres.json +++ b/js/data/locale/mua/dateres.json @@ -12,11 +12,11 @@ "D": "Z", "DD": "ZZ", "YY": "SS", - "YYYY": "Syii", + "YYYY": "SSSS", "M": "F", "MM": "FF", "H": "C", "HH": "CC", - "mm": "CC", - "ss": "CC" + "mm": "cc", + "ss": "cc" } \ No newline at end of file diff --git a/js/data/locale/my/dateres.json b/js/data/locale/my/dateres.json index cd476eddf9..8309a84bff 100644 --- a/js/data/locale/my/dateres.json +++ b/js/data/locale/my/dateres.json @@ -14,7 +14,7 @@ "D": "ရ", "DD": "ရရ", "YY": "နန", - "YYYY": "နှစ်", + "YYYY": "နနနန", "M": "လ", "MM": "လ", "H": "န", diff --git a/js/data/locale/naq/dateres.json b/js/data/locale/naq/dateres.json index 80ad20975c..09a34d611b 100644 --- a/js/data/locale/naq/dateres.json +++ b/js/data/locale/naq/dateres.json @@ -17,6 +17,6 @@ "MM": "ǁǁ", "H": "I", "HH": "II", - "mm": "HH", + "mm": "hh", "ss": "ǀǀ" } \ No newline at end of file diff --git a/js/data/locale/nb/dateres.json b/js/data/locale/nb/dateres.json index 014b2a4a9f..4ede5de535 100644 --- a/js/data/locale/nb/dateres.json +++ b/js/data/locale/nb/dateres.json @@ -11,12 +11,8 @@ "Week": "uke", "Week of Month": "uke i måneden", "Year": "år", - "D": "d", - "DD": "dd", - "YY": "år", - "YYYY": "år", - "M": "m", - "MM": "mm", - "H": "t", - "HH": "tt" + "YY": "ÅR", + "YYYY": "ÅR", + "H": "T", + "HH": "TT" } \ No newline at end of file diff --git a/js/data/locale/nd/dateres.json b/js/data/locale/nd/dateres.json index b4318e9a4d..7e5f9c580f 100644 --- a/js/data/locale/nd/dateres.json +++ b/js/data/locale/nd/dateres.json @@ -16,6 +16,6 @@ "MM": "II", "H": "I", "HH": "II", - "mm": "UU", - "ss": "II" + "mm": "uu", + "ss": "ii" } \ No newline at end of file diff --git a/js/data/locale/ne/dateres.json b/js/data/locale/ne/dateres.json index ef469ca96e..328d6fa30b 100644 --- a/js/data/locale/ne/dateres.json +++ b/js/data/locale/ne/dateres.json @@ -14,7 +14,7 @@ "D": "ब", "DD": "बब", "YY": "वव", - "YYYY": "वर्ष", + "YYYY": "वववव", "M": "म", "MM": "मम", "H": "घ", diff --git a/js/data/locale/nl/dateres.json b/js/data/locale/nl/dateres.json index 1e740d6a78..b32a68c6a3 100644 --- a/js/data/locale/nl/dateres.json +++ b/js/data/locale/nl/dateres.json @@ -11,12 +11,8 @@ "Week": "week", "Week of Month": "week van de maand", "Year": "jaar", - "D": "d", - "DD": "dd", - "YY": "jj", - "YYYY": "jaar", - "M": "m", - "MM": "mm", - "H": "u", - "HH": "uu" + "YY": "JJ", + "YYYY": "JJJJ", + "H": "U", + "HH": "UU" } \ No newline at end of file diff --git a/js/data/locale/nmg/dateres.json b/js/data/locale/nmg/dateres.json index 06b8d7ddf3..c1a7c76a50 100644 --- a/js/data/locale/nmg/dateres.json +++ b/js/data/locale/nmg/dateres.json @@ -10,11 +10,10 @@ "Week": "Sɔ́ndɔ", "Year": "Mbvu", "YY": "MM", - "YYYY": "Mbvu", + "YYYY": "MMMM", "M": "N", "MM": "NN", "H": "W", "HH": "WW", - "mm": "MM", - "ss": "NN" + "ss": "nn" } \ No newline at end of file diff --git a/js/data/locale/nn/dateres.json b/js/data/locale/nn/dateres.json index a4645ec168..35da8fb22f 100644 --- a/js/data/locale/nn/dateres.json +++ b/js/data/locale/nn/dateres.json @@ -11,12 +11,8 @@ "Week": "veke", "Week of Month": "veke i månaden", "Year": "år", - "D": "d", - "DD": "dd", - "YY": "år", - "YYYY": "år", - "M": "m", - "MM": "mm", - "H": "t", - "HH": "tt" + "YY": "ÅR", + "YYYY": "ÅR", + "H": "T", + "HH": "TT" } \ No newline at end of file diff --git a/js/data/locale/nnh/dateres.json b/js/data/locale/nnh/dateres.json index c1219b60ee..0e89cfef3a 100644 --- a/js/data/locale/nnh/dateres.json +++ b/js/data/locale/nnh/dateres.json @@ -5,10 +5,10 @@ "Hour": "fʉ̀ʼ nèm", "Time Zone": "Zone", "Year": "ngùʼ", - "D": "l", - "DD": "ll", - "YY": "nn", - "YYYY": "ngùʼ", - "H": "f", - "HH": "ff" + "D": "L", + "DD": "LL", + "YY": "NN", + "YYYY": "NNNN", + "H": "F", + "HH": "FF" } \ No newline at end of file diff --git a/js/data/locale/nus/dateres.json b/js/data/locale/nus/dateres.json index 74492900be..f1721e5a18 100644 --- a/js/data/locale/nus/dateres.json +++ b/js/data/locale/nus/dateres.json @@ -17,6 +17,5 @@ "MM": "PP", "H": "T", "HH": "TT", - "mm": "MM", - "ss": "TT" + "ss": "tt" } \ No newline at end of file diff --git a/js/data/locale/nyn/dateres.json b/js/data/locale/nyn/dateres.json index 632ba53ee7..73bab9790b 100644 --- a/js/data/locale/nyn/dateres.json +++ b/js/data/locale/nyn/dateres.json @@ -17,6 +17,6 @@ "MM": "OO", "H": "S", "HH": "SS", - "mm": "EE", - "ss": "OO" + "mm": "ee", + "ss": "oo" } \ No newline at end of file diff --git a/js/data/locale/or/dateres.json b/js/data/locale/or/dateres.json index 471f142a5f..13275ee0df 100644 --- a/js/data/locale/or/dateres.json +++ b/js/data/locale/or/dateres.json @@ -14,7 +14,7 @@ "D": "ଦ", "DD": "ଦଦ", "YY": "ବବ", - "YYYY": "ବର୍ଷ", + "YYYY": "ବବବବ", "M": "ମ", "MM": "ମମ", "H": "ଘ", diff --git a/js/data/locale/os/dateres.json b/js/data/locale/os/dateres.json index 76c920c0a1..e613a049d2 100644 --- a/js/data/locale/os/dateres.json +++ b/js/data/locale/os/dateres.json @@ -11,12 +11,12 @@ "Year": "Аз", "D": "Б", "DD": "ББ", - "YY": "Аз", - "YYYY": "Аз", + "YY": "АЗ", + "YYYY": "АЗ", "M": "М", "MM": "ММ", "H": "С", "HH": "СС", - "mm": "ММ", - "ss": "СС" + "mm": "мм", + "ss": "сс" } \ No newline at end of file diff --git a/js/data/locale/pl/dateres.json b/js/data/locale/pl/dateres.json index 7aab8dcc7f..e89c1860ea 100644 --- a/js/data/locale/pl/dateres.json +++ b/js/data/locale/pl/dateres.json @@ -11,12 +11,8 @@ "Week": "tydzień", "Week of Month": "tydzień miesiąca", "Year": "rok", - "D": "d", - "DD": "dd", - "YY": "rr", - "YYYY": "rok", - "M": "m", - "MM": "mm", - "H": "g", - "HH": "gg" + "YY": "RR", + "YYYY": "ROK", + "H": "G", + "HH": "GG" } \ No newline at end of file diff --git a/js/data/locale/pt/dateres.json b/js/data/locale/pt/dateres.json index da522187b0..02d819a785 100644 --- a/js/data/locale/pt/dateres.json +++ b/js/data/locale/pt/dateres.json @@ -1,21 +1,14 @@ { - "Day": "dia", - "Day of Year": "dia do ano", - "Era": "era", - "Hour": "hora", - "Minute": "minuto", - "Month": "mês", - "Second": "segundo", - "Time Zone": "fuso horário", - "Week": "semana", - "Week of Month": "semana do mês", - "Year": "ano", - "D": "d", - "DD": "dd", - "YY": "aa", - "YYYY": "ano", - "M": "m", - "MM": "mm", - "H": "h", - "HH": "hh" + "Day": "Dia", + "Day of Year": "Dia do ano", + "Hour": "Hora", + "Minute": "Minuto", + "Month": "Mês", + "Second": "Segundo", + "Time Zone": "Fuso horário", + "Week": "Semana", + "Week of Month": "Semana do mês", + "Year": "Ano", + "YY": "AA", + "YYYY": "ANO" } \ No newline at end of file diff --git a/js/data/locale/rm/dateres.json b/js/data/locale/rm/dateres.json index 6797e7cdd8..8cf0bcd8f2 100644 --- a/js/data/locale/rm/dateres.json +++ b/js/data/locale/rm/dateres.json @@ -11,10 +11,8 @@ "Year": "onn", "D": "T", "DD": "TT", - "YY": "oo", - "YYYY": "onn", - "M": "m", - "MM": "mm", - "H": "u", - "HH": "uu" + "YY": "OO", + "YYYY": "ONN", + "H": "U", + "HH": "UU" } \ No newline at end of file diff --git a/js/data/locale/rn/dateres.json b/js/data/locale/rn/dateres.json index 9efdc485bc..37006491d2 100644 --- a/js/data/locale/rn/dateres.json +++ b/js/data/locale/rn/dateres.json @@ -17,6 +17,6 @@ "MM": "UU", "H": "I", "HH": "II", - "mm": "UU", - "ss": "II" + "mm": "uu", + "ss": "ii" } \ No newline at end of file diff --git a/js/data/locale/ro/dateres.json b/js/data/locale/ro/dateres.json index c6a8e05f09..c91816f3a2 100644 --- a/js/data/locale/ro/dateres.json +++ b/js/data/locale/ro/dateres.json @@ -11,12 +11,12 @@ "Week": "săptămână", "Week of Month": "săptămâna din lună", "Year": "an", - "D": "z", - "DD": "zi", - "YY": "an", - "YYYY": "an", - "M": "l", - "MM": "ll", - "H": "o", - "HH": "oo" + "D": "ZI", + "DD": "ZI", + "YY": "AN", + "YYYY": "AN", + "M": "L", + "MM": "LL", + "H": "O", + "HH": "OO" } \ No newline at end of file diff --git a/js/data/locale/rof/dateres.json b/js/data/locale/rof/dateres.json index 68d8083e2e..4d5c0d7951 100644 --- a/js/data/locale/rof/dateres.json +++ b/js/data/locale/rof/dateres.json @@ -15,6 +15,5 @@ "YYYY": "MMMM", "H": "I", "HH": "II", - "mm": "DD", - "ss": "SS" + "mm": "dd" } \ No newline at end of file diff --git a/js/data/locale/ru/dateres.json b/js/data/locale/ru/dateres.json index e5afce75ce..2488086882 100644 --- a/js/data/locale/ru/dateres.json +++ b/js/data/locale/ru/dateres.json @@ -10,14 +10,14 @@ "Week": "неделя", "Week of Month": "неделя месяца", "Year": "год", - "D": "д", - "DD": "дд", - "YY": "гг", - "YYYY": "год", - "M": "м", - "MM": "мм", - "H": "ч", - "HH": "чч", + "D": "Д", + "DD": "ДД", + "YY": "ГГ", + "YYYY": "ГОД", + "M": "М", + "MM": "ММ", + "H": "Ч", + "HH": "ЧЧ", "mm": "мм", "ss": "сс" } \ No newline at end of file diff --git a/js/data/locale/rwk/dateres.json b/js/data/locale/rwk/dateres.json index 981532f936..1afbc89c0f 100644 --- a/js/data/locale/rwk/dateres.json +++ b/js/data/locale/rwk/dateres.json @@ -12,9 +12,8 @@ "D": "M", "DD": "MM", "YY": "MM", - "YYYY": "Maka", + "YYYY": "MMMM", "H": "S", "HH": "SS", - "mm": "DD", - "ss": "SS" + "mm": "dd" } \ No newline at end of file diff --git a/js/data/locale/sah/dateres.json b/js/data/locale/sah/dateres.json index 86c2da6f26..30872c4ba0 100644 --- a/js/data/locale/sah/dateres.json +++ b/js/data/locale/sah/dateres.json @@ -12,11 +12,11 @@ "D": "К", "DD": "КК", "YY": "СС", - "YYYY": "Сыл", - "M": "Ы", - "MM": "Ый", + "YYYY": "СЫЛ", + "M": "ЫЙ", + "MM": "ЫЙ", "H": "Ч", "HH": "ЧЧ", - "mm": "ММ", - "ss": "СС" + "mm": "мм", + "ss": "сс" } \ No newline at end of file diff --git a/js/data/locale/saq/dateres.json b/js/data/locale/saq/dateres.json index 4f63b1327f..29e96c9270 100644 --- a/js/data/locale/saq/dateres.json +++ b/js/data/locale/saq/dateres.json @@ -12,11 +12,11 @@ "D": "M", "DD": "MM", "YY": "LL", - "YYYY": "Lari", + "YYYY": "LLLL", "M": "L", "MM": "LL", "H": "S", "HH": "SS", - "mm": "II", - "ss": "II" + "mm": "ii", + "ss": "ii" } \ No newline at end of file diff --git a/js/data/locale/sbp/dateres.json b/js/data/locale/sbp/dateres.json index 8f53dc8321..3e00253481 100644 --- a/js/data/locale/sbp/dateres.json +++ b/js/data/locale/sbp/dateres.json @@ -15,6 +15,6 @@ "YYYY": "MMMM", "H": "I", "HH": "II", - "mm": "II", - "ss": "II" + "mm": "ii", + "ss": "ii" } \ No newline at end of file diff --git a/js/data/locale/se/dateres.json b/js/data/locale/se/dateres.json index 83545f0c25..e55fd9c218 100644 --- a/js/data/locale/se/dateres.json +++ b/js/data/locale/se/dateres.json @@ -9,12 +9,10 @@ "Time Zone": "áigeavádat", "Week": "váhkku", "Year": "jáhki", - "D": "b", - "DD": "bb", - "YY": "jj", - "YYYY": "jjjj", - "M": "m", - "MM": "mm", - "H": "d", - "HH": "dd" + "D": "B", + "DD": "BB", + "YY": "JJ", + "YYYY": "JJJJ", + "H": "D", + "HH": "DD" } \ No newline at end of file diff --git a/js/data/locale/seh/dateres.json b/js/data/locale/seh/dateres.json index ef47d85ab4..6bd3aa101d 100644 --- a/js/data/locale/seh/dateres.json +++ b/js/data/locale/seh/dateres.json @@ -10,7 +10,5 @@ "D": "N", "DD": "NN", "YY": "CC", - "YYYY": "CCCC", - "mm": "MM", - "ss": "SS" + "YYYY": "CCCC" } \ No newline at end of file diff --git a/js/data/locale/ses/dateres.json b/js/data/locale/ses/dateres.json index e85b44dcbf..e70b6a0c45 100644 --- a/js/data/locale/ses/dateres.json +++ b/js/data/locale/ses/dateres.json @@ -17,6 +17,5 @@ "MM": "HH", "H": "G", "HH": "GG", - "mm": "MM", - "ss": "MM" + "ss": "mm" } \ No newline at end of file diff --git a/js/data/locale/sg/dateres.json b/js/data/locale/sg/dateres.json index 17ed1e165a..470b38f074 100644 --- a/js/data/locale/sg/dateres.json +++ b/js/data/locale/sg/dateres.json @@ -9,14 +9,14 @@ "Time Zone": "Zukangbonga", "Week": "Dimâsi", "Year": "Ngû", - "D": "L", - "DD": "Lâ", + "D": "LÂ", + "DD": "LÂ", "YY": "NN", - "YYYY": "Ngû", + "YYYY": "NGÛ", "M": "N", "MM": "NN", "H": "N", "HH": "NN", - "mm": "NN", - "ss": "NN" + "mm": "nn", + "ss": "nn" } \ No newline at end of file diff --git a/js/data/locale/shi/Latn/dateres.json b/js/data/locale/shi/Latn/dateres.json index 49ef39c05a..10f877a314 100644 --- a/js/data/locale/shi/Latn/dateres.json +++ b/js/data/locale/shi/Latn/dateres.json @@ -9,14 +9,14 @@ "Time Zone": "akud n ugmmaḍ", "Week": "imalass", "Year": "asggʷas", - "D": "a", - "DD": "aa", - "YY": "aa", - "YYYY": "aaaa", - "M": "a", - "MM": "aa", - "H": "t", - "HH": "tt", + "D": "A", + "DD": "AA", + "YY": "AA", + "YYYY": "AAAA", + "M": "A", + "MM": "AA", + "H": "T", + "HH": "TT", "mm": "tt", "ss": "tt" } \ No newline at end of file diff --git a/js/data/locale/sk/dateres.json b/js/data/locale/sk/dateres.json index 54cd43be63..a24ae0a50e 100644 --- a/js/data/locale/sk/dateres.json +++ b/js/data/locale/sk/dateres.json @@ -10,12 +10,6 @@ "Week": "týždeň", "Week of Month": "týždeň mesiaca", "Year": "rok", - "D": "d", - "DD": "dd", - "YY": "rr", - "YYYY": "rok", - "M": "m", - "MM": "mm", - "H": "h", - "HH": "hh" + "YY": "RR", + "YYYY": "ROK" } \ No newline at end of file diff --git a/js/data/locale/sl/dateres.json b/js/data/locale/sl/dateres.json index dd0b04b797..e489018b09 100644 --- a/js/data/locale/sl/dateres.json +++ b/js/data/locale/sl/dateres.json @@ -11,12 +11,8 @@ "Week": "teden", "Week of Month": "teden meseca", "Year": "leto", - "D": "d", - "DD": "dd", - "YY": "ll", - "YYYY": "leto", - "M": "m", - "MM": "mm", - "H": "u", - "HH": "uu" + "YY": "LL", + "YYYY": "LLLL", + "H": "U", + "HH": "UU" } \ No newline at end of file diff --git a/js/data/locale/sn/dateres.json b/js/data/locale/sn/dateres.json index 7413ea1d39..3e826f024e 100644 --- a/js/data/locale/sn/dateres.json +++ b/js/data/locale/sn/dateres.json @@ -12,9 +12,7 @@ "D": "Z", "DD": "ZZ", "YY": "GG", - "YYYY": "Gore", + "YYYY": "GGGG", "H": "A", - "HH": "AA", - "mm": "MM", - "ss": "SS" + "HH": "AA" } \ No newline at end of file diff --git a/js/data/locale/sq/dateres.json b/js/data/locale/sq/dateres.json index 390e6a14b3..8bd5dbcbf0 100644 --- a/js/data/locale/sq/dateres.json +++ b/js/data/locale/sq/dateres.json @@ -11,12 +11,8 @@ "Week": "javë", "Week of Month": "javë e muajit", "Year": "vit", - "D": "d", - "DD": "dd", - "YY": "vv", - "YYYY": "vit", - "M": "m", - "MM": "mm", - "H": "o", - "HH": "oo" + "YY": "VV", + "YYYY": "VIT", + "H": "O", + "HH": "OO" } \ No newline at end of file diff --git a/js/data/locale/sr/Latn/dateres.json b/js/data/locale/sr/Latn/dateres.json index 3b1ef3fe93..a6b4413df8 100644 --- a/js/data/locale/sr/Latn/dateres.json +++ b/js/data/locale/sr/Latn/dateres.json @@ -11,14 +11,14 @@ "Week": "nedelja", "Week of Month": "nedelja u mesecu", "Year": "godina", - "D": "d", - "DD": "dd", - "YY": "gg", - "YYYY": "gggg", - "M": "m", - "MM": "mm", - "H": "s", - "HH": "ss", + "D": "D", + "DD": "DD", + "YY": "GG", + "YYYY": "GGGG", + "M": "M", + "MM": "MM", + "H": "S", + "HH": "SS", "mm": "mm", "ss": "ss" } \ No newline at end of file diff --git a/js/data/locale/sr/dateres.json b/js/data/locale/sr/dateres.json index fc06d74fcb..144a34100e 100644 --- a/js/data/locale/sr/dateres.json +++ b/js/data/locale/sr/dateres.json @@ -11,14 +11,14 @@ "Week": "недеља", "Week of Month": "недеља у месецу", "Year": "година", - "D": "д", - "DD": "дд", - "YY": "гг", - "YYYY": "гггг", - "M": "м", - "MM": "мм", - "H": "с", - "HH": "сс", + "D": "Д", + "DD": "ДД", + "YY": "ГГ", + "YYYY": "ГГГГ", + "M": "М", + "MM": "ММ", + "H": "С", + "HH": "СС", "mm": "мм", "ss": "сс" } \ No newline at end of file diff --git a/js/data/locale/sv/dateres.json b/js/data/locale/sv/dateres.json index b57d3a1cf3..06754522a7 100644 --- a/js/data/locale/sv/dateres.json +++ b/js/data/locale/sv/dateres.json @@ -11,12 +11,8 @@ "Week": "vecka", "Week of Month": "vecka i månaden", "Year": "år", - "D": "d", - "DD": "dd", - "YY": "år", - "YYYY": "år", - "M": "m", - "MM": "mm", - "H": "t", - "HH": "tt" + "YY": "ÅR", + "YYYY": "ÅR", + "H": "T", + "HH": "TT" } \ No newline at end of file diff --git a/js/data/locale/sw/dateres.json b/js/data/locale/sw/dateres.json index 46d0cda9d9..4ba4bf998b 100644 --- a/js/data/locale/sw/dateres.json +++ b/js/data/locale/sw/dateres.json @@ -10,13 +10,11 @@ "Week": "wiki", "Week of Month": "wiki ya mwezi", "Year": "mwaka", - "D": "s", - "DD": "ss", - "YY": "mm", - "YYYY": "mmmm", - "M": "m", - "MM": "mm", - "H": "s", - "HH": "ss", + "D": "S", + "DD": "SS", + "YY": "MM", + "YYYY": "MMMM", + "H": "S", + "HH": "SS", "mm": "dd" } \ No newline at end of file diff --git a/js/data/locale/teo/dateres.json b/js/data/locale/teo/dateres.json index 9e57bc0c80..329499f2dc 100644 --- a/js/data/locale/teo/dateres.json +++ b/js/data/locale/teo/dateres.json @@ -12,11 +12,11 @@ "D": "A", "DD": "AA", "YY": "EE", - "YYYY": "Ekan", + "YYYY": "EEEE", "M": "E", "MM": "EE", "H": "E", "HH": "EE", - "mm": "II", - "ss": "II" + "mm": "ii", + "ss": "ii" } \ No newline at end of file diff --git a/js/data/locale/tg/dateres.json b/js/data/locale/tg/dateres.json index abfdea1aac..02544d9851 100644 --- a/js/data/locale/tg/dateres.json +++ b/js/data/locale/tg/dateres.json @@ -9,14 +9,14 @@ "Time Zone": "минтақаи вақт", "Week": "ҳафта", "Year": "сол", - "D": "рӯз", - "DD": "рӯз", - "YY": "сол", - "YYYY": "сол", - "M": "моҳ", - "MM": "моҳ", - "H": "соат", - "HH": "соат", + "D": "РӮЗ", + "DD": "РӮЗ", + "YY": "СОЛ", + "YYYY": "СОЛ", + "M": "МОҲ", + "MM": "МОҲ", + "H": "СОАТ", + "HH": "СОАТ", "mm": "дақиқа", "ss": "сония" } \ No newline at end of file diff --git a/js/data/locale/tk/dateres.json b/js/data/locale/tk/dateres.json index b8a4bb6b5f..e7bfe6f991 100644 --- a/js/data/locale/tk/dateres.json +++ b/js/data/locale/tk/dateres.json @@ -11,14 +11,14 @@ "Week": "hepde", "Week of Month": "aýyň hepdesi", "Year": "ýyl", - "D": "gün", - "DD": "gün", - "YY": "ýyl", - "YYYY": "ýyl", - "M": "aý", - "MM": "aý", - "H": "sagat", - "HH": "sagat", + "D": "GÜN", + "DD": "GÜN", + "YY": "ÝYL", + "YYYY": "ÝYL", + "M": "AÝ", + "MM": "AÝ", + "H": "SAGAT", + "HH": "SAGAT", "mm": "minut", "ss": "sekunt" } \ No newline at end of file diff --git a/js/data/locale/to/dateres.json b/js/data/locale/to/dateres.json index 5e57e25a20..d1293f182b 100644 --- a/js/data/locale/to/dateres.json +++ b/js/data/locale/to/dateres.json @@ -12,10 +12,6 @@ "Year": "taʻu", "D": "ʻ", "DD": "ʻʻ", - "YY": "tt", - "YYYY": "taʻu", - "M": "m", - "MM": "mm", - "H": "h", - "HH": "hh" + "YY": "TT", + "YYYY": "TTTT" } \ No newline at end of file diff --git a/js/data/locale/tr/dateres.json b/js/data/locale/tr/dateres.json index b2d05241a8..358b1ab25a 100644 --- a/js/data/locale/tr/dateres.json +++ b/js/data/locale/tr/dateres.json @@ -11,13 +11,12 @@ "Week": "hafta", "Week of Month": "ayın haftası", "Year": "yıl", - "D": "g", - "DD": "gg", - "YY": "yy", - "YYYY": "yıl", - "M": "a", - "MM": "ay", - "H": "s", - "HH": "ss", + "D": "G", + "DD": "GG", + "YYYY": "YIL", + "M": "AY", + "MM": "AY", + "H": "S", + "HH": "SS", "mm": "dd" } \ No newline at end of file diff --git a/js/data/locale/tt/dateres.json b/js/data/locale/tt/dateres.json index 41f1a53852..1811ea73a0 100644 --- a/js/data/locale/tt/dateres.json +++ b/js/data/locale/tt/dateres.json @@ -8,14 +8,14 @@ "Time Zone": "вакыт өлкәсе", "Week": "атна", "Year": "ел", - "D": "к", - "DD": "кк", - "YY": "ел", - "YYYY": "ел", - "M": "а", - "MM": "ай", - "H": "с", - "HH": "сс", + "D": "К", + "DD": "КК", + "YY": "ЕЛ", + "YYYY": "ЕЛ", + "M": "АЙ", + "MM": "АЙ", + "H": "С", + "HH": "СС", "mm": "мм", "ss": "сс" } \ No newline at end of file diff --git a/js/data/locale/twq/dateres.json b/js/data/locale/twq/dateres.json index b779765111..2601bf41d6 100644 --- a/js/data/locale/twq/dateres.json +++ b/js/data/locale/twq/dateres.json @@ -17,6 +17,5 @@ "MM": "HH", "H": "G", "HH": "GG", - "mm": "MM", - "ss": "MM" + "ss": "mm" } \ No newline at end of file diff --git a/js/data/locale/tzm/dateres.json b/js/data/locale/tzm/dateres.json index dd6b798444..28aecd5350 100644 --- a/js/data/locale/tzm/dateres.json +++ b/js/data/locale/tzm/dateres.json @@ -17,6 +17,6 @@ "MM": "AA", "H": "T", "HH": "TT", - "mm": "TT", - "ss": "TT" + "mm": "tt", + "ss": "tt" } \ No newline at end of file diff --git a/js/data/locale/uk/dateres.json b/js/data/locale/uk/dateres.json index 0e691299b5..d26a5a7abc 100644 --- a/js/data/locale/uk/dateres.json +++ b/js/data/locale/uk/dateres.json @@ -11,14 +11,14 @@ "Week": "тиждень", "Week of Month": "тиждень місяця", "Year": "рік", - "D": "д", - "DD": "дд", - "YY": "рр", - "YYYY": "рік", - "M": "м", - "MM": "мм", - "H": "г", - "HH": "гг", + "D": "Д", + "DD": "ДД", + "YY": "РР", + "YYYY": "РІК", + "M": "М", + "MM": "ММ", + "H": "Г", + "HH": "ГГ", "mm": "хх", "ss": "сс" } \ No newline at end of file diff --git a/js/data/locale/uz/Cyrl/dateres.json b/js/data/locale/uz/Cyrl/dateres.json index 0be921a749..4bbbbba2cd 100644 --- a/js/data/locale/uz/Cyrl/dateres.json +++ b/js/data/locale/uz/Cyrl/dateres.json @@ -11,14 +11,14 @@ "Week": "Ҳафта", "Week of Month": "Week Of Month", "Year": "Йил", - "D": "Кун", - "DD": "Кун", - "YY": "Йил", - "YYYY": "Йил", - "M": "Ой", - "MM": "Ой", - "H": "Соат", - "HH": "Соат", + "D": "КУН", + "DD": "КУН", + "YY": "ЙИЛ", + "YYYY": "ЙИЛ", + "M": "ОЙ", + "MM": "ОЙ", + "H": "СОАТ", + "HH": "СОАТ", "mm": "Дақиқа", "ss": "Сония" } \ No newline at end of file diff --git a/js/data/locale/uz/dateres.json b/js/data/locale/uz/dateres.json index 32d1b3634b..95ea25eefa 100644 --- a/js/data/locale/uz/dateres.json +++ b/js/data/locale/uz/dateres.json @@ -11,14 +11,14 @@ "Week": "hafta", "Week of Month": "oyning haftasi", "Year": "yil", - "D": "kun", - "DD": "kun", - "YY": "yil", - "YYYY": "yil", - "M": "oy", - "MM": "oy", - "H": "soat", - "HH": "soat", + "D": "KUN", + "DD": "KUN", + "YY": "YIL", + "YYYY": "YIL", + "M": "OY", + "MM": "OY", + "H": "SOAT", + "HH": "SOAT", "mm": "daqiqa", "ss": "soniya" } \ No newline at end of file diff --git a/js/data/locale/vai/Latn/dateres.json b/js/data/locale/vai/Latn/dateres.json index 57df76747d..34c0488e69 100644 --- a/js/data/locale/vai/Latn/dateres.json +++ b/js/data/locale/vai/Latn/dateres.json @@ -6,14 +6,14 @@ "Second": "jaki-jaka", "Week": "wiki", "Year": "saŋ", - "D": "t", - "DD": "tt", - "YY": "ss", - "YYYY": "saŋ", - "M": "k", - "MM": "kk", - "H": "h", - "HH": "hh", + "D": "T", + "DD": "TT", + "YY": "SS", + "YYYY": "SAŊ", + "M": "K", + "MM": "KK", + "H": "H", + "HH": "HH", "mm": "mm", "ss": "jj" } \ No newline at end of file diff --git a/js/data/locale/vai/dateres.json b/js/data/locale/vai/dateres.json index 17d56dc31b..c741c4123a 100644 --- a/js/data/locale/vai/dateres.json +++ b/js/data/locale/vai/dateres.json @@ -8,13 +8,13 @@ "Time Zone": "Zone", "Week": "ꔨꔤꕃ", "Year": "ꕢꘋ", - "D": "ꔎ", + "D": "ꔎꔒ", "DD": "ꔎꔒ", "YY": "ꕢꘋ", "YYYY": "ꕢꘋ", - "M": "ꕪ", + "M": "ꕪꖃ", "MM": "ꕪꖃ", - "H": "ꕌ", + "H": "ꕌꕎ", "HH": "ꕌꕎ", "mm": "ꕆꕇ", "ss": "ꕧꕧ" diff --git a/js/data/locale/vi/dateres.json b/js/data/locale/vi/dateres.json index 84d0b4b787..b51505798e 100644 --- a/js/data/locale/vi/dateres.json +++ b/js/data/locale/vi/dateres.json @@ -14,11 +14,11 @@ "D": "N", "DD": "NN", "YY": "NN", - "YYYY": "Năm", + "YYYY": "NĂM", "M": "T", "MM": "TT", "H": "G", "HH": "GG", - "mm": "PP", - "ss": "GG" + "mm": "pp", + "ss": "gg" } \ No newline at end of file diff --git a/js/data/locale/vun/dateres.json b/js/data/locale/vun/dateres.json index 981532f936..1afbc89c0f 100644 --- a/js/data/locale/vun/dateres.json +++ b/js/data/locale/vun/dateres.json @@ -12,9 +12,8 @@ "D": "M", "DD": "MM", "YY": "MM", - "YYYY": "Maka", + "YYYY": "MMMM", "H": "S", "HH": "SS", - "mm": "DD", - "ss": "SS" + "mm": "dd" } \ No newline at end of file diff --git a/js/data/locale/wae/dateres.json b/js/data/locale/wae/dateres.json index bdb6e149c3..2b152ee115 100644 --- a/js/data/locale/wae/dateres.json +++ b/js/data/locale/wae/dateres.json @@ -11,9 +11,7 @@ "D": "T", "DD": "TT", "YY": "JJ", - "YYYY": "Jár", + "YYYY": "JÁR", "H": "S", - "HH": "SS", - "mm": "MM", - "ss": "SS" + "HH": "SS" } \ No newline at end of file diff --git a/js/data/locale/wo/dateres.json b/js/data/locale/wo/dateres.json index 9ab9bf1183..3b1e257531 100644 --- a/js/data/locale/wo/dateres.json +++ b/js/data/locale/wo/dateres.json @@ -9,13 +9,13 @@ "Time Zone": "goxu waxtu", "Week": "ayu-bis", "Year": "at", - "D": "f", - "DD": "ff", - "YY": "at", - "YYYY": "at", - "M": "w", - "MM": "ww", - "H": "w", - "HH": "ww", + "D": "F", + "DD": "FF", + "YY": "AT", + "YYYY": "AT", + "M": "W", + "MM": "WW", + "H": "W", + "HH": "WW", "mm": "ss" } \ No newline at end of file diff --git a/js/data/locale/xog/dateres.json b/js/data/locale/xog/dateres.json index 0605a61f23..3f73264c18 100644 --- a/js/data/locale/xog/dateres.json +++ b/js/data/locale/xog/dateres.json @@ -17,6 +17,6 @@ "MM": "OO", "H": "E", "HH": "EE", - "mm": "EE", - "ss": "OO" + "mm": "ee", + "ss": "oo" } \ No newline at end of file diff --git a/js/data/locale/yav/dateres.json b/js/data/locale/yav/dateres.json index f9f6478fc4..e746e3db5e 100644 --- a/js/data/locale/yav/dateres.json +++ b/js/data/locale/yav/dateres.json @@ -9,12 +9,10 @@ "Time Zone": "kinúki kisikɛl ɔ́ pitɔŋ", "Week": "sɔ́ndiɛ", "Year": "yɔɔŋ", - "D": "p", - "DD": "pp", - "YY": "yy", - "YYYY": "yɔɔŋ", - "M": "o", - "MM": "oo", - "H": "k", - "HH": "kk" + "D": "P", + "DD": "PP", + "M": "O", + "MM": "OO", + "H": "K", + "HH": "KK" } \ No newline at end of file diff --git a/js/data/locale/yo/BJ/dateres.json b/js/data/locale/yo/BJ/dateres.json index 1f16ad7b7b..3954da7432 100644 --- a/js/data/locale/yo/BJ/dateres.json +++ b/js/data/locale/yo/BJ/dateres.json @@ -8,5 +8,5 @@ "D": "Ɔ", "DD": "ƆƆ", "YY": "ƆƆ", - "YYYY": "Ɔdún" + "YYYY": "ƆƆƆƆ" } \ No newline at end of file diff --git a/js/data/locale/yo/dateres.json b/js/data/locale/yo/dateres.json index 068d46a7c1..9a74e15fbb 100644 --- a/js/data/locale/yo/dateres.json +++ b/js/data/locale/yo/dateres.json @@ -12,11 +12,11 @@ "D": "Ọ", "DD": "ỌỌ", "YY": "ỌỌ", - "YYYY": "Ọdún", + "YYYY": "ỌỌỌỌ", "M": "O", "MM": "OO", - "H": "w", - "HH": "ww", - "mm": "ÌÌ", - "ss": "ÌÌ" + "H": "W", + "HH": "WW", + "mm": "ìì", + "ss": "ìì" } \ No newline at end of file diff --git a/js/data/locale/yue/Hans/dateres.json b/js/data/locale/yue/Hans/dateres.json index 26e03de5d3..99bb247da1 100644 --- a/js/data/locale/yue/Hans/dateres.json +++ b/js/data/locale/yue/Hans/dateres.json @@ -4,6 +4,7 @@ "Time Zone": "时区", "Week": "周", "Week of Month": "月周", + "H": "小时", "HH": "小时", "mm": "分钟" } \ No newline at end of file diff --git a/js/data/locale/yue/dateres.json b/js/data/locale/yue/dateres.json index 757531e78b..74874c8f06 100644 --- a/js/data/locale/yue/dateres.json +++ b/js/data/locale/yue/dateres.json @@ -17,7 +17,7 @@ "YYYY": "年", "M": "月", "MM": "月", - "H": "小", + "H": "小時", "HH": "小時", "mm": "分鐘", "ss": "秒" diff --git a/js/data/locale/zh/Hant/dateres.json b/js/data/locale/zh/Hant/dateres.json index 0af99c706d..fdc1cad4e7 100644 --- a/js/data/locale/zh/Hant/dateres.json +++ b/js/data/locale/zh/Hant/dateres.json @@ -6,6 +6,7 @@ "Time Zone": "時區", "Week": "週", "Week of Month": "週", + "H": "小時", "HH": "小時", "mm": "分鐘" } \ No newline at end of file diff --git a/js/data/locale/zh/dateres.json b/js/data/locale/zh/dateres.json index ec6023f1ee..af0957841c 100644 --- a/js/data/locale/zh/dateres.json +++ b/js/data/locale/zh/dateres.json @@ -17,7 +17,7 @@ "YYYY": "年", "M": "月", "MM": "月", - "H": "小", + "H": "小时", "HH": "小时", "mm": "分钟", "ss": "秒" diff --git a/js/data/locale/zu/dateres.json b/js/data/locale/zu/dateres.json index 2269b5fc73..cf8419fa74 100644 --- a/js/data/locale/zu/dateres.json +++ b/js/data/locale/zu/dateres.json @@ -17,6 +17,6 @@ "MM": "II", "H": "I", "HH": "II", - "mm": "II", - "ss": "II" + "mm": "ii", + "ss": "ii" } \ No newline at end of file diff --git a/js/lib/DateFmtInfo.js b/js/lib/DateFmtInfo.js index a273087f32..f40244a4d9 100644 --- a/js/lib/DateFmtInfo.js +++ b/js/lib/DateFmtInfo.js @@ -93,8 +93,24 @@ DateFmtInfo.prototype = { loadParams: loadParams, onLoad: ilib.bind(this, function (rb) { this.rb = rb; - if (callback && typeof(callback) === "function") { - callback(this); + if (locale.getLanguage() !== this.fmt.locale.getLanguage()) { + new ResBundle({ + locale: locale, + name: "sysres", + sync: sync, + loadParams: loadParams, + onLoad: ilib.bind(this, function (rb) { + this.sysres = rb; + if (callback && typeof(callback) === "function") { + callback(this); + } + }) + }); + } else { + this.sysres = this.fmt.sysres; + if (callback && typeof(callback) === "function") { + callback(this); + } } }) }); @@ -128,7 +144,7 @@ DateFmtInfo.prototype = { * @private */ _getSysString: function (key) { - return (this.fmt.sysres.getStringJS(undefined, key + "-" + this.fmt.calName) || this.fmt.sysres.getStringJS(undefined, key)).toString(); + return (this.sysres.getStringJS(undefined, key + "-" + this.fmt.calName) || this.sysres.getStringJS(undefined, key)).toString(); }, /** @@ -268,7 +284,7 @@ DateFmtInfo.prototype = { monthCount = this.fmt.cal.getNumMonths(date.getYears()); for (var i = 1; i <= monthCount; i++) { - months[i] = this.fmt.sysres.getStringJS(this.fmt._getTemplate(template + i, this.fmt.cal.getType())).toString(); + months[i] = this.sysres.getStringJS(this.fmt._getTemplate(template + i, this.fmt.cal.getType())).toString(); } return months; }, @@ -292,7 +308,7 @@ DateFmtInfo.prototype = { template = DateFmt.weekDayLenMap[length], days = []; for (var i = 0; i < 7; i++) { - days[i] = this.fmt.sysres.getStringJS(this.fmt._getTemplate(template + i, this.fmt.cal.getType())).toString(); + days[i] = this.sysres.getStringJS(this.fmt._getTemplate(template + i, this.fmt.cal.getType())).toString(); } return days; }, @@ -310,7 +326,7 @@ DateFmtInfo.prototype = { } var isLeap = this.fmt.cal.isLeapYear(year); - var dateStr = RB.getStringJS("Date"); // i18n: date input form label for the day of the month field + var dateStr = RB.getStringJS("Day"); // i18n: date input form label for the day of the month field var yearStr = RB.getStringJS("Year"); // i18n: date input form label for the year field var monthStr = RB.getStringJS("Month"); // i18n: date input form label for the months field var hourStr = RB.getStringJS("Hour"); // i18n: date input form label for the hours field @@ -356,7 +372,7 @@ DateFmtInfo.prototype = { component: "year", label: yearStr, placeholder: RB.getStringJS("YY"), // i18n: date format placeholder string for 2 digit year - constraint: "[0-9]{2}", + constraint: "\\d{2}", validation: "\\d{2}" }; @@ -365,7 +381,7 @@ DateFmtInfo.prototype = { component: "year", label: yearStr, placeholder: RB.getStringJS("YYYY"), // i18n: date format placeholder string for 4 digit year - constraint: "[0-9]{4}", + constraint: "\\d{4}", validation: "\\d{4}" }; @@ -441,7 +457,7 @@ DateFmtInfo.prototype = { label: hourStr, placeholder: RB.getStringJS("HH"), // i18n: date format placeholder string for 2 digit hour constraint: sequence(0, 23, true), - validation: "\\d{1,2}" + validation: "\\d{2}" }; case 'k': @@ -459,7 +475,7 @@ DateFmtInfo.prototype = { label: hourStr, placeholder: RB.getStringJS("H"), // i18n: date format placeholder string for 1 digit hour constraint: ["24"].concat(sequence(0, 23, true)), - validation: "\\d{1,2}" + validation: "\\d{2}" }; case 'm': @@ -533,7 +549,7 @@ DateFmtInfo.prototype = { for (i = 1; i <= months; i++) { var key = component + i; ret.push({ - label: this.fmt.sysres.getStringJS(undefined, key + "-" + this.fmt.calName) || this.fmt.sysres.getStringJS(undefined, key), + label: this.sysres.getStringJS(undefined, key + "-" + this.fmt.calName) || this.sysres.getStringJS(undefined, key), value: i }); } @@ -558,7 +574,7 @@ DateFmtInfo.prototype = { if (this.fmt.calName !== "gregorian") { key += '-' + this.fmt.calName; } - return this.fmt.sysres.getStringJS(undefined, key); + return this.sysres.getStringJS(undefined, key); }) }; break; @@ -573,18 +589,18 @@ DateFmtInfo.prototype = { case "chinese": for (var i = 0; i < 7; i++) { var key = "azh" + i; - ret.constraint.push(this.fmt.sysres.getStringJS(undefined, key + "-" + this.fmt.calName) || this.fmt.sysres.getStringJS(undefined, key)); + ret.constraint.push(this.sysres.getStringJS(undefined, key + "-" + this.fmt.calName) || this.sysres.getStringJS(undefined, key)); } break; case "ethiopic": for (var i = 0; i < 7; i++) { var key = "a" + i + "-ethiopic"; - ret.constraint.push(this.fmt.sysres.getStringJS(undefined, key + "-" + this.fmt.calName) || this.fmt.sysres.getStringJS(undefined, key)); + ret.constraint.push(this.sysres.getStringJS(undefined, key + "-" + this.fmt.calName) || this.sysres.getStringJS(undefined, key)); } break; default: - ret.constraint.push(this.fmt.sysres.getStringJS(undefined, "a0-" + this.fmt.calName) || this.fmt.sysres.getStringJS(undefined, "a0")); - ret.constraint.push(this.fmt.sysres.getStringJS(undefined, "a1-" + this.fmt.calName) || this.fmt.sysres.getStringJS(undefined, "a1")); + ret.constraint.push(this.sysres.getStringJS(undefined, "a0-" + this.fmt.calName) || this.sysres.getStringJS(undefined, "a0")); + ret.constraint.push(this.sysres.getStringJS(undefined, "a1-" + this.fmt.calName) || this.sysres.getStringJS(undefined, "a1")); break; } return ret; @@ -646,8 +662,8 @@ DateFmtInfo.prototype = { label: RB.getStringJS("Era"), // i18n: date input form label for the era field constraint: [] }; - ret.constraint.push(this.fmt.sysres.getStringJS(undefined, "G0-" + this.fmt.calName) || this.fmt.sysres.getStringJS(undefined, "G0")); - ret.constraint.push(this.fmt.sysres.getStringJS(undefined, "G1-" + this.fmt.calName) || this.fmt.sysres.getStringJS(undefined, "G1")); + ret.constraint.push(this.sysres.getStringJS(undefined, "G0-" + this.fmt.calName) || this.sysres.getStringJS(undefined, "G0")); + ret.constraint.push(this.sysres.getStringJS(undefined, "G1-" + this.fmt.calName) || this.sysres.getStringJS(undefined, "G1")); return ret; case 'z': // general time zone @@ -877,7 +893,7 @@ DateFmtInfo.prototype = { * "component": "year", * "label": "Year", * "placeholder": "YYYY", - * "validation": "[0-9]+" + * "validation": "\\d{4}" * }, * { * "label": " at " diff --git a/js/test/date/testdatefmtasync.js b/js/test/date/testdatefmtasync.js index 4ec4fd3dfe..589b2362c3 100644 --- a/js/test/date/testdatefmtasync.js +++ b/js/test/date/testdatefmtasync.js @@ -315,7 +315,7 @@ module.exports.testdatefmtasync = { var fmt = new DateFmtInfo({ locale: "en-US", type: "date", - date: "short" + length: "short" }); test.ok(fmt !== null); @@ -356,7 +356,7 @@ module.exports.testdatefmtasync = { test.equal(info[4].component, "year"); test.equal(info[4].label, "Year"); - test.equal(info[4].constraint, "[0-9]{2}"); + test.equal(info[4].constraint, "\\d{2}"); test.done(); } }); @@ -369,12 +369,12 @@ module.exports.testdatefmtasync = { var fmt = new DateFmtInfo({ locale: "en-US", type: "date", - date: "full" + length: "full", + uiLocale: "de-DE" }); test.ok(fmt !== null); fmt.getFormatInfo({ - locale: "de-DE", year: 2019, sync: false, onLoad: function(info) { @@ -424,7 +424,7 @@ module.exports.testdatefmtasync = { test.equal(info[4].component, "year"); test.equal(info[4].label, "Jahr"); - test.equal(info[4].constraint, "[0-9]+"); + test.equal(info[4].constraint, "\\d{4}"); test.done(); } }); diff --git a/js/test/date/testdatefmtinfo.js b/js/test/date/testdatefmtinfo.js index 1a60119026..7aa076f21e 100644 --- a/js/test/date/testdatefmtinfo.js +++ b/js/test/date/testdatefmtinfo.js @@ -60,7 +60,7 @@ module.exports.testdategetformatinfo = { test.equal(info[1].label, "/"); test.equal(info[2].component, "day"); - test.equal(info[2].label, "Date"); + test.equal(info[2].label, "Day"); test.deepEqual(info[2].constraint, { "1": [1, 31], "2": [1, 28], @@ -81,7 +81,7 @@ module.exports.testdategetformatinfo = { test.equal(info[4].component, "year"); test.equal(info[4].label, "Year"); - test.equal(info[4].constraint, "[0-9]{2}"); + test.equal(info[4].constraint, "\\d{2}"); } }); @@ -114,7 +114,7 @@ module.exports.testdategetformatinfo = { test.equal(info[1].label, "/"); test.equal(info[2].component, "day"); - test.equal(info[2].label, "Date"); + test.equal(info[2].label, "Day"); test.deepEqual(info[2].constraint, { "1": [1, 31], "2": [1, 29], @@ -135,7 +135,7 @@ module.exports.testdategetformatinfo = { test.equal(info[4].component, "year"); test.equal(info[4].label, "Year"); - test.equal(info[4].constraint, "[0-9]{2}"); + test.equal(info[4].constraint, "\\d{2}"); } }); @@ -181,7 +181,7 @@ module.exports.testdategetformatinfo = { test.equal(info[1].label, " "); test.equal(info[2].component, "day"); - test.equal(info[2].label, "Date"); + test.equal(info[2].label, "Day"); test.deepEqual(info[2].constraint, { "1": [1, 31], "2": [1, 28], @@ -202,7 +202,7 @@ module.exports.testdategetformatinfo = { test.equal(info[4].component, "year"); test.equal(info[4].label, "Year"); - test.equal(info[4].constraint, "[0-9]+"); + test.equal(info[4].constraint, "\\d{4}"); } }); @@ -270,7 +270,7 @@ module.exports.testdategetformatinfo = { test.equal(info[4].component, "year"); test.equal(info[4].label, "Jahr"); - test.equal(info[4].constraint, "[0-9]+"); + test.equal(info[4].constraint, "\\d{4}"); } }); @@ -332,7 +332,7 @@ module.exports.testdategetformatinfo = { test.equal(info[6].component, "year"); test.equal(info[6].label, "Year"); - test.equal(info[6].constraint, "[0-9]{2}"); + test.equal(info[6].constraint, "\\d{2}"); test.ok(!info[7].component); test.equal(info[7].label, " at "); @@ -340,7 +340,7 @@ module.exports.testdategetformatinfo = { test.equal(info[8].component, "hour"); test.equal(info[8].label, "Hour"); test.equal(info[8].placeholder, "H"); - test.deepEqual(info[8].constraint, [1, 12]); + test.deepEqual(info[8].constraint, ["12", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"]); test.equal(info[8].validation, "\\d{1,2}"); test.ok(!info[9].component); @@ -468,7 +468,7 @@ module.exports.testdategetformatinfo = { test.equal(info[4].component, "year"); test.equal(info[4].label, "Year"); - test.equal(info[4].constraint, "[0-9]+"); + test.equal(info[4].constraint, "\\d{4}"); } }); @@ -538,7 +538,7 @@ module.exports.testdategetformatinfo = { test.equal(info[4].component, "year"); test.equal(info[4].label, "Year"); - test.equal(info[4].constraint, "[0-9]+"); + test.equal(info[4].constraint, "\\d{4}"); } }); @@ -606,7 +606,7 @@ module.exports.testdategetformatinfo = { test.equal(info[4].component, "year"); test.equal(info[4].label, "שנה"); - test.equal(info[4].constraint, "[0-9]+"); + test.equal(info[4].constraint, "\\d{4}"); } }); diff --git a/tools/cldr/datefmts.js b/tools/cldr/datefmts.js index 1bd2be2c39..74c9f8fa45 100644 --- a/tools/cldr/datefmts.js +++ b/tools/cldr/datefmts.js @@ -105,6 +105,70 @@ var asianLangs = [ "ja" ]; +// from https://meta.wikimedia.org/wiki/Capitalization_of_Wiktionary_pages#Capitalization_of_month_names +var capitalizedMonthLocales = { + "af": 1, + "br": 1, + "cy": 1, + "el": 1, + "en": 1, + "de": 1, + "bar": 1, + "gsw": 1, + "ksh": 1, + "lb": 1, + "nds": 1, + "pfl": 1, + "hz": 1, + "id": 1, + "la": 1, + "ms": 1, + "pt": 1, + "ve": 1, + "xh": 1, + "zu": 1, +}; +var lowercasedMonthLocales = { + "bs": 1, + "bg": 1, + "hr": 1, + "ca": 1, + "cs": 1, + "da": 1, + "dsb": 1, + "eo": 1, + "es": 1, + "et": 1, + "fi": 1, + "fr": 1, + "hr": 1, + "hsb": 1, + "hu": 1, + "hy": 1, + "is": 1, + "it": 1, + "li": 1, + "lv": 1, + "lt": 1, + "mk": 1, + "no": 1, + "nn": 1, + "nl": 1, + "pl": 1, + "BR": 1, + "ro": 1, + "ru": 1, + "os": 1, + "sr": 1, + "sk": 1, + "sl": 1, + "sv": 1, + "tr": 1, + "uk": 1, + "vi": 1, + "wa": 1 +}; + function addDateFormat(formats, locale, data) { if (!locale) { // root @@ -2163,7 +2227,12 @@ module.exports = { for (var dateField in fieldNames) { if (typeof(cldrData[dateField]) !== 'undefined' && cldrData[dateField].displayName) { if (fieldNames[dateField] !== cldrData[dateField].displayName) { - formats[fieldNames[dateField]] = cldrData[dateField].displayName; + if (capitalizedMonthLocales[language]) { + var fieldName = cldrData[dateField].displayName[0].toUpperCase() + cldrData[dateField].displayName.substring(1); + formats[fieldNames[dateField]] = fieldName; + } else { + formats[fieldNames[dateField]] = cldrData[dateField].displayName; + } } } } @@ -2181,15 +2250,20 @@ module.exports = { "ss": "Second" }; + function isUpper(str) { + return (str.toUpperCase() === str); + } + for (var ph in placeholders) { var name = formats[placeholders[ph]]; if (name) { - if (name.length <= ph.length || rtlLanguages.indexOf(language) > -1 || rtlScripts.indexOf(script) > -1) { + if (name.length <= 2 || name.length < ph.length || rtlLanguages.indexOf(language) > -1 || rtlScripts.indexOf(script) > -1) { // if it's short or if it's using the Arabic script, just use the full name of the field - formats[ph] = name; + formats[ph] = isUpper(ph) ? name.toUpperCase() : name; } else { // else if it's not certain scripts, use the abbreviation - var initial = name[0]; + var initial = name[0]; + initial = isUpper(ph) ? initial.toUpperCase() : initial.toLowerCase(); formats[ph] = ph.replace(/./g, initial); } } From 20c1c902b59e7aeb1c674749ba3dc1cfba5ad120 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Wed, 12 Jun 2019 10:08:07 -0700 Subject: [PATCH 26/38] checkpoint commit solved more unit test failures, but also added more unit tests. --- js/lib/DateFmtInfo.js | 4 +- js/test/date/testdatefmtasync.js | 4 +- js/test/date/testdatefmtinfo.js | 149 +++++++++++++++++++++++++++++-- 3 files changed, 147 insertions(+), 10 deletions(-) diff --git a/js/lib/DateFmtInfo.js b/js/lib/DateFmtInfo.js index f40244a4d9..daec7bbe2c 100644 --- a/js/lib/DateFmtInfo.js +++ b/js/lib/DateFmtInfo.js @@ -93,7 +93,7 @@ DateFmtInfo.prototype = { loadParams: loadParams, onLoad: ilib.bind(this, function (rb) { this.rb = rb; - if (locale.getLanguage() !== this.fmt.locale.getLanguage()) { + if (locale && locale.getLanguage() !== this.fmt.locale.getLanguage()) { new ResBundle({ locale: locale, name: "sysres", @@ -568,7 +568,7 @@ DateFmtInfo.prototype = { return { component: "dayofweek", label: RB.getStringJS("Day of Week"), // i18n: date input form label for the day of the week field - constraint: ilib.bind(this, function(date) { + value: ilib.bind(this, function(date) { var d = date.getJSDate(); var key = component.replace(/c/g, 'E') + d.getDay(); if (this.fmt.calName !== "gregorian") { diff --git a/js/test/date/testdatefmtasync.js b/js/test/date/testdatefmtasync.js index 589b2362c3..ab3a586199 100644 --- a/js/test/date/testdatefmtasync.js +++ b/js/test/date/testdatefmtasync.js @@ -335,7 +335,7 @@ module.exports.testdatefmtasync = { test.equal(info[1].label, "/"); test.equal(info[2].component, "day"); - test.equal(info[2].label, "Date"); + test.equal(info[2].label, "Day"); test.deepEqual(info[2].constraint, { "1": [1, 31], "2": [1, 28], @@ -403,7 +403,7 @@ module.exports.testdatefmtasync = { test.equal(info[1].label, " "); test.equal(info[2].component, "day"); - test.equal(info[2].label, "Datum"); + test.equal(info[2].label, "Tag"); test.deepEqual(info[2].constraint, { "1": [1, 31], "2": [1, 28], diff --git a/js/test/date/testdatefmtinfo.js b/js/test/date/testdatefmtinfo.js index 7aa076f21e..c015d35fb8 100644 --- a/js/test/date/testdatefmtinfo.js +++ b/js/test/date/testdatefmtinfo.js @@ -278,7 +278,7 @@ module.exports.testdategetformatinfo = { }, testDateFmtInfoGetFormatInfoUSShortAllFields: function(test) { - test.expect(165); + test.expect(175); var fmt = new DateFmtInfo({ locale: "en-US", @@ -295,23 +295,26 @@ module.exports.testdategetformatinfo = { onLoad: function(info) { test.ok(info); - test.equal(info.length, 15); + test.equal(info.length, 17); test.equal(info[0].label, "Day of Week"), test.equal(typeof(info[0].value), "function"); test.ok(!info[1].component); - test.equal(info[1].label, " "); + test.equal(info[1].label, ", "); test.equal(info[2].component, "month"); test.equal(info[2].label, "Month"); + test.equal(info[2].placeholder, "M"); test.deepEqual(info[2].constraint, [1, 12]); + test.equal(info[2].validation, "\\d{1,2}"); test.ok(!info[3].component); test.equal(info[3].label, "/"); test.equal(info[4].component, "day"); - test.equal(info[4].label, "Date"); + test.equal(info[4].label, "Day"); + test.equal(info[4].placeholder, "D"); test.deepEqual(info[4].constraint, { "1": [1, 31], "2": [1, 28], @@ -326,14 +329,139 @@ module.exports.testdategetformatinfo = { "11": [1, 30], "12": [1, 31] }); + test.equal(info[4].validation, "\\d{1,2}"); test.ok(!info[5].component); test.equal(info[5].label, "/"); test.equal(info[6].component, "year"); test.equal(info[6].label, "Year"); + test.equal(info[6].placeholder, "YY"); test.equal(info[6].constraint, "\\d{2}"); + test.ok(!info[7].component); + test.equal(info[7].label, ", "); + + test.equal(info[8].component, "hour"); + test.equal(info[8].label, "Hour"); + test.equal(info[8].placeholder, "H"); + test.deepEqual(info[8].constraint, ["12", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"]); + test.equal(info[8].validation, "\\d{1,2}"); + + test.ok(!info[9].component); + test.equal(info[9].label, ":"); + + test.equal(info[10].component, "minute"); + test.equal(info[10].label, "Minute"); + test.equal(info[10].placeholder, "mm"); + for (var i = 0; i < 60; i++) { + test.equal(Number(info[10].constraint[i]), i); + } + test.equal(info[10].validation, "\\d{2}"); + + test.ok(!info[11].component); + test.equal(info[11].label, ":"); + + test.equal(info[12].component, "second"); + test.equal(info[12].label, "Second"); + test.equal(info[12].placeholder, "ss"); + for (var i = 0; i < 60; i++) { + test.equal(Number(info[12].constraint[i]), i); + } + test.equal(info[12].validation, "\\d{2}"); + + test.ok(!info[13].component); + test.equal(info[13].label, " "); + + test.equal(info[14].component, "meridiem"); + test.equal(info[14].label, "AM/PM"); + test.deepEqual(info[14].constraint, ["AM", "PM"]); + + test.ok(!info[15].component); + test.equal(info[15].label, " "); + + test.equal(info[16].component, "timezone"); + test.equal(info[16].label, "Time zone"); + test.equal(typeof(info[16].constraint), "object"); + test.equal(info[16].constraint.length, 511); + } + }); + + test.done(); + }, + + testDateFmtInfoGetFormatInfoUSFullAllFields: function(test) { + test.expect(165); + + var fmt = new DateFmtInfo({ + locale: "en-US", + type: "datetime", + length: "full", + date: "wmdy", + time: "ahmsz" + }); + test.ok(fmt !== null); + + fmt.getFormatInfo({ + sync: true, + year: 2019, // non leap year + onLoad: function(info) { + test.ok(info); + + test.equal(info.length, 17); + + test.equal(info[0].label, "Day of Week"), + test.equal(typeof(info[0].value), "function"); + + test.ok(!info[1].component); + test.equal(info[1].label, ", "); + + test.equal(info[2].component, "month"); + test.equal(info[2].label, "Month"); + test.deepEqual(info[2].constraint, [ + {label: "January", value: 1}, + {label: "February", value: 2}, + {label: "March", value: 3}, + {label: "April", value: 4}, + {label: "May", value: 5}, + {label: "June", value: 6}, + {label: "July", value: 7}, + {label: "August", value: 8}, + {label: "September", value: 9}, + {label: "October", value: 10}, + {label: "November", value: 11}, + {label: "December", value: 12} + ]); + + test.ok(!info[3].component); + test.equal(info[3].label, " "); + + test.equal(info[4].component, "day"); + test.equal(info[4].label, "Day"); + test.deepEqual(info[4].constraint, { + "1": [1, 31], + "2": [1, 28], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + }); + test.equal(info[4].validation, "\\d{1,2}"); + + test.ok(!info[5].component); + test.equal(info[5].label, ", "); + + test.equal(info[6].component, "year"); + test.equal(info[6].label, "Year"); + test.equal(info[6].placeholder, "YYYY"); + test.equal(info[6].constraint, "\\d{4}"); + test.ok(!info[7].component); test.equal(info[7].label, " at "); @@ -372,6 +500,15 @@ module.exports.testdategetformatinfo = { test.equal(info[14].label, "AM/PM"); test.equal(info[14].placeholder, "AM/PM"); test.deepEqual(info[14].constraint, ["AM", "PM"]); + + test.ok(!info[15].component); + test.equal(info[15].label, " "); + + test.equal(info[16].component, "timezone"); + test.equal(info[16].label, "Time zone"); + test.equal(info[16].placeholder, "AM/PM"); + test.equal(typeof(info[16].constraint), "object"); + test.equal(info[16].constraint.length, 511); } }); @@ -447,7 +584,7 @@ module.exports.testdategetformatinfo = { test.equal(info[1].label, " "); test.equal(info[2].component, "day"); - test.equal(info[2].label, "Date"); + test.equal(info[2].label, "Day"); test.deepEqual(info[2].constraint, { "1": [1, 30], "2": [1, 29], @@ -516,7 +653,7 @@ module.exports.testdategetformatinfo = { test.equal(info[1].label, " "); test.equal(info[2].component, "day"); - test.equal(info[2].label, "Date"); + test.equal(info[2].label, "Day"); test.deepEqual(info[2].constraint, { "1": [1, 30], "2": [1, 29], From 012479ab428c2cbe69fd0f932f3a7af7a218d22d Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Sun, 23 Jun 2019 13:43:33 -0700 Subject: [PATCH 27/38] DateFmtInfo object now works. All unit tests pass. --- js/data/locale/ar/sysres.json | 86 +++++++++ js/data/locale/he/sysres.json | 86 +++++++++ js/data/locale/sysres.json | 3 +- js/lib/DateFmt.js | 32 ++-- js/lib/DateFmtInfo.js | 10 +- js/test/date/testdatefmt.js | 7 +- js/test/date/testdatefmtinfo.js | 310 ++++++++++++++++++++++++++++---- tools/cldr/datefmts.js | 57 ++++-- tools/cldr/gendatefmts2.js | 10 ++ 9 files changed, 527 insertions(+), 74 deletions(-) diff --git a/js/data/locale/ar/sysres.json b/js/data/locale/ar/sysres.json index d171636b58..c0d11243e2 100644 --- a/js/data/locale/ar/sysres.json +++ b/js/data/locale/ar/sysres.json @@ -79,6 +79,92 @@ "a1": "م", "G-1": "ق. م", "G1": "ب.م", + "MMMM7-hebrew": "تشري", + "MMM7-hebrew": "تشري", + "NN7-hebrew": "تش", + "N7-hebrew": "ت", + "MMMM8-hebrew": "مرحشوان", + "MMM8-hebrew": "مرحشوان", + "NN8-hebrew": "مر", + "N8-hebrew": "م", + "MMMM9-hebrew": "كيسلو", + "MMM9-hebrew": "كيسلو", + "NN9-hebrew": "كي", + "N9-hebrew": "ك", + "MMMM10-hebrew": "طيفت", + "MMM10-hebrew": "طيفت", + "NN10-hebrew": "طي", + "N10-hebrew": "ط", + "MMMM11-hebrew": "شباط", + "MMM11-hebrew": "شباط", + "NN11-hebrew": "شب", + "N11-hebrew": "ش", + "MMMM12-leap-hebrew": "آذار الأول", + "MMM12-leap-hebrew": "آذار الأول", + "NN12-leap-hebrew": "آذ", + "N12-leap-hebrew": "آ", + "MMMM12-hebrew": "آذار", + "MMM12-hebrew": "آذار", + "NN12-hebrew": "آذ", + "N12-hebrew": "آ", + "MMMM1-hebrew": "نيسان", + "MMM1-hebrew": "نيسان", + "NN1-hebrew": "ني", + "N1-hebrew": "ن", + "MMMM2-hebrew": "أيار", + "MMM2-hebrew": "أيار", + "NN2-hebrew": "أي", + "N2-hebrew": "أ", + "MMMM3-hebrew": "سيفان", + "MMM3-hebrew": "سيفان", + "NN3-hebrew": "سي", + "N3-hebrew": "س", + "MMMM4-hebrew": "تموز", + "MMM4-hebrew": "تموز", + "NN4-hebrew": "تم", + "N4-hebrew": "ت", + "MMMM5-hebrew": "آب", + "MMM5-hebrew": "آب", + "NN5-hebrew": "آب", + "N5-hebrew": "آ", + "MMMM6-hebrew": "أيلول", + "MMM6-hebrew": "أيلول", + "NN6-hebrew": "أي", + "N6-hebrew": "أ", + "MMMM13-leap-hebrew": "آذار الثاني", + "MMM13-leap-hebrew": "آذار الثاني", + "NN13-leap-hebrew": "آذ", + "N13-leap-hebrew": "آ", + "EEEE0-hebrew": "الأحد", + "EEE0-hebrew": "الأحد", + "EE0-hebrew": "أحد", + "E0-hebrew": "ح", + "EEEE1-hebrew": "الاثنين", + "EEE1-hebrew": "الاثنين", + "EE1-hebrew": "إثنين", + "E1-hebrew": "ن", + "EEEE2-hebrew": "الثلاثاء", + "EEE2-hebrew": "الثلاثاء", + "EE2-hebrew": "ثلاثاء", + "E2-hebrew": "ث", + "EEEE3-hebrew": "الأربعاء", + "EEE3-hebrew": "الأربعاء", + "EE3-hebrew": "أربعاء", + "E3-hebrew": "ر", + "EEEE4-hebrew": "الخميس", + "EEE4-hebrew": "الخميس", + "EE4-hebrew": "خميس", + "E4-hebrew": "خ", + "EEEE5-hebrew": "الجمعة", + "EEE5-hebrew": "الجمعة", + "EE5-hebrew": "جمعة", + "E5-hebrew": "ج", + "EEEE6-hebrew": "السبت", + "EEE6-hebrew": "السبت", + "EE6-hebrew": "سبت", + "E6-hebrew": "س", + "a0-hebrew": "ص", + "a1-hebrew": "م", "1#1 millisecond|#{num} milliseconds": "zero#{num} ملي ثانية|one#{num} ملي ثانية|two#{num} ملي ثانية|few#{num} ملي ثانية|many#{num} ملي ثانية|#{num} ملي ثانية", "1#1 second|#{num} seconds": "zero#{num} ثانية|one#ثانية|two#ثانيتان|few#{num} ثوان|many#{num} ثانية|#{num} ثانية", "1#1 minute|#{num} minutes": "zero#{num} دقيقة|one#دقيقة|two#دقيقتان|few#{num} دقائق|many#{num} دقيقة|#{num} دقيقة", diff --git a/js/data/locale/he/sysres.json b/js/data/locale/he/sysres.json index 503895d5ec..3a6596b01f 100644 --- a/js/data/locale/he/sysres.json +++ b/js/data/locale/he/sysres.json @@ -79,6 +79,92 @@ "a1": "אחה״צ", "G-1": "BCE", "G1": "CE", + "MMMM7-hebrew": "תשרי", + "MMM7-hebrew": "תשרי", + "NN7-hebrew": "תש", + "N7-hebrew": "ת", + "MMMM8-hebrew": "חשוון", + "MMM8-hebrew": "חשון", + "NN8-hebrew": "חש", + "N8-hebrew": "ח", + "MMMM9-hebrew": "כסלו", + "MMM9-hebrew": "כסלו", + "NN9-hebrew": "כס", + "N9-hebrew": "כ", + "MMMM10-hebrew": "טבת", + "MMM10-hebrew": "טבת", + "NN10-hebrew": "טב", + "N10-hebrew": "ט", + "MMMM11-hebrew": "שבט", + "MMM11-hebrew": "שבט", + "NN11-hebrew": "שב", + "N11-hebrew": "ש", + "MMMM12-leap-hebrew": "אדר א׳", + "MMM12-leap-hebrew": "אדר א׳", + "NN12-leap-hebrew": "אד", + "N12-leap-hebrew": "א", + "MMMM12-hebrew": "אדר", + "MMM12-hebrew": "אדר", + "NN12-hebrew": "אד", + "N12-hebrew": "א", + "MMMM1-hebrew": "ניסן", + "MMM1-hebrew": "ניסן", + "NN1-hebrew": "ני", + "N1-hebrew": "נ", + "MMMM2-hebrew": "אייר", + "MMM2-hebrew": "אייר", + "NN2-hebrew": "אי", + "N2-hebrew": "א", + "MMMM3-hebrew": "סיוון", + "MMM3-hebrew": "סיון", + "NN3-hebrew": "סי", + "N3-hebrew": "ס", + "MMMM4-hebrew": "תמוז", + "MMM4-hebrew": "תמוז", + "NN4-hebrew": "תמ", + "N4-hebrew": "ת", + "MMMM5-hebrew": "אב", + "MMM5-hebrew": "אב", + "NN5-hebrew": "אב", + "N5-hebrew": "א", + "MMMM6-hebrew": "אלול", + "MMM6-hebrew": "אלול", + "NN6-hebrew": "אל", + "N6-hebrew": "א", + "MMMM13-leap-hebrew": "אדר ב׳", + "MMM13-leap-hebrew": "אדר ב׳", + "NN13-leap-hebrew": "אד", + "N13-leap-hebrew": "א", + "EEEE0-hebrew": "יום ראשון", + "EEE0-hebrew": "יום א׳", + "EE0-hebrew": "א׳", + "E0-hebrew": "א׳", + "EEEE1-hebrew": "יום שני", + "EEE1-hebrew": "יום ב׳", + "EE1-hebrew": "ב׳", + "E1-hebrew": "ב׳", + "EEEE2-hebrew": "יום שלישי", + "EEE2-hebrew": "יום ג׳", + "EE2-hebrew": "ג׳", + "E2-hebrew": "ג׳", + "EEEE3-hebrew": "יום רביעי", + "EEE3-hebrew": "יום ד׳", + "EE3-hebrew": "ד׳", + "E3-hebrew": "ד׳", + "EEEE4-hebrew": "יום חמישי", + "EEE4-hebrew": "יום ה׳", + "EE4-hebrew": "ה׳", + "E4-hebrew": "ה׳", + "EEEE5-hebrew": "יום שישי", + "EEE5-hebrew": "יום ו׳", + "EE5-hebrew": "ו׳", + "E5-hebrew": "ו׳", + "EEEE6-hebrew": "יום שבת", + "EEE6-hebrew": "שבת", + "EE6-hebrew": "ש׳", + "E6-hebrew": "ש׳", + "a0-hebrew": "לפנה״צ", + "a1-hebrew": "אחה״צ", "1#1 millisecond|#{num} milliseconds": "one#אלפית שנייה {num}|two#{num} אלפיות שנייה|many#{num} אלפיות שנייה|#{num} אלפיות שנייה", "1#1 second|#{num} seconds": "one#שניה|two#שתי שניות|many#‏{num} שניות|#{num} שניות", "1#1 minute|#{num} minutes": "one#דקה|two#שתי דקות|many#{num} דקות|#{num} דקות", diff --git a/js/data/locale/sysres.json b/js/data/locale/sysres.json index 371e3deec3..f93a886bec 100644 --- a/js/data/locale/sysres.json +++ b/js/data/locale/sysres.json @@ -148,7 +148,8 @@ "MMMM10-hebrew": "Teveth", "MMMM11-hebrew": "Shevat", "MMMM12-hebrew": "Adar", - "MMMM13-hebrew": "Adar II", + "MMMM12-leap-hebrew": "Adar I", + "MMMM13-leap-hebrew": "Adar II", "E0-hebrew": "R", "E1-hebrew": "S", "E2-hebrew": "S", diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index 0cbd625207..602e6caae6 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -803,17 +803,7 @@ DateFmt.prototype = { while (i < template.length) { ch = template.charAt(i); start = i; - if (ch === "'") { - // console.log("found quoted string"); - i++; - // escaped string - push as-is, then dequote later - while (i < template.length && template.charAt(i) !== "'") { - i++; - } - if (i < template.length) { - i++; // grab the other quote too - } - } else if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) { + if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) { letter = template.charAt(i); // console.log("found letters " + letter); while (i < template.length && ch === letter) { @@ -821,7 +811,15 @@ DateFmt.prototype = { } } else { // console.log("found other"); - while (i < template.length && ch !== "'" && (ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z')) { + while (i < template.length && (ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z')) { + if (ch === "'") { + // console.log("found quoted string"); + i++; + // escaped string - push as-is, then dequote later + while (i < template.length && template.charAt(i) !== "'") { + i++; + } + } ch = template.charAt(++i); } } @@ -1312,7 +1310,10 @@ DateFmt.prototype = { case 'LLL': case 'LLLL': key = templateArr[i] + (date.month || 1); - str += (this.sysres.getStringJS(undefined, key + "-" + this.calName) || this.sysres.getStringJS(undefined, key)); + isLeap = date.cal.isLeapYear(date.year); + str += (isLeap ? this.sysres.getStringJS(undefined, key + "-leap" + "-" + this.calName) : false) || + this.sysres.getStringJS(undefined, key + "-" + this.calName) || + this.sysres.getStringJS(undefined, key); break; case 'E': @@ -1324,8 +1325,11 @@ DateFmt.prototype = { case 'ccc': case 'cccc': key = templateArr[i] + date.getDayOfWeek(); + isLeap = date.cal.isLeapYear(date.year); //console.log("finding " + key + " in the resources"); - str += (this.sysres.getStringJS(undefined, key + "-" + this.calName) || this.sysres.getStringJS(undefined, key)); + str += (isLeap ? this.sysres.getStringJS(undefined, key + "-leap" + "-" + this.calName) : false) || + this.sysres.getStringJS(undefined, key + "-" + this.calName) || + this.sysres.getStringJS(undefined, key); break; case 'a': diff --git a/js/lib/DateFmtInfo.js b/js/lib/DateFmtInfo.js index daec7bbe2c..b409ceef87 100644 --- a/js/lib/DateFmtInfo.js +++ b/js/lib/DateFmtInfo.js @@ -546,10 +546,14 @@ DateFmtInfo.prototype = { constraint: (ilib.bind(this, function() { var ret = []; var months = this.fmt.cal.getNumMonths(year); + var isLeap = this.fmt.cal.isLeapYear(year); for (i = 1; i <= months; i++) { var key = component + i; ret.push({ - label: this.sysres.getStringJS(undefined, key + "-" + this.fmt.calName) || this.sysres.getStringJS(undefined, key), + label: + (isLeap ? this.sysres.getStringJS(undefined, key + "-leap" + "-" + this.fmt.calName) : false) || + this.sysres.getStringJS(undefined, key + "-" + this.fmt.calName) || + this.sysres.getStringJS(undefined, key), value: i }); } @@ -569,7 +573,7 @@ DateFmtInfo.prototype = { component: "dayofweek", label: RB.getStringJS("Day of Week"), // i18n: date input form label for the day of the week field value: ilib.bind(this, function(date) { - var d = date.getJSDate(); + var d = DateFactory._dateToIlib(date).getJSDate(); var key = component.replace(/c/g, 'E') + d.getDay(); if (this.fmt.calName !== "gregorian") { key += '-' + this.fmt.calName; @@ -676,7 +680,7 @@ DateFmtInfo.prototype = { default: return { - label: component + label: component.replace(/'/g, "") }; } })); diff --git a/js/test/date/testdatefmt.js b/js/test/date/testdatefmt.js index 339fbcad4d..05150d4e16 100644 --- a/js/test/date/testdatefmt.js +++ b/js/test/date/testdatefmt.js @@ -763,12 +763,9 @@ module.exports.testdatefmt = { var fmt = new DateFmt(); test.ok(fmt !== null); var expected = [ - "'El'", - " ", + "'El' ", "d", - " ", - "'de'", - " ", + " 'de' ", "MMMM", ", ", "yyyy" diff --git a/js/test/date/testdatefmtinfo.js b/js/test/date/testdatefmtinfo.js index c015d35fb8..663e62d096 100644 --- a/js/test/date/testdatefmtinfo.js +++ b/js/test/date/testdatefmtinfo.js @@ -391,7 +391,7 @@ module.exports.testdategetformatinfo = { }, testDateFmtInfoGetFormatInfoUSFullAllFields: function(test) { - test.expect(165); + test.expect(172); var fmt = new DateFmtInfo({ locale: "en-US", @@ -498,7 +498,6 @@ module.exports.testdategetformatinfo = { test.equal(info[14].component, "meridiem"); test.equal(info[14].label, "AM/PM"); - test.equal(info[14].placeholder, "AM/PM"); test.deepEqual(info[14].constraint, ["AM", "PM"]); test.ok(!info[15].component); @@ -506,7 +505,6 @@ module.exports.testdategetformatinfo = { test.equal(info[16].component, "timezone"); test.equal(info[16].label, "Time zone"); - test.equal(info[16].placeholder, "AM/PM"); test.equal(typeof(info[16].constraint), "object"); test.equal(info[16].constraint.length, 511); } @@ -516,12 +514,12 @@ module.exports.testdategetformatinfo = { }, testDateFmtInfoGetFormatInfoDayOfWeekCalculator: function(test) { - test.expect(16); + test.expect(6); var fmt = new DateFmtInfo({ locale: "en-US", type: "datetime", - length: "short", + length: "full", date: "wmdy", }); test.ok(fmt !== null); @@ -683,7 +681,7 @@ module.exports.testdategetformatinfo = { }, testDateFmtInfoGetFormatInfoHebrewCalendarInHebrew: function(test) { - test.expect(16); + test.expect(18); var fmt = new DateFmtInfo({ locale: "he-IL", @@ -699,31 +697,159 @@ module.exports.testdategetformatinfo = { onLoad: function(info) { test.ok(info); - test.equal(info.length, 5); + test.equal(info.length, 6); - test.equal(info[0].component, "month"); - test.equal(info[0].label, "חודש"); - test.deepEqual(info[0].constraint, [ - {label: "Nisan", value: 1}, - {label: "Iyyar", value: 2}, - {label: "Sivan", value: 3}, - {label: "Tammuz", value: 4}, - {label: "Av", value: 5}, - {label: "Elul", value: 6}, - {label: "Tishri", value: 7}, - {label: "Ḥeshvan", value: 8}, - {label: "Kislev", value: 9}, - {label: "Teveth", value: 10}, - {label: "Shevat", value: 11}, - {label: "Adar", value: 12}, + test.ok(!info[0].component); + test.equal(info[0].label, "\u200F"); // RTL mark + + test.equal(info[1].component, "day"); + test.equal(info[1].label, "יום"); + test.deepEqual(info[1].constraint, { + "1": [1, 30], + "2": [1, 29], + "3": [1, 30], + "4": [1, 29], + "5": [1, 30], + "6": [1, 29], + "7": [1, 30], + "8": [1, 30], + "9": [1, 30], + "10": [1, 29], + "11": [1, 30], + "12": [1, 30] + }); + + test.ok(!info[2].component); + test.equal(info[2].label, " ב"); + + test.equal(info[3].component, "month"); + test.equal(info[3].label, "חודש"); + test.deepEqual(info[3].constraint, [ + {label: "ניסן", value: 1}, + {label: "אייר", value: 2}, + {label: "סיוון", value: 3}, + {label: "תמוז", value: 4}, + {label: "אב", value: 5}, + {label: "אלול", value: 6}, + {label: "תשרי", value: 7}, + {label: "חשוון", value: 8}, + {label: "כסלו", value: 9}, + {label: "טבת", value: 10}, + {label: "שבט", value: 11}, + {label: "אדר", value: 12}, ]); - test.ok(!info[1].component); - test.equal(info[1].label, " "); + test.ok(!info[4].component); + test.equal(info[4].label, " "); - test.equal(info[2].component, "day"); - test.equal(info[2].label, "אשר"); - test.deepEqual(info[2].constraint, { + test.equal(info[5].component, "year"); + test.equal(info[5].label, "שנה"); + test.equal(info[5].constraint, "\\d{4}"); + } + }); + + test.done(); + }, + + testDateFmtInfoGetFormatInfoHebrewCalendarInHebrewLeap: function(test) { + test.expect(18); + + var fmt = new DateFmtInfo({ + locale: "he-IL", + type: "date", + length: "full", + calendar: "hebrew" + }); + test.ok(fmt !== null); + + fmt.getFormatInfo({ + sync: true, + year: 5782, // leap year + onLoad: function(info) { + test.ok(info); + + test.equal(info.length, 6); + + test.ok(!info[0].component); + test.equal(info[0].label, "\u200F"); // RTL mark + + test.equal(info[1].component, "day"); + test.equal(info[1].label, "יום"); + test.deepEqual(info[1].constraint, { + "1": [1, 30], + "2": [1, 29], + "3": [1, 30], + "4": [1, 29], + "5": [1, 30], + "6": [1, 29], + "7": [1, 30], + "8": [1, 29], + "9": [1, 30], + "10": [1, 29], + "11": [1, 30], + "12": [1, 30], + "13": [1, 29] + }); + + test.ok(!info[2].component); + test.equal(info[2].label, " ב"); + + test.equal(info[3].component, "month"); + test.equal(info[3].label, "חודש"); + test.deepEqual(info[3].constraint, [ + {label: "ניסן", value: 1}, + {label: "אייר", value: 2}, + {label: "סיוון", value: 3}, + {label: "תמוז", value: 4}, + {label: "אב", value: 5}, + {label: "אלול", value: 6}, + {label: "תשרי", value: 7}, + {label: "חשוון", value: 8}, + {label: "כסלו", value: 9}, + {label: "טבת", value: 10}, + {label: "שבט", value: 11}, + {label: "אדר א׳", value: 12}, + {label: "אדר ב׳", value: 13} + ]); + + test.ok(!info[4].component); + test.equal(info[4].label, " "); + + test.equal(info[5].component, "year"); + test.equal(info[5].label, "שנה"); + test.equal(info[5].constraint, "\\d{4}"); + } + }); + + test.done(); + }, + + testDateFmtInfoGetFormatInfoHebrewCalendarInArabic: function(test) { + test.expect(18); + + var fmt = new DateFmtInfo({ + locale: "he-IL", + type: "date", + length: "full", + calendar: "hebrew", + uiLocale: "ar-IL" + }); + test.ok(fmt !== null); + + fmt.getFormatInfo({ + sync: true, + year: 5780, // non leap year + onLoad: function(info) { + test.ok(info); + + test.equal(info.length, 6); + + test.ok(!info[0].component); + test.equal(info[0].label, "\u200F"); // RTL mark + + test.equal(info[1].component, "day"); + test.equal(info[1].label, "يوم"); + test.deepEqual(info[1].constraint, { "1": [1, 30], "2": [1, 29], "3": [1, 30], @@ -738,12 +864,106 @@ module.exports.testdategetformatinfo = { "12": [1, 30] }); - test.ok(!info[3].component); - test.equal(info[3].label, ", "); + test.ok(!info[2].component); + test.equal(info[2].label, " ב"); + + test.equal(info[3].component, "month"); + test.equal(info[3].label, "الشهر"); + test.deepEqual(info[3].constraint, [ + {label: "نيسان", value: 1}, + {label: "أيار", value: 2}, + {label: "سيفان", value: 3}, + {label: "تموز", value: 4}, + {label: "آب", value: 5}, + {label: "أيلول", value: 6}, + {label: "تشري", value: 7}, + {label: "مرحشوان", value: 8}, + {label: "كيسلو", value: 9}, + {label: "طيفت", value: 10}, + {label: "شباط", value: 11}, + {label: "آذار", value: 12} + ]); - test.equal(info[4].component, "year"); - test.equal(info[4].label, "שנה"); - test.equal(info[4].constraint, "\\d{4}"); + test.ok(!info[4].component); + test.equal(info[4].label, " "); + + test.equal(info[5].component, "year"); + test.equal(info[5].label, "السنة"); + test.equal(info[5].constraint, "\\d{4}"); + } + }); + + test.done(); + }, + + testDateFmtInfoGetFormatInfoHebrewCalendarInArabicLeap: function(test) { + test.expect(18); + + var fmt = new DateFmtInfo({ + locale: "he-IL", + type: "date", + length: "full", + calendar: "hebrew", + uiLocale: "ar-IL" + }); + test.ok(fmt !== null); + + fmt.getFormatInfo({ + sync: true, + year: 5782, // leap year + onLoad: function(info) { + test.ok(info); + + test.equal(info.length, 6); + + test.ok(!info[0].component); + test.equal(info[0].label, "\u200F"); // RTL mark + + test.equal(info[1].component, "day"); + test.equal(info[1].label, "يوم"); + test.deepEqual(info[1].constraint, { + "1": [1, 30], + "2": [1, 29], + "3": [1, 30], + "4": [1, 29], + "5": [1, 30], + "6": [1, 29], + "7": [1, 30], + "8": [1, 29], + "9": [1, 30], + "10": [1, 29], + "11": [1, 30], + "12": [1, 30], + "13": [1, 29] + }); + + test.ok(!info[2].component); + test.equal(info[2].label, " ב"); + + test.equal(info[3].component, "month"); + test.equal(info[3].label, "الشهر"); + test.deepEqual(info[3].constraint, [ + {label: "نيسان", value: 1}, + {label: "أيار", value: 2}, + {label: "سيفان", value: 3}, + {label: "تموز", value: 4}, + {label: "آب", value: 5}, + {label: "أيلول", value: 6}, + {label: "تشري", value: 7}, + {label: "مرحشوان", value: 8}, + {label: "كيسلو", value: 9}, + {label: "طيفت", value: 10}, + {label: "شباط", value: 11}, + {label: "آذار الأول", value: 12}, + {label: "آذار الثاني", value: 13} + ]); + + test.ok(!info[4].component); + test.equal(info[4].label, " "); + + test.equal(info[5].component, "year"); + test.equal(info[5].label, "السنة"); + test.equal(info[5].constraint, "\\d{4}"); } }); @@ -811,6 +1031,20 @@ module.exports.testdategetformatinfo = { test.done(); }, + testDateFmtInfoGetMonthsOfYearNonLeapYearInHebrew: function(test) { + test.expect(2); + var d = DateFactory({type: "hebrew", locale: "en-US", year: 5775, month: 1, day: 1}); + var fmt = new DateFmtInfo({date: "en-US", calendar: "hebrew", uiLocale: "he-IL"}); + test.ok(fmt !== null); + + var arrMonths = fmt.getMonthsOfYear({length: "long", date: d}); + + var expected = [undefined, "ניסן", "אייר", "סיון", "תמוז", "אב", "אלול", "תשרי", "חשון", "כסלו", "טבת", "שבט", "אדר"]; + + test.deepEqual(arrMonths, expected); + test.done(); + }, + testDateFmtInfoGetDaysOfWeek1: function(test) { test.expect(2); var fmt = new DateFmtInfo({locale: "en-US"}); @@ -823,6 +1057,18 @@ module.exports.testdategetformatinfo = { test.done(); }, + testDateFmtInfoGetDaysOfWeek1InGerman: function(test) { + test.expect(2); + var fmt = new DateFmtInfo({locale: "en-US", uiLocale: "de-DE"}); + test.ok(fmt !== null); + + var arrDays = fmt.getDaysOfWeek(); + + var expected = ["S", "M", "D", "M", "D", "F", "S"]; + test.deepEqual(arrDays, expected); + test.done(); + }, + testDateFmtInfoGetDaysOfWeek2: function(test) { test.expect(2); var fmt = new DateFmtInfo({locale: "en-US"}); diff --git a/tools/cldr/datefmts.js b/tools/cldr/datefmts.js index 74c9f8fa45..3183f55428 100644 --- a/tools/cldr/datefmts.js +++ b/tools/cldr/datefmts.js @@ -1588,11 +1588,27 @@ module.exports = { return formats; }, + ilibMonth: function(calendar, cldrMonth) { + if (calendar !== "hebrew") return cldrMonth; + + var m; + m = parseInt(cldrMonth); + // cldr switched "Adar" and "Adar I" around backwards and numbered the months + // incorrectly, so now we have to compensate + if (m === 6) { + return "12-leap"; + } else if (m === 7) { + return cldrMonth.endsWith("-leap") ? "13-leap" : "12"; + } + m = (m + 6) % 13; + return String(m); + }, + createSystemResources: function (cldrData, language) { var formats, - cldrCalendar, - calendarNameSuffix, - prop; + cldrCalendar, + calendarNameSuffix, + prop; var dayNumbers = { "sun": 0, @@ -1617,38 +1633,41 @@ module.exports = { var isAsian = isAsianLang(language); if (isAsianLang(language)) { for (prop in part.wide) { - formats["MMMM" + prop + calendarNameSuffix] = part.wide[prop].substring(0, part.wide[prop].length-1); - formats["N" + prop + calendarNameSuffix] = - formats["NN" + prop + calendarNameSuffix] = - formats["MMM" + prop + calendarNameSuffix] = + var month = this.ilibMonth(calendarName, prop); + formats["MMMM" + month + calendarNameSuffix] = part.wide[prop].substring(0, part.wide[prop].length-1); + formats["N" + month + calendarNameSuffix] = + formats["NN" + month + calendarNameSuffix] = + formats["MMM" + month + calendarNameSuffix] = part.abbreviated[prop].substring(0, part.abbreviated[prop].length-1); } } else { for (prop in part.wide) { - formats["MMMM" + prop + calendarNameSuffix] = part.wide[prop]; - formats["MMM" + prop + calendarNameSuffix] = part.abbreviated[prop]; - formats["NN" + prop + calendarNameSuffix] = part.abbreviated[prop].substring(0,2); - formats["N" + prop + calendarNameSuffix] = part.abbreviated[prop].substring(0,1); + var month = this.ilibMonth(calendarName, prop); + formats["MMMM" + month + calendarNameSuffix] = part.wide[prop]; + formats["MMM" + month + calendarNameSuffix] = part.abbreviated[prop]; + formats["NN" + month + calendarNameSuffix] = part.abbreviated[prop].substring(0,2); + formats["N" + month + calendarNameSuffix] = part.abbreviated[prop].substring(0,1); /* TODO. Some cldr data provide value as number in narrow format which doesn't meet iLib spec. So I update code to create 'N' format value from abbreviated. but I think it's better to reference abbreviated if narrow values are number. - and some cases are haveing same alphabets which are not good. + and some cases are having same alphabets which are not good. */ if (language === "mn") { - formats["NN" + prop + calendarNameSuffix] = part.abbreviated[prop].substring(0,1); + formats["NN" + month + calendarNameSuffix] = part.abbreviated[prop].substring(0,1); } else if (language === "vi") { - formats["NN" + prop + calendarNameSuffix] = part.abbreviated[prop].substring(0,2) + prop; - formats["N" + prop + calendarNameSuffix] = part.abbreviated[prop].substring(0,1) + prop; + formats["NN" + month + calendarNameSuffix] = part.abbreviated[prop].substring(0,2) + prop; + formats["N" + month + calendarNameSuffix] = part.abbreviated[prop].substring(0,1) + prop; } } } if (usesStandAlone) { part = cldrCalendar.months["stand-alone"]; for (prop in part.wide) { - formats["LLLL" + prop + calendarNameSuffix] = part.wide[prop]; - formats["LLL" + prop + calendarNameSuffix] = part.abbreviated[prop]; - formats["LL" + prop + calendarNameSuffix] = part.abbreviated[prop].substring(0,2); - formats["L" + prop + calendarNameSuffix] = part.narrow[prop]; + var month = this.ilibMonth(calendarName, prop); + formats["LLLL" + month + calendarNameSuffix] = part.wide[prop]; + formats["LLL" + month + calendarNameSuffix] = part.abbreviated[prop]; + formats["LL" + month + calendarNameSuffix] = part.abbreviated[prop].substring(0,2); + formats["L" + month + calendarNameSuffix] = part.narrow[prop]; } } diff --git a/tools/cldr/gendatefmts2.js b/tools/cldr/gendatefmts2.js index a3bc87d75d..59f9693ec6 100644 --- a/tools/cldr/gendatefmts2.js +++ b/tools/cldr/gendatefmts2.js @@ -256,6 +256,16 @@ list.forEach(function (file) { group = aux.getFormatGroup(systemResources, localeComponents); group.data = merge(group.data || {}, newFormats); + // do other calendars for some locales + if (language === "he" || language === "ar") { + cal = require(path.join(sourceDir, "ca-hebrew.json")); + + newFormats = aux.createSystemResources(cal.main[file].dates.calendars, language); + //console.log("data is " + JSON.stringify(newFormats, undefined, 4) + "\n"); + group = aux.getFormatGroup(systemResources, localeComponents); + group.data = merge(group.data || {}, newFormats); + } + // date/time duration. units = require(path.join(sourceDir, "units.json")); newFormats = aux.createDurationResources(units.main[file].units, language, script); From 64f8572a761d96d492984add7ae297719d74251f Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Sun, 23 Jun 2019 13:50:05 -0700 Subject: [PATCH 28/38] Minor whitespace and other clean up --- js/lib/DateFmtInfo.js | 2 +- tools/cldr/datefmts.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/js/lib/DateFmtInfo.js b/js/lib/DateFmtInfo.js index b409ceef87..f9519abffe 100644 --- a/js/lib/DateFmtInfo.js +++ b/js/lib/DateFmtInfo.js @@ -68,7 +68,7 @@ var DateFmtInfo = function(options) { DateFmtInfo.prototype = { /** - * + * @private */ _init: function(options) { var locale, sync = true, callback, loadParams; diff --git a/tools/cldr/datefmts.js b/tools/cldr/datefmts.js index 3183f55428..3687c159d5 100644 --- a/tools/cldr/datefmts.js +++ b/tools/cldr/datefmts.js @@ -2221,8 +2221,8 @@ module.exports = { "H": "H", "HH": "HH", "mm": "mm", - "ss": "ss", - "ms": "ms" + "ss": "ss", + "ms": "ms" }; }, @@ -2268,7 +2268,7 @@ module.exports = { "mm": "Minute", "ss": "Second" }; - + function isUpper(str) { return (str.toUpperCase() === str); } @@ -2282,10 +2282,10 @@ module.exports = { } else { // else if it's not certain scripts, use the abbreviation var initial = name[0]; - initial = isUpper(ph) ? initial.toUpperCase() : initial.toLowerCase(); - formats[ph] = ph.replace(/./g, initial); + initial = isUpper(ph) ? initial.toUpperCase() : initial.toLowerCase(); + formats[ph] = ph.replace(/./g, initial); } - } + } } return formats; From 9b4e6c4d0272e666d7bad1e31ce65733422a1d83 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Mon, 24 Jun 2019 16:38:25 -0700 Subject: [PATCH 29/38] Use the right synchronicity when loading resources --- js/lib/DateFmtInfo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/lib/DateFmtInfo.js b/js/lib/DateFmtInfo.js index f9519abffe..db2a4f1cf0 100644 --- a/js/lib/DateFmtInfo.js +++ b/js/lib/DateFmtInfo.js @@ -75,7 +75,7 @@ DateFmtInfo.prototype = { if (options) { locale = options.uiLocale || options.locale; - sync = !!options.sync; + sync = typeof(options.sync) === "boolean" ? options.sync : true; callback = options.onLoad; loadParams = options.loadParams; } From 840ec57e556335dbebb7feb20fe9ea4cb5ed6295 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Mon, 24 Jun 2019 16:59:25 -0700 Subject: [PATCH 30/38] Fixed dateformtinfo unit tests to be truly async The tests were not testing async properly. Now they are. --- js/lib/DateFmtInfo.js | 3 +- js/test/date/testdatefmtasync.js | 197 ++++++++++++++++--------------- 2 files changed, 102 insertions(+), 98 deletions(-) diff --git a/js/lib/DateFmtInfo.js b/js/lib/DateFmtInfo.js index db2a4f1cf0..01aa035116 100644 --- a/js/lib/DateFmtInfo.js +++ b/js/lib/DateFmtInfo.js @@ -51,7 +51,8 @@ var ISet = require("./ISet.js"); * instance works */ var DateFmtInfo = function(options) { - if (!options || options.sync) { + var sync = typeof(options.sync) === "boolean" ? options.sync : true; + if (!options || sync) { this.fmt = new DateFmt(options); this._init(options); } else { diff --git a/js/test/date/testdatefmtasync.js b/js/test/date/testdatefmtasync.js index ab3a586199..036564951b 100644 --- a/js/test/date/testdatefmtasync.js +++ b/js/test/date/testdatefmtasync.js @@ -304,7 +304,6 @@ module.exports.testdatefmtasync = { test.done(); } }); - } }); }, @@ -315,52 +314,54 @@ module.exports.testdatefmtasync = { var fmt = new DateFmtInfo({ locale: "en-US", type: "date", - length: "short" - }); - test.ok(fmt !== null); - - fmt.getFormatInfo({ + length: "short", sync: false, - year: 2019, - onLoad: function(info) { - test.ok(info); - - test.equal(info.length, 5); - - test.equal(info[0].component, "month"); - test.equal(info[0].label, "Month"); - test.deepEqual(info[0].constraint, [1, 12]); - - test.ok(!info[1].component); - test.equal(info[1].label, "/"); - - test.equal(info[2].component, "day"); - test.equal(info[2].label, "Day"); - test.deepEqual(info[2].constraint, { - "1": [1, 31], - "2": [1, 28], - "3": [1, 31], - "4": [1, 30], - "5": [1, 31], - "6": [1, 30], - "7": [1, 31], - "8": [1, 31], - "9": [1, 30], - "10": [1, 31], - "11": [1, 30], - "12": [1, 31] - }); + onLoad: function(fmt) { + test.ok(fmt !== null); - test.ok(!info[3].component); - test.equal(info[3].label, "/"); + fmt.getFormatInfo({ + sync: false, + year: 2019, + onLoad: function(info) { + test.ok(info); + + test.equal(info.length, 5); + + test.equal(info[0].component, "month"); + test.equal(info[0].label, "Month"); + test.deepEqual(info[0].constraint, [1, 12]); + + test.ok(!info[1].component); + test.equal(info[1].label, "/"); + + test.equal(info[2].component, "day"); + test.equal(info[2].label, "Day"); + test.deepEqual(info[2].constraint, { + "1": [1, 31], + "2": [1, 28], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + }); - test.equal(info[4].component, "year"); - test.equal(info[4].label, "Year"); - test.equal(info[4].constraint, "\\d{2}"); - test.done(); + test.ok(!info[3].component); + test.equal(info[3].label, "/"); + + test.equal(info[4].component, "year"); + test.equal(info[4].label, "Year"); + test.equal(info[4].constraint, "\\d{2}"); + test.done(); + } + }); } }); - }, testDateFmtGetFormatInfoGregorianTranslatedAsync: function(test) { @@ -370,64 +371,66 @@ module.exports.testdatefmtasync = { locale: "en-US", type: "date", length: "full", - uiLocale: "de-DE" - }); - test.ok(fmt !== null); - - fmt.getFormatInfo({ - year: 2019, + uiLocale: "de-DE", sync: false, - onLoad: function(info) { - test.ok(info); - - test.equal(info.length, 5); - - test.equal(info[0].component, "month"); - test.equal(info[0].label, "Monat"); - test.deepEqual(info[0].constraint, [ - {label: "Januar", value: 1}, - {label: "Februar", value: 2}, - {label: "März", value: 3}, - {label: "April", value: 4}, - {label: "Mai", value: 5}, - {label: "Juni", value: 6}, - {label: "Juli", value: 7}, - {label: "August", value: 8}, - {label: "September", value: 9}, - {label: "Oktober", value: 10}, - {label: "November", value: 11}, - {label: "Dezember", value: 12}, - ]); - - test.ok(!info[1].component); - test.equal(info[1].label, " "); - - test.equal(info[2].component, "day"); - test.equal(info[2].label, "Tag"); - test.deepEqual(info[2].constraint, { - "1": [1, 31], - "2": [1, 28], - "3": [1, 31], - "4": [1, 30], - "5": [1, 31], - "6": [1, 30], - "7": [1, 31], - "8": [1, 31], - "9": [1, 30], - "10": [1, 31], - "11": [1, 30], - "12": [1, 31] - }); + onLoad: function(fmt) { + test.ok(fmt !== null); + + fmt.getFormatInfo({ + year: 2019, + sync: false, + onLoad: function(info) { + test.ok(info); + + test.equal(info.length, 5); + + test.equal(info[0].component, "month"); + test.equal(info[0].label, "Monat"); + test.deepEqual(info[0].constraint, [ + {label: "Januar", value: 1}, + {label: "Februar", value: 2}, + {label: "März", value: 3}, + {label: "April", value: 4}, + {label: "Mai", value: 5}, + {label: "Juni", value: 6}, + {label: "Juli", value: 7}, + {label: "August", value: 8}, + {label: "September", value: 9}, + {label: "Oktober", value: 10}, + {label: "November", value: 11}, + {label: "Dezember", value: 12}, + ]); + + test.ok(!info[1].component); + test.equal(info[1].label, " "); + + test.equal(info[2].component, "day"); + test.equal(info[2].label, "Tag"); + test.deepEqual(info[2].constraint, { + "1": [1, 31], + "2": [1, 28], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + }); - test.ok(!info[3].component); - test.equal(info[3].label, ", "); + test.ok(!info[3].component); + test.equal(info[3].label, ", "); - test.equal(info[4].component, "year"); - test.equal(info[4].label, "Jahr"); - test.equal(info[4].constraint, "\\d{4}"); - test.done(); + test.equal(info[4].component, "year"); + test.equal(info[4].label, "Jahr"); + test.equal(info[4].constraint, "\\d{4}"); + test.done(); + } + }); } }); - - }, + } }; \ No newline at end of file From bea498c4bcdb6613ffc8a6ae6efdc47735a66dfd Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Mon, 24 Jun 2019 17:02:53 -0700 Subject: [PATCH 31/38] All unit tests pass now --- js/lib/DateFmtInfo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/lib/DateFmtInfo.js b/js/lib/DateFmtInfo.js index 01aa035116..dba7c9799d 100644 --- a/js/lib/DateFmtInfo.js +++ b/js/lib/DateFmtInfo.js @@ -51,7 +51,7 @@ var ISet = require("./ISet.js"); * instance works */ var DateFmtInfo = function(options) { - var sync = typeof(options.sync) === "boolean" ? options.sync : true; + var sync = options && typeof(options.sync) === "boolean" ? options.sync : true; if (!options || sync) { this.fmt = new DateFmt(options); this._init(options); From 0e64d878e73f9837e729d47072b04f4a1c604690 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Mon, 24 Jun 2019 17:15:33 -0700 Subject: [PATCH 32/38] A little cleanup --- js/lib/DateFmtInfo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/lib/DateFmtInfo.js b/js/lib/DateFmtInfo.js index dba7c9799d..63e1f2e5d0 100644 --- a/js/lib/DateFmtInfo.js +++ b/js/lib/DateFmtInfo.js @@ -52,7 +52,7 @@ var ISet = require("./ISet.js"); */ var DateFmtInfo = function(options) { var sync = options && typeof(options.sync) === "boolean" ? options.sync : true; - if (!options || sync) { + if (sync) { this.fmt = new DateFmt(options); this._init(options); } else { From 3f7a756e8b8fb02cedd1a9ba6252b1b6da8ff0cd Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Mon, 24 Jun 2019 18:06:39 -0700 Subject: [PATCH 33/38] Added more unit tests --- js/lib/DateFmtInfo.js | 2 +- js/test/date/testdatefmtasync.js | 197 ++++++++++++++++++++++++++++++- 2 files changed, 197 insertions(+), 2 deletions(-) diff --git a/js/lib/DateFmtInfo.js b/js/lib/DateFmtInfo.js index f9519abffe..db2a4f1cf0 100644 --- a/js/lib/DateFmtInfo.js +++ b/js/lib/DateFmtInfo.js @@ -75,7 +75,7 @@ DateFmtInfo.prototype = { if (options) { locale = options.uiLocale || options.locale; - sync = !!options.sync; + sync = typeof(options.sync) === "boolean" ? options.sync : true; callback = options.onLoad; loadParams = options.loadParams; } diff --git a/js/test/date/testdatefmtasync.js b/js/test/date/testdatefmtasync.js index ab3a586199..0607ded2b9 100644 --- a/js/test/date/testdatefmtasync.js +++ b/js/test/date/testdatefmtasync.js @@ -1,7 +1,7 @@ /* * testdatefmtasync.js - test the date formatter object asynchronously * - * Copyright © 2018, JEDLSoft + * Copyright © 2018-2019, JEDLSoft * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -428,6 +428,201 @@ module.exports.testdatefmtasync = { test.done(); } }); + }, + + testDateFmtGetFormatInfoGregorianTranslatedAsyncConstructor: function(test) { + test.expect(16); + var fmt = new DateFmtInfo({ + locale: "en-US", + type: "date", + length: "full", + uiLocale: "de-DE", + sync: false, + onLoad: function(fmt) { + test.ok(fmt !== null); + + fmt.getFormatInfo({ + year: 2019, + sync: false, + onLoad: function(info) { + test.ok(info); + + test.equal(info.length, 5); + + test.equal(info[0].component, "month"); + test.equal(info[0].label, "Monat"); + test.deepEqual(info[0].constraint, [ + {label: "Januar", value: 1}, + {label: "Februar", value: 2}, + {label: "März", value: 3}, + {label: "April", value: 4}, + {label: "Mai", value: 5}, + {label: "Juni", value: 6}, + {label: "Juli", value: 7}, + {label: "August", value: 8}, + {label: "September", value: 9}, + {label: "Oktober", value: 10}, + {label: "November", value: 11}, + {label: "Dezember", value: 12}, + ]); + + test.ok(!info[1].component); + test.equal(info[1].label, " "); + + test.equal(info[2].component, "day"); + test.equal(info[2].label, "Tag"); + test.deepEqual(info[2].constraint, { + "1": [1, 31], + "2": [1, 28], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + }); + + test.ok(!info[3].component); + test.equal(info[3].label, ", "); + + test.equal(info[4].component, "year"); + test.equal(info[4].label, "Jahr"); + test.equal(info[4].constraint, "\\d{4}"); + test.done(); + } + }); + } + }); }, + + testDateFmtInfoGetFormatInfoUSFullAllFieldsAsync: function(test) { + test.expect(172); + + var fmt = new DateFmtInfo({ + locale: "en-US", + type: "datetime", + length: "full", + date: "wmdy", + time: "ahmsz", + sync: false, + onLoad: function(fmt) { + test.ok(fmt !== null); + + fmt.getFormatInfo({ + sync: false, + year: 2019, // non leap year + onLoad: function(info) { + test.ok(info); + + test.equal(info.length, 17); + + test.equal(info[0].label, "Day of Week"), + test.equal(typeof(info[0].value), "function"); + + test.ok(!info[1].component); + test.equal(info[1].label, ", "); + + test.equal(info[2].component, "month"); + test.equal(info[2].label, "Month"); + test.deepEqual(info[2].constraint, [ + {label: "January", value: 1}, + {label: "February", value: 2}, + {label: "March", value: 3}, + {label: "April", value: 4}, + {label: "May", value: 5}, + {label: "June", value: 6}, + {label: "July", value: 7}, + {label: "August", value: 8}, + {label: "September", value: 9}, + {label: "October", value: 10}, + {label: "November", value: 11}, + {label: "December", value: 12} + ]); + + test.ok(!info[3].component); + test.equal(info[3].label, " "); + + test.equal(info[4].component, "day"); + test.equal(info[4].label, "Day"); + test.deepEqual(info[4].constraint, { + "1": [1, 31], + "2": [1, 28], + "3": [1, 31], + "4": [1, 30], + "5": [1, 31], + "6": [1, 30], + "7": [1, 31], + "8": [1, 31], + "9": [1, 30], + "10": [1, 31], + "11": [1, 30], + "12": [1, 31] + }); + test.equal(info[4].validation, "\\d{1,2}"); + + test.ok(!info[5].component); + test.equal(info[5].label, ", "); + + test.equal(info[6].component, "year"); + test.equal(info[6].label, "Year"); + test.equal(info[6].placeholder, "YYYY"); + test.equal(info[6].constraint, "\\d{4}"); + + test.ok(!info[7].component); + test.equal(info[7].label, " at "); + + test.equal(info[8].component, "hour"); + test.equal(info[8].label, "Hour"); + test.equal(info[8].placeholder, "H"); + test.deepEqual(info[8].constraint, ["12", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"]); + test.equal(info[8].validation, "\\d{1,2}"); + + test.ok(!info[9].component); + test.equal(info[9].label, ":"); + + test.equal(info[10].component, "minute"); + test.equal(info[10].label, "Minute"); + test.equal(info[10].placeholder, "mm"); + for (var i = 0; i < 60; i++) { + test.equal(Number(info[10].constraint[i]), i); + } + test.equal(info[10].validation, "\\d{2}"); + + test.ok(!info[11].component); + test.equal(info[11].label, ":"); + + test.equal(info[12].component, "second"); + test.equal(info[12].label, "Second"); + test.equal(info[12].placeholder, "ss"); + for (var i = 0; i < 60; i++) { + test.equal(Number(info[12].constraint[i]), i); + } + test.equal(info[12].validation, "\\d{2}"); + + test.ok(!info[13].component); + test.equal(info[13].label, " "); + + test.equal(info[14].component, "meridiem"); + test.equal(info[14].label, "AM/PM"); + test.deepEqual(info[14].constraint, ["AM", "PM"]); + + test.ok(!info[15].component); + test.equal(info[15].label, " "); + + test.equal(info[16].component, "timezone"); + test.equal(info[16].label, "Time zone"); + test.equal(typeof(info[16].constraint), "object"); + test.equal(info[16].constraint.length, 511); + } + }); + + test.done(); + } + }); + } }; \ No newline at end of file From 2e55e6315e6675fa3438e12682ed597ac4d12fa0 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Mon, 24 Jun 2019 20:21:23 -0700 Subject: [PATCH 34/38] Few more unit tests and minor clean-up. --- js/lib/DateFmt.js | 2 +- js/test/date/testdatefmtasync.js | 2 +- js/test/date/testdatefmtinfo.js | 60 ++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/js/lib/DateFmt.js b/js/lib/DateFmt.js index 602e6caae6..277e9bbc5b 100644 --- a/js/lib/DateFmt.js +++ b/js/lib/DateFmt.js @@ -579,7 +579,7 @@ DateFmt.weekDayLenMap = { * * @static * @public - * @deprecated Use DateFmtInfo.getMeridiemsRange() instead + * @deprecated Use DateFmtInfo.getMeridiemsRange() non-static method instead * @param {Object} options options governing the way this date formatter instance works for getting meridiems range * @return {Array.<{name:string,start:string,end:string}>} */ diff --git a/js/test/date/testdatefmtasync.js b/js/test/date/testdatefmtasync.js index f1fd4b79a8..9e5045a53b 100644 --- a/js/test/date/testdatefmtasync.js +++ b/js/test/date/testdatefmtasync.js @@ -193,7 +193,7 @@ module.exports.testdatefmtasync = { testDateFmtGetMonthsOfYearThai: function(test) { test.expect(2); // uses ThaiSolar calendar - var fmt = new DateFmt({ + var fmt = new DateFmtInfo({ locale: "th-TH", sync: false, onLoad: function(fmt) { diff --git a/js/test/date/testdatefmtinfo.js b/js/test/date/testdatefmtinfo.js index 663e62d096..864846ef73 100644 --- a/js/test/date/testdatefmtinfo.js +++ b/js/test/date/testdatefmtinfo.js @@ -970,6 +970,66 @@ module.exports.testdategetformatinfo = { test.done(); }, + testDateFmtInfoGetDateComponentOrderEN: function(test) { + test.expect(2); + + var fmt = new DateFmtInfo({locale: "en"}); + test.ok(fmt !== null); + + test.equal(fmt.getDateComponentOrder(), "mdy"); + test.done(); + }, + + testDateFmtInfoGetDateComponentOrderENGB: function(test) { + test.expect(2); + + var fmt = new DateFmtInfo({locale: "en-GB"}); + test.ok(fmt !== null); + + test.equal(fmt.getDateComponentOrder(), "dmy"); + test.done(); + }, + + testDateFmtInfoGetDateComponentOrderENUS: function(test) { + test.expect(2); + + var fmt = new DateFmtInfo({locale: "en-US"}) + test.ok(fmt !== null); + + test.equal(fmt.getDateComponentOrder(), "mdy"); + test.done(); + }, + + testDateFmtInfoGetDateComponentOrderDE: function(test) { + test.expect(2); + + var fmt = new DateFmtInfo({locale: "de-DE"}); + test.ok(fmt !== null); + + test.equal(fmt.getDateComponentOrder(), "dmy"); + test.done(); + }, + + testDateFmtInfoGetDateComponentOrderAK: function(test) { + test.expect(2); + + var fmt = new DateFmtInfo({locale: "ak-GH"}); + test.ok(fmt !== null); + + test.equal(fmt.getDateComponentOrder(), "ymd"); + test.done(); + }, + + testDateFmtInfoGetDateComponentOrderLV: function(test) { + test.expect(2); + + var fmt = new DateFmtInfo({locale: "lv-LV"}); + test.ok(fmt !== null); + + test.equal(fmt.getDateComponentOrder(), "ydm"); + test.done(); + }, + testDateFmtInfoGetMonthsOfYear1: function(test) { test.expect(2); var fmt = new DateFmtInfo({locale: "en-US"}); From 1a09d6d5e3046b6007dc632900219e34592730b7 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Thu, 25 Jul 2019 20:30:03 -0700 Subject: [PATCH 35/38] Fix incorrect merge --- js/test/date/testMeridiems.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/test/date/testMeridiems.js b/js/test/date/testMeridiems.js index 1a72ed81f0..ce254bfeb2 100644 --- a/js/test/date/testMeridiems.js +++ b/js/test/date/testMeridiems.js @@ -2087,8 +2087,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "ਪੂ.ਦੁ."); - test.equal(range[1].name, "ਬਾ.ਦੁ."); + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); test.done(); }, From daac86cce913c5ba5f18cf0024628e9e481abf6e Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Thu, 25 Jul 2019 20:30:11 -0700 Subject: [PATCH 36/38] Clean up whitespace --- js/test/date/testdatefmtasync.js | 42 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/js/test/date/testdatefmtasync.js b/js/test/date/testdatefmtasync.js index 9e5045a53b..6228e0d3ca 100644 --- a/js/test/date/testdatefmtasync.js +++ b/js/test/date/testdatefmtasync.js @@ -433,7 +433,7 @@ module.exports.testdatefmtasync = { } }); }, - + testDateFmtInfoGetFormatInfoUSFullAllFieldsAsync: function(test) { test.expect(172); @@ -446,21 +446,21 @@ module.exports.testdatefmtasync = { sync: false, onLoad: function(fmt) { test.ok(fmt !== null); - + fmt.getFormatInfo({ sync: false, year: 2019, // non leap year onLoad: function(info) { test.ok(info); - + test.equal(info.length, 17); - + test.equal(info[0].label, "Day of Week"), test.equal(typeof(info[0].value), "function"); - + test.ok(!info[1].component); test.equal(info[1].label, ", "); - + test.equal(info[2].component, "month"); test.equal(info[2].label, "Month"); test.deepEqual(info[2].constraint, [ @@ -477,10 +477,10 @@ module.exports.testdatefmtasync = { {label: "November", value: 11}, {label: "December", value: 12} ]); - + test.ok(!info[3].component); test.equal(info[3].label, " "); - + test.equal(info[4].component, "day"); test.equal(info[4].label, "Day"); test.deepEqual(info[4].constraint, { @@ -498,27 +498,27 @@ module.exports.testdatefmtasync = { "12": [1, 31] }); test.equal(info[4].validation, "\\d{1,2}"); - + test.ok(!info[5].component); test.equal(info[5].label, ", "); - + test.equal(info[6].component, "year"); test.equal(info[6].label, "Year"); test.equal(info[6].placeholder, "YYYY"); test.equal(info[6].constraint, "\\d{4}"); - + test.ok(!info[7].component); test.equal(info[7].label, " at "); - + test.equal(info[8].component, "hour"); test.equal(info[8].label, "Hour"); test.equal(info[8].placeholder, "H"); test.deepEqual(info[8].constraint, ["12", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"]); test.equal(info[8].validation, "\\d{1,2}"); - + test.ok(!info[9].component); test.equal(info[9].label, ":"); - + test.equal(info[10].component, "minute"); test.equal(info[10].label, "Minute"); test.equal(info[10].placeholder, "mm"); @@ -526,10 +526,10 @@ module.exports.testdatefmtasync = { test.equal(Number(info[10].constraint[i]), i); } test.equal(info[10].validation, "\\d{2}"); - + test.ok(!info[11].component); test.equal(info[11].label, ":"); - + test.equal(info[12].component, "second"); test.equal(info[12].label, "Second"); test.equal(info[12].placeholder, "ss"); @@ -537,24 +537,24 @@ module.exports.testdatefmtasync = { test.equal(Number(info[12].constraint[i]), i); } test.equal(info[12].validation, "\\d{2}"); - + test.ok(!info[13].component); test.equal(info[13].label, " "); - + test.equal(info[14].component, "meridiem"); test.equal(info[14].label, "AM/PM"); test.deepEqual(info[14].constraint, ["AM", "PM"]); - + test.ok(!info[15].component); test.equal(info[15].label, " "); - + test.equal(info[16].component, "timezone"); test.equal(info[16].label, "Time zone"); test.equal(typeof(info[16].constraint), "object"); test.equal(info[16].constraint.length, 511); } }); - + test.done(); } }); From 1d7c04b00a47b0cad0de55f13fe0f5bdcffb4b97 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Thu, 25 Jul 2019 22:19:40 -0700 Subject: [PATCH 37/38] Fix minor whitespace --- js/test/date/testdatefmtasync.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/test/date/testdatefmtasync.js b/js/test/date/testdatefmtasync.js index 6228e0d3ca..5c7ef0a417 100644 --- a/js/test/date/testdatefmtasync.js +++ b/js/test/date/testdatefmtasync.js @@ -476,7 +476,7 @@ module.exports.testdatefmtasync = { {label: "October", value: 10}, {label: "November", value: 11}, {label: "December", value: 12} - ]); + ]); test.ok(!info[3].component); test.equal(info[3].label, " "); From 55742fa92dc14e7e6699803613ab921522451b05 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Sun, 17 Oct 2021 20:57:56 -0700 Subject: [PATCH 38/38] Cleanup, resolve some unit tests - after effects of a less-than-successful merge --- js/lib/ilib-unpack.js | 3 +- js/test/date/testMeridiems.js | 243 +++++++++++++++++-------------- js/test/date/testdatefmtasync.js | 4 +- js/test/date/testdatefmtinfo.js | 6 +- tools/cldr/datefmts.js | 210 +++++++++++++------------- 5 files changed, 242 insertions(+), 224 deletions(-) diff --git a/js/lib/ilib-unpack.js b/js/lib/ilib-unpack.js index 74ac3733a6..8599dcb5b1 100644 --- a/js/lib/ilib-unpack.js +++ b/js/lib/ilib-unpack.js @@ -117,7 +117,8 @@ var exportClassesPublic = [ "AlphabeticIndex", "TimeZone", "Currency", - "DigitalSpeedUnit" + "DigitalSpeedUnit", + "DateFmtInfo" ]; if (top) { diff --git a/js/test/date/testMeridiems.js b/js/test/date/testMeridiems.js index d6dcc1ff5e..91c7c2995c 100644 --- a/js/test/date/testMeridiems.js +++ b/js/test/date/testMeridiems.js @@ -490,8 +490,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -501,8 +501,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -512,8 +512,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -523,8 +523,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -534,8 +534,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -545,8 +545,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -556,8 +556,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -567,8 +567,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -578,8 +578,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -589,8 +589,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -600,8 +600,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -611,8 +611,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -622,8 +622,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -633,8 +633,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -644,8 +644,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -655,8 +655,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -666,8 +666,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -677,8 +677,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -688,8 +688,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -1487,8 +1487,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -1856,8 +1856,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -1867,8 +1867,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -1878,8 +1878,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "a. m."); - test.equal(range[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, @@ -2161,158 +2161,175 @@ module.exports.testmeridiems = { testMeridiem_ka_GE: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ka-GE"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ka-GE"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); test.done(); }, testMeridiem_be_BY: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"be-BY"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "be-BY"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); test.done(); }, testMeridiem_lo_LA: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"lo-LA"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "lo-LA"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range); - test.equal(fmt[0].name, "ກ່ອນທ່ຽງ"); - test.equal(fmt[1].name, "ຫຼັງທ່ຽງ"); + test.equal(range[0].name, "ກ່ອນທ່ຽງ"); + test.equal(range[1].name, "ຫຼັງທ່ຽງ"); test.done(); }, testMeridiem_ky_KG: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ky-KG"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ky-KG"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range); - test.equal(fmt[0].name, "таңкы"); - test.equal(fmt[1].name, "түштөн кийинки"); + test.equal(range[0].name, "таңкы"); + test.equal(range[1].name, "түштөн кийинки"); test.done(); }, testMeridiem_ca_AD: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ca-AD"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ca-AD"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, testMeridiem_ca_ES: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ca-ES"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ca-ES"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range); - test.equal(fmt[0].name, "a. m."); - test.equal(fmt[1].name, "p. m."); + test.equal(range[0].name, "a. m."); + test.equal(range[1].name, "p. m."); test.done(); }, testMeridiem_hy_AM: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"hy-AM"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "hy-AM"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); test.done(); }, testMeridiem_gl_ES: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"gl-ES"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "gl-ES"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range); - test.equal(fmt[0].name, "a.m."); - test.equal(fmt[1].name, "p.m."); + test.equal(range[0].name, "a.m."); + test.equal(range[1].name, "p.m."); test.done(); }, testMeridiem_en_ES: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"eu-ES"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "eu-ES"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range); - test.equal(fmt[0].name, "AM"); - test.equal(fmt[1].name, "PM"); + test.equal(range[0].name, "AM"); + test.equal(range[1].name, "PM"); test.done(); }, testMeridiem_ne_NP: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"ne-NP"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "ne-NP"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range); - test.equal(fmt[0].name, "पूर्वाह्न"); - test.equal(fmt[1].name, "अपराह्न"); + test.equal(range[0].name, "पूर्वाह्न"); + test.equal(range[1].name, "अपराह्न"); test.done(); }, testMeridiem_my_MM: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"my-MM"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "my-MM"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range); - test.equal(fmt[0].name, 'နံနက်'); - test.equal(fmt[1].name, 'ညနေ'); + test.equal(range[0].name, 'နံနက်'); + test.equal(range[1].name, 'ညနေ'); test.done(); }, testMeridiem_wo_SN: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"wo-SN"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "wo-SN"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range); - test.equal(fmt[0].name, 'Sub'); - test.equal(fmt[1].name, 'Ngo'); + test.equal(range[0].name, 'Sub'); + test.equal(range[1].name, 'Ngo'); test.done(); }, testMeridiem_tk_TM: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"tk-TM"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "tk-TM"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range); - test.equal(fmt[0].name, 'günortadan öň'); - test.equal(fmt[1].name, 'günortadan soň'); + test.equal(range[0].name, 'günortadan öň'); + test.equal(range[1].name, 'günortadan soň'); test.done(); }, testMeridiem_tg_TJ: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"tg-TJ"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "tg-TJ"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range); - test.equal(fmt[0].name, 'AM'); - test.equal(fmt[1].name, 'PM'); + test.equal(range[0].name, 'AM'); + test.equal(range[1].name, 'PM'); test.done(); }, testMeridiem_mt_MT: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"mt-MT"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "mt-MT"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range); - test.equal(fmt[0].name, 'AM'); - test.equal(fmt[1].name, 'PM'); + test.equal(range[0].name, 'AM'); + test.equal(range[1].name, 'PM'); test.done(); }, testMeridiem_zu_ZA: function(test) { test.expect(3); - var fmt = DateFmt.getMeridiemsRange({locale:"zu-ZA"}); - test.ok(fmt !== null); + var fmtinfo = new DateFmtInfo({locale: "zu-ZA"}); + var range = fmtinfo.getMeridiemsRange(); + test.ok(range); - test.equal(fmt[0].name, 'AM'); - test.equal(fmt[1].name, 'PM'); + test.equal(range[0].name, 'AM'); + test.equal(range[1].name, 'PM'); test.done(); - } + }, + testGetMeridiemsRangeLength_with_am_ET_locale: function(test) { test.expect(2); var fmtinfo = new DateFmtInfo({locale: "am-ET"}); @@ -2710,8 +2727,8 @@ module.exports.testmeridiems = { var range = fmtinfo.getMeridiemsRange(); test.ok(range !== null); - test.equal(range[0].name, "पूर्वाह्न"); - test.equal(range[1].name, "अपराह्न"); + test.equal(range[0].name, "am"); + test.equal(range[1].name, "pm"); test.done(); }, diff --git a/js/test/date/testdatefmtasync.js b/js/test/date/testdatefmtasync.js index 5c7ef0a417..99ba798658 100644 --- a/js/test/date/testdatefmtasync.js +++ b/js/test/date/testdatefmtasync.js @@ -1,7 +1,7 @@ /* * testdatefmtasync.js - test the date formatter object asynchronously * - * Copyright © 2018-2019, JEDLSoft + * Copyright © 2018-2021, JEDLSoft * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -551,7 +551,7 @@ module.exports.testdatefmtasync = { test.equal(info[16].component, "timezone"); test.equal(info[16].label, "Time zone"); test.equal(typeof(info[16].constraint), "object"); - test.equal(info[16].constraint.length, 511); + test.equal(info[16].constraint.length, 532); } }); diff --git a/js/test/date/testdatefmtinfo.js b/js/test/date/testdatefmtinfo.js index 864846ef73..a2f727410b 100644 --- a/js/test/date/testdatefmtinfo.js +++ b/js/test/date/testdatefmtinfo.js @@ -2,7 +2,7 @@ * testgetformatinfo.js - test the date formatter object's * getFormatInfo call * - * Copyright © 2019 JEDLSoft + * Copyright © 2019-2021 JEDLSoft * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -383,7 +383,7 @@ module.exports.testdategetformatinfo = { test.equal(info[16].component, "timezone"); test.equal(info[16].label, "Time zone"); test.equal(typeof(info[16].constraint), "object"); - test.equal(info[16].constraint.length, 511); + test.equal(info[16].constraint.length, 532); } }); @@ -506,7 +506,7 @@ module.exports.testdategetformatinfo = { test.equal(info[16].component, "timezone"); test.equal(info[16].label, "Time zone"); test.equal(typeof(info[16].constraint), "object"); - test.equal(info[16].constraint.length, 511); + test.equal(info[16].constraint.length, 532); } }); diff --git a/tools/cldr/datefmts.js b/tools/cldr/datefmts.js index f46df53e0f..56a8e17c63 100644 --- a/tools/cldr/datefmts.js +++ b/tools/cldr/datefmts.js @@ -333,7 +333,7 @@ function compareFormats(left, right) { return l !== r; } -function replaceFormates(str, org, replace) { +function replaceFormats(str, org, replace) { var repString = str; if (typeof(org) === 'object') { @@ -942,24 +942,24 @@ module.exports = { dmyOrdercldr = dateOrder(cldrFormats[len]); if (calendar.date[dmyiLib] !== undefined && calendar.date[dmyiLib][lenAbbr] !== undefined) { - dateRangeTemplate = replaceFormates(dateRangeTemplate, "{date}", calendar.date[dmyiLib][lenAbbr]); - dateOnlyTemplate = replaceFormates(dateOnlyTemplate, "{date}", calendar.date[dmyiLib][lenAbbr]); + dateRangeTemplate = replaceFormats(dateRangeTemplate, "{date}", calendar.date[dmyiLib][lenAbbr]); + dateOnlyTemplate = replaceFormats(dateOnlyTemplate, "{date}", calendar.date[dmyiLib][lenAbbr]); if (dateTimeOrder) { //{date}{time} switch(dmyOrdercldr) { case "dmy": //console.log("dt,dmy"); - cFmt0 = replaceFormates(cFmt0, "{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt0 = replaceFormats(cFmt0, "{date}", calendar.date[dmyiLib][lenAbbr]); if (language === 'nnh' && (lenAbbr === 'f' || lenAbbr === 'l' )) { //'lyɛ'̌ʼ d 'na' MMMM, yyyy cFmt0 = cFmt0.replace(regExp3, "{ey}").replace(/M+/, "{em}").replace(regExp2,"{ed}"); } else { - cFmt0 = replaceFormates(cFmt0, startTime); + cFmt0 = replaceFormats(cFmt0, startTime); } - cFmt0 = replaceFormates(cFmt0,"{time}", "{st}"); - cFmt0 = replaceFormates(cFmt0,"{time}", "{et}"); + cFmt0 = replaceFormats(cFmt0,"{time}", "{st}"); + cFmt0 = replaceFormats(cFmt0,"{time}", "{et}"); cFmt0 = cFmt0.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c00"][lenAbbr] = cFmt0; @@ -968,14 +968,14 @@ module.exports = { if (language === 'nnh' && (lenAbbr === 'f' || lenAbbr === 'l' )) { //'lyɛ'̌ʼ d 'na' MMMM, yyyy cFmt1 = cFmt1.replace(regExp3, "{ey}").replace(/M+/, "{em}").replace(regExp2,"{ed}"); } else { - cFmt1 = replaceFormates(dateRangeTemplate, startTime); + cFmt1 = replaceFormats(dateRangeTemplate, startTime); } - cFmt1 = replaceFormates(cFmt1,"{time}", "{st}"); - cFmt1 = replaceFormates(cFmt1,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt1 = replaceFormats(cFmt1,"{time}", "{st}"); + cFmt1 = replaceFormats(cFmt1,"{date}", calendar.date[dmyiLib][lenAbbr]); cFmt1 = cFmt1.replace(regExp3,"{ey}").replace(regExp4, "{em}").replace(regExp2,"{ed}"); - cFmt1 = replaceFormates(cFmt1, "{time}", "{et}"); + cFmt1 = replaceFormats(cFmt1, "{time}", "{et}"); cFmt1 = cFmt1.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c01"][lenAbbr] = cFmt1; calendar.range["c02"][lenAbbr] = cFmt1; @@ -988,7 +988,7 @@ module.exports = { cFmt10 = cFmt10.replace(/{date}/, calendar.date["d"][lenAbbr]); cFmt10 = cFmt10.replace(regExp2,"{sd}"); - cFmt10 = replaceFormates(cFmt10,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt10 = replaceFormats(cFmt10,"{date}", calendar.date[dmyiLib][lenAbbr]); if (language === 'nnh' && (lenAbbr === 'f' || lenAbbr === 'l' )) { //'lyɛ'̌ʼ d 'na' MMMM, yyyy cFmt10 = cFmt10.replace(regExp3,"{ey}").replace(/M+/, "{em}").replace(regExp2,"{ed}"); @@ -1001,15 +1001,15 @@ module.exports = { calendar.range["c10"][lenAbbr] = cFmt10; cFmt11 = "{date} – {date}"; - cFmt11 = replaceFormates(cFmt11, "{date}", calendar.date["dm"][lenAbbr]); + cFmt11 = replaceFormats(cFmt11, "{date}", calendar.date["dm"][lenAbbr]); if (language === 'nnh' && (lenAbbr === 'f' || lenAbbr === 'l' )) { //'lyɛ'̌ʼ d 'na' MMMM, yyyy cFmt11 = cFmt11.replace(/M+/, "{sm}").replace(regExp2,"{sd}"); } else { - cFmt11 = replaceFormates(cFmt11, startTime); + cFmt11 = replaceFormats(cFmt11, startTime); } - cFmt11 = replaceFormates(cFmt11,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt11 = replaceFormats(cFmt11,"{date}", calendar.date[dmyiLib][lenAbbr]); cFmt11 = cFmt11.replace(regExp3,"{ey}").replace(/M+/, "{em}").replace(regExp2,"{ed}"); cFmt11 = cFmt11.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c11"][lenAbbr] = cFmt11; @@ -1019,10 +1019,10 @@ module.exports = { if (language === 'nnh' && (lenAbbr === 'f' || lenAbbr === 'l' )) { //'lyɛ'̌ʼ d 'na' MMMM, yyyy cFmt12 = cFmt12.replace(regExp3, "{sy}").replace(/M+/, "{sm}").replace(regExp2,"{sd}"); } else { - cFmt12 = replaceFormates(cFmt12, startTime); + cFmt12 = replaceFormats(cFmt12, startTime); } - cFmt12 = replaceFormates(cFmt12,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt12 = replaceFormats(cFmt12,"{date}", calendar.date[dmyiLib][lenAbbr]); cFmt12 = cFmt12.replace(regExp3,"{ey}").replace(/M+/, "{em}").replace(regExp2,"{ed}"); cFmt12 = cFmt12.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c12"][lenAbbr] = cFmt12; @@ -1030,10 +1030,10 @@ module.exports = { //cFmt20 = dateOnlyTemplate; cFmt20 = "{date} – {date}"; - cFmt20 = replaceFormates(cFmt20, "{date}", calendar.date["my"][lenAbbr]); + cFmt20 = replaceFormats(cFmt20, "{date}", calendar.date["my"][lenAbbr]); cFmt20 = cFmt20.replace(/M+/,"{sm}").replace(/L+/, "{sm}").replace(regExp3, "{sy}"); - cFmt20 = replaceFormates(cFmt20,"{date}", calendar.date["my"][lenAbbr]); + cFmt20 = replaceFormats(cFmt20,"{date}", calendar.date["my"][lenAbbr]); if (language === 'nnh' && (lenAbbr === 'f' || lenAbbr === 'l' )) { //'lyɛ'̌ʼ d 'na' MMMM, yyyy cFmt20 = cFmt20.replace(regExp3, "{ey}").replace(/M+/, "{em}").replace(/L+/, "{em}"); @@ -1052,19 +1052,19 @@ module.exports = { case "mdy": //console.log("{date}{time}, mdy"); - cFmt0 = replaceFormates(cFmt0, "{date}", calendar.date[dmyiLib][lenAbbr]); - cFmt0 = replaceFormates(cFmt0, startTime); - cFmt0 = replaceFormates(cFmt0,"{time}", "{st}"); - cFmt0 = replaceFormates(cFmt0,"{time}", "{et}"); + cFmt0 = replaceFormats(cFmt0, "{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt0 = replaceFormats(cFmt0, startTime); + cFmt0 = replaceFormats(cFmt0,"{time}", "{st}"); + cFmt0 = replaceFormats(cFmt0,"{time}", "{et}"); cFmt0 = cFmt0.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c00"][lenAbbr] = cFmt0; cFmt1 = dateRangeTemplate; - cFmt1 = replaceFormates(dateRangeTemplate, startTime); - cFmt1 = replaceFormates(cFmt1,"{time}", "{st}"); - cFmt1 = replaceFormates(cFmt1,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt1 = replaceFormats(dateRangeTemplate, startTime); + cFmt1 = replaceFormats(cFmt1,"{time}", "{st}"); + cFmt1 = replaceFormats(cFmt1,"{date}", calendar.date[dmyiLib][lenAbbr]); cFmt1 = cFmt1.replace(regExp,"{ey}").replace(/M+/, "{em}").replace(regExp2,"{ed}"); - cFmt1 = replaceFormates(cFmt1, "{time}", "{et}"); + cFmt1 = replaceFormats(cFmt1, "{time}", "{et}"); cFmt1 = cFmt1.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c01"][lenAbbr] = cFmt1; calendar.range["c02"][lenAbbr] = cFmt1; @@ -1073,13 +1073,13 @@ module.exports = { cFmt10 = dateOnlyTemplate; if (lenAbbr === 's') { - cFmt10 = replaceFormates(cFmt10,"{date}", calendar.date[dmyiLib][lenAbbr]); - cFmt10 = replaceFormates(cFmt10, startTime); + cFmt10 = replaceFormats(cFmt10,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt10 = replaceFormats(cFmt10, startTime); cFmt10 = cFmt10.replace(regExp,"{ey}").replace(/M+/, "{em}").replace(regExp2,"{ed}"); } else { - cFmt10 = replaceFormates(cFmt10, startTime); + cFmt10 = replaceFormats(cFmt10, startTime); cFmt10 = cFmt10.replace(/[\s\/]{sy}/,""); - cFmt10 = replaceFormates(cFmt10,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt10 = replaceFormats(cFmt10,"{date}", calendar.date[dmyiLib][lenAbbr]); cFmt10 = cFmt10.replace(regExp,"{ey}").replace(/M+/, "").replace(regExp2,"{ed}"); cFmt10 = cFmt10.replace(/}, –/, "} –").replace("– /{", "– {" ); } @@ -1088,25 +1088,25 @@ module.exports = { calendar.range["c10"][lenAbbr] = cFmt10; cFmt11 = dateOnlyTemplate; - cFmt11 = replaceFormates(cFmt11, startTime); + cFmt11 = replaceFormats(cFmt11, startTime); cFmt11 = cFmt11.replace(/[\,][s\s\-\.\/^\u200f]{sy}/,"").replace(/[\/]{sy}/,""); - cFmt11 = replaceFormates(cFmt11,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt11 = replaceFormats(cFmt11,"{date}", calendar.date[dmyiLib][lenAbbr]); cFmt11 = cFmt11.replace(regExp,"{ey}").replace(/M+/, "{em}").replace(regExp2,"{ed}"); cFmt11 = cFmt11.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c11"][lenAbbr] = cFmt11; cFmt12 = dateOnlyTemplate; - cFmt12 = replaceFormates(cFmt12, startTime); - cFmt12 = replaceFormates(cFmt12,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt12 = replaceFormats(cFmt12, startTime); + cFmt12 = replaceFormats(cFmt12,"{date}", calendar.date[dmyiLib][lenAbbr]); cFmt12 = cFmt12.replace(regExp,"{ey}").replace(/M+/, "{em}").replace(regExp2,"{ed}"); cFmt12 = cFmt12.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c12"][lenAbbr] = cFmt12; cFmt20 = dateOnlyTemplate; - cFmt20 = replaceFormates(cFmt20, startTime); + cFmt20 = replaceFormats(cFmt20, startTime); cFmt20 = cFmt20.replace(/[\W\s]{sd}/,""); - cFmt20 = replaceFormates(cFmt20,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt20 = replaceFormats(cFmt20,"{date}", calendar.date[dmyiLib][lenAbbr]); cFmt20 = cFmt20.replace(regExp,"{ey}").replace(/M+/, "{em}").replace(/[\W]d+/,""); cFmt20 = cFmt20.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c20"][lenAbbr] = cFmt20; @@ -1118,18 +1118,18 @@ module.exports = { case "ymd": //console.log("dt,ymd"); - cFmt0 = replaceFormates(cFmt0, "{date}", calendar.date[dmyiLib][lenAbbr]); - cFmt0 = replaceFormates(cFmt0, startTime); - cFmt0 = replaceFormates(cFmt0,"{time}", "{st}"); - cFmt0 = replaceFormates(cFmt0,"{time}", "{et}"); + cFmt0 = replaceFormats(cFmt0, "{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt0 = replaceFormats(cFmt0, startTime); + cFmt0 = replaceFormats(cFmt0,"{time}", "{st}"); + cFmt0 = replaceFormats(cFmt0,"{time}", "{et}"); cFmt0 = cFmt0.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c00"][lenAbbr] = cFmt0; cFmt1 = dateRangeTemplate; - cFmt1 = replaceFormates(dateRangeTemplate, startTime); - cFmt1 = replaceFormates(cFmt1,"{time}", "{st}"); + cFmt1 = replaceFormats(dateRangeTemplate, startTime); + cFmt1 = replaceFormats(cFmt1,"{time}", "{st}"); - cFmt1 = replaceFormates(cFmt1,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt1 = replaceFormats(cFmt1,"{date}", calendar.date[dmyiLib][lenAbbr]); if (language === 'lt' && (lenAbbr === 'f' || lenAbbr === 'l')) { cFmt1 = cFmt1.replace(regExp3,"{ey}").replace(/M+/, "{em}").replace(/[^\'^s]d+/," {ed}") @@ -1137,15 +1137,15 @@ module.exports = { cFmt1 = cFmt1.replace(regExp3,"{ey}").replace(/M+/, "{em}").replace(regExp2,"{ed}"); } - cFmt1 = replaceFormates(cFmt1, "{time}", "{et}"); + cFmt1 = replaceFormats(cFmt1, "{time}", "{et}"); cFmt1 = cFmt1.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c01"][lenAbbr] = cFmt1; cFmt2 = dateRangeTemplate; - cFmt2 = replaceFormates(dateRangeTemplate, startTime); - cFmt2 = replaceFormates(cFmt2,"{time}", "{st}"); + cFmt2 = replaceFormats(dateRangeTemplate, startTime); + cFmt2 = replaceFormats(cFmt2,"{time}", "{st}"); - cFmt2 = replaceFormates(cFmt2,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt2 = replaceFormats(cFmt2,"{date}", calendar.date[dmyiLib][lenAbbr]); if (language === 'lt' && (lenAbbr === 'f' || lenAbbr === 'l')) { cFmt2 = cFmt2.replace(regExp3,"{ey}").replace(/M+/, "{em}").replace(/[^\'^s]d+/," {ed}") @@ -1153,14 +1153,14 @@ module.exports = { cFmt2 = cFmt2.replace(regExp3,"{ey}").replace(/M+/, "{em}").replace(regExp2,"{ed}"); } - cFmt2 = replaceFormates(cFmt2, "{time}", "{et}"); + cFmt2 = replaceFormats(cFmt2, "{time}", "{et}"); cFmt2 = cFmt2.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c02"][lenAbbr] = cFmt2; cFmt3 = dateRangeTemplate; - cFmt3 = replaceFormates(dateRangeTemplate, startTime); - cFmt3 = replaceFormates(cFmt3,"{time}", "{st}"); - cFmt3 = replaceFormates(cFmt3,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt3 = replaceFormats(dateRangeTemplate, startTime); + cFmt3 = replaceFormats(cFmt3,"{time}", "{st}"); + cFmt3 = replaceFormats(cFmt3,"{date}", calendar.date[dmyiLib][lenAbbr]); if (language === 'lt' && (lenAbbr === 'f' || lenAbbr === 'l')) { @@ -1169,12 +1169,12 @@ module.exports = { cFmt3 = cFmt3.replace(regExp,"{ey}").replace(/M+/, "{em}").replace(regExp2,"{ed}"); } - cFmt3 = replaceFormates(cFmt3, "{time}", "{et}"); + cFmt3 = replaceFormats(cFmt3, "{time}", "{et}"); cFmt3 = cFmt3.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c03"][lenAbbr] = cFmt3; cFmt10 = dateOnlyTemplate; - cFmt10 = replaceFormates(cFmt10, startTime); + cFmt10 = replaceFormats(cFmt10, startTime); if (language === 'lt'&& (lenAbbr === 'f' || lenAbbr === 'l')) { cFmt10 = cFmt10.replace(/{date}/, "{ed} 'd'."); @@ -1194,8 +1194,8 @@ module.exports = { calendar.range["c10"][lenAbbr] = cFmt10; cFmt11 = dateOnlyTemplate; - cFmt11 = replaceFormates(cFmt11, startTime); - cFmt11 = replaceFormates(cFmt11,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt11 = replaceFormats(cFmt11, startTime); + cFmt11 = replaceFormats(cFmt11,"{date}", calendar.date[dmyiLib][lenAbbr]); if (language === 'lt' && (lenAbbr === 'f' || lenAbbr === 'l')) { cFmt11 = cFmt11.replace(/y+[\s\-\.\/^\u200f]/,"").replace(/M+/, "{em}").replace(/[^'^s^]d+/, " {ed}"); @@ -1220,9 +1220,9 @@ module.exports = { calendar.range["c11"][lenAbbr] = cFmt11; cFmt12 = dateOnlyTemplate; - cFmt12 = replaceFormates(cFmt12, startTime); + cFmt12 = replaceFormats(cFmt12, startTime); - cFmt12 = replaceFormates(cFmt12,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt12 = replaceFormats(cFmt12,"{date}", calendar.date[dmyiLib][lenAbbr]); if (language === 'lt' && (lenAbbr === 'f' || lenAbbr === 'l')) { cFmt12 = cFmt12.replace(regExp,"{ey}").replace(/M+/, "{em}").replace(/[^'^s^]d+/, " {ed}"); @@ -1234,10 +1234,10 @@ module.exports = { cFmt20 = "{date} – {date}"; - cFmt20 = replaceFormates(cFmt20, "{date}", calendar.date["my"][lenAbbr]); + cFmt20 = replaceFormats(cFmt20, "{date}", calendar.date["my"][lenAbbr]); cFmt20 = cFmt20.replace(/M+/,"{sm}").replace(/L+/,"{sm}").replace(/y+/, "{sy}"); - cFmt20 = replaceFormates(cFmt20,"{date}", calendar.date["my"][lenAbbr]); + cFmt20 = replaceFormats(cFmt20,"{date}", calendar.date["my"][lenAbbr]); cFmt20 = cFmt20.replace(regExp,"{ey}").replace(/M+/, "{em}").replace(/L+/, "{em}"); cFmt20 = cFmt20.replace(/\'/g,"").replace(/\s\s/g," ").trim(); @@ -1259,20 +1259,20 @@ module.exports = { case "ydm": - cFmt0 = replaceFormates(cFmt0, "{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt0 = replaceFormats(cFmt0, "{date}", calendar.date[dmyiLib][lenAbbr]); cFmt0 = cFmt0.replace(regExp3,"{sy}").replace(/M+/, "{sm}").replace(regExp2,"{sd}"); - cFmt0 = replaceFormates(cFmt0,"{time}", "{st}"); - cFmt0 = replaceFormates(cFmt0,"{time}", "{et}"); + cFmt0 = replaceFormats(cFmt0,"{time}", "{st}"); + cFmt0 = replaceFormats(cFmt0,"{time}", "{et}"); cFmt0 = cFmt0.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c00"][lenAbbr] = cFmt0; //{sy} {sd}{sm} {st} - {ey} {ed}{em} {et} cFmt1 = dateRangeTemplate; cFmt1 = cFmt1.replace(regExp3,"{sy}").replace(/M+/, "{sm}").replace(regExp2,"{sd}"); - cFmt1 = replaceFormates(cFmt1,"{time}", "{st}"); - cFmt1 = replaceFormates(cFmt1,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt1 = replaceFormats(cFmt1,"{time}", "{st}"); + cFmt1 = replaceFormats(cFmt1,"{date}", calendar.date[dmyiLib][lenAbbr]); cFmt1 = cFmt1.replace(regExp3,"{ey}").replace(/M+/, "{em}").replace(regExp2,"{ed}"); - cFmt1 = replaceFormates(cFmt1, "{time}", "{et}"); + cFmt1 = replaceFormats(cFmt1, "{time}", "{et}"); cFmt1 = cFmt1.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c01"][lenAbbr] = cFmt1; calendar.range["c02"][lenAbbr] = cFmt1; @@ -1281,7 +1281,7 @@ module.exports = { //{sy} {sd}{sm} – {ed}{em} cFmt10 = dateOnlyTemplate; cFmt10 = cFmt10.replace(regExp3,"{sy}").replace(/M+/, "{sm}").replace(regExp2,"{sd}"); - cFmt10 = replaceFormates(cFmt10,"{date}",calendar.date["dm"][lenAbbr]); + cFmt10 = replaceFormats(cFmt10,"{date}",calendar.date["dm"][lenAbbr]); cFmt10 = cFmt10.replace(/M+/, "{em}").replace(regExp2,"{ed}"); cFmt10 = cFmt10.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c10"][lenAbbr] = cFmt10; @@ -1289,7 +1289,7 @@ module.exports = { //{sy} {sd}{sm} – {ey} {ed}{em} cFmt11 = dateOnlyTemplate; cFmt11 = cFmt11.replace(regExp3,"{sy}").replace(/M+/, "{sm}").replace(regExp2,"{sd}"); - cFmt11 = replaceFormates(cFmt11,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt11 = replaceFormats(cFmt11,"{date}", calendar.date[dmyiLib][lenAbbr]); cFmt11 = cFmt11.replace(regExp3,"{ey}").replace(/M+/, "{em}").replace(regExp2,"{ed}"); cFmt11 = cFmt11.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c11"][lenAbbr] = cFmt11; @@ -1298,7 +1298,7 @@ module.exports = { cFmt20 = dateOnlyTemplate; cFmt20 = cFmt20.replace(regExp3,"{sy}").replace(/M+/, "{sm}").replace(regExp2,"{sd}"); cFmt20 = cFmt20.replace(/{sd}\W/,""); - cFmt20 = replaceFormates(cFmt20,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt20 = replaceFormats(cFmt20,"{date}", calendar.date[dmyiLib][lenAbbr]); cFmt20 = cFmt20.replace(regExp3,"{ey}").replace(/M+/, "{em}").replace(/\bd+\W/,""); cFmt20 = cFmt20.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c20"][lenAbbr] = cFmt20; @@ -1316,18 +1316,18 @@ module.exports = { case "dmy": // vi-VN Only: dd MMMM 'năm' yyyy, cFmt0 = opcFmt0; - cFmt0 = replaceFormates(cFmt0,"{time}", "{st}"); - cFmt0 = replaceFormates(cFmt0,"{time}", "{et}"); - cFmt0 = replaceFormates(cFmt0, "{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt0 = replaceFormats(cFmt0,"{time}", "{st}"); + cFmt0 = replaceFormats(cFmt0,"{time}", "{et}"); + cFmt0 = replaceFormats(cFmt0, "{date}", calendar.date[dmyiLib][lenAbbr]); cFmt0 = cFmt0.replace(/\b\wy+\b/,"{sy}").replace(regExp2,"{sd}").replace(regExp4,"{sm}"); cFmt0 = cFmt0.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c00"][lenAbbr] = cFmt0; cFmt1 = dateRangeTemplate; - cFmt1 = replaceFormates(cFmt1,"{time}", "{st}"); + cFmt1 = replaceFormats(cFmt1,"{time}", "{st}"); cFmt1 = cFmt1.replace(/\b\wy+\b/,"{sy}").replace(regExp2,"{sd}").replace(regExp4,"{sm}"); - cFmt1 = replaceFormates(cFmt1,"{date}", calendar.date[dmyiLib][lenAbbr]); - cFmt1 = replaceFormates(cFmt1, "{time}", "{et}"); + cFmt1 = replaceFormats(cFmt1,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt1 = replaceFormats(cFmt1, "{time}", "{et}"); if (language === 'vi') { if (lenAbbr === 'l') { cFmt1 = cFmt1.replace(/yyyy/,"{ey}").replace(regExp4, "{em}").replace(regExp2,"{ed}"); @@ -1343,18 +1343,18 @@ module.exports = { //{sd} - {ed}{em}{ey} cFmt10 = "{date} – {date}"; - //cFmt10 = replaceFormates(cFmt10, startTime); + //cFmt10 = replaceFormats(cFmt10, startTime); if (language === 'vi') { if (lenAbbr === 'l') { - cFmt10 = replaceFormates(cFmt10,"{date}", calendar.date["dm"][lenAbbr]); + cFmt10 = replaceFormats(cFmt10,"{date}", calendar.date["dm"][lenAbbr]); cFmt10 = cFmt10.replace(" 'tháng' MM", ""); cFmt10 = cFmt10.replace(regExp2,"{sd}") - cFmt10 = replaceFormates(cFmt10,"{date}", calendar.date["dmy"][lenAbbr]); + cFmt10 = replaceFormats(cFmt10,"{date}", calendar.date["dmy"][lenAbbr]); cFmt10 = cFmt10.replace(regExp2, "{ed}").replace(regExp4, "{em}").replace(/\b\wy+\b/, "{ey}"); } else { - cFmt10 = replaceFormates(cFmt10,"{date}", calendar.date["d"][lenAbbr]); + cFmt10 = replaceFormats(cFmt10,"{date}", calendar.date["d"][lenAbbr]); cFmt10 = cFmt10.replace(regExp2,"{sd}") - cFmt10 = replaceFormates(cFmt10,"{date}", calendar.date["dmy"][lenAbbr]); + cFmt10 = replaceFormats(cFmt10,"{date}", calendar.date["dmy"][lenAbbr]); cFmt10 = cFmt10.replace(regExp2, "{ed}").replace(regExp4, "{em}").replace(regExp3, "{ey}"); } @@ -1365,9 +1365,9 @@ module.exports = { //{sd}{sm} - {ed}{em}{ey} cFmt11 = "{date} – {date}"; if (language === 'vi') { - cFmt11 = replaceFormates(cFmt11,"{date}", calendar.date["dm"][lenAbbr]); + cFmt11 = replaceFormats(cFmt11,"{date}", calendar.date["dm"][lenAbbr]); cFmt11 = cFmt11.replace(regExp2,"{sd}").replace(regExp4,"{sm}"); - cFmt11 = replaceFormates(cFmt11,"{date}", calendar.date["dmy"][lenAbbr]); + cFmt11 = replaceFormats(cFmt11,"{date}", calendar.date["dmy"][lenAbbr]); cFmt11 = cFmt11.replace(regExp2, "{ed}").replace(regExp4, "{em}").replace(/\b\wy+\b/, "{ey}"); } cFmt11 = cFmt11.replace(/\'/g,"").replace(/\s\s/g," "); @@ -1378,11 +1378,11 @@ module.exports = { if (language === 'vi') { if (lenAbbr === 'l') { cFmt12 = cFmt12.replace(regExp2,"{sd}").replace(regExp4,"{sm}").replace(/\b\wy+\b/, "{sy}"); - cFmt12 = replaceFormates(cFmt12,"{date}", calendar.date["dmy"][lenAbbr]); + cFmt12 = replaceFormats(cFmt12,"{date}", calendar.date["dmy"][lenAbbr]); cFmt12 = cFmt12.replace(regExp2, "{ed}").replace(regExp4, "{em}").replace(/yyyy/, "{ey}"); } else { cFmt12 = cFmt12.replace(regExp2,"{sd}").replace(regExp4,"{sm}").replace(regExp3, "{sy}"); - cFmt12 = replaceFormates(cFmt12,"{date}", calendar.date["dmy"][lenAbbr]); + cFmt12 = replaceFormats(cFmt12,"{date}", calendar.date["dmy"][lenAbbr]); cFmt12 = cFmt12.replace(regExp2, "{ed}").replace(regExp4, "{em}").replace(/\b\y+\b/, "{ey}"); } } @@ -1395,21 +1395,21 @@ module.exports = { if (lenAbbr === 'l') { cFmt20 = cFmt20.replace(/'Ngày' dd 'tháng' /,""); cFmt20 = cFmt20.replace(/M+/,"{sm}").replace(/\b\wy+\b/, "{sy}"); - cFmt20 = replaceFormates(cFmt20,"{date}", calendar.date["dmy"][lenAbbr]); + cFmt20 = replaceFormats(cFmt20,"{date}", calendar.date["dmy"][lenAbbr]); cFmt20 = cFmt20.replace(/'Ngày' dd 'tháng' /,""); cFmt20 = cFmt20.replace(/M+/,"{em}").replace(/yyyy/, "{ey}"); } else if(lenAbbr === 'f') { cFmt20 = cFmt20.replace(/d+\s/,""); cFmt20 = cFmt20.replace(/M+/,"{sm}").replace(regExp3, "{sy}"); - cFmt20 = replaceFormates(cFmt20,"{date}", calendar.date["dmy"][lenAbbr]); + cFmt20 = replaceFormats(cFmt20,"{date}", calendar.date["dmy"][lenAbbr]); cFmt20 = cFmt20.replace(/[^s]d+/,""); cFmt20 = cFmt20.replace(/M+/,"{em}").replace(regExp3, "{ey}"); } else { cFmt20 = cFmt20.replace(/d+\W/,""); cFmt20 = cFmt20.replace(/M+/,"{sm}").replace(regExp3, "{sy}"); - cFmt20 = replaceFormates(cFmt20,"{date}", calendar.date["dmy"][lenAbbr]); + cFmt20 = replaceFormats(cFmt20,"{date}", calendar.date["dmy"][lenAbbr]); cFmt20 = cFmt20.replace(/d+\W/,""); cFmt20 = cFmt20.replace(/M+/,"{em}").replace(regExp3, "{ey}"); } @@ -1423,19 +1423,19 @@ module.exports = { break; case "mdy": cFmt0 = opcFmt0; - cFmt0 = replaceFormates(cFmt0,"{time}", "{st}"); - cFmt0 = replaceFormates(cFmt0,"{time}", "{et}"); - cFmt0 = replaceFormates(cFmt0, "{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt0 = replaceFormats(cFmt0,"{time}", "{st}"); + cFmt0 = replaceFormats(cFmt0,"{time}", "{et}"); + cFmt0 = replaceFormats(cFmt0, "{date}", calendar.date[dmyiLib][lenAbbr]); cFmt0 = cFmt0.replace(regExp3,"{sy}").replace(regExp2,"{sd}").replace(regExp4,"{sm}"); cFmt0 = cFmt0.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c00"][lenAbbr] = cFmt0; cFmt1 = dateRangeTemplate; - cFmt1 = replaceFormates(dateRangeTemplate, startTime); - cFmt1 = replaceFormates(cFmt1,"{time}", "{st}"); - cFmt1 = replaceFormates(cFmt1,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt1 = replaceFormats(dateRangeTemplate, startTime); + cFmt1 = replaceFormats(cFmt1,"{time}", "{st}"); + cFmt1 = replaceFormats(cFmt1,"{date}", calendar.date[dmyiLib][lenAbbr]); cFmt1 = cFmt1.replace(regExp3,"{ey}").replace(/M+/, "{em}").replace(regExp2,"{ed}"); - cFmt1 = replaceFormates(cFmt1, "{time}", "{et}"); + cFmt1 = replaceFormats(cFmt1, "{time}", "{et}"); cFmt1 = cFmt1.replace(/\'/g,"").replace(/\s\s/g," "); calendar.range["c01"][lenAbbr] = cFmt1; calendar.range["c02"][lenAbbr] = cFmt1; @@ -1444,15 +1444,15 @@ module.exports = { cFmt10 = "{date} – {date}"; if (lenAbbr === 's') { //mdy-mdy - cFmt10 = replaceFormates(cFmt10,"{date}", calendar.date[dmyiLib][lenAbbr]); - cFmt10 = replaceFormates(cFmt10, startTime); + cFmt10 = replaceFormats(cFmt10,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt10 = replaceFormats(cFmt10, startTime); cFmt10 = cFmt10.replace(regExp3,"{sy}").replace(/M+/, "{sm}").replace(regExp2,"{sd}"); - cFmt10 = replaceFormates(cFmt10,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt10 = replaceFormats(cFmt10,"{date}", calendar.date[dmyiLib][lenAbbr]); cFmt10 = cFmt10.replace(regExp3,"{ey}").replace(/M+/, "{em}").replace(regExp2,"{ed}"); } else { //m d-d y - cFmt10 = replaceFormates(cFmt10,"{date}", calendar.date["dm"][lenAbbr]); + cFmt10 = replaceFormats(cFmt10,"{date}", calendar.date["dm"][lenAbbr]); cFmt10 = cFmt10.replace(/M+/, "{sm}").replace(regExp2,"{sd}"); - cFmt10 = replaceFormates(cFmt10,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt10 = replaceFormats(cFmt10,"{date}", calendar.date[dmyiLib][lenAbbr]); cFmt10 = cFmt10.replace(/[^s^\s]y+/,"{ey}").replace(/M+/,"").replace(regExp2,"{ed}"); } cFmt10 = cFmt10.replace(/\'/g,"").replace(/\s\s/g," "); @@ -1460,9 +1460,9 @@ module.exports = { //md - mdy cFmt11 = "{date} – {date}"; - cFmt11 = replaceFormates(cFmt11,"{date}", calendar.date["dm"][lenAbbr]); + cFmt11 = replaceFormats(cFmt11,"{date}", calendar.date["dm"][lenAbbr]); cFmt11 = cFmt11.replace(/M+/, "{sm}").replace(regExp2,"{sd}"); - cFmt11 = replaceFormates(cFmt11,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt11 = replaceFormats(cFmt11,"{date}", calendar.date[dmyiLib][lenAbbr]); if (lenAbbr === 's') { cFmt11 = cFmt11.replace(regExp3,"{ey}").replace(/M+/,"{em}").replace(regExp2,"{ed}"); } else { @@ -1474,9 +1474,9 @@ module.exports = { //mdy - mdy cFmt12 = "{date} – {date}"; - cFmt12 = replaceFormates(cFmt12,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt12 = replaceFormats(cFmt12,"{date}", calendar.date[dmyiLib][lenAbbr]); cFmt12 = cFmt12.replace(/M+/, "{sm}").replace(regExp2,"{sd}").replace(regExp3,"{sy}"); - cFmt12 = replaceFormates(cFmt12,"{date}", calendar.date[dmyiLib][lenAbbr]); + cFmt12 = replaceFormats(cFmt12,"{date}", calendar.date[dmyiLib][lenAbbr]); if (lenAbbr === 's') { cFmt12 = cFmt12.replace(regExp3,"{ey}").replace(/M+/,"{em}").replace(regExp2,"{ed}"); @@ -1489,9 +1489,9 @@ module.exports = { //my - my cFmt20 = "{date} – {date}"; - cFmt20 = replaceFormates(cFmt20,"{date}", calendar.date["my"][lenAbbr]); + cFmt20 = replaceFormats(cFmt20,"{date}", calendar.date["my"][lenAbbr]); cFmt20 = cFmt20.replace(/M+/, "{sm}").replace(regExp3,"{sy}"); - cFmt20 = replaceFormates(cFmt20,"{date}", calendar.date["my"][lenAbbr]); + cFmt20 = replaceFormats(cFmt20,"{date}", calendar.date["my"][lenAbbr]); if (lenAbbr === 's') { cFmt20 = cFmt20.replace(regExp3,"{ey}").replace(/M+/,"{em}");