Initial commit
This commit is contained in:
+466
@@ -0,0 +1,466 @@
|
||||
/**
|
||||
* @preserve date-and-time (c) KNOWLEDGECODE | MIT
|
||||
*/
|
||||
|
||||
var locales = {},
|
||||
plugins = {},
|
||||
lang = 'en',
|
||||
_res = {
|
||||
MMMM: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
||||
MMM: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
||||
dddd: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
||||
ddd: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
||||
dd: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
|
||||
A: ['AM', 'PM']
|
||||
},
|
||||
_formatter = {
|
||||
YYYY: function (d/*, formatString*/) { return ('000' + d.getFullYear()).slice(-4); },
|
||||
YY: function (d/*, formatString*/) { return ('0' + d.getFullYear()).slice(-2); },
|
||||
Y: function (d/*, formatString*/) { return '' + d.getFullYear(); },
|
||||
MMMM: function (d/*, formatString*/) { return this.res.MMMM[d.getMonth()]; },
|
||||
MMM: function (d/*, formatString*/) { return this.res.MMM[d.getMonth()]; },
|
||||
MM: function (d/*, formatString*/) { return ('0' + (d.getMonth() + 1)).slice(-2); },
|
||||
M: function (d/*, formatString*/) { return '' + (d.getMonth() + 1); },
|
||||
DD: function (d/*, formatString*/) { return ('0' + d.getDate()).slice(-2); },
|
||||
D: function (d/*, formatString*/) { return '' + d.getDate(); },
|
||||
HH: function (d/*, formatString*/) { return ('0' + d.getHours()).slice(-2); },
|
||||
H: function (d/*, formatString*/) { return '' + d.getHours(); },
|
||||
A: function (d/*, formatString*/) { return this.res.A[d.getHours() > 11 | 0]; },
|
||||
hh: function (d/*, formatString*/) { return ('0' + (d.getHours() % 12 || 12)).slice(-2); },
|
||||
h: function (d/*, formatString*/) { return '' + (d.getHours() % 12 || 12); },
|
||||
mm: function (d/*, formatString*/) { return ('0' + d.getMinutes()).slice(-2); },
|
||||
m: function (d/*, formatString*/) { return '' + d.getMinutes(); },
|
||||
ss: function (d/*, formatString*/) { return ('0' + d.getSeconds()).slice(-2); },
|
||||
s: function (d/*, formatString*/) { return '' + d.getSeconds(); },
|
||||
SSS: function (d/*, formatString*/) { return ('00' + d.getMilliseconds()).slice(-3); },
|
||||
SS: function (d/*, formatString*/) { return ('0' + (d.getMilliseconds() / 10 | 0)).slice(-2); },
|
||||
S: function (d/*, formatString*/) { return '' + (d.getMilliseconds() / 100 | 0); },
|
||||
dddd: function (d/*, formatString*/) { return this.res.dddd[d.getDay()]; },
|
||||
ddd: function (d/*, formatString*/) { return this.res.ddd[d.getDay()]; },
|
||||
dd: function (d/*, formatString*/) { return this.res.dd[d.getDay()]; },
|
||||
Z: function (d/*, formatString*/) {
|
||||
var offset = d.getTimezoneOffset() / 0.6 | 0;
|
||||
return (offset > 0 ? '-' : '+') + ('000' + Math.abs(offset - (offset % 100 * 0.4 | 0))).slice(-4);
|
||||
},
|
||||
post: function (str) { return str; },
|
||||
res: _res
|
||||
},
|
||||
_parser = {
|
||||
YYYY: function (str/*, formatString */) { return this.exec(/^\d{4}/, str); },
|
||||
Y: function (str/*, formatString */) { return this.exec(/^\d{1,4}/, str); },
|
||||
MMMM: function (str/*, formatString */) {
|
||||
var result = this.find(this.res.MMMM, str);
|
||||
result.value++;
|
||||
return result;
|
||||
},
|
||||
MMM: function (str/*, formatString */) {
|
||||
var result = this.find(this.res.MMM, str);
|
||||
result.value++;
|
||||
return result;
|
||||
},
|
||||
MM: function (str/*, formatString */) { return this.exec(/^\d\d/, str); },
|
||||
M: function (str/*, formatString */) { return this.exec(/^\d\d?/, str); },
|
||||
DD: function (str/*, formatString */) { return this.exec(/^\d\d/, str); },
|
||||
D: function (str/*, formatString */) { return this.exec(/^\d\d?/, str); },
|
||||
HH: function (str/*, formatString */) { return this.exec(/^\d\d/, str); },
|
||||
H: function (str/*, formatString */) { return this.exec(/^\d\d?/, str); },
|
||||
A: function (str/*, formatString */) { return this.find(this.res.A, str); },
|
||||
hh: function (str/*, formatString */) { return this.exec(/^\d\d/, str); },
|
||||
h: function (str/*, formatString */) { return this.exec(/^\d\d?/, str); },
|
||||
mm: function (str/*, formatString */) { return this.exec(/^\d\d/, str); },
|
||||
m: function (str/*, formatString */) { return this.exec(/^\d\d?/, str); },
|
||||
ss: function (str/*, formatString */) { return this.exec(/^\d\d/, str); },
|
||||
s: function (str/*, formatString */) { return this.exec(/^\d\d?/, str); },
|
||||
SSS: function (str/*, formatString */) { return this.exec(/^\d{1,3}/, str); },
|
||||
SS: function (str/*, formatString */) {
|
||||
var result = this.exec(/^\d\d?/, str);
|
||||
result.value *= 10;
|
||||
return result;
|
||||
},
|
||||
S: function (str/*, formatString */) {
|
||||
var result = this.exec(/^\d/, str);
|
||||
result.value *= 100;
|
||||
return result;
|
||||
},
|
||||
Z: function (str/*, formatString */) {
|
||||
var result = this.exec(/^[\+-]\d{2}[0-5]\d/, str);
|
||||
result.value = (result.value / 100 | 0) * -60 - result.value % 100;
|
||||
return result;
|
||||
},
|
||||
h12: function (h, a) { return (h === 12 ? 0 : h) + a * 12; },
|
||||
exec: function (re, str) {
|
||||
var result = (re.exec(str) || [''])[0];
|
||||
return { value: result | 0, length: result.length };
|
||||
},
|
||||
find: function (array, str) {
|
||||
var index = -1, length = 0;
|
||||
|
||||
for (var i = 0, len = array.length, item; i < len; i++) {
|
||||
item = array[i];
|
||||
if (!str.indexOf(item) && item.length > length) {
|
||||
index = i;
|
||||
length = item.length;
|
||||
}
|
||||
}
|
||||
return { value: index, length: length };
|
||||
},
|
||||
pre: function (str) { return str; },
|
||||
res: _res
|
||||
},
|
||||
extend = function (base, props, override, res) {
|
||||
var obj = {}, key;
|
||||
|
||||
for (key in base) {
|
||||
obj[key] = base[key];
|
||||
}
|
||||
for (key in props || {}) {
|
||||
if (!(!!override ^ !!obj[key])) {
|
||||
obj[key] = props[key];
|
||||
}
|
||||
}
|
||||
if (res) {
|
||||
obj.res = res;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
|
||||
var proto = {
|
||||
_formatter: _formatter,
|
||||
_parser: _parser
|
||||
};
|
||||
|
||||
/**
|
||||
* Compiling a format string
|
||||
* @param {string} formatString - a format string
|
||||
* @returns {Array.<string>} a compiled object
|
||||
*/
|
||||
proto.compile = function (formatString) {
|
||||
var re = /\[([^\[\]]|\[[^\[\]]*])*]|([A-Za-z])\2+|\.{3}|./g, keys, pattern = [formatString];
|
||||
|
||||
while ((keys = re.exec(formatString))) {
|
||||
pattern[pattern.length] = keys[0];
|
||||
}
|
||||
return pattern;
|
||||
};
|
||||
|
||||
/**
|
||||
* Formatting a Date and Time
|
||||
* @param {Date} dateObj - a Date object
|
||||
* @param {string|Array.<string>} arg - a format string or its compiled object
|
||||
* @param {boolean} [utc] - output as UTC
|
||||
* @returns {string} a formatted string
|
||||
*/
|
||||
proto.format = function (dateObj, arg, utc) {
|
||||
var pattern = typeof arg === 'string' ? this.compile(arg) : arg,
|
||||
offset = dateObj.getTimezoneOffset(),
|
||||
d = this.addMinutes(dateObj, utc ? offset : 0),
|
||||
formatter = this._formatter, str = '';
|
||||
|
||||
d.getTimezoneOffset = function () { return utc ? 0 : offset; };
|
||||
for (var i = 1, len = pattern.length, token; i < len; i++) {
|
||||
token = pattern[i];
|
||||
str += formatter[token] ? formatter.post(formatter[token](d, pattern[0])) : token.replace(/\[(.*)]/, '$1');
|
||||
}
|
||||
return str;
|
||||
};
|
||||
|
||||
/**
|
||||
* Pre-parsing a Date and Time string
|
||||
* @param {string} dateString - a date string
|
||||
* @param {string|Array.<string>} arg - a format string or its compiled object
|
||||
* @returns {Object} a date structure
|
||||
*/
|
||||
proto.preparse = function (dateString, arg) {
|
||||
var pattern = typeof arg === 'string' ? this.compile(arg) : arg,
|
||||
dt = { Y: 1970, M: 1, D: 1, H: 0, A: 0, h: 0, m: 0, s: 0, S: 0, Z: 0, _index: 0, _length: 0, _match: 0 },
|
||||
comment = /\[(.*)]/, parser = this._parser, offset = 0;
|
||||
|
||||
dateString = parser.pre(dateString);
|
||||
for (var i = 1, len = pattern.length, token, result; i < len; i++) {
|
||||
token = pattern[i];
|
||||
if (parser[token]) {
|
||||
result = parser[token](dateString.slice(offset), pattern[0]);
|
||||
if (!result.length) {
|
||||
break;
|
||||
}
|
||||
offset += result.length;
|
||||
dt[result.token || token.charAt(0)] = result.value;
|
||||
dt._match++;
|
||||
} else if (token === dateString.charAt(offset) || token === ' ') {
|
||||
offset++;
|
||||
} else if (comment.test(token) && !dateString.slice(offset).indexOf(comment.exec(token)[1])) {
|
||||
offset += token.length - 2;
|
||||
} else if (token === '...') {
|
||||
offset = dateString.length;
|
||||
break;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
dt.H = dt.H || parser.h12(dt.h, dt.A);
|
||||
dt._index = offset;
|
||||
dt._length = dateString.length;
|
||||
return dt;
|
||||
};
|
||||
|
||||
/**
|
||||
* Parsing a Date and Time string
|
||||
* @param {string} dateString - a date string
|
||||
* @param {string|Array.<string>} arg - a format string or its compiled object
|
||||
* @param {boolean} [utc] - input as UTC
|
||||
* @returns {Date} a constructed date
|
||||
*/
|
||||
proto.parse = function (dateString, arg, utc) {
|
||||
var dt = this.preparse(dateString, arg);
|
||||
|
||||
if (this.isValid(dt)) {
|
||||
dt.M -= dt.Y < 100 ? 22801 : 1; // 22801 = 1900 * 12 + 1
|
||||
if (utc || dt.Z) {
|
||||
return new Date(Date.UTC(dt.Y, dt.M, dt.D, dt.H, dt.m + dt.Z, dt.s, dt.S));
|
||||
}
|
||||
return new Date(dt.Y, dt.M, dt.D, dt.H, dt.m, dt.s, dt.S);
|
||||
}
|
||||
return new Date(NaN);
|
||||
};
|
||||
|
||||
/**
|
||||
* Validation
|
||||
* @param {Object|string} arg1 - a date structure or a date string
|
||||
* @param {string|Array.<string>} [arg2] - a format string or its compiled object
|
||||
* @returns {boolean} whether the date string is a valid date
|
||||
*/
|
||||
proto.isValid = function (arg1, arg2) {
|
||||
var dt = typeof arg1 === 'string' ? this.preparse(arg1, arg2) : arg1,
|
||||
last = [31, 28 + this.isLeapYear(dt.Y) | 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][dt.M - 1];
|
||||
|
||||
return !(
|
||||
dt._index < 1 || dt._length < 1 || dt._index - dt._length || dt._match < 1 ||
|
||||
dt.Y < 1 || dt.Y > 9999 || dt.M < 1 || dt.M > 12 || dt.D < 1 || dt.D > last ||
|
||||
dt.H < 0 || dt.H > 23 || dt.m < 0 || dt.m > 59 || dt.s < 0 || dt.s > 59 || dt.S < 0 || dt.S > 999 ||
|
||||
dt.Z < -720 || dt.Z > 840
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Transforming a Date and Time string
|
||||
* @param {string} dateString - a date string
|
||||
* @param {string|Array.<string>} arg1 - a format string or its compiled object
|
||||
* @param {string|Array.<string>} arg2 - a transformed format string or its compiled object
|
||||
* @param {boolean} [utc] - output as UTC
|
||||
* @returns {string} a formatted string
|
||||
*/
|
||||
proto.transform = function (dateString, arg1, arg2, utc) {
|
||||
return this.format(this.parse(dateString, arg1), arg2, utc);
|
||||
};
|
||||
|
||||
/**
|
||||
* Adding years
|
||||
* @param {Date} dateObj - a date object
|
||||
* @param {number} years - number of years to add
|
||||
* @returns {Date} a date after adding the value
|
||||
*/
|
||||
proto.addYears = function (dateObj, years) {
|
||||
return this.addMonths(dateObj, years * 12);
|
||||
};
|
||||
|
||||
/**
|
||||
* Adding months
|
||||
* @param {Date} dateObj - a date object
|
||||
* @param {number} months - number of months to add
|
||||
* @returns {Date} a date after adding the value
|
||||
*/
|
||||
proto.addMonths = function (dateObj, months) {
|
||||
var d = new Date(dateObj.getTime());
|
||||
|
||||
d.setMonth(d.getMonth() + months);
|
||||
return d;
|
||||
};
|
||||
|
||||
/**
|
||||
* Adding days
|
||||
* @param {Date} dateObj - a date object
|
||||
* @param {number} days - number of days to add
|
||||
* @returns {Date} a date after adding the value
|
||||
*/
|
||||
proto.addDays = function (dateObj, days) {
|
||||
var d = new Date(dateObj.getTime());
|
||||
|
||||
d.setDate(d.getDate() + days);
|
||||
return d;
|
||||
};
|
||||
|
||||
/**
|
||||
* Adding hours
|
||||
* @param {Date} dateObj - a date object
|
||||
* @param {number} hours - number of hours to add
|
||||
* @returns {Date} a date after adding the value
|
||||
*/
|
||||
proto.addHours = function (dateObj, hours) {
|
||||
return this.addMinutes(dateObj, hours * 60);
|
||||
};
|
||||
|
||||
/**
|
||||
* Adding minutes
|
||||
* @param {Date} dateObj - a date object
|
||||
* @param {number} minutes - number of minutes to add
|
||||
* @returns {Date} a date after adding the value
|
||||
*/
|
||||
proto.addMinutes = function (dateObj, minutes) {
|
||||
return this.addSeconds(dateObj, minutes * 60);
|
||||
};
|
||||
|
||||
/**
|
||||
* Adding seconds
|
||||
* @param {Date} dateObj - a date object
|
||||
* @param {number} seconds - number of seconds to add
|
||||
* @returns {Date} a date after adding the value
|
||||
*/
|
||||
proto.addSeconds = function (dateObj, seconds) {
|
||||
return this.addMilliseconds(dateObj, seconds * 1000);
|
||||
};
|
||||
|
||||
/**
|
||||
* Adding milliseconds
|
||||
* @param {Date} dateObj - a date object
|
||||
* @param {number} milliseconds - number of milliseconds to add
|
||||
* @returns {Date} a date after adding the value
|
||||
*/
|
||||
proto.addMilliseconds = function (dateObj, milliseconds) {
|
||||
return new Date(dateObj.getTime() + milliseconds);
|
||||
};
|
||||
|
||||
/**
|
||||
* Subtracting two dates
|
||||
* @param {Date} date1 - a Date object
|
||||
* @param {Date} date2 - a Date object
|
||||
* @returns {Object} a result object subtracting date2 from date1
|
||||
*/
|
||||
proto.subtract = function (date1, date2) {
|
||||
var delta = date1.getTime() - date2.getTime();
|
||||
|
||||
return {
|
||||
toMilliseconds: function () {
|
||||
return delta;
|
||||
},
|
||||
toSeconds: function () {
|
||||
return delta / 1000;
|
||||
},
|
||||
toMinutes: function () {
|
||||
return delta / 60000;
|
||||
},
|
||||
toHours: function () {
|
||||
return delta / 3600000;
|
||||
},
|
||||
toDays: function () {
|
||||
return delta / 86400000;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Whether year is leap year
|
||||
* @param {number} y - year
|
||||
* @returns {boolean} whether year is leap year
|
||||
*/
|
||||
proto.isLeapYear = function (y) {
|
||||
return (!(y % 4) && !!(y % 100)) || !(y % 400);
|
||||
};
|
||||
|
||||
/**
|
||||
* Comparison of two dates
|
||||
* @param {Date} date1 - a Date object
|
||||
* @param {Date} date2 - a Date object
|
||||
* @returns {boolean} whether the two dates are the same day (time is ignored)
|
||||
*/
|
||||
proto.isSameDay = function (date1, date2) {
|
||||
return date1.toDateString() === date2.toDateString();
|
||||
};
|
||||
|
||||
/**
|
||||
* Defining new locale
|
||||
* @param {string} code - language code
|
||||
* @param {Function} locale - locale installer
|
||||
* @returns {string} current language code
|
||||
*/
|
||||
proto.locale = function (code, locale) {
|
||||
if (!locales[code]) {
|
||||
locales[code] = locale;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Defining new plugin
|
||||
* @param {string} name - plugin name
|
||||
* @param {Function} plugin - plugin installer
|
||||
* @returns {void}
|
||||
*/
|
||||
proto.plugin = function (name, plugin) {
|
||||
if (!plugins[name]) {
|
||||
plugins[name] = plugin;
|
||||
}
|
||||
};
|
||||
|
||||
var localized_proto = extend(proto);
|
||||
var date = extend(proto);
|
||||
|
||||
/**
|
||||
* Changing locale
|
||||
* @param {Function|string} [locale] - locale object | language code
|
||||
* @returns {string} current language code
|
||||
*/
|
||||
date.locale = function (locale) {
|
||||
var install = typeof locale === 'function' ? locale : date.locale[locale];
|
||||
|
||||
if (!install) {
|
||||
return lang;
|
||||
}
|
||||
lang = install(proto);
|
||||
|
||||
var extension = locales[lang] || {};
|
||||
var res = extend(_res, extension.res, true);
|
||||
var formatter = extend(_formatter, extension.formatter, true, res);
|
||||
var parser = extend(_parser, extension.parser, true, res);
|
||||
|
||||
date._formatter = localized_proto._formatter = formatter;
|
||||
date._parser = localized_proto._parser = parser;
|
||||
|
||||
for (var plugin in plugins) {
|
||||
date.extend(plugins[plugin]);
|
||||
}
|
||||
|
||||
return lang;
|
||||
};
|
||||
|
||||
/**
|
||||
* Feature extension
|
||||
* @param {Object} extension - extension object
|
||||
* @returns {void}
|
||||
*/
|
||||
date.extend = function (extension) {
|
||||
var res = extend(date._parser.res, extension.res);
|
||||
var extender = extension.extender || {};
|
||||
|
||||
date._formatter = extend(date._formatter, extension.formatter, false, res);
|
||||
date._parser = extend(date._parser, extension.parser, false, res);
|
||||
|
||||
for (var key in extender) {
|
||||
if (!date[key]) {
|
||||
date[key] = extender[key];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Importing plugin
|
||||
* @param {Function|string} plugin - plugin object | plugin name
|
||||
* @returns {void}
|
||||
*/
|
||||
date.plugin = function (plugin) {
|
||||
var install = typeof plugin === 'function' ? plugin : date.plugin[plugin];
|
||||
|
||||
if (install) {
|
||||
date.extend(plugins[install(proto, localized_proto)] || {});
|
||||
}
|
||||
};
|
||||
|
||||
export { date as default };
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
date-and-time (c) KNOWLEDGECODE | MIT
|
||||
*/
|
||||
var g={},l={},m="en",p={MMMM:"January February March April May June July August September October November December".split(" "),MMM:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),dddd:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ddd:"Sun Mon Tue Wed Thu Fri Sat".split(" "),dd:"Su Mo Tu We Th Fr Sa".split(" "),A:["AM","PM"]},q={YYYY:function(a){return("000"+a.getFullYear()).slice(-4)},YY:function(a){return("0"+a.getFullYear()).slice(-2)},Y:function(a){return""+
|
||||
a.getFullYear()},MMMM:function(a){return this.res.MMMM[a.getMonth()]},MMM:function(a){return this.res.MMM[a.getMonth()]},MM:function(a){return("0"+(a.getMonth()+1)).slice(-2)},M:function(a){return""+(a.getMonth()+1)},DD:function(a){return("0"+a.getDate()).slice(-2)},D:function(a){return""+a.getDate()},HH:function(a){return("0"+a.getHours()).slice(-2)},H:function(a){return""+a.getHours()},A:function(a){return this.res.A[11<a.getHours()|0]},hh:function(a){return("0"+(a.getHours()%12||12)).slice(-2)},
|
||||
h:function(a){return""+(a.getHours()%12||12)},mm:function(a){return("0"+a.getMinutes()).slice(-2)},m:function(a){return""+a.getMinutes()},ss:function(a){return("0"+a.getSeconds()).slice(-2)},s:function(a){return""+a.getSeconds()},SSS:function(a){return("00"+a.getMilliseconds()).slice(-3)},SS:function(a){return("0"+(a.getMilliseconds()/10|0)).slice(-2)},S:function(a){return""+(a.getMilliseconds()/100|0)},dddd:function(a){return this.res.dddd[a.getDay()]},ddd:function(a){return this.res.ddd[a.getDay()]},
|
||||
dd:function(a){return this.res.dd[a.getDay()]},Z:function(a){a=a.getTimezoneOffset()/.6|0;return(0<a?"-":"+")+("000"+Math.abs(a-(a%100*.4|0))).slice(-4)},post:function(a){return a},res:p},r={YYYY:function(a){return this.exec(/^\d{4}/,a)},Y:function(a){return this.exec(/^\d{1,4}/,a)},MMMM:function(a){a=this.find(this.res.MMMM,a);a.value++;return a},MMM:function(a){a=this.find(this.res.MMM,a);a.value++;return a},MM:function(a){return this.exec(/^\d\d/,a)},M:function(a){return this.exec(/^\d\d?/,a)},
|
||||
DD:function(a){return this.exec(/^\d\d/,a)},D:function(a){return this.exec(/^\d\d?/,a)},HH:function(a){return this.exec(/^\d\d/,a)},H:function(a){return this.exec(/^\d\d?/,a)},A:function(a){return this.find(this.res.A,a)},hh:function(a){return this.exec(/^\d\d/,a)},h:function(a){return this.exec(/^\d\d?/,a)},mm:function(a){return this.exec(/^\d\d/,a)},m:function(a){return this.exec(/^\d\d?/,a)},ss:function(a){return this.exec(/^\d\d/,a)},s:function(a){return this.exec(/^\d\d?/,a)},SSS:function(a){return this.exec(/^\d{1,3}/,
|
||||
a)},SS:function(a){a=this.exec(/^\d\d?/,a);a.value*=10;return a},S:function(a){a=this.exec(/^\d/,a);a.value*=100;return a},Z:function(a){a=this.exec(/^[\+-]\d{2}[0-5]\d/,a);a.value=-60*(a.value/100|0)-a.value%100;return a},h12:function(a,b){return(12===a?0:a)+12*b},exec:function(a,b){a=(a.exec(b)||[""])[0];return{value:a|0,length:a.length}},find:function(a,b){for(var c=-1,d=0,f=0,e=a.length,k;f<e;f++)k=a[f],!b.indexOf(k)&&k.length>d&&(c=f,d=k.length);return{value:c,length:d}},pre:function(a){return a},
|
||||
res:p};function t(a,b,c,d){var f={},e;for(e in a)f[e]=a[e];for(e in b||{})!!c^!!f[e]||(f[e]=b[e]);d&&(f.res=d);return f}
|
||||
var v={_formatter:q,_parser:r,compile:function(a){for(var b=/\[([^\[\]]|\[[^\[\]]*])*]|([A-Za-z])\2+|\.{3}|./g,c,d=[a];c=b.exec(a);)d[d.length]=c[0];return d},format:function(a,b,c){b="string"===typeof b?this.compile(b):b;var d=a.getTimezoneOffset();a=this.addMinutes(a,c?d:0);var f=this._formatter,e="";a.getTimezoneOffset=function(){return c?0:d};for(var k=1,u=b.length,h;k<u;k++)h=b[k],e+=f[h]?f.post(f[h](a,b[0])):h.replace(/\[(.*)]/,"$1");return e},preparse:function(a,b){b="string"===typeof b?this.compile(b):
|
||||
b;var c={Y:1970,M:1,D:1,H:0,A:0,h:0,m:0,s:0,S:0,Z:0,_index:0,_length:0,_match:0},d=/\[(.*)]/,f=this._parser,e=0;a=f.pre(a);for(var k=1,u=b.length,h,n;k<u;k++)if(h=b[k],f[h]){n=f[h](a.slice(e),b[0]);if(!n.length)break;e+=n.length;c[n.token||h.charAt(0)]=n.value;c._match++}else if(h===a.charAt(e)||" "===h)e++;else if(d.test(h)&&!a.slice(e).indexOf(d.exec(h)[1]))e+=h.length-2;else{"..."===h&&(e=a.length);break}c.H=c.H||f.h12(c.h,c.A);c._index=e;c._length=a.length;return c},parse:function(a,b,c){a=this.preparse(a,
|
||||
b);return this.isValid(a)?(a.M-=100>a.Y?22801:1,c||a.Z?new Date(Date.UTC(a.Y,a.M,a.D,a.H,a.m+a.Z,a.s,a.S)):new Date(a.Y,a.M,a.D,a.H,a.m,a.s,a.S)):new Date(NaN)},isValid:function(a,b){a="string"===typeof a?this.preparse(a,b):a;b=[31,28+this.isLeapYear(a.Y)|0,31,30,31,30,31,31,30,31,30,31][a.M-1];return!(1>a._index||1>a._length||a._index-a._length||1>a._match||1>a.Y||9999<a.Y||1>a.M||12<a.M||1>a.D||a.D>b||0>a.H||23<a.H||0>a.m||59<a.m||0>a.s||59<a.s||0>a.S||999<a.S||-720>a.Z||840<a.Z)},transform:function(a,
|
||||
b,c,d){return this.format(this.parse(a,b),c,d)},addYears:function(a,b){return this.addMonths(a,12*b)},addMonths:function(a,b){a=new Date(a.getTime());a.setMonth(a.getMonth()+b);return a},addDays:function(a,b){a=new Date(a.getTime());a.setDate(a.getDate()+b);return a},addHours:function(a,b){return this.addMinutes(a,60*b)},addMinutes:function(a,b){return this.addSeconds(a,60*b)},addSeconds:function(a,b){return this.addMilliseconds(a,1E3*b)},addMilliseconds:function(a,b){return new Date(a.getTime()+
|
||||
b)},subtract:function(a,b){var c=a.getTime()-b.getTime();return{toMilliseconds:function(){return c},toSeconds:function(){return c/1E3},toMinutes:function(){return c/6E4},toHours:function(){return c/36E5},toDays:function(){return c/864E5}}},isLeapYear:function(a){return!(a%4)&&!!(a%100)||!(a%400)},isSameDay:function(a,b){return a.toDateString()===b.toDateString()},locale:function(a,b){g[a]||(g[a]=b)},plugin:function(a,b){l[a]||(l[a]=b)}},w=t(v),x=t(v);
|
||||
x.locale=function(a){a="function"===typeof a?a:x.locale[a];if(!a)return m;m=a(v);var b=g[m]||{},c=t(p,b.res,!0);a=t(q,b.formatter,!0,c);b=t(r,b.parser,!0,c);x._formatter=w._formatter=a;x._parser=w._parser=b;for(var d in l)x.extend(l[d]);return m};x.extend=function(a){var b=t(x._parser.res,a.res),c=a.extender||{};x._formatter=t(x._formatter,a.formatter,!1,b);x._parser=t(x._parser,a.parser,!1,b);for(var d in c)x[d]||(x[d]=c[d])};
|
||||
x.plugin=function(a){(a="function"===typeof a?a:x.plugin[a])&&x.extend(l[a(v,w)]||{})};export default x
|
||||
+466
@@ -0,0 +1,466 @@
|
||||
/**
|
||||
* @preserve date-and-time (c) KNOWLEDGECODE | MIT
|
||||
*/
|
||||
|
||||
var locales = {},
|
||||
plugins = {},
|
||||
lang = 'en',
|
||||
_res = {
|
||||
MMMM: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
||||
MMM: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
||||
dddd: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
||||
ddd: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
||||
dd: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
|
||||
A: ['AM', 'PM']
|
||||
},
|
||||
_formatter = {
|
||||
YYYY: function (d/*, formatString*/) { return ('000' + d.getFullYear()).slice(-4); },
|
||||
YY: function (d/*, formatString*/) { return ('0' + d.getFullYear()).slice(-2); },
|
||||
Y: function (d/*, formatString*/) { return '' + d.getFullYear(); },
|
||||
MMMM: function (d/*, formatString*/) { return this.res.MMMM[d.getMonth()]; },
|
||||
MMM: function (d/*, formatString*/) { return this.res.MMM[d.getMonth()]; },
|
||||
MM: function (d/*, formatString*/) { return ('0' + (d.getMonth() + 1)).slice(-2); },
|
||||
M: function (d/*, formatString*/) { return '' + (d.getMonth() + 1); },
|
||||
DD: function (d/*, formatString*/) { return ('0' + d.getDate()).slice(-2); },
|
||||
D: function (d/*, formatString*/) { return '' + d.getDate(); },
|
||||
HH: function (d/*, formatString*/) { return ('0' + d.getHours()).slice(-2); },
|
||||
H: function (d/*, formatString*/) { return '' + d.getHours(); },
|
||||
A: function (d/*, formatString*/) { return this.res.A[d.getHours() > 11 | 0]; },
|
||||
hh: function (d/*, formatString*/) { return ('0' + (d.getHours() % 12 || 12)).slice(-2); },
|
||||
h: function (d/*, formatString*/) { return '' + (d.getHours() % 12 || 12); },
|
||||
mm: function (d/*, formatString*/) { return ('0' + d.getMinutes()).slice(-2); },
|
||||
m: function (d/*, formatString*/) { return '' + d.getMinutes(); },
|
||||
ss: function (d/*, formatString*/) { return ('0' + d.getSeconds()).slice(-2); },
|
||||
s: function (d/*, formatString*/) { return '' + d.getSeconds(); },
|
||||
SSS: function (d/*, formatString*/) { return ('00' + d.getMilliseconds()).slice(-3); },
|
||||
SS: function (d/*, formatString*/) { return ('0' + (d.getMilliseconds() / 10 | 0)).slice(-2); },
|
||||
S: function (d/*, formatString*/) { return '' + (d.getMilliseconds() / 100 | 0); },
|
||||
dddd: function (d/*, formatString*/) { return this.res.dddd[d.getDay()]; },
|
||||
ddd: function (d/*, formatString*/) { return this.res.ddd[d.getDay()]; },
|
||||
dd: function (d/*, formatString*/) { return this.res.dd[d.getDay()]; },
|
||||
Z: function (d/*, formatString*/) {
|
||||
var offset = d.getTimezoneOffset() / 0.6 | 0;
|
||||
return (offset > 0 ? '-' : '+') + ('000' + Math.abs(offset - (offset % 100 * 0.4 | 0))).slice(-4);
|
||||
},
|
||||
post: function (str) { return str; },
|
||||
res: _res
|
||||
},
|
||||
_parser = {
|
||||
YYYY: function (str/*, formatString */) { return this.exec(/^\d{4}/, str); },
|
||||
Y: function (str/*, formatString */) { return this.exec(/^\d{1,4}/, str); },
|
||||
MMMM: function (str/*, formatString */) {
|
||||
var result = this.find(this.res.MMMM, str);
|
||||
result.value++;
|
||||
return result;
|
||||
},
|
||||
MMM: function (str/*, formatString */) {
|
||||
var result = this.find(this.res.MMM, str);
|
||||
result.value++;
|
||||
return result;
|
||||
},
|
||||
MM: function (str/*, formatString */) { return this.exec(/^\d\d/, str); },
|
||||
M: function (str/*, formatString */) { return this.exec(/^\d\d?/, str); },
|
||||
DD: function (str/*, formatString */) { return this.exec(/^\d\d/, str); },
|
||||
D: function (str/*, formatString */) { return this.exec(/^\d\d?/, str); },
|
||||
HH: function (str/*, formatString */) { return this.exec(/^\d\d/, str); },
|
||||
H: function (str/*, formatString */) { return this.exec(/^\d\d?/, str); },
|
||||
A: function (str/*, formatString */) { return this.find(this.res.A, str); },
|
||||
hh: function (str/*, formatString */) { return this.exec(/^\d\d/, str); },
|
||||
h: function (str/*, formatString */) { return this.exec(/^\d\d?/, str); },
|
||||
mm: function (str/*, formatString */) { return this.exec(/^\d\d/, str); },
|
||||
m: function (str/*, formatString */) { return this.exec(/^\d\d?/, str); },
|
||||
ss: function (str/*, formatString */) { return this.exec(/^\d\d/, str); },
|
||||
s: function (str/*, formatString */) { return this.exec(/^\d\d?/, str); },
|
||||
SSS: function (str/*, formatString */) { return this.exec(/^\d{1,3}/, str); },
|
||||
SS: function (str/*, formatString */) {
|
||||
var result = this.exec(/^\d\d?/, str);
|
||||
result.value *= 10;
|
||||
return result;
|
||||
},
|
||||
S: function (str/*, formatString */) {
|
||||
var result = this.exec(/^\d/, str);
|
||||
result.value *= 100;
|
||||
return result;
|
||||
},
|
||||
Z: function (str/*, formatString */) {
|
||||
var result = this.exec(/^[\+-]\d{2}[0-5]\d/, str);
|
||||
result.value = (result.value / 100 | 0) * -60 - result.value % 100;
|
||||
return result;
|
||||
},
|
||||
h12: function (h, a) { return (h === 12 ? 0 : h) + a * 12; },
|
||||
exec: function (re, str) {
|
||||
var result = (re.exec(str) || [''])[0];
|
||||
return { value: result | 0, length: result.length };
|
||||
},
|
||||
find: function (array, str) {
|
||||
var index = -1, length = 0;
|
||||
|
||||
for (var i = 0, len = array.length, item; i < len; i++) {
|
||||
item = array[i];
|
||||
if (!str.indexOf(item) && item.length > length) {
|
||||
index = i;
|
||||
length = item.length;
|
||||
}
|
||||
}
|
||||
return { value: index, length: length };
|
||||
},
|
||||
pre: function (str) { return str; },
|
||||
res: _res
|
||||
},
|
||||
extend = function (base, props, override, res) {
|
||||
var obj = {}, key;
|
||||
|
||||
for (key in base) {
|
||||
obj[key] = base[key];
|
||||
}
|
||||
for (key in props || {}) {
|
||||
if (!(!!override ^ !!obj[key])) {
|
||||
obj[key] = props[key];
|
||||
}
|
||||
}
|
||||
if (res) {
|
||||
obj.res = res;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
|
||||
var proto = {
|
||||
_formatter: _formatter,
|
||||
_parser: _parser
|
||||
};
|
||||
|
||||
/**
|
||||
* Compiling a format string
|
||||
* @param {string} formatString - a format string
|
||||
* @returns {Array.<string>} a compiled object
|
||||
*/
|
||||
proto.compile = function (formatString) {
|
||||
var re = /\[([^\[\]]|\[[^\[\]]*])*]|([A-Za-z])\2+|\.{3}|./g, keys, pattern = [formatString];
|
||||
|
||||
while ((keys = re.exec(formatString))) {
|
||||
pattern[pattern.length] = keys[0];
|
||||
}
|
||||
return pattern;
|
||||
};
|
||||
|
||||
/**
|
||||
* Formatting a Date and Time
|
||||
* @param {Date} dateObj - a Date object
|
||||
* @param {string|Array.<string>} arg - a format string or its compiled object
|
||||
* @param {boolean} [utc] - output as UTC
|
||||
* @returns {string} a formatted string
|
||||
*/
|
||||
proto.format = function (dateObj, arg, utc) {
|
||||
var pattern = typeof arg === 'string' ? this.compile(arg) : arg,
|
||||
offset = dateObj.getTimezoneOffset(),
|
||||
d = this.addMinutes(dateObj, utc ? offset : 0),
|
||||
formatter = this._formatter, str = '';
|
||||
|
||||
d.getTimezoneOffset = function () { return utc ? 0 : offset; };
|
||||
for (var i = 1, len = pattern.length, token; i < len; i++) {
|
||||
token = pattern[i];
|
||||
str += formatter[token] ? formatter.post(formatter[token](d, pattern[0])) : token.replace(/\[(.*)]/, '$1');
|
||||
}
|
||||
return str;
|
||||
};
|
||||
|
||||
/**
|
||||
* Pre-parsing a Date and Time string
|
||||
* @param {string} dateString - a date string
|
||||
* @param {string|Array.<string>} arg - a format string or its compiled object
|
||||
* @returns {Object} a date structure
|
||||
*/
|
||||
proto.preparse = function (dateString, arg) {
|
||||
var pattern = typeof arg === 'string' ? this.compile(arg) : arg,
|
||||
dt = { Y: 1970, M: 1, D: 1, H: 0, A: 0, h: 0, m: 0, s: 0, S: 0, Z: 0, _index: 0, _length: 0, _match: 0 },
|
||||
comment = /\[(.*)]/, parser = this._parser, offset = 0;
|
||||
|
||||
dateString = parser.pre(dateString);
|
||||
for (var i = 1, len = pattern.length, token, result; i < len; i++) {
|
||||
token = pattern[i];
|
||||
if (parser[token]) {
|
||||
result = parser[token](dateString.slice(offset), pattern[0]);
|
||||
if (!result.length) {
|
||||
break;
|
||||
}
|
||||
offset += result.length;
|
||||
dt[result.token || token.charAt(0)] = result.value;
|
||||
dt._match++;
|
||||
} else if (token === dateString.charAt(offset) || token === ' ') {
|
||||
offset++;
|
||||
} else if (comment.test(token) && !dateString.slice(offset).indexOf(comment.exec(token)[1])) {
|
||||
offset += token.length - 2;
|
||||
} else if (token === '...') {
|
||||
offset = dateString.length;
|
||||
break;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
dt.H = dt.H || parser.h12(dt.h, dt.A);
|
||||
dt._index = offset;
|
||||
dt._length = dateString.length;
|
||||
return dt;
|
||||
};
|
||||
|
||||
/**
|
||||
* Parsing a Date and Time string
|
||||
* @param {string} dateString - a date string
|
||||
* @param {string|Array.<string>} arg - a format string or its compiled object
|
||||
* @param {boolean} [utc] - input as UTC
|
||||
* @returns {Date} a constructed date
|
||||
*/
|
||||
proto.parse = function (dateString, arg, utc) {
|
||||
var dt = this.preparse(dateString, arg);
|
||||
|
||||
if (this.isValid(dt)) {
|
||||
dt.M -= dt.Y < 100 ? 22801 : 1; // 22801 = 1900 * 12 + 1
|
||||
if (utc || dt.Z) {
|
||||
return new Date(Date.UTC(dt.Y, dt.M, dt.D, dt.H, dt.m + dt.Z, dt.s, dt.S));
|
||||
}
|
||||
return new Date(dt.Y, dt.M, dt.D, dt.H, dt.m, dt.s, dt.S);
|
||||
}
|
||||
return new Date(NaN);
|
||||
};
|
||||
|
||||
/**
|
||||
* Validation
|
||||
* @param {Object|string} arg1 - a date structure or a date string
|
||||
* @param {string|Array.<string>} [arg2] - a format string or its compiled object
|
||||
* @returns {boolean} whether the date string is a valid date
|
||||
*/
|
||||
proto.isValid = function (arg1, arg2) {
|
||||
var dt = typeof arg1 === 'string' ? this.preparse(arg1, arg2) : arg1,
|
||||
last = [31, 28 + this.isLeapYear(dt.Y) | 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][dt.M - 1];
|
||||
|
||||
return !(
|
||||
dt._index < 1 || dt._length < 1 || dt._index - dt._length || dt._match < 1 ||
|
||||
dt.Y < 1 || dt.Y > 9999 || dt.M < 1 || dt.M > 12 || dt.D < 1 || dt.D > last ||
|
||||
dt.H < 0 || dt.H > 23 || dt.m < 0 || dt.m > 59 || dt.s < 0 || dt.s > 59 || dt.S < 0 || dt.S > 999 ||
|
||||
dt.Z < -720 || dt.Z > 840
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Transforming a Date and Time string
|
||||
* @param {string} dateString - a date string
|
||||
* @param {string|Array.<string>} arg1 - a format string or its compiled object
|
||||
* @param {string|Array.<string>} arg2 - a transformed format string or its compiled object
|
||||
* @param {boolean} [utc] - output as UTC
|
||||
* @returns {string} a formatted string
|
||||
*/
|
||||
proto.transform = function (dateString, arg1, arg2, utc) {
|
||||
return this.format(this.parse(dateString, arg1), arg2, utc);
|
||||
};
|
||||
|
||||
/**
|
||||
* Adding years
|
||||
* @param {Date} dateObj - a date object
|
||||
* @param {number} years - number of years to add
|
||||
* @returns {Date} a date after adding the value
|
||||
*/
|
||||
proto.addYears = function (dateObj, years) {
|
||||
return this.addMonths(dateObj, years * 12);
|
||||
};
|
||||
|
||||
/**
|
||||
* Adding months
|
||||
* @param {Date} dateObj - a date object
|
||||
* @param {number} months - number of months to add
|
||||
* @returns {Date} a date after adding the value
|
||||
*/
|
||||
proto.addMonths = function (dateObj, months) {
|
||||
var d = new Date(dateObj.getTime());
|
||||
|
||||
d.setMonth(d.getMonth() + months);
|
||||
return d;
|
||||
};
|
||||
|
||||
/**
|
||||
* Adding days
|
||||
* @param {Date} dateObj - a date object
|
||||
* @param {number} days - number of days to add
|
||||
* @returns {Date} a date after adding the value
|
||||
*/
|
||||
proto.addDays = function (dateObj, days) {
|
||||
var d = new Date(dateObj.getTime());
|
||||
|
||||
d.setDate(d.getDate() + days);
|
||||
return d;
|
||||
};
|
||||
|
||||
/**
|
||||
* Adding hours
|
||||
* @param {Date} dateObj - a date object
|
||||
* @param {number} hours - number of hours to add
|
||||
* @returns {Date} a date after adding the value
|
||||
*/
|
||||
proto.addHours = function (dateObj, hours) {
|
||||
return this.addMinutes(dateObj, hours * 60);
|
||||
};
|
||||
|
||||
/**
|
||||
* Adding minutes
|
||||
* @param {Date} dateObj - a date object
|
||||
* @param {number} minutes - number of minutes to add
|
||||
* @returns {Date} a date after adding the value
|
||||
*/
|
||||
proto.addMinutes = function (dateObj, minutes) {
|
||||
return this.addSeconds(dateObj, minutes * 60);
|
||||
};
|
||||
|
||||
/**
|
||||
* Adding seconds
|
||||
* @param {Date} dateObj - a date object
|
||||
* @param {number} seconds - number of seconds to add
|
||||
* @returns {Date} a date after adding the value
|
||||
*/
|
||||
proto.addSeconds = function (dateObj, seconds) {
|
||||
return this.addMilliseconds(dateObj, seconds * 1000);
|
||||
};
|
||||
|
||||
/**
|
||||
* Adding milliseconds
|
||||
* @param {Date} dateObj - a date object
|
||||
* @param {number} milliseconds - number of milliseconds to add
|
||||
* @returns {Date} a date after adding the value
|
||||
*/
|
||||
proto.addMilliseconds = function (dateObj, milliseconds) {
|
||||
return new Date(dateObj.getTime() + milliseconds);
|
||||
};
|
||||
|
||||
/**
|
||||
* Subtracting two dates
|
||||
* @param {Date} date1 - a Date object
|
||||
* @param {Date} date2 - a Date object
|
||||
* @returns {Object} a result object subtracting date2 from date1
|
||||
*/
|
||||
proto.subtract = function (date1, date2) {
|
||||
var delta = date1.getTime() - date2.getTime();
|
||||
|
||||
return {
|
||||
toMilliseconds: function () {
|
||||
return delta;
|
||||
},
|
||||
toSeconds: function () {
|
||||
return delta / 1000;
|
||||
},
|
||||
toMinutes: function () {
|
||||
return delta / 60000;
|
||||
},
|
||||
toHours: function () {
|
||||
return delta / 3600000;
|
||||
},
|
||||
toDays: function () {
|
||||
return delta / 86400000;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Whether year is leap year
|
||||
* @param {number} y - year
|
||||
* @returns {boolean} whether year is leap year
|
||||
*/
|
||||
proto.isLeapYear = function (y) {
|
||||
return (!(y % 4) && !!(y % 100)) || !(y % 400);
|
||||
};
|
||||
|
||||
/**
|
||||
* Comparison of two dates
|
||||
* @param {Date} date1 - a Date object
|
||||
* @param {Date} date2 - a Date object
|
||||
* @returns {boolean} whether the two dates are the same day (time is ignored)
|
||||
*/
|
||||
proto.isSameDay = function (date1, date2) {
|
||||
return date1.toDateString() === date2.toDateString();
|
||||
};
|
||||
|
||||
/**
|
||||
* Defining new locale
|
||||
* @param {string} code - language code
|
||||
* @param {Function} locale - locale installer
|
||||
* @returns {string} current language code
|
||||
*/
|
||||
proto.locale = function (code, locale) {
|
||||
if (!locales[code]) {
|
||||
locales[code] = locale;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Defining new plugin
|
||||
* @param {string} name - plugin name
|
||||
* @param {Function} plugin - plugin installer
|
||||
* @returns {void}
|
||||
*/
|
||||
proto.plugin = function (name, plugin) {
|
||||
if (!plugins[name]) {
|
||||
plugins[name] = plugin;
|
||||
}
|
||||
};
|
||||
|
||||
var localized_proto = extend(proto);
|
||||
var date = extend(proto);
|
||||
|
||||
/**
|
||||
* Changing locale
|
||||
* @param {Function|string} [locale] - locale object | language code
|
||||
* @returns {string} current language code
|
||||
*/
|
||||
date.locale = function (locale) {
|
||||
var install = typeof locale === 'function' ? locale : date.locale[locale];
|
||||
|
||||
if (!install) {
|
||||
return lang;
|
||||
}
|
||||
lang = install(proto);
|
||||
|
||||
var extension = locales[lang] || {};
|
||||
var res = extend(_res, extension.res, true);
|
||||
var formatter = extend(_formatter, extension.formatter, true, res);
|
||||
var parser = extend(_parser, extension.parser, true, res);
|
||||
|
||||
date._formatter = localized_proto._formatter = formatter;
|
||||
date._parser = localized_proto._parser = parser;
|
||||
|
||||
for (var plugin in plugins) {
|
||||
date.extend(plugins[plugin]);
|
||||
}
|
||||
|
||||
return lang;
|
||||
};
|
||||
|
||||
/**
|
||||
* Feature extension
|
||||
* @param {Object} extension - extension object
|
||||
* @returns {void}
|
||||
*/
|
||||
date.extend = function (extension) {
|
||||
var res = extend(date._parser.res, extension.res);
|
||||
var extender = extension.extender || {};
|
||||
|
||||
date._formatter = extend(date._formatter, extension.formatter, false, res);
|
||||
date._parser = extend(date._parser, extension.parser, false, res);
|
||||
|
||||
for (var key in extender) {
|
||||
if (!date[key]) {
|
||||
date[key] = extender[key];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Importing plugin
|
||||
* @param {Function|string} plugin - plugin object | plugin name
|
||||
* @returns {void}
|
||||
*/
|
||||
date.plugin = function (plugin) {
|
||||
var install = typeof plugin === 'function' ? plugin : date.plugin[plugin];
|
||||
|
||||
if (install) {
|
||||
date.extend(plugins[install(proto, localized_proto)] || {});
|
||||
}
|
||||
};
|
||||
|
||||
export { date as default };
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Arabic (ar)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var ar = function (date) {
|
||||
var code = 'ar';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['كانون الثاني يناير', 'شباط فبراير', 'آذار مارس', 'نيسان أبريل', 'أيار مايو', 'حزيران يونيو', 'تموز يوليو', 'آب أغسطس', 'أيلول سبتمبر', 'تشرين الأول أكتوبر', 'تشرين الثاني نوفمبر', 'كانون الأول ديسمبر'],
|
||||
MMM: ['كانون الثاني يناير', 'شباط فبراير', 'آذار مارس', 'نيسان أبريل', 'أيار مايو', 'حزيران يونيو', 'تموز يوليو', 'آب أغسطس', 'أيلول سبتمبر', 'تشرين الأول أكتوبر', 'تشرين الثاني نوفمبر', 'كانون الأول ديسمبر'],
|
||||
dddd: ['الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
|
||||
ddd: ['أحد', 'إثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'],
|
||||
dd: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
|
||||
A: ['ص', 'م']
|
||||
},
|
||||
formatter: {
|
||||
post: function (str) {
|
||||
var num = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩'];
|
||||
return str.replace(/\d/g, function (i) {
|
||||
return num[i | 0];
|
||||
});
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
pre: function (str) {
|
||||
var map = { '٠': 0, '١': 1, '٢': 2, '٣': 3, '٤': 4, '٥': 5, '٦': 6, '٧': 7, '٨': 8, '٩': 9 };
|
||||
return str.replace(/[٠١٢٣٤٥٦٧٨٩]/g, function (i) {
|
||||
return '' + map[i];
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { ar as default };
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Arabic (ar)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var ar = function (date) {
|
||||
var code = 'ar';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['كانون الثاني يناير', 'شباط فبراير', 'آذار مارس', 'نيسان أبريل', 'أيار مايو', 'حزيران يونيو', 'تموز يوليو', 'آب أغسطس', 'أيلول سبتمبر', 'تشرين الأول أكتوبر', 'تشرين الثاني نوفمبر', 'كانون الأول ديسمبر'],
|
||||
MMM: ['كانون الثاني يناير', 'شباط فبراير', 'آذار مارس', 'نيسان أبريل', 'أيار مايو', 'حزيران يونيو', 'تموز يوليو', 'آب أغسطس', 'أيلول سبتمبر', 'تشرين الأول أكتوبر', 'تشرين الثاني نوفمبر', 'كانون الأول ديسمبر'],
|
||||
dddd: ['الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
|
||||
ddd: ['أحد', 'إثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'],
|
||||
dd: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
|
||||
A: ['ص', 'م']
|
||||
},
|
||||
formatter: {
|
||||
post: function (str) {
|
||||
var num = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩'];
|
||||
return str.replace(/\d/g, function (i) {
|
||||
return num[i | 0];
|
||||
});
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
pre: function (str) {
|
||||
var map = { '٠': 0, '١': 1, '٢': 2, '٣': 3, '٤': 4, '٥': 5, '٦': 6, '٧': 7, '٨': 8, '٩': 9 };
|
||||
return str.replace(/[٠١٢٣٤٥٦٧٨٩]/g, function (i) {
|
||||
return '' + map[i];
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { ar as default };
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Azerbaijani (az)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var az = function (date) {
|
||||
var code = 'az';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'],
|
||||
MMM: ['yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek'],
|
||||
dddd: ['Bazar', 'Bazar ertəsi', 'Çərşənbə axşamı', 'Çərşənbə', 'Cümə axşamı', 'Cümə', 'Şənbə'],
|
||||
ddd: ['Baz', 'BzE', 'ÇAx', 'Çər', 'CAx', 'Cüm', 'Şən'],
|
||||
dd: ['Bz', 'BE', 'ÇA', 'Çə', 'CA', 'Cü', 'Şə'],
|
||||
A: ['gecə', 'səhər', 'gündüz', 'axşam']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 4) {
|
||||
return this.res.A[0]; // gecə
|
||||
} else if (h < 12) {
|
||||
return this.res.A[1]; // səhər
|
||||
} else if (h < 17) {
|
||||
return this.res.A[2]; // gündüz
|
||||
}
|
||||
return this.res.A[3]; // axşam
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 2) {
|
||||
return h; // gecə, səhər
|
||||
}
|
||||
return h > 11 ? h : h + 12; // gündüz, axşam
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { az as default };
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Azerbaijani (az)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var az = function (date) {
|
||||
var code = 'az';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'],
|
||||
MMM: ['yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek'],
|
||||
dddd: ['Bazar', 'Bazar ertəsi', 'Çərşənbə axşamı', 'Çərşənbə', 'Cümə axşamı', 'Cümə', 'Şənbə'],
|
||||
ddd: ['Baz', 'BzE', 'ÇAx', 'Çər', 'CAx', 'Cüm', 'Şən'],
|
||||
dd: ['Bz', 'BE', 'ÇA', 'Çə', 'CA', 'Cü', 'Şə'],
|
||||
A: ['gecə', 'səhər', 'gündüz', 'axşam']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 4) {
|
||||
return this.res.A[0]; // gecə
|
||||
} else if (h < 12) {
|
||||
return this.res.A[1]; // səhər
|
||||
} else if (h < 17) {
|
||||
return this.res.A[2]; // gündüz
|
||||
}
|
||||
return this.res.A[3]; // axşam
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 2) {
|
||||
return h; // gecə, səhər
|
||||
}
|
||||
return h > 11 ? h : h + 12; // gündüz, axşam
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { az as default };
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Bengali (bn)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var bn = function (date) {
|
||||
var code = 'bn';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['জানুয়ারী', 'ফেবুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'অগাস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'],
|
||||
MMM: ['জানু', 'ফেব', 'মার্চ', 'এপর', 'মে', 'জুন', 'জুল', 'অগ', 'সেপ্ট', 'অক্টো', 'নভ', 'ডিসেম্'],
|
||||
dddd: ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পত্তিবার', 'শুক্রবার', 'শনিবার'],
|
||||
ddd: ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পত্তি', 'শুক্র', 'শনি'],
|
||||
dd: ['রব', 'সম', 'মঙ্গ', 'বু', 'ব্রিহ', 'শু', 'শনি'],
|
||||
A: ['রাত', 'সকাল', 'দুপুর', 'বিকাল']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 4) {
|
||||
return this.res.A[0]; // রাত
|
||||
} else if (h < 10) {
|
||||
return this.res.A[1]; // সকাল
|
||||
} else if (h < 17) {
|
||||
return this.res.A[2]; // দুপুর
|
||||
} else if (h < 20) {
|
||||
return this.res.A[3]; // বিকাল
|
||||
}
|
||||
return this.res.A[0]; // রাত
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 1) {
|
||||
return h < 4 || h > 11 ? h : h + 12; // রাত
|
||||
} else if (a < 2) {
|
||||
return h; // সকাল
|
||||
} else if (a < 3) {
|
||||
return h > 9 ? h : h + 12; // দুপুর
|
||||
}
|
||||
return h + 12; // বিকাল
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { bn as default };
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Bengali (bn)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var bn = function (date) {
|
||||
var code = 'bn';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['জানুয়ারী', 'ফেবুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'অগাস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'],
|
||||
MMM: ['জানু', 'ফেব', 'মার্চ', 'এপর', 'মে', 'জুন', 'জুল', 'অগ', 'সেপ্ট', 'অক্টো', 'নভ', 'ডিসেম্'],
|
||||
dddd: ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পত্তিবার', 'শুক্রবার', 'শনিবার'],
|
||||
ddd: ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পত্তি', 'শুক্র', 'শনি'],
|
||||
dd: ['রব', 'সম', 'মঙ্গ', 'বু', 'ব্রিহ', 'শু', 'শনি'],
|
||||
A: ['রাত', 'সকাল', 'দুপুর', 'বিকাল']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 4) {
|
||||
return this.res.A[0]; // রাত
|
||||
} else if (h < 10) {
|
||||
return this.res.A[1]; // সকাল
|
||||
} else if (h < 17) {
|
||||
return this.res.A[2]; // দুপুর
|
||||
} else if (h < 20) {
|
||||
return this.res.A[3]; // বিকাল
|
||||
}
|
||||
return this.res.A[0]; // রাত
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 1) {
|
||||
return h < 4 || h > 11 ? h : h + 12; // রাত
|
||||
} else if (a < 2) {
|
||||
return h; // সকাল
|
||||
} else if (a < 3) {
|
||||
return h > 9 ? h : h + 12; // দুপুর
|
||||
}
|
||||
return h + 12; // বিকাল
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { bn as default };
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Czech (cs)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var cs = function (date) {
|
||||
var code = 'cs';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'],
|
||||
MMM: ['led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro'],
|
||||
dddd: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'],
|
||||
ddd: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'],
|
||||
dd: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { cs as default };
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Czech (cs)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var cs = function (date) {
|
||||
var code = 'cs';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'],
|
||||
MMM: ['led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro'],
|
||||
dddd: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'],
|
||||
ddd: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'],
|
||||
dd: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { cs as default };
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve German (de)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var de = function (date) {
|
||||
var code = 'de';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
|
||||
MMM: ['Jan.', 'Febr.', 'Mrz.', 'Apr.', 'Mai', 'Jun.', 'Jul.', 'Aug.', 'Sept.', 'Okt.', 'Nov.', 'Dez.'],
|
||||
dddd: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
|
||||
ddd: ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'],
|
||||
dd: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
|
||||
A: ['Uhr nachmittags', 'Uhr morgens']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { de as default };
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve German (de)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var de = function (date) {
|
||||
var code = 'de';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
|
||||
MMM: ['Jan.', 'Febr.', 'Mrz.', 'Apr.', 'Mai', 'Jun.', 'Jul.', 'Aug.', 'Sept.', 'Okt.', 'Nov.', 'Dez.'],
|
||||
dddd: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
|
||||
ddd: ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'],
|
||||
dd: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
|
||||
A: ['Uhr nachmittags', 'Uhr morgens']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { de as default };
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Danish (DK)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var dk = function (date) {
|
||||
var code = 'dk';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'],
|
||||
MMM: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
|
||||
dddd: ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'],
|
||||
ddd: ['søn', 'man', 'tir', 'ons', 'tors', 'fre', 'lør'],
|
||||
dd: ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { dk as default };
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Danish (DK)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var dk = function (date) {
|
||||
var code = 'dk';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'],
|
||||
MMM: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
|
||||
dddd: ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'],
|
||||
ddd: ['søn', 'man', 'tir', 'ons', 'tors', 'fre', 'lør'],
|
||||
dd: ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { dk as default };
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Greek (el)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var el = function (date) {
|
||||
var code = 'el';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: [
|
||||
['Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος'],
|
||||
['Ιανουαρίου', 'Φεβρουαρίου', 'Μαρτίου', 'Απριλίου', 'Μαΐου', 'Ιουνίου', 'Ιουλίου', 'Αυγούστου', 'Σεπτεμβρίου', 'Οκτωβρίου', 'Νοεμβρίου', 'Δεκεμβρίου']
|
||||
],
|
||||
MMM: ['Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιουν', 'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ'],
|
||||
dddd: ['Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο'],
|
||||
ddd: ['Κυρ', 'Δευ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ'],
|
||||
dd: ['Κυ', 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σα'],
|
||||
A: ['πμ', 'μμ']
|
||||
},
|
||||
formatter: {
|
||||
MMMM: function (d, formatString) {
|
||||
return this.res.MMMM[/D.*MMMM/.test(formatString) | 0][d.getMonth()];
|
||||
},
|
||||
hh: function (d) {
|
||||
return ('0' + d.getHours() % 12).slice(-2);
|
||||
},
|
||||
h: function (d) {
|
||||
return d.getHours() % 12;
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
MMMM: function (str, formatString) {
|
||||
var result = this.find(this.res.MMMM[/D.*MMMM/.test(formatString) | 0], str);
|
||||
result.value++;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { el as default };
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Greek (el)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var el = function (date) {
|
||||
var code = 'el';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: [
|
||||
['Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος'],
|
||||
['Ιανουαρίου', 'Φεβρουαρίου', 'Μαρτίου', 'Απριλίου', 'Μαΐου', 'Ιουνίου', 'Ιουλίου', 'Αυγούστου', 'Σεπτεμβρίου', 'Οκτωβρίου', 'Νοεμβρίου', 'Δεκεμβρίου']
|
||||
],
|
||||
MMM: ['Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιουν', 'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ'],
|
||||
dddd: ['Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο'],
|
||||
ddd: ['Κυρ', 'Δευ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ'],
|
||||
dd: ['Κυ', 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σα'],
|
||||
A: ['πμ', 'μμ']
|
||||
},
|
||||
formatter: {
|
||||
MMMM: function (d, formatString) {
|
||||
return this.res.MMMM[/D.*MMMM/.test(formatString) | 0][d.getMonth()];
|
||||
},
|
||||
hh: function (d) {
|
||||
return ('0' + d.getHours() % 12).slice(-2);
|
||||
},
|
||||
h: function (d) {
|
||||
return d.getHours() % 12;
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
MMMM: function (str, formatString) {
|
||||
var result = this.find(this.res.MMMM[/D.*MMMM/.test(formatString) | 0], str);
|
||||
result.value++;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { el as default };
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Englis (en)
|
||||
* @preserve This is a dummy module.
|
||||
*/
|
||||
|
||||
var en = function (date) {
|
||||
var code = 'en';
|
||||
|
||||
return code;
|
||||
};
|
||||
|
||||
export { en as default };
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Englis (en)
|
||||
* @preserve This is a dummy module.
|
||||
*/
|
||||
|
||||
var en = function (date) {
|
||||
var code = 'en';
|
||||
|
||||
return code;
|
||||
};
|
||||
|
||||
export { en as default };
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Spanish (es)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var es = function (date) {
|
||||
var code = 'es';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'],
|
||||
MMM: ['ene.', 'feb.', 'mar.', 'abr.', 'may.', 'jun.', 'jul.', 'ago.', 'sep.', 'oct.', 'nov.', 'dic.'],
|
||||
dddd: ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'],
|
||||
ddd: ['dom.', 'lun.', 'mar.', 'mié.', 'jue.', 'vie.', 'sáb.'],
|
||||
dd: ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sá'],
|
||||
A: ['de la mañana', 'de la tarde', 'de la noche']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 12) {
|
||||
return this.res.A[0]; // de la mañana
|
||||
} else if (h < 19) {
|
||||
return this.res.A[1]; // de la tarde
|
||||
}
|
||||
return this.res.A[2]; // de la noche
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 1) {
|
||||
return h; // de la mañana
|
||||
}
|
||||
return h > 11 ? h : h + 12; // de la tarde, de la noche
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { es as default };
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Spanish (es)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var es = function (date) {
|
||||
var code = 'es';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'],
|
||||
MMM: ['ene.', 'feb.', 'mar.', 'abr.', 'may.', 'jun.', 'jul.', 'ago.', 'sep.', 'oct.', 'nov.', 'dic.'],
|
||||
dddd: ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'],
|
||||
ddd: ['dom.', 'lun.', 'mar.', 'mié.', 'jue.', 'vie.', 'sáb.'],
|
||||
dd: ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sá'],
|
||||
A: ['de la mañana', 'de la tarde', 'de la noche']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 12) {
|
||||
return this.res.A[0]; // de la mañana
|
||||
} else if (h < 19) {
|
||||
return this.res.A[1]; // de la tarde
|
||||
}
|
||||
return this.res.A[2]; // de la noche
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 1) {
|
||||
return h; // de la mañana
|
||||
}
|
||||
return h > 11 ? h : h + 12; // de la tarde, de la noche
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { es as default };
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Persian (fa)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var fa = function (date) {
|
||||
var code = 'fa';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'],
|
||||
MMM: ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'],
|
||||
dddd: ['یکشنبه', 'دوشنبه', 'سهشنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'],
|
||||
ddd: ['یکشنبه', 'دوشنبه', 'سهشنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'],
|
||||
dd: ['ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش'],
|
||||
A: ['قبل از ظهر', 'بعد از ظهر']
|
||||
},
|
||||
formatter: {
|
||||
post: function (str) {
|
||||
var num = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
|
||||
return str.replace(/\d/g, function (i) {
|
||||
return num[i | 0];
|
||||
});
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
pre: function (str) {
|
||||
var map = { '۰': 0, '۱': 1, '۲': 2, '۳': 3, '۴': 4, '۵': 5, '۶': 6, '۷': 7, '۸': 8, '۹': 9 };
|
||||
return str.replace(/[۰۱۲۳۴۵۶۷۸۹]/g, function (i) {
|
||||
return '' + map[i];
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { fa as default };
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Persian (fa)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var fa = function (date) {
|
||||
var code = 'fa';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'],
|
||||
MMM: ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'],
|
||||
dddd: ['یکشنبه', 'دوشنبه', 'سهشنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'],
|
||||
ddd: ['یکشنبه', 'دوشنبه', 'سهشنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'],
|
||||
dd: ['ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش'],
|
||||
A: ['قبل از ظهر', 'بعد از ظهر']
|
||||
},
|
||||
formatter: {
|
||||
post: function (str) {
|
||||
var num = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
|
||||
return str.replace(/\d/g, function (i) {
|
||||
return num[i | 0];
|
||||
});
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
pre: function (str) {
|
||||
var map = { '۰': 0, '۱': 1, '۲': 2, '۳': 3, '۴': 4, '۵': 5, '۶': 6, '۷': 7, '۸': 8, '۹': 9 };
|
||||
return str.replace(/[۰۱۲۳۴۵۶۷۸۹]/g, function (i) {
|
||||
return '' + map[i];
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { fa as default };
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve French (fr)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var fr = function (date) {
|
||||
var code = 'fr';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
|
||||
MMM: ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],
|
||||
dddd: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'],
|
||||
ddd: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
|
||||
dd: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'],
|
||||
A: ['matin', 'l\'après-midi']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { fr as default };
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve French (fr)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var fr = function (date) {
|
||||
var code = 'fr';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
|
||||
MMM: ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],
|
||||
dddd: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'],
|
||||
ddd: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
|
||||
dd: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'],
|
||||
A: ['matin', 'l\'après-midi']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { fr as default };
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Hindi (hi)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var hi = function (date) {
|
||||
var code = 'hi';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'],
|
||||
MMM: ['जन.', 'फ़र.', 'मार्च', 'अप्रै.', 'मई', 'जून', 'जुल.', 'अग.', 'सित.', 'अक्टू.', 'नव.', 'दिस.'],
|
||||
dddd: ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरूवार', 'शुक्रवार', 'शनिवार'],
|
||||
ddd: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरू', 'शुक्र', 'शनि'],
|
||||
dd: ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'],
|
||||
A: ['रात', 'सुबह', 'दोपहर', 'शाम']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 4) {
|
||||
return this.res.A[0]; // रात
|
||||
} else if (h < 10) {
|
||||
return this.res.A[1]; // सुबह
|
||||
} else if (h < 17) {
|
||||
return this.res.A[2]; // दोपहर
|
||||
} else if (h < 20) {
|
||||
return this.res.A[3]; // शाम
|
||||
}
|
||||
return this.res.A[0]; // रात
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 1) {
|
||||
return h < 4 || h > 11 ? h : h + 12; // रात
|
||||
} else if (a < 2) {
|
||||
return h; // सुबह
|
||||
} else if (a < 3) {
|
||||
return h > 9 ? h : h + 12; // दोपहर
|
||||
}
|
||||
return h + 12; // शाम
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { hi as default };
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Hindi (hi)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var hi = function (date) {
|
||||
var code = 'hi';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'],
|
||||
MMM: ['जन.', 'फ़र.', 'मार्च', 'अप्रै.', 'मई', 'जून', 'जुल.', 'अग.', 'सित.', 'अक्टू.', 'नव.', 'दिस.'],
|
||||
dddd: ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरूवार', 'शुक्रवार', 'शनिवार'],
|
||||
ddd: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरू', 'शुक्र', 'शनि'],
|
||||
dd: ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'],
|
||||
A: ['रात', 'सुबह', 'दोपहर', 'शाम']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 4) {
|
||||
return this.res.A[0]; // रात
|
||||
} else if (h < 10) {
|
||||
return this.res.A[1]; // सुबह
|
||||
} else if (h < 17) {
|
||||
return this.res.A[2]; // दोपहर
|
||||
} else if (h < 20) {
|
||||
return this.res.A[3]; // शाम
|
||||
}
|
||||
return this.res.A[0]; // रात
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 1) {
|
||||
return h < 4 || h > 11 ? h : h + 12; // रात
|
||||
} else if (a < 2) {
|
||||
return h; // सुबह
|
||||
} else if (a < 3) {
|
||||
return h > 9 ? h : h + 12; // दोपहर
|
||||
}
|
||||
return h + 12; // शाम
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { hi as default };
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Hungarian (hu)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var hu = function (date) {
|
||||
var code = 'hu';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december'],
|
||||
MMM: ['jan', 'feb', 'márc', 'ápr', 'máj', 'jún', 'júl', 'aug', 'szept', 'okt', 'nov', 'dec'],
|
||||
dddd: ['vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat'],
|
||||
ddd: ['vas', 'hét', 'kedd', 'sze', 'csüt', 'pén', 'szo'],
|
||||
dd: ['v', 'h', 'k', 'sze', 'cs', 'p', 'szo'],
|
||||
A: ['de', 'du']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { hu as default };
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Hungarian (hu)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var hu = function (date) {
|
||||
var code = 'hu';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december'],
|
||||
MMM: ['jan', 'feb', 'márc', 'ápr', 'máj', 'jún', 'júl', 'aug', 'szept', 'okt', 'nov', 'dec'],
|
||||
dddd: ['vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat'],
|
||||
ddd: ['vas', 'hét', 'kedd', 'sze', 'csüt', 'pén', 'szo'],
|
||||
dd: ['v', 'h', 'k', 'sze', 'cs', 'p', 'szo'],
|
||||
A: ['de', 'du']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { hu as default };
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Indonesian (id)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var id = function (date) {
|
||||
var code = 'id';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'],
|
||||
MMM: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nov', 'Des'],
|
||||
dddd: ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu'],
|
||||
ddd: ['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
|
||||
dd: ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sb'],
|
||||
A: ['pagi', 'siang', 'sore', 'malam']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 11) {
|
||||
return this.res.A[0]; // pagi
|
||||
} else if (h < 15) {
|
||||
return this.res.A[1]; // siang
|
||||
} else if (h < 19) {
|
||||
return this.res.A[2]; // sore
|
||||
}
|
||||
return this.res.A[3]; // malam
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 1) {
|
||||
return h; // pagi
|
||||
} else if (a < 2) {
|
||||
return h >= 11 ? h : h + 12; // siang
|
||||
}
|
||||
return h + 12; // sore, malam
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { id as default };
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Indonesian (id)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var id = function (date) {
|
||||
var code = 'id';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'],
|
||||
MMM: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nov', 'Des'],
|
||||
dddd: ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu'],
|
||||
ddd: ['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
|
||||
dd: ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sb'],
|
||||
A: ['pagi', 'siang', 'sore', 'malam']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 11) {
|
||||
return this.res.A[0]; // pagi
|
||||
} else if (h < 15) {
|
||||
return this.res.A[1]; // siang
|
||||
} else if (h < 19) {
|
||||
return this.res.A[2]; // sore
|
||||
}
|
||||
return this.res.A[3]; // malam
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 1) {
|
||||
return h; // pagi
|
||||
} else if (a < 2) {
|
||||
return h >= 11 ? h : h + 12; // siang
|
||||
}
|
||||
return h + 12; // sore, malam
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { id as default };
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Italian (it)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var it = function (date) {
|
||||
var code = 'it';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'],
|
||||
MMM: ['gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'],
|
||||
dddd: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'],
|
||||
ddd: ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab'],
|
||||
dd: ['Do', 'Lu', 'Ma', 'Me', 'Gi', 'Ve', 'Sa'],
|
||||
A: ['di mattina', 'di pomerrigio']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { it as default };
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Italian (it)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var it = function (date) {
|
||||
var code = 'it';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'],
|
||||
MMM: ['gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'],
|
||||
dddd: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'],
|
||||
ddd: ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab'],
|
||||
dd: ['Do', 'Lu', 'Ma', 'Me', 'Gi', 'Ve', 'Sa'],
|
||||
A: ['di mattina', 'di pomerrigio']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { it as default };
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Japanese (ja)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var ja = function (date) {
|
||||
var code = 'ja';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
||||
MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
||||
dddd: ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'],
|
||||
ddd: ['日', '月', '火', '水', '木', '金', '土'],
|
||||
dd: ['日', '月', '火', '水', '木', '金', '土'],
|
||||
A: ['午前', '午後']
|
||||
},
|
||||
formatter: {
|
||||
hh: function (d) {
|
||||
return ('0' + d.getHours() % 12).slice(-2);
|
||||
},
|
||||
h: function (d) {
|
||||
return d.getHours() % 12;
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { ja as default };
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Japanese (ja)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var ja = function (date) {
|
||||
var code = 'ja';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
||||
MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
||||
dddd: ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'],
|
||||
ddd: ['日', '月', '火', '水', '木', '金', '土'],
|
||||
dd: ['日', '月', '火', '水', '木', '金', '土'],
|
||||
A: ['午前', '午後']
|
||||
},
|
||||
formatter: {
|
||||
hh: function (d) {
|
||||
return ('0' + d.getHours() % 12).slice(-2);
|
||||
},
|
||||
h: function (d) {
|
||||
return d.getHours() % 12;
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { ja as default };
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Javanese (jv)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var jv = function (date) {
|
||||
var code = 'jv';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'Nopember', 'Desember'],
|
||||
MMM: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nop', 'Des'],
|
||||
dddd: ['Minggu', 'Senen', 'Seloso', 'Rebu', 'Kemis', 'Jemuwah', 'Septu'],
|
||||
ddd: ['Min', 'Sen', 'Sel', 'Reb', 'Kem', 'Jem', 'Sep'],
|
||||
dd: ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sp'],
|
||||
A: ['enjing', 'siyang', 'sonten', 'ndalu']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 11) {
|
||||
return this.res.A[0]; // enjing
|
||||
} else if (h < 15) {
|
||||
return this.res.A[1]; // siyang
|
||||
} else if (h < 19) {
|
||||
return this.res.A[2]; // sonten
|
||||
}
|
||||
return this.res.A[3]; // ndalu
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 1) {
|
||||
return h; // enjing
|
||||
} else if (a < 2) {
|
||||
return h >= 11 ? h : h + 12; // siyang
|
||||
}
|
||||
return h + 12; // sonten, ndalu
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { jv as default };
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Javanese (jv)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var jv = function (date) {
|
||||
var code = 'jv';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'Nopember', 'Desember'],
|
||||
MMM: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nop', 'Des'],
|
||||
dddd: ['Minggu', 'Senen', 'Seloso', 'Rebu', 'Kemis', 'Jemuwah', 'Septu'],
|
||||
ddd: ['Min', 'Sen', 'Sel', 'Reb', 'Kem', 'Jem', 'Sep'],
|
||||
dd: ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sp'],
|
||||
A: ['enjing', 'siyang', 'sonten', 'ndalu']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 11) {
|
||||
return this.res.A[0]; // enjing
|
||||
} else if (h < 15) {
|
||||
return this.res.A[1]; // siyang
|
||||
} else if (h < 19) {
|
||||
return this.res.A[2]; // sonten
|
||||
}
|
||||
return this.res.A[3]; // ndalu
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 1) {
|
||||
return h; // enjing
|
||||
} else if (a < 2) {
|
||||
return h >= 11 ? h : h + 12; // siyang
|
||||
}
|
||||
return h + 12; // sonten, ndalu
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { jv as default };
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Korean (ko)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var ko = function (date) {
|
||||
var code = 'ko';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
|
||||
MMM: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
|
||||
dddd: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'],
|
||||
ddd: ['일', '월', '화', '수', '목', '금', '토'],
|
||||
dd: ['일', '월', '화', '수', '목', '금', '토'],
|
||||
A: ['오전', '오후']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { ko as default };
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Korean (ko)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var ko = function (date) {
|
||||
var code = 'ko';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
|
||||
MMM: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
|
||||
dddd: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'],
|
||||
ddd: ['일', '월', '화', '수', '목', '금', '토'],
|
||||
dd: ['일', '월', '화', '수', '목', '금', '토'],
|
||||
A: ['오전', '오후']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { ko as default };
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Burmese (my)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var my = function (date) {
|
||||
var code = 'my';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['ဇန်နဝါရီ', 'ဖေဖော်ဝါရီ', 'မတ်', 'ဧပြီ', 'မေ', 'ဇွန်', 'ဇူလိုင်', 'သြဂုတ်', 'စက်တင်ဘာ', 'အောက်တိုဘာ', 'နိုဝင်ဘာ', 'ဒီဇင်ဘာ'],
|
||||
MMM: ['ဇန်', 'ဖေ', 'မတ်', 'ပြီ', 'မေ', 'ဇွန်', 'လိုင်', 'သြ', 'စက်', 'အောက်', 'နို', 'ဒီ'],
|
||||
dddd: ['တနင်္ဂနွေ', 'တနင်္လာ', 'အင်္ဂါ', 'ဗုဒ္ဓဟူး', 'ကြာသပတေး', 'သောကြာ', 'စနေ'],
|
||||
ddd: ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'],
|
||||
dd: ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ']
|
||||
},
|
||||
formatter: {
|
||||
post: function (str) {
|
||||
var num = ['၀', '၁', '၂', '၃', '၄', '၅', '၆', '၇', '၈', '၉'];
|
||||
return str.replace(/\d/g, function (i) {
|
||||
return num[i | 0];
|
||||
});
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
pre: function (str) {
|
||||
var map = { '၀': 0, '၁': 1, '၂': 2, '၃': 3, '၄': 4, '၅': 5, '၆': 6, '၇': 7, '၈': 8, '၉': 9 };
|
||||
return str.replace(/[၀၁၂၃၄၅၆၇၈၉]/g, function (i) {
|
||||
return '' + map[i];
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { my as default };
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Burmese (my)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var my = function (date) {
|
||||
var code = 'my';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['ဇန်နဝါရီ', 'ဖေဖော်ဝါရီ', 'မတ်', 'ဧပြီ', 'မေ', 'ဇွန်', 'ဇူလိုင်', 'သြဂုတ်', 'စက်တင်ဘာ', 'အောက်တိုဘာ', 'နိုဝင်ဘာ', 'ဒီဇင်ဘာ'],
|
||||
MMM: ['ဇန်', 'ဖေ', 'မတ်', 'ပြီ', 'မေ', 'ဇွန်', 'လိုင်', 'သြ', 'စက်', 'အောက်', 'နို', 'ဒီ'],
|
||||
dddd: ['တနင်္ဂနွေ', 'တနင်္လာ', 'အင်္ဂါ', 'ဗုဒ္ဓဟူး', 'ကြာသပတေး', 'သောကြာ', 'စနေ'],
|
||||
ddd: ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'],
|
||||
dd: ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ']
|
||||
},
|
||||
formatter: {
|
||||
post: function (str) {
|
||||
var num = ['၀', '၁', '၂', '၃', '၄', '၅', '၆', '၇', '၈', '၉'];
|
||||
return str.replace(/\d/g, function (i) {
|
||||
return num[i | 0];
|
||||
});
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
pre: function (str) {
|
||||
var map = { '၀': 0, '၁': 1, '၂': 2, '၃': 3, '၄': 4, '၅': 5, '၆': 6, '၇': 7, '၈': 8, '၉': 9 };
|
||||
return str.replace(/[၀၁၂၃၄၅၆၇၈၉]/g, function (i) {
|
||||
return '' + map[i];
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { my as default };
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Dutch (nl)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var nl = function (date) {
|
||||
var code = 'nl';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
|
||||
MMM: [
|
||||
['jan.', 'feb.', 'mrt.', 'apr.', 'mei', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'],
|
||||
['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec']
|
||||
],
|
||||
dddd: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
|
||||
ddd: ['zo.', 'ma.', 'di.', 'wo.', 'do.', 'vr.', 'za.'],
|
||||
dd: ['Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za']
|
||||
},
|
||||
formatter: {
|
||||
MMM: function (d, formatString) {
|
||||
return this.res.MMM[/-MMM-/.test(formatString) | 0][d.getMonth()];
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
MMM: function (str, formatString) {
|
||||
var result = this.find(this.res.MMM[/-MMM-/.test(formatString) | 0], str);
|
||||
result.value++;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { nl as default };
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Dutch (nl)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var nl = function (date) {
|
||||
var code = 'nl';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
|
||||
MMM: [
|
||||
['jan.', 'feb.', 'mrt.', 'apr.', 'mei', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'],
|
||||
['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec']
|
||||
],
|
||||
dddd: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
|
||||
ddd: ['zo.', 'ma.', 'di.', 'wo.', 'do.', 'vr.', 'za.'],
|
||||
dd: ['Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za']
|
||||
},
|
||||
formatter: {
|
||||
MMM: function (d, formatString) {
|
||||
return this.res.MMM[/-MMM-/.test(formatString) | 0][d.getMonth()];
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
MMM: function (str, formatString) {
|
||||
var result = this.find(this.res.MMM[/-MMM-/.test(formatString) | 0], str);
|
||||
result.value++;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { nl as default };
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Punjabi (pa-in)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var pa_in = function (date) {
|
||||
var code = 'pa-in';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'],
|
||||
MMM: ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'],
|
||||
dddd: ['ਐਤਵਾਰ', 'ਸੋਮਵਾਰ', 'ਮੰਗਲਵਾਰ', 'ਬੁਧਵਾਰ', 'ਵੀਰਵਾਰ', 'ਸ਼ੁੱਕਰਵਾਰ', 'ਸ਼ਨੀਚਰਵਾਰ'],
|
||||
ddd: ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁਧ', 'ਵੀਰ', 'ਸ਼ੁਕਰ', 'ਸ਼ਨੀ'],
|
||||
dd: ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁਧ', 'ਵੀਰ', 'ਸ਼ੁਕਰ', 'ਸ਼ਨੀ'],
|
||||
A: ['ਰਾਤ', 'ਸਵੇਰ', 'ਦੁਪਹਿਰ', 'ਸ਼ਾਮ']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 4) {
|
||||
return this.res.A[0]; // ਰਾਤ
|
||||
} else if (h < 10) {
|
||||
return this.res.A[1]; // ਸਵੇਰ
|
||||
} else if (h < 17) {
|
||||
return this.res.A[2]; // ਦੁਪਹਿਰ
|
||||
} else if (h < 20) {
|
||||
return this.res.A[3]; // ਸ਼ਾਮ
|
||||
}
|
||||
return this.res.A[0]; // ਰਾਤ
|
||||
},
|
||||
post: function (str) {
|
||||
var num = ['੦', '੧', '੨', '੩', '੪', '੫', '੬', '੭', '੮', '੯'];
|
||||
return str.replace(/\d/g, function (i) {
|
||||
return num[i | 0];
|
||||
});
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 1) {
|
||||
return h < 4 || h > 11 ? h : h + 12; // ਰਾਤ
|
||||
} else if (a < 2) {
|
||||
return h; // ਸਵੇਰ
|
||||
} else if (a < 3) {
|
||||
return h >= 10 ? h : h + 12; // ਦੁਪਹਿਰ
|
||||
}
|
||||
return h + 12; // ਸ਼ਾਮ
|
||||
},
|
||||
pre: function (str) {
|
||||
var map = { '੦': 0, '੧': 1, '੨': 2, '੩': 3, '੪': 4, '੫': 5, '੬': 6, '੭': 7, '੮': 8, '੯': 9 };
|
||||
return str.replace(/[੦੧੨੩੪੫੬੭੮੯]/g, function (i) {
|
||||
return '' + map[i];
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { pa_in as default };
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Punjabi (pa-in)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var pa_in = function (date) {
|
||||
var code = 'pa-in';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'],
|
||||
MMM: ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'],
|
||||
dddd: ['ਐਤਵਾਰ', 'ਸੋਮਵਾਰ', 'ਮੰਗਲਵਾਰ', 'ਬੁਧਵਾਰ', 'ਵੀਰਵਾਰ', 'ਸ਼ੁੱਕਰਵਾਰ', 'ਸ਼ਨੀਚਰਵਾਰ'],
|
||||
ddd: ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁਧ', 'ਵੀਰ', 'ਸ਼ੁਕਰ', 'ਸ਼ਨੀ'],
|
||||
dd: ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁਧ', 'ਵੀਰ', 'ਸ਼ੁਕਰ', 'ਸ਼ਨੀ'],
|
||||
A: ['ਰਾਤ', 'ਸਵੇਰ', 'ਦੁਪਹਿਰ', 'ਸ਼ਾਮ']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 4) {
|
||||
return this.res.A[0]; // ਰਾਤ
|
||||
} else if (h < 10) {
|
||||
return this.res.A[1]; // ਸਵੇਰ
|
||||
} else if (h < 17) {
|
||||
return this.res.A[2]; // ਦੁਪਹਿਰ
|
||||
} else if (h < 20) {
|
||||
return this.res.A[3]; // ਸ਼ਾਮ
|
||||
}
|
||||
return this.res.A[0]; // ਰਾਤ
|
||||
},
|
||||
post: function (str) {
|
||||
var num = ['੦', '੧', '੨', '੩', '੪', '੫', '੬', '੭', '੮', '੯'];
|
||||
return str.replace(/\d/g, function (i) {
|
||||
return num[i | 0];
|
||||
});
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 1) {
|
||||
return h < 4 || h > 11 ? h : h + 12; // ਰਾਤ
|
||||
} else if (a < 2) {
|
||||
return h; // ਸਵੇਰ
|
||||
} else if (a < 3) {
|
||||
return h >= 10 ? h : h + 12; // ਦੁਪਹਿਰ
|
||||
}
|
||||
return h + 12; // ਸ਼ਾਮ
|
||||
},
|
||||
pre: function (str) {
|
||||
var map = { '੦': 0, '੧': 1, '੨': 2, '੩': 3, '੪': 4, '੫': 5, '੬': 6, '੭': 7, '੮': 8, '੯': 9 };
|
||||
return str.replace(/[੦੧੨੩੪੫੬੭੮੯]/g, function (i) {
|
||||
return '' + map[i];
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { pa_in as default };
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Polish (pl)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var pl = function (date) {
|
||||
var code = 'pl';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: [
|
||||
['styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień'],
|
||||
['stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 'sierpnia', 'września', 'października', 'listopada', 'grudnia']
|
||||
],
|
||||
MMM: ['sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru'],
|
||||
dddd: ['niedziela', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota'],
|
||||
ddd: ['nie', 'pon', 'wt', 'śr', 'czw', 'pt', 'sb'],
|
||||
dd: ['Nd', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'So']
|
||||
},
|
||||
formatter: {
|
||||
MMMM: function (d, formatString) {
|
||||
return this.res.MMMM[/D MMMM/.test(formatString) | 0][d.getMonth()];
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
MMMM: function (str, formatString) {
|
||||
var result = this.find(this.res.MMMM[/D MMMM/.test(formatString) | 0], str);
|
||||
result.value++;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { pl as default };
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Polish (pl)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var pl = function (date) {
|
||||
var code = 'pl';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: [
|
||||
['styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień'],
|
||||
['stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 'sierpnia', 'września', 'października', 'listopada', 'grudnia']
|
||||
],
|
||||
MMM: ['sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru'],
|
||||
dddd: ['niedziela', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota'],
|
||||
ddd: ['nie', 'pon', 'wt', 'śr', 'czw', 'pt', 'sb'],
|
||||
dd: ['Nd', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'So']
|
||||
},
|
||||
formatter: {
|
||||
MMMM: function (d, formatString) {
|
||||
return this.res.MMMM[/D MMMM/.test(formatString) | 0][d.getMonth()];
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
MMMM: function (str, formatString) {
|
||||
var result = this.find(this.res.MMMM[/D MMMM/.test(formatString) | 0], str);
|
||||
result.value++;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { pl as default };
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Portuguese (pt)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var pt = function (date) {
|
||||
var code = 'pt';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
|
||||
MMM: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
|
||||
dddd: ['Domingo', 'Segunda-Feira', 'Terça-Feira', 'Quarta-Feira', 'Quinta-Feira', 'Sexta-Feira', 'Sábado'],
|
||||
ddd: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'],
|
||||
dd: ['Dom', '2ª', '3ª', '4ª', '5ª', '6ª', 'Sáb'],
|
||||
A: ['da madrugada', 'da manhã', 'da tarde', 'da noite']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 5) {
|
||||
return this.res.A[0]; // da madrugada
|
||||
} else if (h < 12) {
|
||||
return this.res.A[1]; // da manhã
|
||||
} else if (h < 19) {
|
||||
return this.res.A[2]; // da tarde
|
||||
}
|
||||
return this.res.A[3]; // da noite
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 2) {
|
||||
return h; // da madrugada, da manhã
|
||||
}
|
||||
return h > 11 ? h : h + 12; // da tarde, da noite
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { pt as default };
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Portuguese (pt)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var pt = function (date) {
|
||||
var code = 'pt';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
|
||||
MMM: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
|
||||
dddd: ['Domingo', 'Segunda-Feira', 'Terça-Feira', 'Quarta-Feira', 'Quinta-Feira', 'Sexta-Feira', 'Sábado'],
|
||||
ddd: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'],
|
||||
dd: ['Dom', '2ª', '3ª', '4ª', '5ª', '6ª', 'Sáb'],
|
||||
A: ['da madrugada', 'da manhã', 'da tarde', 'da noite']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 5) {
|
||||
return this.res.A[0]; // da madrugada
|
||||
} else if (h < 12) {
|
||||
return this.res.A[1]; // da manhã
|
||||
} else if (h < 19) {
|
||||
return this.res.A[2]; // da tarde
|
||||
}
|
||||
return this.res.A[3]; // da noite
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 2) {
|
||||
return h; // da madrugada, da manhã
|
||||
}
|
||||
return h > 11 ? h : h + 12; // da tarde, da noite
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { pt as default };
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Romanian (ro)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var ro = function (date) {
|
||||
var code = 'ro';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie'],
|
||||
MMM: ['ian.', 'febr.', 'mart.', 'apr.', 'mai', 'iun.', 'iul.', 'aug.', 'sept.', 'oct.', 'nov.', 'dec.'],
|
||||
dddd: ['duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă'],
|
||||
ddd: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'],
|
||||
dd: ['Du', 'Lu', 'Ma', 'Mi', 'Jo', 'Vi', 'Sâ']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { ro as default };
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Romanian (ro)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var ro = function (date) {
|
||||
var code = 'ro';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie'],
|
||||
MMM: ['ian.', 'febr.', 'mart.', 'apr.', 'mai', 'iun.', 'iul.', 'aug.', 'sept.', 'oct.', 'nov.', 'dec.'],
|
||||
dddd: ['duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă'],
|
||||
ddd: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'],
|
||||
dd: ['Du', 'Lu', 'Ma', 'Mi', 'Jo', 'Vi', 'Sâ']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { ro as default };
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Russian (ru)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var ru = function (date) {
|
||||
var code = 'ru';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['Января', 'Февраля', 'Марта', 'Апреля', 'Мая', 'Июня', 'Июля', 'Августа', 'Сентября', 'Октября', 'Ноября', 'Декабря'],
|
||||
MMM: ['янв', 'фев', 'мар', 'апр', 'мая', 'июня', 'июля', 'авг', 'сен', 'окт', 'ноя', 'дек'],
|
||||
dddd: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'],
|
||||
ddd: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
|
||||
dd: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
|
||||
A: ['ночи', 'утра', 'дня', 'вечера']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 4) {
|
||||
return this.res.A[0]; // ночи
|
||||
} else if (h < 12) {
|
||||
return this.res.A[1]; // утра
|
||||
} else if (h < 17) {
|
||||
return this.res.A[2]; // дня
|
||||
}
|
||||
return this.res.A[3]; // вечера
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 2) {
|
||||
return h; // ночи, утра
|
||||
}
|
||||
return h > 11 ? h : h + 12; // дня, вечера
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { ru as default };
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Russian (ru)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var ru = function (date) {
|
||||
var code = 'ru';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['Января', 'Февраля', 'Марта', 'Апреля', 'Мая', 'Июня', 'Июля', 'Августа', 'Сентября', 'Октября', 'Ноября', 'Декабря'],
|
||||
MMM: ['янв', 'фев', 'мар', 'апр', 'мая', 'июня', 'июля', 'авг', 'сен', 'окт', 'ноя', 'дек'],
|
||||
dddd: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'],
|
||||
ddd: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
|
||||
dd: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
|
||||
A: ['ночи', 'утра', 'дня', 'вечера']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 4) {
|
||||
return this.res.A[0]; // ночи
|
||||
} else if (h < 12) {
|
||||
return this.res.A[1]; // утра
|
||||
} else if (h < 17) {
|
||||
return this.res.A[2]; // дня
|
||||
}
|
||||
return this.res.A[3]; // вечера
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 2) {
|
||||
return h; // ночи, утра
|
||||
}
|
||||
return h > 11 ? h : h + 12; // дня, вечера
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { ru as default };
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Kinyarwanda (rw)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var rw = function (date) {
|
||||
var code = 'rw';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['Mutarama', 'Gashyantare', 'Werurwe', 'Mata', 'Gicurasi', 'Kamena', 'Nyakanga', 'Kanama', 'Nzeri', 'Ukwakira', 'Ugushyingo', 'Ukuboza'],
|
||||
MMM: ['Mtr', 'Gas', 'Wer', 'Mta', 'Gic', 'Kmn', 'Nyk', 'Knm', 'Nze', 'Ukw', 'Ugu', 'Uku'],
|
||||
dddd: ['Ku cyumweru', 'Ku wambere', 'Ku wakabiri', 'Ku wagatatu', 'Ku wakane', 'Ku wagatanu', 'Ku wagatandatu'],
|
||||
ddd: ['Cyu', 'Mbe', 'Kbr', 'Gtt', 'Kne', 'Gtn', 'Gtd'],
|
||||
dd: ['Cy', 'Mb', 'Kb', 'Gt', 'Kn', 'Gn', 'Gd']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { rw as default };
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Kinyarwanda (rw)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var rw = function (date) {
|
||||
var code = 'rw';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['Mutarama', 'Gashyantare', 'Werurwe', 'Mata', 'Gicurasi', 'Kamena', 'Nyakanga', 'Kanama', 'Nzeri', 'Ukwakira', 'Ugushyingo', 'Ukuboza'],
|
||||
MMM: ['Mtr', 'Gas', 'Wer', 'Mta', 'Gic', 'Kmn', 'Nyk', 'Knm', 'Nze', 'Ukw', 'Ugu', 'Uku'],
|
||||
dddd: ['Ku cyumweru', 'Ku wambere', 'Ku wakabiri', 'Ku wagatatu', 'Ku wakane', 'Ku wagatanu', 'Ku wagatandatu'],
|
||||
ddd: ['Cyu', 'Mbe', 'Kbr', 'Gtt', 'Kne', 'Gtn', 'Gtd'],
|
||||
dd: ['Cy', 'Mb', 'Kb', 'Gt', 'Kn', 'Gn', 'Gd']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { rw as default };
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Serbian (sr)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var sr = function (date) {
|
||||
var code = 'sr';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'],
|
||||
MMM: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'],
|
||||
dddd: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'],
|
||||
ddd: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'],
|
||||
dd: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { sr as default };
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Serbian (sr)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var sr = function (date) {
|
||||
var code = 'sr';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'],
|
||||
MMM: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'],
|
||||
dddd: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'],
|
||||
ddd: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'],
|
||||
dd: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { sr as default };
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Thai (th)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var th = function (date) {
|
||||
var code = 'th';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'],
|
||||
MMM: ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'],
|
||||
dddd: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'],
|
||||
ddd: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัส', 'ศุกร์', 'เสาร์'],
|
||||
dd: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'],
|
||||
A: ['ก่อนเที่ยง', 'หลังเที่ยง']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { th as default };
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Thai (th)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var th = function (date) {
|
||||
var code = 'th';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'],
|
||||
MMM: ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'],
|
||||
dddd: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'],
|
||||
ddd: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัส', 'ศุกร์', 'เสาร์'],
|
||||
dd: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'],
|
||||
A: ['ก่อนเที่ยง', 'หลังเที่ยง']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { th as default };
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Turkish (tr)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var tr = function (date) {
|
||||
var code = 'tr';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'],
|
||||
MMM: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'],
|
||||
dddd: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'],
|
||||
ddd: ['Paz', 'Pts', 'Sal', 'Çar', 'Per', 'Cum', 'Cts'],
|
||||
dd: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { tr as default };
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Turkish (tr)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var tr = function (date) {
|
||||
var code = 'tr';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'],
|
||||
MMM: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'],
|
||||
dddd: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'],
|
||||
ddd: ['Paz', 'Pts', 'Sal', 'Çar', 'Per', 'Cum', 'Cts'],
|
||||
dd: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { tr as default };
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Ukrainian (uk)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var uk = function (date) {
|
||||
var code = 'uk';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['січня', 'лютого', 'березня', 'квітня', 'травня', 'червня', 'липня', 'серпня', 'вересня', 'жовтня', 'листопада', 'грудня'],
|
||||
MMM: ['січ', 'лют', 'бер', 'квіт', 'трав', 'черв', 'лип', 'серп', 'вер', 'жовт', 'лист', 'груд'],
|
||||
dddd: [
|
||||
['неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'п’ятниця', 'субота'],
|
||||
['неділю', 'понеділок', 'вівторок', 'середу', 'четвер', 'п’ятницю', 'суботу'],
|
||||
['неділі', 'понеділка', 'вівторка', 'середи', 'четверга', 'п’ятниці', 'суботи']
|
||||
],
|
||||
ddd: ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
|
||||
dd: ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
|
||||
A: ['ночі', 'ранку', 'дня', 'вечора']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 4) {
|
||||
return this.res.A[0]; // ночі
|
||||
} else if (h < 12) {
|
||||
return this.res.A[1]; // ранку
|
||||
} else if (h < 17) {
|
||||
return this.res.A[2]; // дня
|
||||
}
|
||||
return this.res.A[3]; // вечора
|
||||
},
|
||||
dddd: function (d, formatString) {
|
||||
var type = 0;
|
||||
if (/(\[[ВвУу]\]) ?dddd/.test(formatString)) {
|
||||
type = 1;
|
||||
} else if (/\[?(?:минулої|наступної)? ?\] ?dddd/.test(formatString)) {
|
||||
type = 2;
|
||||
}
|
||||
return this.res.dddd[type][d.getDay()];
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 2) {
|
||||
return h; // ночі, ранку
|
||||
}
|
||||
return h > 11 ? h : h + 12; // дня, вечора
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { uk as default };
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Ukrainian (uk)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var uk = function (date) {
|
||||
var code = 'uk';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['січня', 'лютого', 'березня', 'квітня', 'травня', 'червня', 'липня', 'серпня', 'вересня', 'жовтня', 'листопада', 'грудня'],
|
||||
MMM: ['січ', 'лют', 'бер', 'квіт', 'трав', 'черв', 'лип', 'серп', 'вер', 'жовт', 'лист', 'груд'],
|
||||
dddd: [
|
||||
['неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'п’ятниця', 'субота'],
|
||||
['неділю', 'понеділок', 'вівторок', 'середу', 'четвер', 'п’ятницю', 'суботу'],
|
||||
['неділі', 'понеділка', 'вівторка', 'середи', 'четверга', 'п’ятниці', 'суботи']
|
||||
],
|
||||
ddd: ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
|
||||
dd: ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
|
||||
A: ['ночі', 'ранку', 'дня', 'вечора']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var h = d.getHours();
|
||||
if (h < 4) {
|
||||
return this.res.A[0]; // ночі
|
||||
} else if (h < 12) {
|
||||
return this.res.A[1]; // ранку
|
||||
} else if (h < 17) {
|
||||
return this.res.A[2]; // дня
|
||||
}
|
||||
return this.res.A[3]; // вечора
|
||||
},
|
||||
dddd: function (d, formatString) {
|
||||
var type = 0;
|
||||
if (/(\[[ВвУу]\]) ?dddd/.test(formatString)) {
|
||||
type = 1;
|
||||
} else if (/\[?(?:минулої|наступної)? ?\] ?dddd/.test(formatString)) {
|
||||
type = 2;
|
||||
}
|
||||
return this.res.dddd[type][d.getDay()];
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 2) {
|
||||
return h; // ночі, ранку
|
||||
}
|
||||
return h > 11 ? h : h + 12; // дня, вечора
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { uk as default };
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Uzbek (uz)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var uz = function (date) {
|
||||
var code = 'uz';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['январ', 'феврал', 'март', 'апрел', 'май', 'июн', 'июл', 'август', 'сентябр', 'октябр', 'ноябр', 'декабр'],
|
||||
MMM: ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'],
|
||||
dddd: ['Якшанба', 'Душанба', 'Сешанба', 'Чоршанба', 'Пайшанба', 'Жума', 'Шанба'],
|
||||
ddd: ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'],
|
||||
dd: ['Як', 'Ду', 'Се', 'Чо', 'Па', 'Жу', 'Ша']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { uz as default };
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Uzbek (uz)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var uz = function (date) {
|
||||
var code = 'uz';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['январ', 'феврал', 'март', 'апрел', 'май', 'июн', 'июл', 'август', 'сентябр', 'октябр', 'ноябр', 'декабр'],
|
||||
MMM: ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'],
|
||||
dddd: ['Якшанба', 'Душанба', 'Сешанба', 'Чоршанба', 'Пайшанба', 'Жума', 'Шанба'],
|
||||
ddd: ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'],
|
||||
dd: ['Як', 'Ду', 'Се', 'Чо', 'Па', 'Жу', 'Ша']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { uz as default };
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Vietnamese (vi)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var vi = function (date) {
|
||||
var code = 'vi';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['tháng 1', 'tháng 2', 'tháng 3', 'tháng 4', 'tháng 5', 'tháng 6', 'tháng 7', 'tháng 8', 'tháng 9', 'tháng 10', 'tháng 11', 'tháng 12'],
|
||||
MMM: ['Th01', 'Th02', 'Th03', 'Th04', 'Th05', 'Th06', 'Th07', 'Th08', 'Th09', 'Th10', 'Th11', 'Th12'],
|
||||
dddd: ['chủ nhật', 'thứ hai', 'thứ ba', 'thứ tư', 'thứ năm', 'thứ sáu', 'thứ bảy'],
|
||||
ddd: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
|
||||
dd: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
|
||||
A: ['sa', 'ch']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { vi as default };
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Vietnamese (vi)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var vi = function (date) {
|
||||
var code = 'vi';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['tháng 1', 'tháng 2', 'tháng 3', 'tháng 4', 'tháng 5', 'tháng 6', 'tháng 7', 'tháng 8', 'tháng 9', 'tháng 10', 'tháng 11', 'tháng 12'],
|
||||
MMM: ['Th01', 'Th02', 'Th03', 'Th04', 'Th05', 'Th06', 'Th07', 'Th08', 'Th09', 'Th10', 'Th11', 'Th12'],
|
||||
dddd: ['chủ nhật', 'thứ hai', 'thứ ba', 'thứ tư', 'thứ năm', 'thứ sáu', 'thứ bảy'],
|
||||
ddd: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
|
||||
dd: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
|
||||
A: ['sa', 'ch']
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { vi as default };
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Chinese (zh-cn)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var zh_cn = function (date) {
|
||||
var code = 'zh-cn';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
|
||||
MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
||||
dddd: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
|
||||
ddd: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
|
||||
dd: ['日', '一', '二', '三', '四', '五', '六'],
|
||||
A: ['凌晨', '早上', '上午', '中午', '下午', '晚上']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var hm = d.getHours() * 100 + d.getMinutes();
|
||||
if (hm < 600) {
|
||||
return this.res.A[0]; // 凌晨
|
||||
} else if (hm < 900) {
|
||||
return this.res.A[1]; // 早上
|
||||
} else if (hm < 1130) {
|
||||
return this.res.A[2]; // 上午
|
||||
} else if (hm < 1230) {
|
||||
return this.res.A[3]; // 中午
|
||||
} else if (hm < 1800) {
|
||||
return this.res.A[4]; // 下午
|
||||
}
|
||||
return this.res.A[5]; // 晚上
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 4) {
|
||||
return h; // 凌晨, 早上, 上午, 中午
|
||||
}
|
||||
return h > 11 ? h : h + 12; // 下午, 晚上
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { zh_cn as default };
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Chinese (zh-cn)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var zh_cn = function (date) {
|
||||
var code = 'zh-cn';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
|
||||
MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
||||
dddd: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
|
||||
ddd: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
|
||||
dd: ['日', '一', '二', '三', '四', '五', '六'],
|
||||
A: ['凌晨', '早上', '上午', '中午', '下午', '晚上']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var hm = d.getHours() * 100 + d.getMinutes();
|
||||
if (hm < 600) {
|
||||
return this.res.A[0]; // 凌晨
|
||||
} else if (hm < 900) {
|
||||
return this.res.A[1]; // 早上
|
||||
} else if (hm < 1130) {
|
||||
return this.res.A[2]; // 上午
|
||||
} else if (hm < 1230) {
|
||||
return this.res.A[3]; // 中午
|
||||
} else if (hm < 1800) {
|
||||
return this.res.A[4]; // 下午
|
||||
}
|
||||
return this.res.A[5]; // 晚上
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 4) {
|
||||
return h; // 凌晨, 早上, 上午, 中午
|
||||
}
|
||||
return h > 11 ? h : h + 12; // 下午, 晚上
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { zh_cn as default };
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Chinese (zh-tw)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var zh_tw = function (date) {
|
||||
var code = 'zh-tw';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
|
||||
MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
||||
dddd: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
|
||||
ddd: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
|
||||
dd: ['日', '一', '二', '三', '四', '五', '六'],
|
||||
A: ['早上', '上午', '中午', '下午', '晚上']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var hm = d.getHours() * 100 + d.getMinutes();
|
||||
if (hm < 900) {
|
||||
return this.res.A[0]; // 早上
|
||||
} else if (hm < 1130) {
|
||||
return this.res.A[1]; // 上午
|
||||
} else if (hm < 1230) {
|
||||
return this.res.A[2]; // 中午
|
||||
} else if (hm < 1800) {
|
||||
return this.res.A[3]; // 下午
|
||||
}
|
||||
return this.res.A[4]; // 晚上
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 3) {
|
||||
return h; // 早上, 上午, 中午
|
||||
}
|
||||
return h > 11 ? h : h + 12; // 下午, 晚上
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { zh_tw as default };
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* @preserve date-and-time.js locale configuration
|
||||
* @preserve Chinese (zh-tw)
|
||||
* @preserve It is using moment.js locale configuration as a reference.
|
||||
*/
|
||||
|
||||
var zh_tw = function (date) {
|
||||
var code = 'zh-tw';
|
||||
|
||||
date.locale(code, {
|
||||
res: {
|
||||
MMMM: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
|
||||
MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
||||
dddd: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
|
||||
ddd: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
|
||||
dd: ['日', '一', '二', '三', '四', '五', '六'],
|
||||
A: ['早上', '上午', '中午', '下午', '晚上']
|
||||
},
|
||||
formatter: {
|
||||
A: function (d) {
|
||||
var hm = d.getHours() * 100 + d.getMinutes();
|
||||
if (hm < 900) {
|
||||
return this.res.A[0]; // 早上
|
||||
} else if (hm < 1130) {
|
||||
return this.res.A[1]; // 上午
|
||||
} else if (hm < 1230) {
|
||||
return this.res.A[2]; // 中午
|
||||
} else if (hm < 1800) {
|
||||
return this.res.A[3]; // 下午
|
||||
}
|
||||
return this.res.A[4]; // 晚上
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
h12: function (h, a) {
|
||||
if (a < 3) {
|
||||
return h; // 早上, 上午, 中午
|
||||
}
|
||||
return h > 11 ? h : h + 12; // 下午, 晚上
|
||||
}
|
||||
}
|
||||
});
|
||||
return code;
|
||||
};
|
||||
|
||||
export { zh_tw as default };
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @preserve date-and-time.js plugin
|
||||
* @preserve day-of-week
|
||||
*/
|
||||
|
||||
var plugin = function (date) {
|
||||
var name = 'day-of-week';
|
||||
|
||||
date.plugin(name, {
|
||||
parser: {
|
||||
dddd: function (str) { return this.find(this.res.dddd, str); },
|
||||
ddd: function (str) { return this.find(this.res.ddd, str); },
|
||||
dd: function (str) { return this.find(this.res.dd, str); }
|
||||
}
|
||||
});
|
||||
return name;
|
||||
};
|
||||
|
||||
export { plugin as default };
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @preserve date-and-time.js plugin
|
||||
* @preserve day-of-week
|
||||
*/
|
||||
|
||||
var plugin = function (date) {
|
||||
var name = 'day-of-week';
|
||||
|
||||
date.plugin(name, {
|
||||
parser: {
|
||||
dddd: function (str) { return this.find(this.res.dddd, str); },
|
||||
ddd: function (str) { return this.find(this.res.ddd, str); },
|
||||
dd: function (str) { return this.find(this.res.dd, str); }
|
||||
}
|
||||
});
|
||||
return name;
|
||||
};
|
||||
|
||||
export { plugin as default };
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* @preserve date-and-time.js plugin
|
||||
* @preserve meridiem
|
||||
*/
|
||||
|
||||
var plugin = function (date) {
|
||||
var name = 'meridiem';
|
||||
|
||||
date.plugin(name, {
|
||||
res: {
|
||||
AA: ['A.M.', 'P.M.'],
|
||||
a: ['am', 'pm'],
|
||||
aa: ['a.m.', 'p.m.']
|
||||
},
|
||||
formatter: {
|
||||
AA: function (d) {
|
||||
return this.res.AA[d.getHours() > 11 | 0];
|
||||
},
|
||||
a: function (d) {
|
||||
return this.res.a[d.getHours() > 11 | 0];
|
||||
},
|
||||
aa: function (d) {
|
||||
return this.res.aa[d.getHours() > 11 | 0];
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
AA: function (str) {
|
||||
var result = this.find(this.res.AA, str);
|
||||
result.token = 'A';
|
||||
return result;
|
||||
},
|
||||
a: function (str) {
|
||||
var result = this.find(this.res.a, str);
|
||||
result.token = 'A';
|
||||
return result;
|
||||
},
|
||||
aa: function (str) {
|
||||
var result = this.find(this.res.aa, str);
|
||||
result.token = 'A';
|
||||
return result;
|
||||
}
|
||||
}
|
||||
});
|
||||
return name;
|
||||
};
|
||||
|
||||
export { plugin as default };
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* @preserve date-and-time.js plugin
|
||||
* @preserve meridiem
|
||||
*/
|
||||
|
||||
var plugin = function (date) {
|
||||
var name = 'meridiem';
|
||||
|
||||
date.plugin(name, {
|
||||
res: {
|
||||
AA: ['A.M.', 'P.M.'],
|
||||
a: ['am', 'pm'],
|
||||
aa: ['a.m.', 'p.m.']
|
||||
},
|
||||
formatter: {
|
||||
AA: function (d) {
|
||||
return this.res.AA[d.getHours() > 11 | 0];
|
||||
},
|
||||
a: function (d) {
|
||||
return this.res.a[d.getHours() > 11 | 0];
|
||||
},
|
||||
aa: function (d) {
|
||||
return this.res.aa[d.getHours() > 11 | 0];
|
||||
}
|
||||
},
|
||||
parser: {
|
||||
AA: function (str) {
|
||||
var result = this.find(this.res.AA, str);
|
||||
result.token = 'A';
|
||||
return result;
|
||||
},
|
||||
a: function (str) {
|
||||
var result = this.find(this.res.a, str);
|
||||
result.token = 'A';
|
||||
return result;
|
||||
},
|
||||
aa: function (str) {
|
||||
var result = this.find(this.res.aa, str);
|
||||
result.token = 'A';
|
||||
return result;
|
||||
}
|
||||
}
|
||||
});
|
||||
return name;
|
||||
};
|
||||
|
||||
export { plugin as default };
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @preserve date-and-time.js plugin
|
||||
* @preserve microsecond
|
||||
*/
|
||||
|
||||
var plugin = function (date) {
|
||||
var name = 'microsecond';
|
||||
|
||||
date.plugin(name, {
|
||||
parser: {
|
||||
SSSSSS: function (str) {
|
||||
var result = this.exec(/^\d{1,6}/, str);
|
||||
result.value = result.value / 1000 | 0;
|
||||
return result;
|
||||
},
|
||||
SSSSS: function (str) {
|
||||
var result = this.exec(/^\d{1,5}/, str);
|
||||
result.value = result.value / 100 | 0;
|
||||
return result;
|
||||
},
|
||||
SSSS: function (str) {
|
||||
var result = this.exec(/^\d{1,4}/, str);
|
||||
result.value = result.value / 10 | 0;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
});
|
||||
return name;
|
||||
};
|
||||
|
||||
export { plugin as default };
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @preserve date-and-time.js plugin
|
||||
* @preserve microsecond
|
||||
*/
|
||||
|
||||
var plugin = function (date) {
|
||||
var name = 'microsecond';
|
||||
|
||||
date.plugin(name, {
|
||||
parser: {
|
||||
SSSSSS: function (str) {
|
||||
var result = this.exec(/^\d{1,6}/, str);
|
||||
result.value = result.value / 1000 | 0;
|
||||
return result;
|
||||
},
|
||||
SSSSS: function (str) {
|
||||
var result = this.exec(/^\d{1,5}/, str);
|
||||
result.value = result.value / 100 | 0;
|
||||
return result;
|
||||
},
|
||||
SSSS: function (str) {
|
||||
var result = this.exec(/^\d{1,4}/, str);
|
||||
result.value = result.value / 10 | 0;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
});
|
||||
return name;
|
||||
};
|
||||
|
||||
export { plugin as default };
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @preserve date-and-time.js plugin
|
||||
* @preserve ordinal
|
||||
*/
|
||||
|
||||
var plugin = function (date) {
|
||||
var name = 'ordinal';
|
||||
|
||||
date.plugin(name, {
|
||||
formatter: {
|
||||
DDD: function (d) {
|
||||
var day = d.getDate();
|
||||
|
||||
switch (day) {
|
||||
case 1:
|
||||
case 21:
|
||||
case 31:
|
||||
return day + 'st';
|
||||
case 2:
|
||||
case 22:
|
||||
return day + 'nd';
|
||||
case 3:
|
||||
case 23:
|
||||
return day + 'rd';
|
||||
default:
|
||||
return day + 'th';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return name;
|
||||
};
|
||||
|
||||
export { plugin as default };
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @preserve date-and-time.js plugin
|
||||
* @preserve ordinal
|
||||
*/
|
||||
|
||||
var plugin = function (date) {
|
||||
var name = 'ordinal';
|
||||
|
||||
date.plugin(name, {
|
||||
formatter: {
|
||||
DDD: function (d) {
|
||||
var day = d.getDate();
|
||||
|
||||
switch (day) {
|
||||
case 1:
|
||||
case 21:
|
||||
case 31:
|
||||
return day + 'st';
|
||||
case 2:
|
||||
case 22:
|
||||
return day + 'nd';
|
||||
case 3:
|
||||
case 23:
|
||||
return day + 'rd';
|
||||
default:
|
||||
return day + 'th';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return name;
|
||||
};
|
||||
|
||||
export { plugin as default };
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* @preserve date-and-time.js plugin
|
||||
* @preserve timespan
|
||||
*/
|
||||
|
||||
var plugin = function (date) {
|
||||
var timeSpan = function (date1, date2) {
|
||||
var milliseconds = function (dt, time) {
|
||||
dt.S = time;
|
||||
return dt;
|
||||
},
|
||||
seconds = function (dt, time) {
|
||||
dt.s = time / 1000 | 0;
|
||||
return milliseconds(dt, Math.abs(time) % 1000);
|
||||
},
|
||||
minutes = function (dt, time) {
|
||||
dt.m = time / 60000 | 0;
|
||||
return seconds(dt, Math.abs(time) % 60000);
|
||||
},
|
||||
hours = function (dt, time) {
|
||||
dt.H = time / 3600000 | 0;
|
||||
return minutes(dt, Math.abs(time) % 3600000);
|
||||
},
|
||||
days = function (dt, time) {
|
||||
dt.D = time / 86400000 | 0;
|
||||
return hours(dt, Math.abs(time) % 86400000);
|
||||
},
|
||||
format = function (dt, formatString) {
|
||||
var pattern = date.compile(formatString);
|
||||
var str = '';
|
||||
|
||||
for (var i = 1, len = pattern.length, token, value; i < len; i++) {
|
||||
token = pattern[i].charAt(0);
|
||||
if (token in dt) {
|
||||
value = '' + Math.abs(dt[token]);
|
||||
while (value.length < pattern[i].length) {
|
||||
value = '0' + value;
|
||||
}
|
||||
if (dt[token] < 0) {
|
||||
value = '-' + value;
|
||||
}
|
||||
str += value;
|
||||
} else {
|
||||
str += pattern[i].replace(/\[(.*)]/, '$1');
|
||||
}
|
||||
}
|
||||
return str;
|
||||
},
|
||||
delta = date1.getTime() - date2.getTime();
|
||||
|
||||
return {
|
||||
toMilliseconds: function (formatString) {
|
||||
return format(milliseconds({}, delta), formatString);
|
||||
},
|
||||
toSeconds: function (formatString) {
|
||||
return format(seconds({}, delta), formatString);
|
||||
},
|
||||
toMinutes: function (formatString) {
|
||||
return format(minutes({}, delta), formatString);
|
||||
},
|
||||
toHours: function (formatString) {
|
||||
return format(hours({}, delta), formatString);
|
||||
},
|
||||
toDays: function (formatString) {
|
||||
return format(days({}, delta), formatString);
|
||||
}
|
||||
};
|
||||
};
|
||||
var name = 'timespan';
|
||||
|
||||
date.plugin(name, { extender: { timeSpan: timeSpan } });
|
||||
return name;
|
||||
};
|
||||
|
||||
export { plugin as default };
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* @preserve date-and-time.js plugin
|
||||
* @preserve timespan
|
||||
*/
|
||||
|
||||
var plugin = function (date) {
|
||||
var timeSpan = function (date1, date2) {
|
||||
var milliseconds = function (dt, time) {
|
||||
dt.S = time;
|
||||
return dt;
|
||||
},
|
||||
seconds = function (dt, time) {
|
||||
dt.s = time / 1000 | 0;
|
||||
return milliseconds(dt, Math.abs(time) % 1000);
|
||||
},
|
||||
minutes = function (dt, time) {
|
||||
dt.m = time / 60000 | 0;
|
||||
return seconds(dt, Math.abs(time) % 60000);
|
||||
},
|
||||
hours = function (dt, time) {
|
||||
dt.H = time / 3600000 | 0;
|
||||
return minutes(dt, Math.abs(time) % 3600000);
|
||||
},
|
||||
days = function (dt, time) {
|
||||
dt.D = time / 86400000 | 0;
|
||||
return hours(dt, Math.abs(time) % 86400000);
|
||||
},
|
||||
format = function (dt, formatString) {
|
||||
var pattern = date.compile(formatString);
|
||||
var str = '';
|
||||
|
||||
for (var i = 1, len = pattern.length, token, value; i < len; i++) {
|
||||
token = pattern[i].charAt(0);
|
||||
if (token in dt) {
|
||||
value = '' + Math.abs(dt[token]);
|
||||
while (value.length < pattern[i].length) {
|
||||
value = '0' + value;
|
||||
}
|
||||
if (dt[token] < 0) {
|
||||
value = '-' + value;
|
||||
}
|
||||
str += value;
|
||||
} else {
|
||||
str += pattern[i].replace(/\[(.*)]/, '$1');
|
||||
}
|
||||
}
|
||||
return str;
|
||||
},
|
||||
delta = date1.getTime() - date2.getTime();
|
||||
|
||||
return {
|
||||
toMilliseconds: function (formatString) {
|
||||
return format(milliseconds({}, delta), formatString);
|
||||
},
|
||||
toSeconds: function (formatString) {
|
||||
return format(seconds({}, delta), formatString);
|
||||
},
|
||||
toMinutes: function (formatString) {
|
||||
return format(minutes({}, delta), formatString);
|
||||
},
|
||||
toHours: function (formatString) {
|
||||
return format(hours({}, delta), formatString);
|
||||
},
|
||||
toDays: function (formatString) {
|
||||
return format(days({}, delta), formatString);
|
||||
}
|
||||
};
|
||||
};
|
||||
var name = 'timespan';
|
||||
|
||||
date.plugin(name, { extender: { timeSpan: timeSpan } });
|
||||
return name;
|
||||
};
|
||||
|
||||
export { plugin as default };
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* @preserve date-and-time.js plugin
|
||||
* @preserve timezone
|
||||
*/
|
||||
|
||||
var plugin = function (date, localized_date) {
|
||||
var options = {
|
||||
year: 'numeric', month: 'numeric', day: 'numeric',
|
||||
hour: 'numeric', minute: 'numeric', second: 'numeric'
|
||||
};
|
||||
var pattern = date.compile('M/D/Y, h:mm:ss A');
|
||||
var formatTZ = function (dateObj, arg, timeZone) {
|
||||
options.timeZone = 'UTC';
|
||||
var utcObj = date.parse(new Intl.DateTimeFormat('en-US', options).format(dateObj), pattern);
|
||||
|
||||
options.timeZone = timeZone;
|
||||
var dateObj2 = date.parse(new Intl.DateTimeFormat('en-US', options).format(dateObj), pattern);
|
||||
|
||||
var dateObj3 = date.addMilliseconds(dateObj2, dateObj.getMilliseconds());
|
||||
|
||||
dateObj3.getTimezoneOffset = function () { return (utcObj.getTime() - dateObj2.getTime()) / 60000 | 0; };
|
||||
return localized_date.format(dateObj3, arg);
|
||||
};
|
||||
var adjustments = [
|
||||
-60, -30, -20,
|
||||
0,
|
||||
60, 30, 20
|
||||
];
|
||||
var parseTZ = function (dateString, arg, timeZone) {
|
||||
var pattern2 = typeof arg === 'string' ? date.compile(arg) : arg;
|
||||
var dateObj = localized_date.parse(dateString, pattern2, true);
|
||||
|
||||
for (var i = 1, len = pattern2.length; i < len; i++) {
|
||||
if (pattern2[i].indexOf('Z') === 0) {
|
||||
return dateObj;
|
||||
}
|
||||
}
|
||||
|
||||
options.timeZone = timeZone;
|
||||
var dateTimeFormat = new Intl.DateTimeFormat('en-US', options);
|
||||
var dateObj2 = date.addMilliseconds(
|
||||
date.parse(dateTimeFormat.format(dateObj), pattern, true),
|
||||
dateObj.getMilliseconds()
|
||||
);
|
||||
var offset = dateObj.getTime() - dateObj2.getTime();
|
||||
var dateString2 = date.format(localized_date.parse(dateString, pattern2), pattern);
|
||||
|
||||
var comparer = function (d) {
|
||||
return dateString2 === dateTimeFormat.format(d);
|
||||
};
|
||||
|
||||
// Trying to adjust for daylight saving time.
|
||||
for (var j = 0, len2 = adjustments.length; j < len2; j++) {
|
||||
var d = date.addMilliseconds(dateObj, offset + adjustments[j] * 60000);
|
||||
if (comparer(d)) {
|
||||
return d;
|
||||
}
|
||||
}
|
||||
return NaN;
|
||||
};
|
||||
|
||||
var name = 'timezone';
|
||||
|
||||
date.plugin(name, {
|
||||
extender: {
|
||||
formatTZ: formatTZ,
|
||||
parseTZ: parseTZ
|
||||
}
|
||||
});
|
||||
return name;
|
||||
};
|
||||
|
||||
export { plugin as default };
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* @preserve date-and-time.js plugin
|
||||
* @preserve timezone
|
||||
*/
|
||||
|
||||
var plugin = function (date, localized_date) {
|
||||
var options = {
|
||||
year: 'numeric', month: 'numeric', day: 'numeric',
|
||||
hour: 'numeric', minute: 'numeric', second: 'numeric'
|
||||
};
|
||||
var pattern = date.compile('M/D/Y, h:mm:ss A');
|
||||
var formatTZ = function (dateObj, arg, timeZone) {
|
||||
options.timeZone = 'UTC';
|
||||
var utcObj = date.parse(new Intl.DateTimeFormat('en-US', options).format(dateObj), pattern);
|
||||
|
||||
options.timeZone = timeZone;
|
||||
var dateObj2 = date.parse(new Intl.DateTimeFormat('en-US', options).format(dateObj), pattern);
|
||||
|
||||
var dateObj3 = date.addMilliseconds(dateObj2, dateObj.getMilliseconds());
|
||||
|
||||
dateObj3.getTimezoneOffset = function () { return (utcObj.getTime() - dateObj2.getTime()) / 60000 | 0; };
|
||||
return localized_date.format(dateObj3, arg);
|
||||
};
|
||||
var adjustments = [
|
||||
-60, -30, -20,
|
||||
0,
|
||||
60, 30, 20
|
||||
];
|
||||
var parseTZ = function (dateString, arg, timeZone) {
|
||||
var pattern2 = typeof arg === 'string' ? date.compile(arg) : arg;
|
||||
var dateObj = localized_date.parse(dateString, pattern2, true);
|
||||
|
||||
for (var i = 1, len = pattern2.length; i < len; i++) {
|
||||
if (pattern2[i].indexOf('Z') === 0) {
|
||||
return dateObj;
|
||||
}
|
||||
}
|
||||
|
||||
options.timeZone = timeZone;
|
||||
var dateTimeFormat = new Intl.DateTimeFormat('en-US', options);
|
||||
var dateObj2 = date.addMilliseconds(
|
||||
date.parse(dateTimeFormat.format(dateObj), pattern, true),
|
||||
dateObj.getMilliseconds()
|
||||
);
|
||||
var offset = dateObj.getTime() - dateObj2.getTime();
|
||||
var dateString2 = date.format(localized_date.parse(dateString, pattern2), pattern);
|
||||
|
||||
var comparer = function (d) {
|
||||
return dateString2 === dateTimeFormat.format(d);
|
||||
};
|
||||
|
||||
// Trying to adjust for daylight saving time.
|
||||
for (var j = 0, len2 = adjustments.length; j < len2; j++) {
|
||||
var d = date.addMilliseconds(dateObj, offset + adjustments[j] * 60000);
|
||||
if (comparer(d)) {
|
||||
return d;
|
||||
}
|
||||
}
|
||||
return NaN;
|
||||
};
|
||||
|
||||
var name = 'timezone';
|
||||
|
||||
date.plugin(name, {
|
||||
extender: {
|
||||
formatTZ: formatTZ,
|
||||
parseTZ: parseTZ
|
||||
}
|
||||
});
|
||||
return name;
|
||||
};
|
||||
|
||||
export { plugin as default };
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* @preserve date-and-time.js plugin
|
||||
* @preserve two-digit-year
|
||||
*/
|
||||
|
||||
var plugin = function (date) {
|
||||
var name = 'two-digit-year';
|
||||
|
||||
date.plugin(name, {
|
||||
parser: {
|
||||
YY: function (str) {
|
||||
var result = this.exec(/^\d\d/, str);
|
||||
result.value += result.value < 70 ? 2000 : 1900;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
});
|
||||
return name;
|
||||
};
|
||||
|
||||
export { plugin as default };
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* @preserve date-and-time.js plugin
|
||||
* @preserve two-digit-year
|
||||
*/
|
||||
|
||||
var plugin = function (date) {
|
||||
var name = 'two-digit-year';
|
||||
|
||||
date.plugin(name, {
|
||||
parser: {
|
||||
YY: function (str) {
|
||||
var result = this.exec(/^\d\d/, str);
|
||||
result.value += result.value < 70 ? 2000 : 1900;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
});
|
||||
return name;
|
||||
};
|
||||
|
||||
export { plugin as default };
|
||||
Reference in New Issue
Block a user