UNPKG

253 kBJavaScriptView Raw
1function mod(n, x) {
2 return (n % x + x) % x;
3}
4function absFloor(num) {
5 return num < 0 ? Math.ceil(num) || 0 : Math.floor(num);
6}
7
8function isString(str) {
9 return typeof str === 'string';
10}
11function isDate(value) {
12 return value instanceof Date || Object.prototype.toString.call(value) === '[object Date]';
13}
14function isBoolean(value) {
15 return value === true || value === false;
16}
17function isDateValid(date) {
18 return date && date.getTime && !isNaN(date.getTime());
19}
20// eslint-disable-next-line @typescript-eslint/ban-types
21function isFunction(fn) {
22 return (fn instanceof Function ||
23 Object.prototype.toString.call(fn) === '[object Function]');
24}
25function isNumber(value) {
26 return typeof value === 'number' || Object.prototype.toString.call(value) === '[object Number]';
27}
28function isArray(input) {
29 return (input instanceof Array ||
30 Object.prototype.toString.call(input) === '[object Array]');
31}
32function hasOwnProp(a /*object*/, b) {
33 return Object.prototype.hasOwnProperty.call(a, b);
34}
35function isObject(input /*object*/) {
36 // IE8 will treat undefined and null as object if it wasn't for
37 // input != null
38 return (input != null && Object.prototype.toString.call(input) === '[object Object]');
39}
40function isObjectEmpty(obj) {
41 if (Object.getOwnPropertyNames) {
42 return (Object.getOwnPropertyNames(obj).length === 0);
43 }
44 let k;
45 for (k in obj) {
46 // eslint-disable-next-line no-prototype-builtins
47 if (obj.hasOwnProperty(k)) {
48 return false;
49 }
50 }
51 return true;
52}
53function isUndefined(input) {
54 return input === void 0;
55}
56function toInt(argumentForCoercion) {
57 const coercedNumber = +argumentForCoercion;
58 let value = 0;
59 if (coercedNumber !== 0 && isFinite(coercedNumber)) {
60 value = absFloor(coercedNumber);
61 }
62 return value;
63}
64
65const aliases = {};
66const _mapUnits = {
67 date: 'day',
68 hour: 'hours',
69 minute: 'minutes',
70 second: 'seconds',
71 millisecond: 'milliseconds'
72};
73function addUnitAlias(unit, shorthand) {
74 const lowerCase = unit.toLowerCase();
75 let _unit = unit;
76 if (lowerCase in _mapUnits) {
77 _unit = _mapUnits[lowerCase];
78 }
79 aliases[lowerCase] = aliases[`${lowerCase}s`] = aliases[shorthand] = _unit;
80}
81function normalizeUnits(units) {
82 return isString(units) ? aliases[units] || aliases[units.toLowerCase()] : undefined;
83}
84function normalizeObjectUnits(inputObject) {
85 const normalizedInput = {};
86 let normalizedProp;
87 let prop;
88 for (prop in inputObject) {
89 if (hasOwnProp(inputObject, prop)) {
90 normalizedProp = normalizeUnits(prop);
91 if (normalizedProp) {
92 normalizedInput[normalizedProp] = inputObject[prop];
93 }
94 }
95 }
96 return normalizedInput;
97}
98
99// place in new Date([array])
100const YEAR = 0;
101const MONTH = 1;
102const DATE = 2;
103const HOUR = 3;
104const MINUTE = 4;
105const SECOND = 5;
106const MILLISECOND = 6;
107const WEEK = 7;
108const WEEKDAY = 8;
109
110function zeroFill(num, targetLength, forceSign) {
111 const absNumber = `${Math.abs(num)}`;
112 const zerosToFill = targetLength - absNumber.length;
113 const sign = num >= 0;
114 const _sign = sign ? (forceSign ? '+' : '') : '-';
115 // todo: this is crazy slow
116 const _zeros = Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1);
117 return (_sign + _zeros + absNumber);
118}
119
120const formatFunctions = {};
121const formatTokenFunctions = {};
122const formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
123// token: 'M'
124// padded: ['MM', 2]
125// ordinal: 'Mo'
126// callback: function () { this.month() + 1 }
127function addFormatToken(token, padded, ordinal, callback) {
128 if (token) {
129 formatTokenFunctions[token] = callback;
130 }
131 if (padded) {
132 formatTokenFunctions[padded[0]] = function () {
133 return zeroFill(callback.apply(null, arguments), padded[1], padded[2]);
134 };
135 }
136 if (ordinal) {
137 formatTokenFunctions[ordinal] = function (date, opts) {
138 return opts.locale.ordinal(callback.apply(null, arguments), token);
139 };
140 }
141}
142function makeFormatFunction(format) {
143 const array = format.match(formattingTokens);
144 const length = array.length;
145 const formatArr = new Array(length);
146 for (let i = 0; i < length; i++) {
147 formatArr[i] = formatTokenFunctions[array[i]]
148 ? formatTokenFunctions[array[i]]
149 : removeFormattingTokens(array[i]);
150 }
151 return function (date, locale, isUTC, offset = 0) {
152 let output = '';
153 for (let j = 0; j < length; j++) {
154 output += isFunction(formatArr[j])
155 ? formatArr[j].call(null, date, { format, locale, isUTC, offset })
156 : formatArr[j];
157 }
158 return output;
159 };
160}
161function removeFormattingTokens(input) {
162 if (input.match(/\[[\s\S]/)) {
163 return input.replace(/^\[|\]$/g, '');
164 }
165 return input.replace(/\\/g, '');
166}
167
168// eslint-disable-next-line @typescript-eslint/no-unused-vars
169function createUTCDate(y, m, d) {
170 // eslint-disable-next-line prefer-rest-params
171 const date = new Date(Date.UTC.apply(null, arguments));
172 // the Date.UTC function remaps years 0-99 to 1900-1999
173 if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
174 date.setUTCFullYear(y);
175 }
176 return date;
177}
178function createDate(y, m = 0, d = 1, h = 0, M = 0, s = 0, ms = 0) {
179 const date = new Date(y, m, d, h, M, s, ms);
180 // the date constructor remaps years 0-99 to 1900-1999
181 if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
182 date.setFullYear(y);
183 }
184 return date;
185}
186
187function getHours(date, isUTC = false) {
188 return isUTC ? date.getUTCHours() : date.getHours();
189}
190function getMinutes(date, isUTC = false) {
191 return isUTC ? date.getUTCMinutes() : date.getMinutes();
192}
193function getSeconds(date, isUTC = false) {
194 return isUTC ? date.getUTCSeconds() : date.getSeconds();
195}
196function getMilliseconds(date, isUTC = false) {
197 return isUTC ? date.getUTCMilliseconds() : date.getMilliseconds();
198}
199function getTime(date) {
200 return date.getTime();
201}
202function getDay(date, isUTC = false) {
203 return isUTC ? date.getUTCDay() : date.getDay();
204}
205function getDate(date, isUTC = false) {
206 return isUTC ? date.getUTCDate() : date.getDate();
207}
208function getMonth(date, isUTC = false) {
209 return isUTC ? date.getUTCMonth() : date.getMonth();
210}
211function getFullYear(date, isUTC = false) {
212 return isUTC ? date.getUTCFullYear() : date.getFullYear();
213}
214function getUnixTime(date) {
215 return Math.floor(date.valueOf() / 1000);
216}
217function unix(date) {
218 return Math.floor(date.valueOf() / 1000);
219}
220function getFirstDayOfMonth(date) {
221 return createDate(date.getFullYear(), date.getMonth(), 1, date.getHours(), date.getMinutes(), date.getSeconds());
222}
223function daysInMonth(date) {
224 return _daysInMonth(date.getFullYear(), date.getMonth());
225}
226function _daysInMonth(year, month) {
227 return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
228}
229function isFirstDayOfWeek(date, firstDayOfWeek) {
230 return date.getDay() === Number(firstDayOfWeek);
231}
232function isSameMonth(date1, date2) {
233 if (!date1 || !date2) {
234 return false;
235 }
236 return isSameYear(date1, date2) && getMonth(date1) === getMonth(date2);
237}
238function isSameYear(date1, date2) {
239 if (!date1 || !date2) {
240 return false;
241 }
242 return getFullYear(date1) === getFullYear(date2);
243}
244function isSameDay(date1, date2) {
245 if (!date1 || !date2) {
246 return false;
247 }
248 return (isSameYear(date1, date2) &&
249 isSameMonth(date1, date2) &&
250 getDate(date1) === getDate(date2));
251}
252
253const match1 = /\d/; // 0 - 9
254const match2 = /\d\d/; // 00 - 99
255const match3 = /\d{3}/; // 000 - 999
256const match4 = /\d{4}/; // 0000 - 9999
257const match6 = /[+-]?\d{6}/; // -999999 - 999999
258const match1to2 = /\d\d?/; // 0 - 99
259const match3to4 = /\d\d\d\d?/; // 999 - 9999
260const match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
261const match1to3 = /\d{1,3}/; // 0 - 999
262const match1to4 = /\d{1,4}/; // 0 - 9999
263const match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
264const matchUnsigned = /\d+/; // 0 - inf
265const matchSigned = /[+-]?\d+/; // -inf - inf
266const matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
267const matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
268const matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
269// any word (or two) characters or numbers including two/three word month in arabic.
270// includes scottish gaelic two word and hyphenated months
271const matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;
272const regexes = {};
273function addRegexToken(token, regex, strictRegex) {
274 if (isFunction(regex)) {
275 regexes[token] = regex;
276 return;
277 }
278 regexes[token] = function (isStrict, locale) {
279 return (isStrict && strictRegex) ? strictRegex : regex;
280 };
281}
282function getParseRegexForToken(token, locale) {
283 const _strict = false;
284 if (!hasOwnProp(regexes, token)) {
285 return new RegExp(unescapeFormat(token));
286 }
287 return regexes[token](_strict, locale);
288}
289// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
290function unescapeFormat(str) {
291 return regexEscape(str
292 .replace('\\', '')
293 .replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, (matched, p1, p2, p3, p4) => p1 || p2 || p3 || p4));
294}
295function regexEscape(str) {
296 return str.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
297}
298
299const tokens = {};
300function addParseToken(token, callback) {
301 const _token = isString(token) ? [token] : token;
302 let func = callback;
303 if (isNumber(callback)) {
304 func = function (input, array, config) {
305 array[callback] = toInt(input);
306 return config;
307 };
308 }
309 if (isArray(_token) && isFunction(func)) {
310 let i;
311 for (i = 0; i < _token.length; i++) {
312 tokens[_token[i]] = func;
313 }
314 }
315}
316function addWeekParseToken(token, callback) {
317 addParseToken(token, function (input, array, config, _token) {
318 config._w = config._w || {};
319 return callback(input, config._w, config, _token);
320 });
321}
322function addTimeToArrayFromToken(token, input, config) {
323 if (input != null && hasOwnProp(tokens, token)) {
324 tokens[token](input, config._a, config, token);
325 }
326 return config;
327}
328
329const priorities = {};
330function addUnitPriority(unit, priority) {
331 priorities[unit] = priority;
332}
333/*
334export function getPrioritizedUnits(unitsObj) {
335 const units = [];
336 let unit;
337 for (unit in unitsObj) {
338 if (unitsObj.hasOwnProperty(unit)) {
339 units.push({ unit, priority: priorities[unit] });
340 }
341 }
342 units.sort(function (a, b) {
343 return a.priority - b.priority;
344 });
345
346 return units;
347}
348*/
349
350function initDayOfMonth() {
351 // FORMATTING
352 addFormatToken('D', ['DD', 2, false], 'Do', function (date, opts) {
353 return getDate(date, opts.isUTC)
354 .toString(10);
355 });
356 // ALIASES
357 addUnitAlias('date', 'D');
358 // PRIOROITY
359 addUnitPriority('date', 9);
360 // PARSING
361 addRegexToken('D', match1to2);
362 addRegexToken('DD', match1to2, match2);
363 addRegexToken('Do', function (isStrict, locale) {
364 return locale._dayOfMonthOrdinalParse || locale._ordinalParse;
365 });
366 addParseToken(['D', 'DD'], DATE);
367 addParseToken('Do', function (input, array, config) {
368 array[DATE] = toInt(input.match(match1to2)[0]);
369 return config;
370 });
371}
372
373function defaultParsingFlags() {
374 // We need to deep clone this object.
375 return {
376 empty: false,
377 unusedTokens: [],
378 unusedInput: [],
379 overflow: -2,
380 charsLeftOver: 0,
381 nullInput: false,
382 invalidMonth: null,
383 invalidFormat: false,
384 userInvalidated: false,
385 iso: false,
386 parsedDateParts: [],
387 meridiem: null,
388 rfc2822: false,
389 weekdayMismatch: false
390 };
391}
392function getParsingFlags(config) {
393 if (config._pf == null) {
394 config._pf = defaultParsingFlags();
395 }
396 return config._pf;
397}
398
399// FORMATTING
400function getYear(date, opts) {
401 if (opts.locale.getFullYear) {
402 return opts.locale.getFullYear(date, opts.isUTC).toString();
403 }
404 return getFullYear(date, opts.isUTC).toString();
405}
406function initYear() {
407 addFormatToken('Y', null, null, function (date, opts) {
408 const y = getFullYear(date, opts.isUTC);
409 return y <= 9999 ? y.toString(10) : `+${y}`;
410 });
411 addFormatToken(null, ['YY', 2, false], null, function (date, opts) {
412 return (getFullYear(date, opts.isUTC) % 100).toString(10);
413 });
414 addFormatToken(null, ['YYYY', 4, false], null, getYear);
415 addFormatToken(null, ['YYYYY', 5, false], null, getYear);
416 addFormatToken(null, ['YYYYYY', 6, true], null, getYear);
417 // ALIASES
418 addUnitAlias('year', 'y');
419 // PRIORITIES
420 addUnitPriority('year', 1);
421 // PARSING
422 addRegexToken('Y', matchSigned);
423 addRegexToken('YY', match1to2, match2);
424 addRegexToken('YYYY', match1to4, match4);
425 addRegexToken('YYYYY', match1to6, match6);
426 addRegexToken('YYYYYY', match1to6, match6);
427 addParseToken(['YYYYY', 'YYYYYY'], YEAR);
428 addParseToken('YYYY', function (input, array, config) {
429 array[YEAR] = input.length === 2 ? parseTwoDigitYear(input) : toInt(input);
430 return config;
431 });
432 addParseToken('YY', function (input, array, config) {
433 array[YEAR] = parseTwoDigitYear(input);
434 return config;
435 });
436 addParseToken('Y', function (input, array, config) {
437 array[YEAR] = parseInt(input, 10);
438 return config;
439 });
440}
441function parseTwoDigitYear(input) {
442 return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
443}
444function daysInYear(year) {
445 return isLeapYear(year) ? 366 : 365;
446}
447function isLeapYear(year) {
448 return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
449}
450
451// todo: this is duplicate, source in date-getters.ts
452function daysInMonth$1(year, month) {
453 if (isNaN(year) || isNaN(month)) {
454 return NaN;
455 }
456 const modMonth = mod(month, 12);
457 const _year = year + (month - modMonth) / 12;
458 return modMonth === 1
459 ? isLeapYear(_year) ? 29 : 28
460 : (31 - modMonth % 7 % 2);
461}
462function initMonth() {
463 // FORMATTING
464 addFormatToken('M', ['MM', 2, false], 'Mo', function (date, opts) {
465 return (getMonth(date, opts.isUTC) + 1).toString(10);
466 });
467 addFormatToken('MMM', null, null, function (date, opts) {
468 return opts.locale.monthsShort(date, opts.format, opts.isUTC);
469 });
470 addFormatToken('MMMM', null, null, function (date, opts) {
471 return opts.locale.months(date, opts.format, opts.isUTC);
472 });
473 // ALIASES
474 addUnitAlias('month', 'M');
475 // PRIORITY
476 addUnitPriority('month', 8);
477 // PARSING
478 addRegexToken('M', match1to2);
479 addRegexToken('MM', match1to2, match2);
480 addRegexToken('MMM', function (isStrict, locale) {
481 return locale.monthsShortRegex(isStrict);
482 });
483 addRegexToken('MMMM', function (isStrict, locale) {
484 return locale.monthsRegex(isStrict);
485 });
486 addParseToken(['M', 'MM'], function (input, array, config) {
487 array[MONTH] = toInt(input) - 1;
488 return config;
489 });
490 addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
491 const month = config._locale.monthsParse(input, token, config._strict);
492 // if we didn't find a month name, mark the date as invalid.
493 if (month != null) {
494 array[MONTH] = month;
495 }
496 else {
497 getParsingFlags(config).invalidMonth = !!input;
498 }
499 return config;
500 });
501}
502
503const defaultTimeUnit = {
504 year: 0,
505 month: 0,
506 day: 0,
507 hour: 0,
508 minute: 0,
509 seconds: 0
510};
511function shiftDate(date, unit) {
512 const _unit = Object.assign({}, defaultTimeUnit, unit);
513 const year = date.getFullYear() + (_unit.year || 0);
514 const month = date.getMonth() + (_unit.month || 0);
515 let day = date.getDate() + (_unit.day || 0);
516 if (_unit.month && !_unit.day) {
517 day = Math.min(day, daysInMonth$1(year, month));
518 }
519 return createDate(year, month, day, date.getHours() + (_unit.hour || 0), date.getMinutes() + (_unit.minute || 0), date.getSeconds() + (_unit.seconds || 0));
520}
521function setFullDate(date, unit) {
522 return createDate(getNum(date.getFullYear(), unit.year), getNum(date.getMonth(), unit.month), 1, // day, to avoid issue with wrong months selection at the end of current month (#5371)
523 getNum(date.getHours(), unit.hour), getNum(date.getMinutes(), unit.minute), getNum(date.getSeconds(), unit.seconds), getNum(date.getMilliseconds(), unit.milliseconds));
524}
525function getNum(def, num) {
526 return isNumber(num) ? num : def;
527}
528function setFullYear(date, value, isUTC) {
529 const _month = getMonth(date, isUTC);
530 const _date = getDate(date, isUTC);
531 const _year = getFullYear(date, isUTC);
532 if (isLeapYear(_year) && _month === 1 && _date === 29) {
533 const _daysInMonth = daysInMonth$1(value, _month);
534 isUTC ? date.setUTCFullYear(value, _month, _daysInMonth) : date.setFullYear(value, _month, _daysInMonth);
535 }
536 isUTC ? date.setUTCFullYear(value) : date.setFullYear(value);
537 return date;
538}
539function setMonth(date, value, isUTC) {
540 const dayOfMonth = Math.min(getDate(date), daysInMonth$1(getFullYear(date), value));
541 isUTC ? date.setUTCMonth(value, dayOfMonth) : date.setMonth(value, dayOfMonth);
542 return date;
543}
544function setDay(date, value, isUTC) {
545 isUTC ? date.setUTCDate(value) : date.setDate(value);
546 return date;
547}
548function setHours(date, value, isUTC) {
549 isUTC ? date.setUTCHours(value) : date.setHours(value);
550 return date;
551}
552function setMinutes(date, value, isUTC) {
553 isUTC ? date.setUTCMinutes(value) : date.setMinutes(value);
554 return date;
555}
556function setSeconds(date, value, isUTC) {
557 isUTC ? date.setUTCSeconds(value) : date.setSeconds(value);
558 return date;
559}
560function setMilliseconds(date, value, isUTC) {
561 isUTC ? date.setUTCMilliseconds(value) : date.setMilliseconds(value);
562 return date;
563}
564function setDate(date, value, isUTC) {
565 isUTC ? date.setUTCDate(value) : date.setDate(value);
566 return date;
567}
568function setTime(date, value) {
569 date.setTime(value);
570 return date;
571}
572
573// fastest way to clone date
574// https://jsperf.com/clone-date-object2
575function cloneDate(date) {
576 return new Date(date.getTime());
577}
578
579function startOf(date, unit, isUTC) {
580 const _date = cloneDate(date);
581 // the following switch intentionally omits break keywords
582 // to utilize falling through the cases.
583 switch (unit) {
584 case 'year':
585 setMonth(_date, 0, isUTC);
586 /* falls through */
587 case 'quarter':
588 case 'month':
589 setDate(_date, 1, isUTC);
590 /* falls through */
591 case 'week':
592 case 'isoWeek':
593 case 'day':
594 case 'date':
595 setHours(_date, 0, isUTC);
596 /* falls through */
597 case 'hours':
598 setMinutes(_date, 0, isUTC);
599 /* falls through */
600 case 'minutes':
601 setSeconds(_date, 0, isUTC);
602 /* falls through */
603 case 'seconds':
604 setMilliseconds(_date, 0, isUTC);
605 }
606 // weeks are a special case
607 if (unit === 'week') {
608 setLocaleDayOfWeek(_date, 0, { isUTC });
609 }
610 if (unit === 'isoWeek') {
611 setISODayOfWeek(_date, 1);
612 }
613 // quarters are also special
614 if (unit === 'quarter') {
615 setMonth(_date, Math.floor(getMonth(_date, isUTC) / 3) * 3, isUTC);
616 }
617 return _date;
618}
619function endOf(date, unit, isUTC) {
620 let _unit = unit;
621 // 'date' is an alias for 'day', so it should be considered as such.
622 if (_unit === 'date') {
623 _unit = 'day';
624 }
625 const start = startOf(date, _unit, isUTC);
626 const _step = add(start, 1, _unit === 'isoWeek' ? 'week' : _unit, isUTC);
627 const res = subtract(_step, 1, 'milliseconds', isUTC);
628 return res;
629}
630
631function initDayOfYear() {
632 // FORMATTING
633 addFormatToken('DDD', ['DDDD', 3, false], 'DDDo', function (date) {
634 return getDayOfYear(date)
635 .toString(10);
636 });
637 // ALIASES
638 addUnitAlias('dayOfYear', 'DDD');
639 // PRIORITY
640 addUnitPriority('dayOfYear', 4);
641 addRegexToken('DDD', match1to3);
642 addRegexToken('DDDD', match3);
643 addParseToken(['DDD', 'DDDD'], function (input, array, config) {
644 config._dayOfYear = toInt(input);
645 return config;
646 });
647}
648function getDayOfYear(date, isUTC) {
649 const date1 = +startOf(date, 'day', isUTC);
650 const date2 = +startOf(date, 'year', isUTC);
651 const someDate = date1 - date2;
652 const oneDay = 1000 * 60 * 60 * 24;
653 return Math.round(someDate / oneDay) + 1;
654}
655function setDayOfYear(date, input) {
656 const dayOfYear = getDayOfYear(date);
657 return add(date, (input - dayOfYear), 'day');
658}
659
660/**
661 *
662 * @param {number} year
663 * @param {number} dow - start-of-first-week
664 * @param {number} doy - start-of-year
665 * @returns {number}
666 */
667function firstWeekOffset(year, dow, doy) {
668 // first-week day -- which january is always in the first week (4 for iso, 1 for other)
669 const fwd = dow - doy + 7;
670 // first-week day local weekday -- which local weekday is fwd
671 const fwdlw = (createUTCDate(year, 0, fwd).getUTCDay() - dow + 7) % 7;
672 return -fwdlw + fwd - 1;
673}
674// https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
675function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
676 const localWeekday = (7 + weekday - dow) % 7;
677 const weekOffset = firstWeekOffset(year, dow, doy);
678 const dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset;
679 let resYear;
680 let resDayOfYear;
681 if (dayOfYear <= 0) {
682 resYear = year - 1;
683 resDayOfYear = daysInYear(resYear) + dayOfYear;
684 }
685 else if (dayOfYear > daysInYear(year)) {
686 resYear = year + 1;
687 resDayOfYear = dayOfYear - daysInYear(year);
688 }
689 else {
690 resYear = year;
691 resDayOfYear = dayOfYear;
692 }
693 return {
694 year: resYear,
695 dayOfYear: resDayOfYear
696 };
697}
698function weekOfYear(date, dow, doy, isUTC) {
699 const weekOffset = firstWeekOffset(getFullYear(date, isUTC), dow, doy);
700 const week = Math.floor((getDayOfYear(date, isUTC) - weekOffset - 1) / 7) + 1;
701 let resWeek;
702 let resYear;
703 if (week < 1) {
704 resYear = getFullYear(date, isUTC) - 1;
705 resWeek = week + weeksInYear(resYear, dow, doy);
706 }
707 else if (week > weeksInYear(getFullYear(date, isUTC), dow, doy)) {
708 resWeek = week - weeksInYear(getFullYear(date, isUTC), dow, doy);
709 resYear = getFullYear(date, isUTC) + 1;
710 }
711 else {
712 resYear = getFullYear(date, isUTC);
713 resWeek = week;
714 }
715 return {
716 week: resWeek,
717 year: resYear
718 };
719}
720function weeksInYear(year, dow, doy) {
721 const weekOffset = firstWeekOffset(year, dow, doy);
722 const weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
723 return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
724}
725
726const MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
727const defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
728const defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
729const defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
730const defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
731const defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
732const defaultLongDateFormat = {
733 LTS: 'h:mm:ss A',
734 LT: 'h:mm A',
735 L: 'MM/DD/YYYY',
736 LL: 'MMMM D, YYYY',
737 LLL: 'MMMM D, YYYY h:mm A',
738 LLLL: 'dddd, MMMM D, YYYY h:mm A'
739};
740const defaultOrdinal = '%d';
741const defaultDayOfMonthOrdinalParse = /\d{1,2}/;
742const defaultMonthsShortRegex = matchWord;
743const defaultMonthsRegex = matchWord;
744class Locale {
745 constructor(config) {
746 if (config) {
747 this.set(config);
748 }
749 }
750 set(config) {
751 let confKey;
752 for (confKey in config) {
753 // eslint-disable-next-line no-prototype-builtins
754 if (!config.hasOwnProperty(confKey)) {
755 continue;
756 }
757 const prop = config[confKey];
758 const key = (isFunction(prop) ? confKey : `_${confKey}`);
759 this[key] = prop;
760 }
761 this._config = config;
762 }
763 calendar(key, date, now) {
764 const output = this._calendar[key] || this._calendar.sameElse;
765 return isFunction(output) ? output.call(null, date, now) : output;
766 }
767 longDateFormat(key) {
768 const format = this._longDateFormat[key];
769 const formatUpper = this._longDateFormat[key.toUpperCase()];
770 if (format || !formatUpper) {
771 return format;
772 }
773 this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
774 return val.slice(1);
775 });
776 return this._longDateFormat[key];
777 }
778 get invalidDate() {
779 return this._invalidDate;
780 }
781 set invalidDate(val) {
782 this._invalidDate = val;
783 }
784 ordinal(num, token) {
785 return this._ordinal.replace('%d', num.toString(10));
786 }
787 preparse(str, format) {
788 return str;
789 }
790 getFullYear(date, isUTC = false) {
791 return getFullYear(date, isUTC);
792 }
793 postformat(str) {
794 return str;
795 }
796 relativeTime(num, withoutSuffix, str, isFuture) {
797 const output = this._relativeTime[str];
798 return (isFunction(output)) ?
799 output(num, withoutSuffix, str, isFuture) :
800 output.replace(/%d/i, num.toString(10));
801 }
802 pastFuture(diff, output) {
803 const format = this._relativeTime[diff > 0 ? 'future' : 'past'];
804 return isFunction(format) ? format(output) : format.replace(/%s/i, output);
805 }
806 months(date, format, isUTC = false) {
807 if (!date) {
808 return isArray(this._months)
809 ? this._months
810 : this._months.standalone;
811 }
812 if (isArray(this._months)) {
813 return this._months[getMonth(date, isUTC)];
814 }
815 const key = (this._months.isFormat || MONTHS_IN_FORMAT).test(format)
816 ? 'format'
817 : 'standalone';
818 return this._months[key][getMonth(date, isUTC)];
819 }
820 monthsShort(date, format, isUTC = false) {
821 if (!date) {
822 return isArray(this._monthsShort)
823 ? this._monthsShort
824 : this._monthsShort.standalone;
825 }
826 if (isArray(this._monthsShort)) {
827 return this._monthsShort[getMonth(date, isUTC)];
828 }
829 const key = MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone';
830 return this._monthsShort[key][getMonth(date, isUTC)];
831 }
832 monthsParse(monthName, format, strict) {
833 let date;
834 let regex;
835 if (this._monthsParseExact) {
836 return this.handleMonthStrictParse(monthName, format, strict);
837 }
838 if (!this._monthsParse) {
839 this._monthsParse = [];
840 this._longMonthsParse = [];
841 this._shortMonthsParse = [];
842 }
843 // TODO: add sorting
844 // Sorting makes sure if one month (or abbr) is a prefix of another
845 // see sorting in computeMonthsParse
846 let i;
847 for (i = 0; i < 12; i++) {
848 // make the regex if we don't have it already
849 date = new Date(Date.UTC(2000, i));
850 if (strict && !this._longMonthsParse[i]) {
851 const _months = this.months(date, '', true).replace('.', '');
852 const _shortMonths = this.monthsShort(date, '', true).replace('.', '');
853 this._longMonthsParse[i] = new RegExp(`^${_months}$`, 'i');
854 this._shortMonthsParse[i] = new RegExp(`^${_shortMonths}$`, 'i');
855 }
856 if (!strict && !this._monthsParse[i]) {
857 regex = `^${this.months(date, '', true)}|^${this.monthsShort(date, '', true)}`;
858 this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
859 }
860 // testing the regex
861 if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
862 return i;
863 }
864 if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
865 return i;
866 }
867 if (!strict && this._monthsParse[i].test(monthName)) {
868 return i;
869 }
870 }
871 }
872 monthsRegex(isStrict) {
873 if (this._monthsParseExact) {
874 if (!hasOwnProp(this, '_monthsRegex')) {
875 this.computeMonthsParse();
876 }
877 if (isStrict) {
878 return this._monthsStrictRegex;
879 }
880 return this._monthsRegex;
881 }
882 if (!hasOwnProp(this, '_monthsRegex')) {
883 this._monthsRegex = defaultMonthsRegex;
884 }
885 return this._monthsStrictRegex && isStrict ?
886 this._monthsStrictRegex : this._monthsRegex;
887 }
888 monthsShortRegex(isStrict) {
889 if (this._monthsParseExact) {
890 if (!hasOwnProp(this, '_monthsRegex')) {
891 this.computeMonthsParse();
892 }
893 if (isStrict) {
894 return this._monthsShortStrictRegex;
895 }
896 return this._monthsShortRegex;
897 }
898 if (!hasOwnProp(this, '_monthsShortRegex')) {
899 this._monthsShortRegex = defaultMonthsShortRegex;
900 }
901 return this._monthsShortStrictRegex && isStrict ?
902 this._monthsShortStrictRegex : this._monthsShortRegex;
903 }
904 /** Week */
905 week(date, isUTC) {
906 return weekOfYear(date, this._week.dow, this._week.doy, isUTC).week;
907 }
908 firstDayOfWeek() {
909 return this._week.dow;
910 }
911 firstDayOfYear() {
912 return this._week.doy;
913 }
914 weekdays(date, format, isUTC) {
915 if (!date) {
916 return isArray(this._weekdays)
917 ? this._weekdays
918 : this._weekdays.standalone;
919 }
920 if (isArray(this._weekdays)) {
921 return this._weekdays[getDay(date, isUTC)];
922 }
923 const _key = this._weekdays.isFormat.test(format)
924 ? 'format'
925 : 'standalone';
926 return this._weekdays[_key][getDay(date, isUTC)];
927 }
928 weekdaysMin(date, format, isUTC) {
929 return date ? this._weekdaysMin[getDay(date, isUTC)] : this._weekdaysMin;
930 }
931 weekdaysShort(date, format, isUTC) {
932 return date ? this._weekdaysShort[getDay(date, isUTC)] : this._weekdaysShort;
933 }
934 // proto.weekdaysParse = localeWeekdaysParse;
935 weekdaysParse(weekdayName, format, strict) {
936 let i;
937 let regex;
938 if (this._weekdaysParseExact) {
939 return this.handleWeekStrictParse(weekdayName, format, strict);
940 }
941 if (!this._weekdaysParse) {
942 this._weekdaysParse = [];
943 this._minWeekdaysParse = [];
944 this._shortWeekdaysParse = [];
945 this._fullWeekdaysParse = [];
946 }
947 for (i = 0; i < 7; i++) {
948 // make the regex if we don't have it already
949 // fix: here is the issue
950 const date = setDayOfWeek(new Date(Date.UTC(2000, 1)), i, null, true);
951 if (strict && !this._fullWeekdaysParse[i]) {
952 this._fullWeekdaysParse[i] = new RegExp(`^${this.weekdays(date, '', true).replace('.', '\.?')}$`, 'i');
953 this._shortWeekdaysParse[i] = new RegExp(`^${this.weekdaysShort(date, '', true).replace('.', '\.?')}$`, 'i');
954 this._minWeekdaysParse[i] = new RegExp(`^${this.weekdaysMin(date, '', true).replace('.', '\.?')}$`, 'i');
955 }
956 if (!this._weekdaysParse[i]) {
957 regex = `^${this.weekdays(date, '', true)}|^${this.weekdaysShort(date, '', true)}|^${this.weekdaysMin(date, '', true)}`;
958 this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
959 }
960 if (!isArray(this._fullWeekdaysParse)
961 || !isArray(this._shortWeekdaysParse)
962 || !isArray(this._minWeekdaysParse)
963 || !isArray(this._weekdaysParse)) {
964 return;
965 }
966 // testing the regex
967 if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
968 return i;
969 }
970 else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
971 return i;
972 }
973 else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
974 return i;
975 }
976 else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
977 return i;
978 }
979 }
980 }
981 // proto.weekdaysRegex = weekdaysRegex;
982 weekdaysRegex(isStrict) {
983 if (this._weekdaysParseExact) {
984 if (!hasOwnProp(this, '_weekdaysRegex')) {
985 this.computeWeekdaysParse();
986 }
987 if (isStrict) {
988 return this._weekdaysStrictRegex;
989 }
990 else {
991 return this._weekdaysRegex;
992 }
993 }
994 else {
995 if (!hasOwnProp(this, '_weekdaysRegex')) {
996 this._weekdaysRegex = matchWord;
997 }
998 return this._weekdaysStrictRegex && isStrict ?
999 this._weekdaysStrictRegex : this._weekdaysRegex;
1000 }
1001 }
1002 // proto.weekdaysShortRegex = weekdaysShortRegex;
1003 // proto.weekdaysMinRegex = weekdaysMinRegex;
1004 weekdaysShortRegex(isStrict) {
1005 if (this._weekdaysParseExact) {
1006 if (!hasOwnProp(this, '_weekdaysRegex')) {
1007 this.computeWeekdaysParse();
1008 }
1009 if (isStrict) {
1010 return this._weekdaysShortStrictRegex;
1011 }
1012 else {
1013 return this._weekdaysShortRegex;
1014 }
1015 }
1016 else {
1017 if (!hasOwnProp(this, '_weekdaysShortRegex')) {
1018 this._weekdaysShortRegex = matchWord;
1019 }
1020 return this._weekdaysShortStrictRegex && isStrict ?
1021 this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
1022 }
1023 }
1024 weekdaysMinRegex(isStrict) {
1025 if (this._weekdaysParseExact) {
1026 if (!hasOwnProp(this, '_weekdaysRegex')) {
1027 this.computeWeekdaysParse();
1028 }
1029 if (isStrict) {
1030 return this._weekdaysMinStrictRegex;
1031 }
1032 else {
1033 return this._weekdaysMinRegex;
1034 }
1035 }
1036 else {
1037 if (!hasOwnProp(this, '_weekdaysMinRegex')) {
1038 this._weekdaysMinRegex = matchWord;
1039 }
1040 return this._weekdaysMinStrictRegex && isStrict ?
1041 this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
1042 }
1043 }
1044 isPM(input) {
1045 // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
1046 // Using charAt should be more compatible.
1047 return input.toLowerCase().charAt(0) === 'p';
1048 }
1049 meridiem(hours, minutes, isLower) {
1050 if (hours > 11) {
1051 return isLower ? 'pm' : 'PM';
1052 }
1053 return isLower ? 'am' : 'AM';
1054 }
1055 formatLongDate(key) {
1056 this._longDateFormat = this._longDateFormat ? this._longDateFormat : defaultLongDateFormat;
1057 const format = this._longDateFormat[key];
1058 const formatUpper = this._longDateFormat[key.toUpperCase()];
1059 if (format || !formatUpper) {
1060 return format;
1061 }
1062 this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, (val) => {
1063 return val.slice(1);
1064 });
1065 return this._longDateFormat[key];
1066 }
1067 handleMonthStrictParse(monthName, format, strict) {
1068 const llc = monthName.toLocaleLowerCase();
1069 let i;
1070 let ii;
1071 let mom;
1072 if (!this._monthsParse) {
1073 // this is not used
1074 this._monthsParse = [];
1075 this._longMonthsParse = [];
1076 this._shortMonthsParse = [];
1077 for (i = 0; i < 12; ++i) {
1078 mom = new Date(2000, i);
1079 this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
1080 this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
1081 }
1082 }
1083 if (strict) {
1084 if (format === 'MMM') {
1085 ii = this._shortMonthsParse.indexOf(llc);
1086 return ii !== -1 ? ii : null;
1087 }
1088 ii = this._longMonthsParse.indexOf(llc);
1089 return ii !== -1 ? ii : null;
1090 }
1091 if (format === 'MMM') {
1092 ii = this._shortMonthsParse.indexOf(llc);
1093 if (ii !== -1) {
1094 return ii;
1095 }
1096 ii = this._longMonthsParse.indexOf(llc);
1097 return ii !== -1 ? ii : null;
1098 }
1099 ii = this._longMonthsParse.indexOf(llc);
1100 if (ii !== -1) {
1101 return ii;
1102 }
1103 ii = this._shortMonthsParse.indexOf(llc);
1104 return ii !== -1 ? ii : null;
1105 }
1106 handleWeekStrictParse(weekdayName, format, strict) {
1107 let ii;
1108 const llc = weekdayName.toLocaleLowerCase();
1109 if (!this._weekdaysParse) {
1110 this._weekdaysParse = [];
1111 this._shortWeekdaysParse = [];
1112 this._minWeekdaysParse = [];
1113 let i;
1114 for (i = 0; i < 7; ++i) {
1115 const date = setDayOfWeek(new Date(Date.UTC(2000, 1)), i, null, true);
1116 this._minWeekdaysParse[i] = this.weekdaysMin(date).toLocaleLowerCase();
1117 this._shortWeekdaysParse[i] = this.weekdaysShort(date).toLocaleLowerCase();
1118 this._weekdaysParse[i] = this.weekdays(date, '').toLocaleLowerCase();
1119 }
1120 }
1121 if (!isArray(this._weekdaysParse)
1122 || !isArray(this._shortWeekdaysParse)
1123 || !isArray(this._minWeekdaysParse)) {
1124 return;
1125 }
1126 if (strict) {
1127 if (format === 'dddd') {
1128 ii = this._weekdaysParse.indexOf(llc);
1129 return ii !== -1 ? ii : null;
1130 }
1131 else if (format === 'ddd') {
1132 ii = this._shortWeekdaysParse.indexOf(llc);
1133 return ii !== -1 ? ii : null;
1134 }
1135 else {
1136 ii = this._minWeekdaysParse.indexOf(llc);
1137 return ii !== -1 ? ii : null;
1138 }
1139 }
1140 else {
1141 if (format === 'dddd') {
1142 ii = this._weekdaysParse.indexOf(llc);
1143 if (ii !== -1) {
1144 return ii;
1145 }
1146 ii = this._shortWeekdaysParse.indexOf(llc);
1147 if (ii !== -1) {
1148 return ii;
1149 }
1150 ii = this._minWeekdaysParse.indexOf(llc);
1151 return ii !== -1 ? ii : null;
1152 }
1153 else if (format === 'ddd') {
1154 ii = this._shortWeekdaysParse.indexOf(llc);
1155 if (ii !== -1) {
1156 return ii;
1157 }
1158 ii = this._weekdaysParse.indexOf(llc);
1159 if (ii !== -1) {
1160 return ii;
1161 }
1162 ii = this._minWeekdaysParse.indexOf(llc);
1163 return ii !== -1 ? ii : null;
1164 }
1165 else {
1166 ii = this._minWeekdaysParse.indexOf(llc);
1167 if (ii !== -1) {
1168 return ii;
1169 }
1170 ii = this._weekdaysParse.indexOf(llc);
1171 if (ii !== -1) {
1172 return ii;
1173 }
1174 ii = this._shortWeekdaysParse.indexOf(llc);
1175 return ii !== -1 ? ii : null;
1176 }
1177 }
1178 }
1179 computeMonthsParse() {
1180 const shortPieces = [];
1181 const longPieces = [];
1182 const mixedPieces = [];
1183 let date;
1184 let i;
1185 for (i = 0; i < 12; i++) {
1186 // make the regex if we don't have it already
1187 date = new Date(2000, i);
1188 shortPieces.push(this.monthsShort(date, ''));
1189 longPieces.push(this.months(date, ''));
1190 mixedPieces.push(this.months(date, ''));
1191 mixedPieces.push(this.monthsShort(date, ''));
1192 }
1193 // Sorting makes sure if one month (or abbr) is a prefix of another it
1194 // will match the longer piece.
1195 shortPieces.sort(cmpLenRev);
1196 longPieces.sort(cmpLenRev);
1197 mixedPieces.sort(cmpLenRev);
1198 for (i = 0; i < 12; i++) {
1199 shortPieces[i] = regexEscape(shortPieces[i]);
1200 longPieces[i] = regexEscape(longPieces[i]);
1201 }
1202 for (i = 0; i < 24; i++) {
1203 mixedPieces[i] = regexEscape(mixedPieces[i]);
1204 }
1205 this._monthsRegex = new RegExp(`^(${mixedPieces.join('|')})`, 'i');
1206 this._monthsShortRegex = this._monthsRegex;
1207 this._monthsStrictRegex = new RegExp(`^(${longPieces.join('|')})`, 'i');
1208 this._monthsShortStrictRegex = new RegExp(`^(${shortPieces.join('|')})`, 'i');
1209 }
1210 computeWeekdaysParse() {
1211 const minPieces = [];
1212 const shortPieces = [];
1213 const longPieces = [];
1214 const mixedPieces = [];
1215 let i;
1216 for (i = 0; i < 7; i++) {
1217 // make the regex if we don't have it already
1218 // let mom = createUTC([2000, 1]).day(i);
1219 const date = setDayOfWeek(new Date(Date.UTC(2000, 1)), i, null, true);
1220 const minp = this.weekdaysMin(date);
1221 const shortp = this.weekdaysShort(date);
1222 const longp = this.weekdays(date);
1223 minPieces.push(minp);
1224 shortPieces.push(shortp);
1225 longPieces.push(longp);
1226 mixedPieces.push(minp);
1227 mixedPieces.push(shortp);
1228 mixedPieces.push(longp);
1229 }
1230 // Sorting makes sure if one weekday (or abbr) is a prefix of another it
1231 // will match the longer piece.
1232 minPieces.sort(cmpLenRev);
1233 shortPieces.sort(cmpLenRev);
1234 longPieces.sort(cmpLenRev);
1235 mixedPieces.sort(cmpLenRev);
1236 for (i = 0; i < 7; i++) {
1237 shortPieces[i] = regexEscape(shortPieces[i]);
1238 longPieces[i] = regexEscape(longPieces[i]);
1239 mixedPieces[i] = regexEscape(mixedPieces[i]);
1240 }
1241 this._weekdaysRegex = new RegExp(`^(${mixedPieces.join('|')})`, 'i');
1242 this._weekdaysShortRegex = this._weekdaysRegex;
1243 this._weekdaysMinRegex = this._weekdaysRegex;
1244 this._weekdaysStrictRegex = new RegExp(`^(${longPieces.join('|')})`, 'i');
1245 this._weekdaysShortStrictRegex = new RegExp(`^(${shortPieces.join('|')})`, 'i');
1246 this._weekdaysMinStrictRegex = new RegExp(`^(${minPieces.join('|')})`, 'i');
1247 }
1248}
1249function cmpLenRev(a, b) {
1250 return b.length - a.length;
1251}
1252
1253const defaultCalendar = {
1254 sameDay: '[Today at] LT',
1255 nextDay: '[Tomorrow at] LT',
1256 nextWeek: 'dddd [at] LT',
1257 lastDay: '[Yesterday at] LT',
1258 lastWeek: '[Last] dddd [at] LT',
1259 sameElse: 'L'
1260};
1261
1262const defaultInvalidDate = 'Invalid date';
1263const defaultLocaleWeek = {
1264 dow: 0,
1265 doy: 6 // The week that contains Jan 1st is the first week of the year.
1266};
1267const defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
1268const defaultRelativeTime = {
1269 future: 'in %s',
1270 past: '%s ago',
1271 s: 'a few seconds',
1272 ss: '%d seconds',
1273 m: 'a minute',
1274 mm: '%d minutes',
1275 h: 'an hour',
1276 hh: '%d hours',
1277 d: 'a day',
1278 dd: '%d days',
1279 M: 'a month',
1280 MM: '%d months',
1281 y: 'a year',
1282 yy: '%d years'
1283};
1284const baseConfig = {
1285 calendar: defaultCalendar,
1286 longDateFormat: defaultLongDateFormat,
1287 invalidDate: defaultInvalidDate,
1288 ordinal: defaultOrdinal,
1289 dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
1290 relativeTime: defaultRelativeTime,
1291 months: defaultLocaleMonths,
1292 monthsShort: defaultLocaleMonthsShort,
1293 week: defaultLocaleWeek,
1294 weekdays: defaultLocaleWeekdays,
1295 weekdaysMin: defaultLocaleWeekdaysMin,
1296 weekdaysShort: defaultLocaleWeekdaysShort,
1297 meridiemParse: defaultLocaleMeridiemParse
1298};
1299
1300// compare two arrays, return the number of differences
1301function compareArrays(array1, array2, dontConvert) {
1302 const len = Math.min(array1.length, array2.length);
1303 const lengthDiff = Math.abs(array1.length - array2.length);
1304 let diffs = 0;
1305 let i;
1306 for (i = 0; i < len; i++) {
1307 if ((dontConvert && array1[i] !== array2[i])
1308 || (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
1309 diffs++;
1310 }
1311 }
1312 return diffs + lengthDiff;
1313}
1314
1315// FORMATTING
1316function initWeek() {
1317 addFormatToken('w', ['ww', 2, false], 'wo', function (date, opts) {
1318 return getWeek(date, opts.locale)
1319 .toString(10);
1320 });
1321 addFormatToken('W', ['WW', 2, false], 'Wo', function (date) {
1322 return getISOWeek(date)
1323 .toString(10);
1324 });
1325 // ALIASES
1326 addUnitAlias('week', 'w');
1327 addUnitAlias('isoWeek', 'W');
1328 // PRIORITIES
1329 addUnitPriority('week', 5);
1330 addUnitPriority('isoWeek', 5);
1331 // PARSING
1332 addRegexToken('w', match1to2);
1333 addRegexToken('ww', match1to2, match2);
1334 addRegexToken('W', match1to2);
1335 addRegexToken('WW', match1to2, match2);
1336 addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
1337 week[token.substr(0, 1)] = toInt(input);
1338 return config;
1339 });
1340 // export function getSetWeek (input) {
1341 // var week = this.localeData().week(this);
1342 // return input == null ? week : this.add((input - week) * 7, 'd');
1343 // }
1344}
1345function setWeek(date, input, locale = getLocale()) {
1346 const week = getWeek(date, locale);
1347 return add(date, (input - week) * 7, 'day');
1348}
1349function getWeek(date, locale = getLocale(), isUTC) {
1350 return locale.week(date, isUTC);
1351}
1352// export function getSetISOWeek (input) {
1353// var week = weekOfYear(this, 1, 4).week;
1354// return input == null ? week : this.add((input - week) * 7, 'd');
1355// }
1356function setISOWeek(date, input) {
1357 const week = getISOWeek(date);
1358 return add(date, (input - week) * 7, 'day');
1359}
1360function getISOWeek(date, isUTC) {
1361 return weekOfYear(date, 1, 4, isUTC).week;
1362}
1363
1364// FORMATTING
1365function initWeekYear() {
1366 addFormatToken(null, ['gg', 2, false], null, function (date, opts) {
1367 // return this.weekYear() % 100;
1368 return (getWeekYear(date, opts.locale) % 100).toString();
1369 });
1370 addFormatToken(null, ['GG', 2, false], null, function (date) {
1371 // return this.isoWeekYear() % 100;
1372 return (getISOWeekYear(date) % 100).toString();
1373 });
1374 addWeekYearFormatToken('gggg', _getWeekYearFormatCb);
1375 addWeekYearFormatToken('ggggg', _getWeekYearFormatCb);
1376 addWeekYearFormatToken('GGGG', _getISOWeekYearFormatCb);
1377 addWeekYearFormatToken('GGGGG', _getISOWeekYearFormatCb);
1378 // ALIASES
1379 addUnitAlias('weekYear', 'gg');
1380 addUnitAlias('isoWeekYear', 'GG');
1381 // PRIORITY
1382 addUnitPriority('weekYear', 1);
1383 addUnitPriority('isoWeekYear', 1);
1384 // PARSING
1385 addRegexToken('G', matchSigned);
1386 addRegexToken('g', matchSigned);
1387 addRegexToken('GG', match1to2, match2);
1388 addRegexToken('gg', match1to2, match2);
1389 addRegexToken('GGGG', match1to4, match4);
1390 addRegexToken('gggg', match1to4, match4);
1391 addRegexToken('GGGGG', match1to6, match6);
1392 addRegexToken('ggggg', match1to6, match6);
1393 addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
1394 week[token.substr(0, 2)] = toInt(input);
1395 return config;
1396 });
1397 addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
1398 week[token] = parseTwoDigitYear(input);
1399 return config;
1400 });
1401}
1402function addWeekYearFormatToken(token, getter) {
1403 addFormatToken(null, [token, token.length, false], null, getter);
1404}
1405function _getWeekYearFormatCb(date, opts) {
1406 return getWeekYear(date, opts.locale).toString();
1407}
1408function _getISOWeekYearFormatCb(date) {
1409 return getISOWeekYear(date).toString();
1410}
1411// MOMENTS
1412function getSetWeekYear(date, input, locale = getLocale(), isUTC) {
1413 return getSetWeekYearHelper(date, input,
1414 // this.week(),
1415 getWeek(date, locale, isUTC),
1416 // this.weekday(),
1417 getLocaleDayOfWeek(date, locale, isUTC), locale.firstDayOfWeek(), locale.firstDayOfYear(), isUTC);
1418}
1419function getWeekYear(date, locale = getLocale(), isUTC) {
1420 return weekOfYear(date, locale.firstDayOfWeek(), locale.firstDayOfYear(), isUTC).year;
1421}
1422function getSetISOWeekYear(date, input, isUTC) {
1423 return getSetWeekYearHelper(date, input, getISOWeek(date, isUTC), getISODayOfWeek(date, isUTC), 1, 4);
1424}
1425function getISOWeekYear(date, isUTC) {
1426 return weekOfYear(date, 1, 4, isUTC).year;
1427}
1428function getISOWeeksInYear(date, isUTC) {
1429 return weeksInYear(getFullYear(date, isUTC), 1, 4);
1430}
1431function getWeeksInYear(date, isUTC, locale = getLocale()) {
1432 return weeksInYear(getFullYear(date, isUTC), locale.firstDayOfWeek(), locale.firstDayOfYear());
1433}
1434function getSetWeekYearHelper(date, input, week, weekday, dow, doy, isUTC) {
1435 if (!input) {
1436 return getWeekYear(date, void 0, isUTC);
1437 }
1438 const weeksTarget = weeksInYear(input, dow, doy);
1439 const _week = week > weeksTarget ? weeksTarget : week;
1440 return setWeekAll(date, input, _week, weekday, dow, doy);
1441}
1442function setWeekAll(date, weekYear, week, weekday, dow, doy) {
1443 const dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
1444 const _date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
1445 setFullYear(date, getFullYear(_date, true), true);
1446 setMonth(date, getMonth(_date, true), true);
1447 setDate(date, getDate(_date, true), true);
1448 return date;
1449}
1450
1451// todo: add support for timezones
1452function initTimezone() {
1453 // FORMATTING
1454 addFormatToken('z', null, null, function (date, opts) {
1455 return opts.isUTC ? 'UTC' : '';
1456 });
1457 addFormatToken('zz', null, null, function (date, opts) {
1458 return opts.isUTC ? 'Coordinated Universal Time' : '';
1459 });
1460}
1461// MOMENTS
1462function getZoneAbbr(isUTC) {
1463 return isUTC ? 'UTC' : '';
1464}
1465function getZoneName(isUTC) {
1466 return isUTC ? 'Coordinated Universal Time' : '';
1467}
1468
1469function initTimestamp() {
1470 // FORMATTING
1471 addFormatToken('X', null, null, function (date) {
1472 return unix(date)
1473 .toString(10);
1474 });
1475 addFormatToken('x', null, null, function (date) {
1476 return date.valueOf()
1477 .toString(10);
1478 });
1479 // PARSING
1480 addRegexToken('x', matchSigned);
1481 addRegexToken('X', matchTimestamp);
1482 addParseToken('X', function (input, array, config) {
1483 config._d = new Date(parseFloat(input) * 1000);
1484 return config;
1485 });
1486 addParseToken('x', function (input, array, config) {
1487 config._d = new Date(toInt(input));
1488 return config;
1489 });
1490}
1491
1492function initSecond() {
1493 // FORMATTING
1494 addFormatToken('s', ['ss', 2, false], null, function (date, opts) {
1495 return getSeconds(date, opts.isUTC)
1496 .toString(10);
1497 });
1498 // ALIASES
1499 addUnitAlias('second', 's');
1500 // PRIORITY
1501 addUnitPriority('second', 15);
1502 // PARSING
1503 addRegexToken('s', match1to2);
1504 addRegexToken('ss', match1to2, match2);
1505 addParseToken(['s', 'ss'], SECOND);
1506}
1507
1508function initQuarter() {
1509 // FORMATTING
1510 addFormatToken('Q', null, 'Qo', function (date, opts) {
1511 return getQuarter(date, opts.isUTC)
1512 .toString(10);
1513 });
1514 // ALIASES
1515 addUnitAlias('quarter', 'Q');
1516 // PRIORITY
1517 addUnitPriority('quarter', 7);
1518 // PARSING
1519 addRegexToken('Q', match1);
1520 addParseToken('Q', function (input, array, config) {
1521 array[MONTH] = (toInt(input) - 1) * 3;
1522 return config;
1523 });
1524}
1525// MOMENTS
1526function getQuarter(date, isUTC = false) {
1527 return Math.ceil((getMonth(date, isUTC) + 1) / 3);
1528}
1529function setQuarter(date, quarter, isUTC) {
1530 return setMonth(date, (quarter - 1) * 3 + getMonth(date, isUTC) % 3, isUTC);
1531}
1532// export function getSetQuarter(input) {
1533// return input == null
1534// ? Math.ceil((this.month() + 1) / 3)
1535// : this.month((input - 1) * 3 + this.month() % 3);
1536// }
1537
1538// FORMATTING
1539function addOffsetFormatToken(token, separator) {
1540 addFormatToken(token, null, null, function (date, config) {
1541 let offset = getUTCOffset(date, { _isUTC: config.isUTC, _offset: config.offset });
1542 let sign = '+';
1543 if (offset < 0) {
1544 offset = -offset;
1545 sign = '-';
1546 }
1547 return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
1548 });
1549}
1550function initOffset() {
1551 addOffsetFormatToken('Z', ':');
1552 addOffsetFormatToken('ZZ', '');
1553 // PARSING
1554 addRegexToken('Z', matchShortOffset);
1555 addRegexToken('ZZ', matchShortOffset);
1556 addParseToken(['Z', 'ZZ'], function (input, array, config) {
1557 config._useUTC = true;
1558 config._tzm = offsetFromString(matchShortOffset, input);
1559 return config;
1560 });
1561}
1562// HELPERS
1563// timezone chunker
1564// '+10:00' > ['10', '00']
1565// '-1530' > ['-15', '30']
1566const chunkOffset = /([\+\-]|\d\d)/gi;
1567function offsetFromString(matcher, str) {
1568 const matches = (str || '').match(matcher);
1569 if (matches === null) {
1570 return null;
1571 }
1572 const chunk = matches[matches.length - 1];
1573 const parts = chunk.match(chunkOffset) || ['-', '0', '0'];
1574 const minutes = parseInt(parts[1], 10) * 60 + toInt(parts[2]);
1575 const _min = parts[0] === '+' ? minutes : -minutes;
1576 return minutes === 0 ? 0 : _min;
1577}
1578// Return a moment from input, that is local/utc/zone equivalent to model.
1579function cloneWithOffset(input, date, config = {}) {
1580 if (!config._isUTC) {
1581 return input;
1582 }
1583 const res = cloneDate(date);
1584 // todo: input._d - res._d + ((res._offset || 0) - (input._offset || 0))*60000
1585 const offsetDiff = (config._offset || 0) * 60000;
1586 const diff = input.valueOf() - res.valueOf() + offsetDiff;
1587 // Use low-level api, because this fn is low-level api.
1588 res.setTime(res.valueOf() + diff);
1589 // todo: add timezone handling
1590 // hooks.updateOffset(res, false);
1591 return res;
1592}
1593function getDateOffset(date) {
1594 // On Firefox.24 Date#getTimezoneOffset returns a floating point.
1595 // https://github.com/moment/moment/pull/1871
1596 return -Math.round(date.getTimezoneOffset() / 15) * 15;
1597}
1598// HOOKS
1599// This function will be called whenever a moment is mutated.
1600// It is intended to keep the offset in sync with the timezone.
1601// todo: it's from moment timezones
1602// hooks.updateOffset = function () {
1603// };
1604// MOMENTS
1605// keepLocalTime = true means only change the timezone, without
1606// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
1607// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
1608// +0200, so we adjust the time as needed, to be valid.
1609//
1610// Keeping the time actually adds/subtracts (one hour)
1611// from the actual represented time. That is why we call updateOffset
1612// a second time. In case it wants us to change the offset again
1613// _changeInProgress == true case, then we have to adjust, because
1614// there is no such time in the given timezone.
1615function getUTCOffset(date, config = {}) {
1616 const _offset = config._offset || 0;
1617 return config._isUTC ? _offset : getDateOffset(date);
1618}
1619function setUTCOffset(date, input, keepLocalTime, keepMinutes, config = {}) {
1620 const offset = config._offset || 0;
1621 let localAdjust;
1622 let _input = input;
1623 let _date = date;
1624 if (isString(_input)) {
1625 _input = offsetFromString(matchShortOffset, _input);
1626 if (_input === null) {
1627 return _date;
1628 }
1629 }
1630 else if (isNumber(_input) && Math.abs(_input) < 16 && !keepMinutes) {
1631 _input = _input * 60;
1632 }
1633 if (!config._isUTC && keepLocalTime) {
1634 localAdjust = getDateOffset(_date);
1635 }
1636 config._offset = _input;
1637 config._isUTC = true;
1638 if (localAdjust != null) {
1639 _date = add(_date, localAdjust, 'minutes');
1640 }
1641 if (offset !== _input) {
1642 if (!keepLocalTime || config._changeInProgress) {
1643 _date = add(_date, _input - offset, 'minutes', config._isUTC);
1644 // addSubtract(this, createDuration(_input - offset, 'm'), 1, false);
1645 }
1646 else if (!config._changeInProgress) {
1647 config._changeInProgress = true;
1648 // todo: add timezone handling
1649 // hooks.updateOffset(this, true);
1650 config._changeInProgress = null;
1651 }
1652 }
1653 return _date;
1654}
1655/*
1656export function getSetZone(input, keepLocalTime) {
1657 if (input != null) {
1658 if (typeof input !== 'string') {
1659 input = -input;
1660 }
1661
1662 this.utcOffset(input, keepLocalTime);
1663
1664 return this;
1665 } else {
1666 return -this.utcOffset();
1667 }
1668}
1669*/
1670function setOffsetToUTC(date, keepLocalTime) {
1671 return setUTCOffset(date, 0, keepLocalTime);
1672}
1673function isDaylightSavingTime(date) {
1674 return (getUTCOffset(date) > getUTCOffset(setMonth(cloneDate(date), 0))
1675 || getUTCOffset(date) > getUTCOffset(setMonth(cloneDate(date), 5)));
1676}
1677/*export function setOffsetToLocal(date: Date, isUTC?: boolean, keepLocalTime?: boolean) {
1678 if (this._isUTC) {
1679 this.utcOffset(0, keepLocalTime);
1680 this._isUTC = false;
1681
1682 if (keepLocalTime) {
1683 this.subtract(getDateOffset(this), 'm');
1684 }
1685 }
1686 return this;
1687}*/
1688function setOffsetToParsedOffset(date, input, config = {}) {
1689 if (config._tzm != null) {
1690 return setUTCOffset(date, config._tzm, false, true, config);
1691 }
1692 if (isString(input)) {
1693 const tZone = offsetFromString(matchOffset, input);
1694 if (tZone != null) {
1695 return setUTCOffset(date, tZone, false, false, config);
1696 }
1697 return setUTCOffset(date, 0, true, false, config);
1698 }
1699 return date;
1700}
1701function hasAlignedHourOffset(date, input) {
1702 const _input = input ? getUTCOffset(input, { _isUTC: false }) : 0;
1703 return (getUTCOffset(date) - _input) % 60 === 0;
1704}
1705// DEPRECATED
1706/*export function isDaylightSavingTimeShifted() {
1707 if (!isUndefined(this._isDSTShifted)) {
1708 return this._isDSTShifted;
1709 }
1710
1711 const c = {};
1712
1713 copyConfig(c, this);
1714 c = prepareConfig(c);
1715
1716 if (c._a) {
1717 const other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
1718 this._isDSTShifted = this.isValid() &&
1719 compareArrays(c._a, other.toArray()) > 0;
1720 } else {
1721 this._isDSTShifted = false;
1722 }
1723
1724 return this._isDSTShifted;
1725}*/
1726// in Khronos
1727/*export function isLocal() {
1728 return this.isValid() ? !this._isUTC : false;
1729}
1730
1731export function isUtcOffset() {
1732 return this.isValid() ? this._isUTC : false;
1733}
1734
1735export function isUtc() {
1736 return this.isValid() ? this._isUTC && this._offset === 0 : false;
1737}*/
1738
1739function initMinute() {
1740 // FORMATTING
1741 addFormatToken('m', ['mm', 2, false], null, function (date, opts) {
1742 return getMinutes(date, opts.isUTC)
1743 .toString(10);
1744 });
1745 // ALIASES
1746 addUnitAlias('minute', 'm');
1747 // PRIORITY
1748 addUnitPriority('minute', 14);
1749 // PARSING
1750 addRegexToken('m', match1to2);
1751 addRegexToken('mm', match1to2, match2);
1752 addParseToken(['m', 'mm'], MINUTE);
1753}
1754
1755// FORMATTING
1756function initMillisecond() {
1757 addFormatToken('S', null, null, function (date, opts) {
1758 return (~~(getMilliseconds(date, opts.isUTC) / 100)).toString(10);
1759 });
1760 addFormatToken(null, ['SS', 2, false], null, function (date, opts) {
1761 return (~~(getMilliseconds(date, opts.isUTC) / 10)).toString(10);
1762 });
1763 addFormatToken(null, ['SSS', 3, false], null, function (date, opts) {
1764 return (getMilliseconds(date, opts.isUTC)).toString(10);
1765 });
1766 addFormatToken(null, ['SSSS', 4, false], null, function (date, opts) {
1767 return (getMilliseconds(date, opts.isUTC) * 10).toString(10);
1768 });
1769 addFormatToken(null, ['SSSSS', 5, false], null, function (date, opts) {
1770 return (getMilliseconds(date, opts.isUTC) * 100).toString(10);
1771 });
1772 addFormatToken(null, ['SSSSSS', 6, false], null, function (date, opts) {
1773 return (getMilliseconds(date, opts.isUTC) * 1000).toString(10);
1774 });
1775 addFormatToken(null, ['SSSSSSS', 7, false], null, function (date, opts) {
1776 return (getMilliseconds(date, opts.isUTC) * 10000).toString(10);
1777 });
1778 addFormatToken(null, ['SSSSSSSS', 8, false], null, function (date, opts) {
1779 return (getMilliseconds(date, opts.isUTC) * 100000).toString(10);
1780 });
1781 addFormatToken(null, ['SSSSSSSSS', 9, false], null, function (date, opts) {
1782 return (getMilliseconds(date, opts.isUTC) * 1000000).toString(10);
1783 });
1784 // ALIASES
1785 addUnitAlias('millisecond', 'ms');
1786 // PRIORITY
1787 addUnitPriority('millisecond', 16);
1788 // PARSING
1789 addRegexToken('S', match1to3, match1);
1790 addRegexToken('SS', match1to3, match2);
1791 addRegexToken('SSS', match1to3, match3);
1792 let token;
1793 for (token = 'SSSS'; token.length <= 9; token += 'S') {
1794 addRegexToken(token, matchUnsigned);
1795 }
1796 function parseMs(input, array, config) {
1797 array[MILLISECOND] = toInt(parseFloat(`0.${input}`) * 1000);
1798 return config;
1799 }
1800 for (token = 'S'; token.length <= 9; token += 'S') {
1801 addParseToken(token, parseMs);
1802 }
1803 // MOMENTS
1804}
1805
1806function initHour() {
1807 // FORMATTING
1808 function hFormat(date, isUTC) {
1809 return getHours(date, isUTC) % 12 || 12;
1810 }
1811 function kFormat(date, isUTC) {
1812 return getHours(date, isUTC) || 24;
1813 }
1814 addFormatToken('H', ['HH', 2, false], null, function (date, opts) {
1815 return getHours(date, opts.isUTC)
1816 .toString(10);
1817 });
1818 addFormatToken('h', ['hh', 2, false], null, function (date, opts) {
1819 return hFormat(date, opts.isUTC)
1820 .toString(10);
1821 });
1822 addFormatToken('k', ['kk', 2, false], null, function (date, opts) {
1823 return kFormat(date, opts.isUTC)
1824 .toString(10);
1825 });
1826 addFormatToken('hmm', null, null, function (date, opts) {
1827 const _h = hFormat(date, opts.isUTC);
1828 const _mm = zeroFill(getMinutes(date, opts.isUTC), 2);
1829 return `${_h}${_mm}`;
1830 });
1831 addFormatToken('hmmss', null, null, function (date, opts) {
1832 const _h = hFormat(date, opts.isUTC);
1833 const _mm = zeroFill(getMinutes(date, opts.isUTC), 2);
1834 const _ss = zeroFill(getSeconds(date, opts.isUTC), 2);
1835 return `${_h}${_mm}${_ss}`;
1836 });
1837 addFormatToken('Hmm', null, null, function (date, opts) {
1838 const _H = getHours(date, opts.isUTC);
1839 const _mm = zeroFill(getMinutes(date, opts.isUTC), 2);
1840 return `${_H}${_mm}`;
1841 });
1842 addFormatToken('Hmmss', null, null, function (date, opts) {
1843 const _H = getHours(date, opts.isUTC);
1844 const _mm = zeroFill(getMinutes(date, opts.isUTC), 2);
1845 const _ss = zeroFill(getSeconds(date, opts.isUTC), 2);
1846 return `${_H}${_mm}${_ss}`;
1847 });
1848 function meridiem(token, lowercase) {
1849 addFormatToken(token, null, null, function (date, opts) {
1850 return opts.locale.meridiem(getHours(date, opts.isUTC), getMinutes(date, opts.isUTC), lowercase);
1851 });
1852 }
1853 meridiem('a', true);
1854 meridiem('A', false);
1855 // ALIASES
1856 addUnitAlias('hour', 'h');
1857 // PRIORITY
1858 addUnitPriority('hour', 13);
1859 // PARSING
1860 function matchMeridiem(isStrict, locale) {
1861 return locale._meridiemParse;
1862 }
1863 addRegexToken('a', matchMeridiem);
1864 addRegexToken('A', matchMeridiem);
1865 addRegexToken('H', match1to2);
1866 addRegexToken('h', match1to2);
1867 addRegexToken('k', match1to2);
1868 addRegexToken('HH', match1to2, match2);
1869 addRegexToken('hh', match1to2, match2);
1870 addRegexToken('kk', match1to2, match2);
1871 addRegexToken('hmm', match3to4);
1872 addRegexToken('hmmss', match5to6);
1873 addRegexToken('Hmm', match3to4);
1874 addRegexToken('Hmmss', match5to6);
1875 addParseToken(['H', 'HH'], HOUR);
1876 addParseToken(['k', 'kk'], function (input, array, config) {
1877 const kInput = toInt(input);
1878 array[HOUR] = kInput === 24 ? 0 : kInput;
1879 return config;
1880 });
1881 addParseToken(['a', 'A'], function (input, array, config) {
1882 config._isPm = config._locale.isPM(input);
1883 config._meridiem = input;
1884 return config;
1885 });
1886 addParseToken(['h', 'hh'], function (input, array, config) {
1887 array[HOUR] = toInt(input);
1888 getParsingFlags(config).bigHour = true;
1889 return config;
1890 });
1891 addParseToken('hmm', function (input, array, config) {
1892 const pos = input.length - 2;
1893 array[HOUR] = toInt(input.substr(0, pos));
1894 array[MINUTE] = toInt(input.substr(pos));
1895 getParsingFlags(config).bigHour = true;
1896 return config;
1897 });
1898 addParseToken('hmmss', function (input, array, config) {
1899 const pos1 = input.length - 4;
1900 const pos2 = input.length - 2;
1901 array[HOUR] = toInt(input.substr(0, pos1));
1902 array[MINUTE] = toInt(input.substr(pos1, 2));
1903 array[SECOND] = toInt(input.substr(pos2));
1904 getParsingFlags(config).bigHour = true;
1905 return config;
1906 });
1907 addParseToken('Hmm', function (input, array, config) {
1908 const pos = input.length - 2;
1909 array[HOUR] = toInt(input.substr(0, pos));
1910 array[MINUTE] = toInt(input.substr(pos));
1911 return config;
1912 });
1913 addParseToken('Hmmss', function (input, array, config) {
1914 const pos1 = input.length - 4;
1915 const pos2 = input.length - 2;
1916 array[HOUR] = toInt(input.substr(0, pos1));
1917 array[MINUTE] = toInt(input.substr(pos1, 2));
1918 array[SECOND] = toInt(input.substr(pos2));
1919 return config;
1920 });
1921}
1922
1923// internal storage for locale config files
1924const locales = {};
1925const localeFamilies = {};
1926let globalLocale;
1927function normalizeLocale(key) {
1928 return key ? key.toLowerCase().replace('_', '-') : key;
1929}
1930// pick the locale from the array
1931// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
1932// substring from most specific to least,
1933// but move to the next array item if it's a more specific variant than the current root
1934function chooseLocale(names) {
1935 let next;
1936 let locale;
1937 let i = 0;
1938 while (i < names.length) {
1939 const split = normalizeLocale(names[i]).split('-');
1940 let j = split.length;
1941 next = normalizeLocale(names[i + 1]);
1942 next = next ? next.split('-') : null;
1943 while (j > 0) {
1944 locale = loadLocale(split.slice(0, j).join('-'));
1945 if (locale) {
1946 return locale;
1947 }
1948 if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
1949 // the next array item is better than a shallower substring of this one
1950 break;
1951 }
1952 j--;
1953 }
1954 i++;
1955 }
1956 return null;
1957}
1958function mergeConfigs(parentConfig, childConfig) {
1959 const res = Object.assign({}, parentConfig);
1960 for (const childProp in childConfig) {
1961 if (!hasOwnProp(childConfig, childProp)) {
1962 continue;
1963 }
1964 if (isObject(parentConfig[childProp]) && isObject(childConfig[childProp])) {
1965 res[childProp] = {};
1966 Object.assign(res[childProp], parentConfig[childProp]);
1967 Object.assign(res[childProp], childConfig[childProp]);
1968 }
1969 else if (childConfig[childProp] != null) {
1970 res[childProp] = childConfig[childProp];
1971 }
1972 else {
1973 delete res[childProp];
1974 }
1975 }
1976 for (const parentProp in parentConfig) {
1977 if (hasOwnProp(parentConfig, parentProp) &&
1978 !hasOwnProp(childConfig, parentProp) &&
1979 isObject(parentConfig[parentProp])) {
1980 // make sure changes to properties don't modify parent config
1981 res[parentProp] = Object.assign({}, res[parentProp]);
1982 }
1983 }
1984 return res;
1985}
1986function loadLocale(name) {
1987 // no way!
1988 /* var oldLocale = null;
1989 // TODO: Find a better way to register and load all the locales in Node
1990 if (!locales[name] && (typeof module !== 'undefined') &&
1991 module && module.exports) {
1992 try {
1993 oldLocale = globalLocale._abbr;
1994 var aliasedRequire = require;
1995 aliasedRequire('./locale/' + name);
1996 getSetGlobalLocale(oldLocale);
1997 } catch (e) {}
1998 }*/
1999 if (!locales[name]) {
2000 console.error(`Khronos locale error: please load locale "${name}" before using it`);
2001 // throw new Error(`Khronos locale error: please load locale "${name}" before using it`);
2002 }
2003 return locales[name];
2004}
2005// This function will load locale and then set the global locale. If
2006// no arguments are passed in, it will simply return the current global
2007// locale key.
2008function getSetGlobalLocale(key, values) {
2009 let data;
2010 if (key) {
2011 if (isUndefined(values)) {
2012 data = getLocale(key);
2013 }
2014 else if (isString(key)) {
2015 data = defineLocale(key, values);
2016 }
2017 if (data) {
2018 globalLocale = data;
2019 }
2020 }
2021 return globalLocale && globalLocale._abbr;
2022}
2023function defineLocale(name, config) {
2024 if (config === null) {
2025 // useful for testing
2026 delete locales[name];
2027 globalLocale = getLocale('en');
2028 return null;
2029 }
2030 if (!config) {
2031 return;
2032 }
2033 let parentConfig = baseConfig;
2034 config.abbr = name;
2035 if (config.parentLocale != null) {
2036 if (locales[config.parentLocale] != null) {
2037 parentConfig = locales[config.parentLocale]._config;
2038 }
2039 else {
2040 if (!localeFamilies[config.parentLocale]) {
2041 localeFamilies[config.parentLocale] = [];
2042 }
2043 localeFamilies[config.parentLocale].push({ name, config });
2044 return null;
2045 }
2046 }
2047 locales[name] = new Locale(mergeConfigs(parentConfig, config));
2048 if (localeFamilies[name]) {
2049 localeFamilies[name].forEach(function (x) {
2050 defineLocale(x.name, x.config);
2051 });
2052 }
2053 // backwards compat for now: also set the locale
2054 // make sure we set the locale AFTER all child locales have been
2055 // created, so we won't end up with the child locale set.
2056 getSetGlobalLocale(name);
2057 return locales[name];
2058}
2059function updateLocale(name, config) {
2060 let _config = config;
2061 if (_config != null) {
2062 let parentConfig = baseConfig;
2063 // MERGE
2064 const tmpLocale = loadLocale(name);
2065 if (tmpLocale != null) {
2066 parentConfig = tmpLocale._config;
2067 }
2068 _config = mergeConfigs(parentConfig, _config);
2069 const locale = new Locale(_config);
2070 locale.parentLocale = locales[name];
2071 locales[name] = locale;
2072 // backwards compat for now: also set the locale
2073 getSetGlobalLocale(name);
2074 }
2075 else {
2076 // pass null for config to unupdate, useful for tests
2077 if (locales[name] != null) {
2078 if (locales[name].parentLocale != null) {
2079 locales[name] = locales[name].parentLocale;
2080 }
2081 else if (locales[name] != null) {
2082 delete locales[name];
2083 }
2084 }
2085 }
2086 return locales[name];
2087}
2088// returns locale data
2089function getLocale(key) {
2090 setDefaultLocale();
2091 if (!key) {
2092 return globalLocale;
2093 }
2094 // let locale;
2095 const _key = isArray(key) ? key : [key];
2096 return chooseLocale(_key);
2097}
2098function listLocales() {
2099 return Object.keys(locales);
2100}
2101function setDefaultLocale() {
2102 if (locales[`en`]) {
2103 return undefined;
2104 }
2105 getSetGlobalLocale('en', {
2106 dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
2107 ordinal(num) {
2108 const b = num % 10;
2109 const output = toInt((num % 100) / 10) === 1
2110 ? 'th'
2111 : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';
2112 return num + output;
2113 }
2114 });
2115 initWeek();
2116 initWeekYear();
2117 initYear();
2118 initTimezone();
2119 initTimestamp();
2120 initSecond();
2121 initQuarter();
2122 initOffset();
2123 initMonth();
2124 initMinute();
2125 initMillisecond();
2126 initHour();
2127 initDayOfYear();
2128 initDayOfWeek();
2129 initDayOfMonth();
2130}
2131
2132const ordering = ['year', 'quarter', 'month', 'week', 'day', 'hours', 'minutes', 'seconds', 'milliseconds'];
2133const ɵ0 = (mem, order) => {
2134 mem[order] = true;
2135 return mem;
2136};
2137const orderingHash = ordering.reduce(ɵ0, {});
2138function isDurationValid(duration) {
2139 const durationKeys = Object.keys(duration);
2140 if (durationKeys
2141 .some((key) => {
2142 return (key in orderingHash)
2143 && duration[key] === null
2144 || isNaN(duration[key]);
2145 })) {
2146 return false;
2147 }
2148 // for (let key in duration) {
2149 // if (!(indexOf.call(ordering, key) !== -1 && (duration[key] == null || !isNaN(duration[key])))) {
2150 // return false;
2151 // }
2152 // }
2153 let unitHasDecimal = false;
2154 for (let i = 0; i < ordering.length; ++i) {
2155 if (duration[ordering[i]]) {
2156 // only allow non-integers for smallest unit
2157 if (unitHasDecimal) {
2158 return false;
2159 }
2160 if (duration[ordering[i]] !== toInt(duration[ordering[i]])) {
2161 unitHasDecimal = true;
2162 }
2163 }
2164 }
2165 return true;
2166}
2167// export function isValid() {
2168// return this._isValid;
2169// }
2170//
2171// export function createInvalid(): Duration {
2172// return createDuration(NaN);
2173// }
2174
2175function absCeil(number) {
2176 return number < 0 ? Math.floor(number) : Math.ceil(number);
2177}
2178
2179function bubble(dur) {
2180 let milliseconds = dur._milliseconds;
2181 let days = dur._days;
2182 let months = dur._months;
2183 const data = dur._data;
2184 // if we have a mix of positive and negative values, bubble down first
2185 // check: https://github.com/moment/moment/issues/2166
2186 if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
2187 (milliseconds <= 0 && days <= 0 && months <= 0))) {
2188 milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
2189 days = 0;
2190 months = 0;
2191 }
2192 // The following code bubbles up values, see the tests for
2193 // examples of what that means.
2194 data.milliseconds = milliseconds % 1000;
2195 const seconds = absFloor(milliseconds / 1000);
2196 data.seconds = seconds % 60;
2197 const minutes = absFloor(seconds / 60);
2198 data.minutes = minutes % 60;
2199 const hours = absFloor(minutes / 60);
2200 data.hours = hours % 24;
2201 days += absFloor(hours / 24);
2202 // convert days to months
2203 const monthsFromDays = absFloor(daysToMonths(days));
2204 months += monthsFromDays;
2205 days -= absCeil(monthsToDays(monthsFromDays));
2206 // 12 months -> 1 year
2207 const years = absFloor(months / 12);
2208 months %= 12;
2209 data.day = days;
2210 data.month = months;
2211 data.year = years;
2212 return dur;
2213}
2214function daysToMonths(day) {
2215 // 400 years have 146097 days (taking into account leap year rules)
2216 // 400 years have 12 months === 4800
2217 return day * 4800 / 146097;
2218}
2219function monthsToDays(month) {
2220 // the reverse of daysToMonths
2221 return month * 146097 / 4800;
2222}
2223
2224let round = Math.round;
2225const thresholds = {
2226 ss: 44,
2227 s: 45,
2228 m: 45,
2229 h: 22,
2230 d: 26,
2231 M: 11 // months to year
2232};
2233// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
2234function substituteTimeAgo(str, num, withoutSuffix, isFuture, locale) {
2235 return locale.relativeTime(num || 1, !!withoutSuffix, str, isFuture);
2236}
2237function relativeTime(posNegDuration, withoutSuffix, locale) {
2238 const duration = createDuration(posNegDuration).abs();
2239 const seconds = round(duration.as('s'));
2240 const minutes = round(duration.as('m'));
2241 const hours = round(duration.as('h'));
2242 const days = round(duration.as('d'));
2243 const months = round(duration.as('M'));
2244 const years = round(duration.as('y'));
2245 const a = seconds <= thresholds.ss && ['s', seconds] ||
2246 seconds < thresholds.s && ['ss', seconds] ||
2247 minutes <= 1 && ['m'] ||
2248 minutes < thresholds.m && ['mm', minutes] ||
2249 hours <= 1 && ['h'] ||
2250 hours < thresholds.h && ['hh', hours] ||
2251 days <= 1 && ['d'] ||
2252 days < thresholds.d && ['dd', days] ||
2253 months <= 1 && ['M'] ||
2254 months < thresholds.M && ['MM', months] ||
2255 years <= 1 && ['y'] || ['yy', years];
2256 const b = [a[0], a[1], withoutSuffix, +posNegDuration > 0, locale];
2257 // a[2] = withoutSuffix;
2258 // a[3] = +posNegDuration > 0;
2259 // a[4] = locale;
2260 return substituteTimeAgo.apply(null, b);
2261}
2262// This function allows you to set the rounding function for relative time strings
2263function getSetRelativeTimeRounding(roundingFunction) {
2264 if (roundingFunction === undefined) {
2265 return round;
2266 }
2267 if (typeof (roundingFunction) === 'function') {
2268 round = roundingFunction;
2269 return true;
2270 }
2271 return false;
2272}
2273// This function allows you to set a threshold for relative time strings
2274function getSetRelativeTimeThreshold(threshold, limit) {
2275 if (thresholds[threshold] === undefined) {
2276 return false;
2277 }
2278 if (limit === undefined) {
2279 return thresholds[threshold];
2280 }
2281 thresholds[threshold] = limit;
2282 if (threshold === 's') {
2283 thresholds.ss = limit - 1;
2284 }
2285 return true;
2286}
2287// export function humanize(withSuffix) {
2288// if (!this.isValid()) {
2289// return this.localeData().invalidDate();
2290// }
2291//
2292// const locale = this.localeData();
2293// let output = relativeTime(this, !withSuffix, locale);
2294//
2295// if (withSuffix) {
2296// output = locale.pastFuture(+this, output);
2297// }
2298//
2299// return locale.postformat(output);
2300// }
2301
2302class Duration {
2303 constructor(duration, config = {}) {
2304 this._data = {};
2305 this._locale = getLocale();
2306 this._locale = config && config._locale || getLocale();
2307 // const normalizedInput = normalizeObjectUnits(duration);
2308 const normalizedInput = duration;
2309 const years = normalizedInput.year || 0;
2310 const quarters = normalizedInput.quarter || 0;
2311 const months = normalizedInput.month || 0;
2312 const weeks = normalizedInput.week || 0;
2313 const days = normalizedInput.day || 0;
2314 const hours = normalizedInput.hours || 0;
2315 const minutes = normalizedInput.minutes || 0;
2316 const seconds = normalizedInput.seconds || 0;
2317 const milliseconds = normalizedInput.milliseconds || 0;
2318 this._isValid = isDurationValid(normalizedInput);
2319 // representation for dateAddRemove
2320 this._milliseconds = +milliseconds +
2321 seconds * 1000 +
2322 minutes * 60 * 1000 + // 1000 * 60
2323 hours * 1000 * 60 * 60; // using 1000 * 60 * 60
2324 // instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
2325 // Because of dateAddRemove treats 24 hours as different from a
2326 // day when working around DST, we need to store them separately
2327 this._days = +days +
2328 weeks * 7;
2329 // It is impossible to translate months into days without knowing
2330 // which months you are are talking about, so we have to store
2331 // it separately.
2332 this._months = +months +
2333 quarters * 3 +
2334 years * 12;
2335 // this._data = {};
2336 // this._locale = getLocale();
2337 // this._bubble();
2338 return bubble(this);
2339 }
2340 isValid() {
2341 return this._isValid;
2342 }
2343 humanize(withSuffix) {
2344 // throw new Error(`TODO: implement`);
2345 if (!this.isValid()) {
2346 return this.localeData().invalidDate;
2347 }
2348 const locale = this.localeData();
2349 let output = relativeTime(this, !withSuffix, locale);
2350 if (withSuffix) {
2351 output = locale.pastFuture(+this, output);
2352 }
2353 return locale.postformat(output);
2354 }
2355 localeData() {
2356 return this._locale;
2357 }
2358 locale(localeKey) {
2359 if (!localeKey) {
2360 return this._locale._abbr;
2361 }
2362 this._locale = getLocale(localeKey) || this._locale;
2363 return this;
2364 }
2365 abs() {
2366 const mathAbs = Math.abs;
2367 const data = this._data;
2368 this._milliseconds = mathAbs(this._milliseconds);
2369 this._days = mathAbs(this._days);
2370 this._months = mathAbs(this._months);
2371 data.milliseconds = mathAbs(data.milliseconds);
2372 data.seconds = mathAbs(data.seconds);
2373 data.minutes = mathAbs(data.minutes);
2374 data.hours = mathAbs(data.hours);
2375 data.month = mathAbs(data.month);
2376 data.year = mathAbs(data.year);
2377 return this;
2378 }
2379 as(_units) {
2380 if (!this.isValid()) {
2381 return NaN;
2382 }
2383 let days;
2384 let months;
2385 const milliseconds = this._milliseconds;
2386 const units = normalizeUnits(_units);
2387 if (units === 'month' || units === 'year') {
2388 days = this._days + milliseconds / 864e5;
2389 months = this._months + daysToMonths(days);
2390 return units === 'month' ? months : months / 12;
2391 }
2392 // handle milliseconds separately because of floating point math errors (issue #1867)
2393 days = this._days + Math.round(monthsToDays(this._months));
2394 switch (units) {
2395 case 'week':
2396 return days / 7 + milliseconds / 6048e5;
2397 case 'day':
2398 return days + milliseconds / 864e5;
2399 case 'hours':
2400 return days * 24 + milliseconds / 36e5;
2401 case 'minutes':
2402 return days * 1440 + milliseconds / 6e4;
2403 case 'seconds':
2404 return days * 86400 + milliseconds / 1000;
2405 // Math.floor prevents floating point math errors here
2406 case 'milliseconds':
2407 return Math.floor(days * 864e5) + milliseconds;
2408 default:
2409 throw new Error(`Unknown unit ${units}`);
2410 }
2411 }
2412 valueOf() {
2413 if (!this.isValid()) {
2414 return NaN;
2415 }
2416 return (this._milliseconds +
2417 this._days * 864e5 +
2418 (this._months % 12) * 2592e6 +
2419 toInt(this._months / 12) * 31536e6);
2420 }
2421}
2422function isDuration(obj) {
2423 return obj instanceof Duration;
2424}
2425
2426function isValid(config) {
2427 if (config._isValid == null) {
2428 const flags = getParsingFlags(config);
2429 const parsedParts = Array.prototype.some.call(flags.parsedDateParts, function (i) {
2430 return i != null;
2431 });
2432 let isNowValid = !isNaN(config._d && config._d.getTime()) &&
2433 flags.overflow < 0 &&
2434 !flags.empty &&
2435 !flags.invalidMonth &&
2436 !flags.invalidWeekday &&
2437 !flags.weekdayMismatch &&
2438 !flags.nullInput &&
2439 !flags.invalidFormat &&
2440 !flags.userInvalidated &&
2441 (!flags.meridiem || (flags.meridiem && parsedParts));
2442 if (config._strict) {
2443 isNowValid = isNowValid &&
2444 flags.charsLeftOver === 0 &&
2445 flags.unusedTokens.length === 0 &&
2446 flags.bigHour === undefined;
2447 }
2448 if (Object.isFrozen == null || !Object.isFrozen(config)) {
2449 config._isValid = isNowValid;
2450 }
2451 else {
2452 return isNowValid;
2453 }
2454 }
2455 return config._isValid;
2456}
2457function createInvalid(config, flags) {
2458 config._d = new Date(NaN);
2459 Object.assign(getParsingFlags(config), flags || { userInvalidated: true });
2460 return config;
2461}
2462function markInvalid(config) {
2463 config._isValid = false;
2464 return config;
2465}
2466
2467// iso 8601 regex
2468// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
2469const extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
2470const basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
2471const tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
2472const isoDates = [
2473 ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/, true],
2474 ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/, true],
2475 ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/, true],
2476 ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
2477 ['YYYY-DDD', /\d{4}-\d{3}/, true],
2478 ['YYYY-MM', /\d{4}-\d\d/, false],
2479 ['YYYYYYMMDD', /[+-]\d{10}/, true],
2480 ['YYYYMMDD', /\d{8}/, true],
2481 // YYYYMM is NOT allowed by the standard
2482 ['GGGG[W]WWE', /\d{4}W\d{3}/, true],
2483 ['GGGG[W]WW', /\d{4}W\d{2}/, false],
2484 ['YYYYDDD', /\d{7}/, true]
2485];
2486// iso time formats and regexes
2487const isoTimes = [
2488 ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
2489 ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
2490 ['HH:mm:ss', /\d\d:\d\d:\d\d/],
2491 ['HH:mm', /\d\d:\d\d/],
2492 ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
2493 ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
2494 ['HHmmss', /\d\d\d\d\d\d/],
2495 ['HHmm', /\d\d\d\d/],
2496 ['HH', /\d\d/]
2497];
2498const aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
2499const obsOffsets = {
2500 UT: 0,
2501 GMT: 0,
2502 EDT: -4 * 60,
2503 EST: -5 * 60,
2504 CDT: -5 * 60,
2505 CST: -6 * 60,
2506 MDT: -6 * 60,
2507 MST: -7 * 60,
2508 PDT: -7 * 60,
2509 PST: -8 * 60
2510};
2511// RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
2512const rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;
2513// date from iso format
2514function configFromISO(config) {
2515 if (!isString(config._i)) {
2516 return config;
2517 }
2518 const input = config._i;
2519 const match = extendedIsoRegex.exec(input) || basicIsoRegex.exec(input);
2520 let allowTime;
2521 let dateFormat;
2522 let timeFormat;
2523 let tzFormat;
2524 if (!match) {
2525 config._isValid = false;
2526 return config;
2527 }
2528 // getParsingFlags(config).iso = true;
2529 let i;
2530 let l;
2531 for (i = 0, l = isoDates.length; i < l; i++) {
2532 if (isoDates[i][1].exec(match[1])) {
2533 dateFormat = isoDates[i][0];
2534 allowTime = isoDates[i][2] !== false;
2535 break;
2536 }
2537 }
2538 if (dateFormat == null) {
2539 config._isValid = false;
2540 return config;
2541 }
2542 if (match[3]) {
2543 for (i = 0, l = isoTimes.length; i < l; i++) {
2544 if (isoTimes[i][1].exec(match[3])) {
2545 // match[2] should be 'T' or space
2546 timeFormat = (match[2] || ' ') + isoTimes[i][0];
2547 break;
2548 }
2549 }
2550 if (timeFormat == null) {
2551 config._isValid = false;
2552 return config;
2553 }
2554 }
2555 if (!allowTime && timeFormat != null) {
2556 config._isValid = false;
2557 return config;
2558 }
2559 if (match[4]) {
2560 if (tzRegex.exec(match[4])) {
2561 tzFormat = 'Z';
2562 }
2563 else {
2564 config._isValid = false;
2565 return config;
2566 }
2567 }
2568 config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
2569 return configFromStringAndFormat(config);
2570}
2571function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
2572 const result = [
2573 untruncateYear(yearStr),
2574 defaultLocaleMonthsShort.indexOf(monthStr),
2575 parseInt(dayStr, 10),
2576 parseInt(hourStr, 10),
2577 parseInt(minuteStr, 10)
2578 ];
2579 if (secondStr) {
2580 result.push(parseInt(secondStr, 10));
2581 }
2582 return result;
2583}
2584function untruncateYear(yearStr) {
2585 const year = parseInt(yearStr, 10);
2586 return year <= 49 ? year + 2000 : year;
2587}
2588function preprocessRFC2822(str) {
2589 // Remove comments and folding whitespace and replace multiple-spaces with a single space
2590 return str
2591 .replace(/\([^)]*\)|[\n\t]/g, ' ')
2592 .replace(/(\s\s+)/g, ' ').trim();
2593}
2594function checkWeekday(weekdayStr, parsedInput, config) {
2595 if (weekdayStr) {
2596 // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.
2597 const weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr);
2598 const weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();
2599 if (weekdayProvided !== weekdayActual) {
2600 getParsingFlags(config).weekdayMismatch = true;
2601 config._isValid = false;
2602 return false;
2603 }
2604 }
2605 return true;
2606}
2607function calculateOffset(obsOffset, militaryOffset, numOffset) {
2608 if (obsOffset) {
2609 return obsOffsets[obsOffset];
2610 }
2611 else if (militaryOffset) {
2612 // the only allowed military tz is Z
2613 return 0;
2614 }
2615 else {
2616 const hm = parseInt(numOffset, 10);
2617 const m = hm % 100;
2618 const h = (hm - m) / 100;
2619 return h * 60 + m;
2620 }
2621}
2622// date and time from ref 2822 format
2623function configFromRFC2822(config) {
2624 if (!isString(config._i)) {
2625 return config;
2626 }
2627 const match = rfc2822.exec(preprocessRFC2822(config._i));
2628 if (!match) {
2629 return markInvalid(config);
2630 }
2631 const parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);
2632 if (!checkWeekday(match[1], parsedArray, config)) {
2633 return config;
2634 }
2635 config._a = parsedArray;
2636 config._tzm = calculateOffset(match[8], match[9], match[10]);
2637 config._d = createUTCDate.apply(null, config._a);
2638 config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
2639 getParsingFlags(config).rfc2822 = true;
2640 return config;
2641}
2642// date from iso format or fallback
2643function configFromString(config) {
2644 if (!isString(config._i)) {
2645 return config;
2646 }
2647 const matched = aspNetJsonRegex.exec(config._i);
2648 if (matched !== null) {
2649 config._d = new Date(+matched[1]);
2650 return config;
2651 }
2652 // todo: update logic processing
2653 // isISO -> configFromISO
2654 // isRFC -> configFromRFC
2655 configFromISO(config);
2656 if (config._isValid === false) {
2657 delete config._isValid;
2658 }
2659 else {
2660 return config;
2661 }
2662 configFromRFC2822(config);
2663 if (config._isValid === false) {
2664 delete config._isValid;
2665 }
2666 else {
2667 return config;
2668 }
2669 // Final attempt, use Input Fallback
2670 // hooks.createFromInputFallback(config);
2671 return createInvalid(config);
2672}
2673// hooks.createFromInputFallback = deprecate(
2674// 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
2675// 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
2676// 'discouraged and will be removed in an upcoming major release. Please refer to ' +
2677// 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
2678// function (config) {
2679// config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
2680// }
2681// );
2682
2683// moment.js
2684function formatDate(date, format, locale, isUTC, offset = 0) {
2685 const _locale = getLocale(locale || 'en');
2686 if (!_locale) {
2687 throw new Error(`Locale "${locale}" is not defined, please add it with "defineLocale(...)"`);
2688 }
2689 const _format = format || (isUTC ? 'YYYY-MM-DDTHH:mm:ss[Z]' : 'YYYY-MM-DDTHH:mm:ssZ');
2690 const output = formatMoment(date, _format, _locale, isUTC, offset);
2691 if (!output) {
2692 return output;
2693 }
2694 return _locale.postformat(output);
2695}
2696// format date using native date object
2697function formatMoment(date, _format, locale, isUTC, offset = 0) {
2698 if (!isDateValid(date)) {
2699 return locale.invalidDate;
2700 }
2701 const format = expandFormat(_format, locale);
2702 formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
2703 return formatFunctions[format](date, locale, isUTC, offset);
2704}
2705function expandFormat(_format, locale) {
2706 let format = _format;
2707 let i = 5;
2708 const localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
2709 const replaceLongDateFormatTokens = (input) => {
2710 return locale.formatLongDate(input) || input;
2711 };
2712 localFormattingTokens.lastIndex = 0;
2713 while (i >= 0 && localFormattingTokens.test(format)) {
2714 format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
2715 localFormattingTokens.lastIndex = 0;
2716 i -= 1;
2717 }
2718 return format;
2719}
2720
2721// Pick the first defined of two or three arguments.
2722function defaults(a, b, c) {
2723 if (a != null) {
2724 return a;
2725 }
2726 if (b != null) {
2727 return b;
2728 }
2729 return c;
2730}
2731
2732function currentDateArray(config) {
2733 const nowValue = new Date();
2734 if (config._useUTC) {
2735 return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
2736 }
2737 return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
2738}
2739// convert an array to a date.
2740// the array should mirror the parameters below
2741// note: all values past the year are optional and will default to the lowest possible value.
2742// [year, month, day , hour, minute, second, millisecond]
2743function configFromArray(config) {
2744 const input = [];
2745 let i;
2746 let date;
2747 let yearToUse;
2748 if (config._d) {
2749 return config;
2750 }
2751 const currentDate = currentDateArray(config);
2752 // compute day of the year from weeks and weekdays
2753 if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
2754 dayOfYearFromWeekInfo(config);
2755 }
2756 // if the day of the year is set, figure out what it is
2757 if (config._dayOfYear != null) {
2758 yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
2759 if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
2760 getParsingFlags(config)._overflowDayOfYear = true;
2761 }
2762 date = new Date(Date.UTC(yearToUse, 0, config._dayOfYear));
2763 config._a[MONTH] = date.getUTCMonth();
2764 config._a[DATE] = date.getUTCDate();
2765 }
2766 // Default to current date.
2767 // * if no year, month, day of month are given, default to today
2768 // * if day of month is given, default month and year
2769 // * if month is given, default only year
2770 // * if year is given, don't default anything
2771 for (i = 0; i < 3 && config._a[i] == null; ++i) {
2772 config._a[i] = input[i] = currentDate[i];
2773 }
2774 // Zero out whatever was not defaulted, including time
2775 for (; i < 7; i++) {
2776 config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
2777 }
2778 // Check for 24:00:00.000
2779 if (config._a[HOUR] === 24 &&
2780 config._a[MINUTE] === 0 &&
2781 config._a[SECOND] === 0 &&
2782 config._a[MILLISECOND] === 0) {
2783 config._nextDay = true;
2784 config._a[HOUR] = 0;
2785 }
2786 // eslint-disable-next-line prefer-spread
2787 config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
2788 const expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
2789 // Apply timezone offset from input. The actual utcOffset can be changed
2790 // with parseZone.
2791 if (config._tzm != null) {
2792 config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
2793 }
2794 if (config._nextDay) {
2795 config._a[HOUR] = 24;
2796 }
2797 // check for mismatching day of week
2798 if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {
2799 getParsingFlags(config).weekdayMismatch = true;
2800 }
2801 return config;
2802}
2803function dayOfYearFromWeekInfo(config) {
2804 let weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
2805 const w = config._w;
2806 if (w.GG != null || w.W != null || w.E != null) {
2807 dow = 1;
2808 doy = 4;
2809 // TODO: We need to take the current isoWeekYear, but that depends on
2810 // how we interpret now (local, utc, fixed offset). So create
2811 // a now version of current config (take local/utc/offset flags, and
2812 // create now).
2813 weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(new Date(), 1, 4).year);
2814 week = defaults(w.W, 1);
2815 weekday = defaults(w.E, 1);
2816 if (weekday < 1 || weekday > 7) {
2817 weekdayOverflow = true;
2818 }
2819 }
2820 else {
2821 dow = config._locale._week.dow;
2822 doy = config._locale._week.doy;
2823 const curWeek = weekOfYear(new Date(), dow, doy);
2824 weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
2825 // Default to current week.
2826 week = defaults(w.w, curWeek.week);
2827 if (w.d != null) {
2828 // weekday -- low day numbers are considered next week
2829 weekday = w.d;
2830 if (weekday < 0 || weekday > 6) {
2831 weekdayOverflow = true;
2832 }
2833 }
2834 else if (w.e != null) {
2835 // local weekday -- counting starts from beginning of week
2836 weekday = w.e + dow;
2837 if (w.e < 0 || w.e > 6) {
2838 weekdayOverflow = true;
2839 }
2840 }
2841 else {
2842 // default to beginning of week
2843 weekday = dow;
2844 }
2845 }
2846 if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
2847 getParsingFlags(config)._overflowWeeks = true;
2848 }
2849 else if (weekdayOverflow != null) {
2850 getParsingFlags(config)._overflowWeekday = true;
2851 }
2852 else {
2853 temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
2854 config._a[YEAR] = temp.year;
2855 config._dayOfYear = temp.dayOfYear;
2856 }
2857 return config;
2858}
2859
2860function checkOverflow(config) {
2861 let overflow;
2862 const a = config._a;
2863 if (a && getParsingFlags(config).overflow === -2) {
2864 // todo: fix this sh*t
2865 overflow =
2866 a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
2867 a[DATE] < 1 || a[DATE] > daysInMonth$1(a[YEAR], a[MONTH]) ? DATE :
2868 a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
2869 a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
2870 a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
2871 a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
2872 -1;
2873 if (getParsingFlags(config)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
2874 overflow = DATE;
2875 }
2876 if (getParsingFlags(config)._overflowWeeks && overflow === -1) {
2877 overflow = WEEK;
2878 }
2879 if (getParsingFlags(config)._overflowWeekday && overflow === -1) {
2880 overflow = WEEKDAY;
2881 }
2882 getParsingFlags(config).overflow = overflow;
2883 }
2884 return config;
2885}
2886
2887// constant that refers to the ISO standard
2888// hooks.ISO_8601 = function () {};
2889const ISO_8601 = 'ISO_8601';
2890// constant that refers to the RFC 2822 form
2891// hooks.RFC_2822 = function () {};
2892const RFC_2822 = 'RFC_2822';
2893// date from string and format string
2894function configFromStringAndFormat(config) {
2895 // TODO: Move this to another part of the creation flow to prevent circular deps
2896 if (config._f === ISO_8601) {
2897 return configFromISO(config);
2898 }
2899 if (config._f === RFC_2822) {
2900 return configFromRFC2822(config);
2901 }
2902 config._a = [];
2903 getParsingFlags(config).empty = true;
2904 if (isArray(config._f) || (!config._i && config._i !== 0)) {
2905 return config;
2906 }
2907 // This array is used to make a Date, either with `new Date` or `Date.UTC`
2908 let input = config._i.toString();
2909 let totalParsedInputLength = 0;
2910 const inputLength = input.length;
2911 const tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
2912 let i;
2913 let token;
2914 let parsedInput;
2915 let skipped;
2916 for (i = 0; i < tokens.length; i++) {
2917 token = tokens[i];
2918 parsedInput = (input.match(getParseRegexForToken(token, config._locale)) || [])[0];
2919 if (parsedInput) {
2920 skipped = input.substr(0, input.indexOf(parsedInput));
2921 if (skipped.length > 0) {
2922 getParsingFlags(config).unusedInput.push(skipped);
2923 }
2924 input = input.slice(input.indexOf(parsedInput) + parsedInput.length);
2925 totalParsedInputLength += parsedInput.length;
2926 }
2927 // don't parse if it's not a known token
2928 if (formatTokenFunctions[token]) {
2929 if (parsedInput) {
2930 getParsingFlags(config).empty = false;
2931 }
2932 else {
2933 getParsingFlags(config).unusedTokens.push(token);
2934 }
2935 addTimeToArrayFromToken(token, parsedInput, config);
2936 }
2937 else if (config._strict && !parsedInput) {
2938 getParsingFlags(config).unusedTokens.push(token);
2939 }
2940 }
2941 // add remaining unparsed input length to the string
2942 getParsingFlags(config).charsLeftOver = inputLength - totalParsedInputLength;
2943 if (input.length > 0) {
2944 getParsingFlags(config).unusedInput.push(input);
2945 }
2946 // clear _12h flag if hour is <= 12
2947 if (config._a[HOUR] <= 12 &&
2948 getParsingFlags(config).bigHour === true &&
2949 config._a[HOUR] > 0) {
2950 getParsingFlags(config).bigHour = void 0;
2951 }
2952 getParsingFlags(config).parsedDateParts = config._a.slice(0);
2953 getParsingFlags(config).meridiem = config._meridiem;
2954 // handle meridiem
2955 config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
2956 configFromArray(config);
2957 return checkOverflow(config);
2958}
2959function meridiemFixWrap(locale, _hour, meridiem) {
2960 let hour = _hour;
2961 if (meridiem == null) {
2962 // nothing to do
2963 return hour;
2964 }
2965 if (locale.meridiemHour != null) {
2966 return locale.meridiemHour(hour, meridiem);
2967 }
2968 if (locale.isPM == null) {
2969 // this is not supposed to happen
2970 return hour;
2971 }
2972 // Fallback
2973 const isPm = locale.isPM(meridiem);
2974 if (isPm && hour < 12) {
2975 hour += 12;
2976 }
2977 if (!isPm && hour === 12) {
2978 hour = 0;
2979 }
2980 return hour;
2981}
2982
2983// date from string and array of format strings
2984function configFromStringAndArray(config) {
2985 let tempConfig;
2986 let bestMoment;
2987 let scoreToBeat;
2988 let currentScore;
2989 if (!config._f || config._f.length === 0) {
2990 getParsingFlags(config).invalidFormat = true;
2991 return createInvalid(config);
2992 }
2993 let i;
2994 for (i = 0; i < config._f.length; i++) {
2995 currentScore = 0;
2996 tempConfig = Object.assign({}, config);
2997 if (config._useUTC != null) {
2998 tempConfig._useUTC = config._useUTC;
2999 }
3000 tempConfig._f = config._f[i];
3001 configFromStringAndFormat(tempConfig);
3002 if (!isValid(tempConfig)) {
3003 continue;
3004 }
3005 // if there is any input that was not parsed add a penalty for that format
3006 currentScore += getParsingFlags(tempConfig).charsLeftOver;
3007 // or tokens
3008 currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
3009 getParsingFlags(tempConfig).score = currentScore;
3010 if (scoreToBeat == null || currentScore < scoreToBeat) {
3011 scoreToBeat = currentScore;
3012 bestMoment = tempConfig;
3013 }
3014 }
3015 return Object.assign(config, bestMoment || tempConfig);
3016}
3017
3018function configFromObject(config) {
3019 if (config._d) {
3020 return config;
3021 }
3022 const input = config._i;
3023 if (isObject(input)) {
3024 const i = normalizeObjectUnits(input);
3025 config._a = [i.year, i.month, i.day, i.hours, i.minutes, i.seconds, i.milliseconds]
3026 // todo: obsolete -> remove it
3027 .map(obj => isString(obj) ? parseInt(obj, 10) : obj);
3028 }
3029 return configFromArray(config);
3030}
3031
3032function createFromConfig(config) {
3033 const res = checkOverflow(prepareConfig(config));
3034 // todo: remove, in moment.js it's never called cuz of moment constructor
3035 res._d = new Date(res._d != null ? res._d.getTime() : NaN);
3036 if (!isValid(Object.assign({}, res, { _isValid: null }))) {
3037 res._d = new Date(NaN);
3038 }
3039 // todo: update offset
3040 /*if (res._nextDay) {
3041 // Adding is smart enough around DST
3042 res._d = add(res._d, 1, 'day');
3043 res._nextDay = undefined;
3044 }*/
3045 return res;
3046}
3047function prepareConfig(config) {
3048 let input = config._i;
3049 const format = config._f;
3050 config._locale = config._locale || getLocale(config._l);
3051 if (input === null || (format === undefined && input === '')) {
3052 return createInvalid(config, { nullInput: true });
3053 }
3054 if (isString(input)) {
3055 config._i = input = config._locale.preparse(input, format);
3056 }
3057 if (isDate(input)) {
3058 config._d = cloneDate(input);
3059 return config;
3060 }
3061 // todo: add check for recursion
3062 if (isArray(format)) {
3063 configFromStringAndArray(config);
3064 }
3065 else if (format) {
3066 configFromStringAndFormat(config);
3067 }
3068 else {
3069 configFromInput(config);
3070 }
3071 if (!isValid(config)) {
3072 config._d = null;
3073 }
3074 return config;
3075}
3076function configFromInput(config) {
3077 const input = config._i;
3078 if (isUndefined(input)) {
3079 config._d = new Date();
3080 }
3081 else if (isDate(input)) {
3082 config._d = cloneDate(input);
3083 }
3084 else if (isString(input)) {
3085 configFromString(config);
3086 }
3087 else if (isArray(input) && input.length) {
3088 const _arr = input.slice(0);
3089 config._a = _arr.map(obj => isString(obj) ? parseInt(obj, 10) : obj);
3090 configFromArray(config);
3091 }
3092 else if (isObject(input)) {
3093 configFromObject(config);
3094 }
3095 else if (isNumber(input)) {
3096 // from milliseconds
3097 config._d = new Date(input);
3098 }
3099 else {
3100 // hooks.createFromInputFallback(config);
3101 return createInvalid(config);
3102 }
3103 return config;
3104}
3105function createLocalOrUTC(input, format, localeKey, strict, isUTC) {
3106 const config = {};
3107 let _input = input;
3108 // params switch -> skip; testing it well
3109 // if (localeKey === true || localeKey === false) {
3110 // strict = localeKey;
3111 // localeKey = undefined;
3112 // }
3113 // todo: fail fast and return not valid date
3114 if ((isObject(_input) && isObjectEmpty(_input)) || (isArray(_input) && _input.length === 0)) {
3115 _input = undefined;
3116 }
3117 // object construction must be done this way.
3118 // https://github.com/moment/moment/issues/1423
3119 // config._isAMomentObject = true;
3120 config._useUTC = config._isUTC = isUTC;
3121 config._l = localeKey;
3122 config._i = _input;
3123 config._f = format;
3124 config._strict = strict;
3125 return createFromConfig(config);
3126}
3127
3128function parseDate(input, format, localeKey, strict, isUTC) {
3129 if (isDate(input)) {
3130 return input;
3131 }
3132 const config = createLocalOrUTC(input, format, localeKey, strict, isUTC);
3133 return config._d;
3134}
3135function utcAsLocal(date) {
3136 if (!(date instanceof Date)) {
3137 return null;
3138 }
3139 return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
3140}
3141
3142function absRound(num) {
3143 return num < 0 ? Math.round(num * -1) * -1 : Math.round(num);
3144}
3145
3146function isAfter(date1, date2, units = 'milliseconds') {
3147 if (!date1 || !date2) {
3148 return false;
3149 }
3150 if (units === 'milliseconds') {
3151 return date1.valueOf() > date2.valueOf();
3152 }
3153 return date2.valueOf() < startOf(date1, units).valueOf();
3154}
3155function isBefore(date1, date2, units = 'milliseconds') {
3156 if (!date1 || !date2) {
3157 return false;
3158 }
3159 if (units === 'milliseconds') {
3160 return date1.valueOf() < date2.valueOf();
3161 }
3162 return endOf(date1, units).valueOf() < date2.valueOf();
3163}
3164function isDisabledDay(date, daysDisabled) {
3165 if (typeof daysDisabled === 'undefined' || !daysDisabled || !daysDisabled.length) {
3166 return false;
3167 }
3168 return daysDisabled.some((day) => day === date.getDay());
3169}
3170function isBetween(date, from, to, units, inclusivity = '()') {
3171 const leftBound = inclusivity[0] === '('
3172 ? isAfter(date, from, units)
3173 : !isBefore(date, from, units);
3174 const rightBound = inclusivity[1] === ')'
3175 ? isBefore(date, to, units)
3176 : !isAfter(date, to, units);
3177 return leftBound && rightBound;
3178}
3179function isSame(date1, date2, units = 'milliseconds') {
3180 if (!date1 || !date2) {
3181 return false;
3182 }
3183 if (units === 'milliseconds') {
3184 return date1.valueOf() === date2.valueOf();
3185 }
3186 const inputMs = date2.valueOf();
3187 return (startOf(date1, units).valueOf() <= inputMs &&
3188 inputMs <= endOf(date1, units).valueOf());
3189}
3190function isSameDay$1(date1, date2) {
3191 return (date1.getDay() == date2.getDay());
3192}
3193function isSameOrAfter(date1, date2, units) {
3194 return isSame(date1, date2, units) || isAfter(date1, date2, units);
3195}
3196function isSameOrBefore(date1, date2, units) {
3197 return isSame(date1, date2, units) || isBefore(date1, date2, units);
3198}
3199
3200// ASP.NET json date format regex
3201const aspNetRegex = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
3202// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
3203// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
3204// and further modified to allow for strings containing both week and day
3205const isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
3206function createDuration(input, key, config = {}) {
3207 const duration = convertDuration(input, key);
3208 // matching against regexp is expensive, do it on demand
3209 return new Duration(duration, config);
3210}
3211function convertDuration(input, key) {
3212 // checks for null or undefined
3213 if (input == null) {
3214 return {};
3215 }
3216 if (isDuration(input)) {
3217 return {
3218 milliseconds: input._milliseconds,
3219 day: input._days,
3220 month: input._months
3221 };
3222 }
3223 if (isNumber(input)) {
3224 // duration = {};
3225 return key ? { [key]: input } : { milliseconds: input };
3226 }
3227 if (isString(input)) {
3228 let match = aspNetRegex.exec(input);
3229 if (match) {
3230 const sign = (match[1] === '-') ? -1 : 1;
3231 return {
3232 year: 0,
3233 day: toInt(match[DATE]) * sign,
3234 hours: toInt(match[HOUR]) * sign,
3235 minutes: toInt(match[MINUTE]) * sign,
3236 seconds: toInt(match[SECOND]) * sign,
3237 // the millisecond decimal point is included in the match
3238 milliseconds: toInt(absRound(toInt(match[MILLISECOND]) * 1000)) * sign
3239 };
3240 }
3241 match = isoRegex.exec(input);
3242 if (match) {
3243 const sign = (match[1] === '-') ? -1 : (match[1] === '+') ? 1 : 1;
3244 return {
3245 year: parseIso(match[2], sign),
3246 month: parseIso(match[3], sign),
3247 week: parseIso(match[4], sign),
3248 day: parseIso(match[5], sign),
3249 hours: parseIso(match[6], sign),
3250 minutes: parseIso(match[7], sign),
3251 seconds: parseIso(match[8], sign)
3252 };
3253 }
3254 }
3255 if (isObject(input) && ('from' in input || 'to' in input)) {
3256 const diffRes = momentsDifference(parseDate(input.from), parseDate(input.to));
3257 return {
3258 milliseconds: diffRes.milliseconds,
3259 month: diffRes.months
3260 };
3261 }
3262 return input;
3263}
3264// createDuration.fn = Duration.prototype;
3265// createDuration.invalid = invalid;
3266function parseIso(inp, sign) {
3267 // We'd normally use ~~inp for this, but unfortunately it also
3268 // converts floats to ints.
3269 // inp may be undefined, so careful calling replace on it.
3270 const res = inp && parseFloat(inp.replace(',', '.'));
3271 // apply sign while we're at it
3272 return (isNaN(res) ? 0 : res) * sign;
3273}
3274function positiveMomentsDifference(base, other) {
3275 const res = { milliseconds: 0, months: 0 };
3276 res.months = getMonth(other) - getMonth(base) +
3277 (getFullYear(other) - getFullYear(base)) * 12;
3278 const _basePlus = add(cloneDate(base), res.months, 'month');
3279 if (isAfter(_basePlus, other)) {
3280 --res.months;
3281 }
3282 res.milliseconds = +other - +(add(cloneDate(base), res.months, 'month'));
3283 return res;
3284}
3285function momentsDifference(base, other) {
3286 if (!(isDateValid(base) && isDateValid(other))) {
3287 return { milliseconds: 0, months: 0 };
3288 }
3289 let res;
3290 const _other = cloneWithOffset(other, base, { _offset: base.getTimezoneOffset() });
3291 if (isBefore(base, _other)) {
3292 res = positiveMomentsDifference(base, _other);
3293 }
3294 else {
3295 res = positiveMomentsDifference(_other, base);
3296 res.milliseconds = -res.milliseconds;
3297 res.months = -res.months;
3298 }
3299 return res;
3300}
3301
3302function add(date, val, period, isUTC) {
3303 const dur = createDuration(val, period);
3304 return addSubtract(date, dur, 1, isUTC);
3305}
3306function subtract(date, val, period, isUTC) {
3307 const dur = createDuration(val, period);
3308 return addSubtract(date, dur, -1, isUTC);
3309}
3310function addSubtract(date, duration, isAdding, isUTC) {
3311 const milliseconds = duration._milliseconds;
3312 const days = absRound(duration._days);
3313 const months = absRound(duration._months);
3314 // todo: add timezones support
3315 // const _updateOffset = updateOffset == null ? true : updateOffset;
3316 if (months) {
3317 setMonth(date, getMonth(date, isUTC) + months * isAdding, isUTC);
3318 }
3319 if (days) {
3320 setDate(date, getDate(date, isUTC) + days * isAdding, isUTC);
3321 }
3322 if (milliseconds) {
3323 setTime(date, getTime(date) + milliseconds * isAdding);
3324 }
3325 return cloneDate(date);
3326 // todo: add timezones support
3327 // if (_updateOffset) {
3328 // hooks.updateOffset(date, days || months);
3329 // }
3330}
3331
3332function initDayOfWeek() {
3333 // FORMATTING
3334 addFormatToken('d', null, 'do', function (date, opts) {
3335 return getDay(date, opts.isUTC)
3336 .toString(10);
3337 });
3338 addFormatToken('dd', null, null, function (date, opts) {
3339 return opts.locale.weekdaysMin(date, opts.format, opts.isUTC);
3340 });
3341 addFormatToken('ddd', null, null, function (date, opts) {
3342 return opts.locale.weekdaysShort(date, opts.format, opts.isUTC);
3343 });
3344 addFormatToken('dddd', null, null, function (date, opts) {
3345 return opts.locale.weekdays(date, opts.format, opts.isUTC);
3346 });
3347 addFormatToken('e', null, null, function (date, opts) {
3348 return getLocaleDayOfWeek(date, opts.locale, opts.isUTC)
3349 .toString(10);
3350 // return getDay(date, opts.isUTC).toString(10);
3351 });
3352 addFormatToken('E', null, null, function (date, opts) {
3353 return getISODayOfWeek(date, opts.isUTC)
3354 .toString(10);
3355 });
3356 // ALIASES
3357 addUnitAlias('day', 'd');
3358 addUnitAlias('weekday', 'e');
3359 addUnitAlias('isoWeekday', 'E');
3360 // PRIORITY
3361 addUnitPriority('day', 11);
3362 addUnitPriority('weekday', 11);
3363 addUnitPriority('isoWeekday', 11);
3364 // PARSING
3365 addRegexToken('d', match1to2);
3366 addRegexToken('e', match1to2);
3367 addRegexToken('E', match1to2);
3368 addRegexToken('dd', function (isStrict, locale) {
3369 return locale.weekdaysMinRegex(isStrict);
3370 });
3371 addRegexToken('ddd', function (isStrict, locale) {
3372 return locale.weekdaysShortRegex(isStrict);
3373 });
3374 addRegexToken('dddd', function (isStrict, locale) {
3375 return locale.weekdaysRegex(isStrict);
3376 });
3377 addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
3378 const weekday = config._locale.weekdaysParse(input, token, config._strict);
3379 // if we didn't get a weekday name, mark the date as invalid
3380 if (weekday != null) {
3381 week.d = weekday;
3382 }
3383 else {
3384 getParsingFlags(config).invalidWeekday = !!input;
3385 }
3386 return config;
3387 });
3388 addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
3389 week[token] = toInt(input);
3390 return config;
3391 });
3392}
3393// HELPERS
3394function parseWeekday(input, locale) {
3395 if (!isString(input)) {
3396 return input;
3397 }
3398 const _num = parseInt(input, 10);
3399 if (!isNaN(_num)) {
3400 return _num;
3401 }
3402 const _weekDay = locale.weekdaysParse(input);
3403 if (isNumber(_weekDay)) {
3404 return _weekDay;
3405 }
3406 return null;
3407}
3408function parseIsoWeekday(input, locale = getLocale()) {
3409 if (isString(input)) {
3410 return locale.weekdaysParse(input) % 7 || 7;
3411 }
3412 return isNumber(input) && isNaN(input) ? null : input;
3413}
3414// MOMENTS
3415function getSetDayOfWeek(date, input, opts) {
3416 if (!input) {
3417 return getDayOfWeek(date, opts.isUTC);
3418 }
3419 return setDayOfWeek(date, input, opts.locale, opts.isUTC);
3420}
3421function setDayOfWeek(date, input, locale = getLocale(), isUTC) {
3422 const day = getDay(date, isUTC);
3423 const _input = parseWeekday(input, locale);
3424 return add(date, _input - day, 'day');
3425}
3426function getDayOfWeek(date, isUTC) {
3427 return getDay(date, isUTC);
3428}
3429/********************************************/
3430// todo: utc
3431// getSetLocaleDayOfWeek
3432function getLocaleDayOfWeek(date, locale = getLocale(), isUTC) {
3433 return (getDay(date, isUTC) + 7 - locale.firstDayOfWeek()) % 7;
3434}
3435function setLocaleDayOfWeek(date, input, opts = {}) {
3436 const weekday = getLocaleDayOfWeek(date, opts.locale, opts.isUTC);
3437 return add(date, input - weekday, 'day');
3438}
3439// getSetISODayOfWeek
3440function getISODayOfWeek(date, isUTC) {
3441 return getDay(date, isUTC) || 7;
3442}
3443function setISODayOfWeek(date, input, opts = {}) {
3444 // behaves the same as moment#day except
3445 // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
3446 // as a setter, sunday should belong to the previous week.
3447 const weekday = parseIsoWeekday(input, opts.locale);
3448 return setDayOfWeek(date, getDayOfWeek(date) % 7 ? weekday : weekday - 7);
3449}
3450
3451//! moment.js locale configuration
3452//! locale : Arabic [ar]
3453//! author : Abdel Said: https://github.com/abdelsaid
3454//! author : Ahmed Elkhatib
3455//! author : forabi https://github.com/forabi
3456const symbolMap = {
3457 1: '١',
3458 2: '٢',
3459 3: '٣',
3460 4: '٤',
3461 5: '٥',
3462 6: '٦',
3463 7: '٧',
3464 8: '٨',
3465 9: '٩',
3466 0: '٠'
3467};
3468const numberMap = {
3469 '١': '1',
3470 '٢': '2',
3471 '٣': '3',
3472 '٤': '4',
3473 '٥': '5',
3474 '٦': '6',
3475 '٧': '7',
3476 '٨': '8',
3477 '٩': '9',
3478 '٠': '0'
3479};
3480const pluralForm = function (num) {
3481 return num === 0 ? 0 : num === 1 ? 1 : num === 2 ? 2 : num % 100 >= 3 && num % 100 <= 10 ? 3 : num % 100 >= 11 ? 4 : 5;
3482};
3483const ɵ0$1 = pluralForm;
3484const plurals = {
3485 s: ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
3486 m: ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
3487 h: ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
3488 d: ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
3489 M: ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
3490 y: ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
3491};
3492const pluralize = function (u) {
3493 return function (num, withoutSuffix) {
3494 const f = pluralForm(num);
3495 let str = plurals[u][pluralForm(num)];
3496 if (f === 2) {
3497 str = str[withoutSuffix ? 0 : 1];
3498 }
3499 return str.replace(/%d/i, num.toString());
3500 };
3501};
3502const ɵ1 = pluralize;
3503const months = [
3504 'يناير',
3505 'فبراير',
3506 'مارس',
3507 'أبريل',
3508 'مايو',
3509 'يونيو',
3510 'يوليو',
3511 'أغسطس',
3512 'سبتمبر',
3513 'أكتوبر',
3514 'نوفمبر',
3515 'ديسمبر'
3516];
3517const arLocale = {
3518 abbr: 'ar',
3519 months,
3520 monthsShort: months,
3521 weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
3522 weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
3523 weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
3524 weekdaysParseExact: true,
3525 longDateFormat: {
3526 LT: 'HH:mm',
3527 LTS: 'HH:mm:ss',
3528 L: 'D/\u200FM/\u200FYYYY',
3529 LL: 'D MMMM YYYY',
3530 LLL: 'D MMMM YYYY HH:mm',
3531 LLLL: 'dddd D MMMM YYYY HH:mm'
3532 },
3533 meridiemParse: /ص|م/,
3534 isPM(input) {
3535 return 'م' === input;
3536 },
3537 meridiem(hour, minute, isLower) {
3538 if (hour < 12) {
3539 return 'ص';
3540 }
3541 else {
3542 return 'م';
3543 }
3544 },
3545 calendar: {
3546 sameDay: '[اليوم عند الساعة] LT',
3547 nextDay: '[غدًا عند الساعة] LT',
3548 nextWeek: 'dddd [عند الساعة] LT',
3549 lastDay: '[أمس عند الساعة] LT',
3550 lastWeek: 'dddd [عند الساعة] LT',
3551 sameElse: 'L'
3552 },
3553 relativeTime: {
3554 future: 'بعد %s',
3555 past: 'منذ %s',
3556 s: pluralize('s'),
3557 ss: pluralize('s'),
3558 m: pluralize('m'),
3559 mm: pluralize('m'),
3560 h: pluralize('h'),
3561 hh: pluralize('h'),
3562 d: pluralize('d'),
3563 dd: pluralize('d'),
3564 M: pluralize('M'),
3565 MM: pluralize('M'),
3566 y: pluralize('y'),
3567 yy: pluralize('y')
3568 },
3569 preparse(str) {
3570 return str.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
3571 return numberMap[match];
3572 }).replace(/،/g, ',');
3573 },
3574 postformat(str) {
3575 return str.replace(/\d/g, function (match) {
3576 return symbolMap[match];
3577 }).replace(/,/g, '،');
3578 },
3579 week: {
3580 dow: 6,
3581 doy: 12 // The week that contains Jan 1st is the first week of the year.
3582 }
3583};
3584
3585const ɵ0$2 = function (d) {
3586 switch (d) {
3587 case 0:
3588 case 3:
3589 case 6:
3590 return '[В изминалата] dddd [в] LT';
3591 case 1:
3592 case 2:
3593 case 4:
3594 case 5:
3595 return '[В изминалия] dddd [в] LT';
3596 }
3597};
3598//! moment.js locale configuration
3599//! locale : Bulgarian [bg]
3600//! author : Iskren Ivov Chernev : https://github.com/ichernev
3601//! author : Kunal Marwaha : https://github.com/marwahaha
3602//! author : Matt Grande : https://github.com/mattgrande
3603//! author : Isaac Cambron : https://github.com/icambron
3604//! author : Venelin Manchev : https://github.com/vmanchev
3605const bgLocale = {
3606 abbr: 'bg',
3607 months: 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),
3608 monthsShort: 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
3609 weekdays: 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),
3610 weekdaysShort: 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
3611 weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
3612 longDateFormat: {
3613 LT: 'H:mm',
3614 LTS: 'H:mm:ss',
3615 L: 'D.MM.YYYY',
3616 LL: 'D MMMM YYYY',
3617 LLL: 'D MMMM YYYY H:mm',
3618 LLLL: 'dddd, D MMMM YYYY H:mm'
3619 },
3620 calendar: {
3621 sameDay: '[Днес в] LT',
3622 nextDay: '[Утре в] LT',
3623 nextWeek: 'dddd [в] LT',
3624 lastDay: '[Вчера в] LT',
3625 lastWeek: ɵ0$2,
3626 sameElse: 'L'
3627 },
3628 relativeTime: {
3629 future: 'след %s',
3630 past: 'преди %s',
3631 s: 'няколко секунди',
3632 ss: '%d секунди',
3633 m: 'минута',
3634 mm: '%d минути',
3635 h: 'час',
3636 hh: '%d часа',
3637 d: 'ден',
3638 dd: '%d дни',
3639 M: 'месец',
3640 MM: '%d месеца',
3641 y: 'година',
3642 yy: '%d години'
3643 },
3644 dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
3645 ordinal: function (_num) {
3646 const number = Number(_num);
3647 let lastDigit = number % 10, last2Digits = number % 100;
3648 if (number === 0) {
3649 return number + '-ев';
3650 }
3651 else if (last2Digits === 0) {
3652 return number + '-ен';
3653 }
3654 else if (last2Digits > 10 && last2Digits < 20) {
3655 return number + '-ти';
3656 }
3657 else if (lastDigit === 1) {
3658 return number + '-ви';
3659 }
3660 else if (lastDigit === 2) {
3661 return number + '-ри';
3662 }
3663 else if (lastDigit === 7 || lastDigit === 8) {
3664 return number + '-ми';
3665 }
3666 else {
3667 return number + '-ти';
3668 }
3669 },
3670 week: {
3671 dow: 1,
3672 doy: 7 // The week that contains Jan 1st is the first week of the year.
3673 }
3674};
3675
3676//! moment.js locale configuration
3677//! locale : Catalan [ca]
3678//! author : Xavier Arbat : https://github.com/XavisaurusRex
3679let monthsShortDot = 'gen._feb._mar._abr._mai._jun._jul._ago._set._oct._nov._des.'.split('_'), monthsShort = 'ene_feb_mar_abr_mai_jun_jul_ago_set_oct_nov_des'.split('_');
3680let monthsParse = [/^gen/i, /^feb/i, /^mar/i, /^abr/i, /^mai/i, /^jun/i, /^jul/i, /^ago/i, /^set/i, /^oct/i, /^nov/i, /^des/i];
3681let monthsRegex = /^(gener|febrer|març|abril|maig|juny|juliol|agost|setembre|octubre|novembre|desembre|gen\.?|feb\.?|mar\.?|abr\.?|mai\.?|jun\.?|jul\.?|ago\.?|set\.?|oct\.?|nov\.?|des\.?)/i;
3682const caLocale = {
3683 abbr: 'ca',
3684 months: 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),
3685 monthsShort(date, format, isUTC) {
3686 if (!date) {
3687 return monthsShortDot;
3688 }
3689 if (/-MMM-/.test(format)) {
3690 return monthsShort[getMonth(date, isUTC)];
3691 }
3692 return monthsShortDot[getMonth(date, isUTC)];
3693 },
3694 monthsRegex,
3695 monthsShortRegex: monthsRegex,
3696 monthsStrictRegex: /^(gener|febrer|març|abril|maig|juny|juliol|agost|setembre|octubre|novembre|desembre)/i,
3697 monthsShortStrictRegex: /^(gen\.?|feb\.?|mar\.?|abr\.?|mai\.?|jun\.?|jul\.?|ago\.?|set\.?|oct\.?|nov\.?|des\.?)/i,
3698 monthsParse,
3699 longMonthsParse: monthsParse,
3700 shortMonthsParse: monthsParse,
3701 weekdays: 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),
3702 weekdaysShort: 'diu._dil._dim._dix._dij._div._dis.'.split('_'),
3703 weekdaysMin: 'dg_dl_dt_dc_dj_dv_ds'.split('_'),
3704 weekdaysParseExact: true,
3705 longDateFormat: {
3706 LT: 'H:mm',
3707 LTS: 'H:mm:ss',
3708 L: 'DD/MM/YYYY',
3709 LL: 'D [de] MMMM [de] YYYY',
3710 LLL: 'D [de] MMMM [de] YYYY H:mm',
3711 LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm'
3712 },
3713 calendar: {
3714 sameDay(date) {
3715 return '[avui a ' + ('la' + (getHours(date) !== 1) ? 'les' : '') + '] LT';
3716 },
3717 nextDay(date) {
3718 return '[dema a ' + ('la' + (getHours(date) !== 1) ? 'les' : '') + '] LT';
3719 },
3720 nextWeek(date) {
3721 return 'dddd [a ' + ('la' + (getHours(date) !== 1) ? 'les' : '') + '] LT';
3722 },
3723 lastDay(date) {
3724 return '[ahir a ' + ('la' + (getHours(date) !== 1) ? 'les' : '') + '] LT';
3725 },
3726 lastWeek(date) {
3727 return '[el] dddd [' + ('passada la ' + (getHours(date) !== 1) ? 'passades les' : '') + '] LT';
3728 },
3729 sameElse: 'L'
3730 },
3731 relativeTime: {
3732 future: 'en %s',
3733 past: 'fa %s',
3734 s: 'uns segons',
3735 ss: '%d segons',
3736 m: 'un minut',
3737 mm: '%d minuts',
3738 h: 'una hora',
3739 hh: '%d hores',
3740 d: 'un dia',
3741 dd: '%d dies',
3742 M: 'un mes',
3743 MM: '%d mesos',
3744 y: 'un any',
3745 yy: '%d anys'
3746 },
3747 dayOfMonthOrdinalParse: /\d{1,2}(er|on|er|rt|é)/,
3748 ordinal(_num) {
3749 const num = Number(_num);
3750 const output = (num > 4) ? 'é' :
3751 (num === 1 || num === 3) ? 'r' :
3752 (num === 2) ? 'n' :
3753 (num === 4) ? 't' : 'é';
3754 return num + output;
3755 },
3756 week: {
3757 dow: 1,
3758 doy: 4 // The week that contains Jan 4th is the first week of the year.
3759 }
3760};
3761
3762//! moment.js locale configuration
3763//! locale : Czech [cs]
3764//! author : petrbela : https://github.com/petrbela
3765const months$1 = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_');
3766const monthsShort$1 = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');
3767function plural(num) {
3768 return (num > 1) && (num < 5) && (~~(num / 10) !== 1);
3769}
3770function translate(num, withoutSuffix, key, isFuture) {
3771 const result = num + ' ';
3772 switch (key) {
3773 case 's': // a few seconds / in a few seconds / a few seconds ago
3774 return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';
3775 case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
3776 if (withoutSuffix || isFuture) {
3777 return result + (plural(num) ? 'sekundy' : 'sekund');
3778 }
3779 else {
3780 return result + 'sekundami';
3781 }
3782 // break;
3783 case 'm': // a minute / in a minute / a minute ago
3784 return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');
3785 case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
3786 if (withoutSuffix || isFuture) {
3787 return result + (plural(num) ? 'minuty' : 'minut');
3788 }
3789 else {
3790 return result + 'minutami';
3791 }
3792 // break;
3793 case 'h': // an hour / in an hour / an hour ago
3794 return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
3795 case 'hh': // 9 hours / in 9 hours / 9 hours ago
3796 if (withoutSuffix || isFuture) {
3797 return result + (plural(num) ? 'hodiny' : 'hodin');
3798 }
3799 else {
3800 return result + 'hodinami';
3801 }
3802 // break;
3803 case 'd': // a day / in a day / a day ago
3804 return (withoutSuffix || isFuture) ? 'den' : 'dnem';
3805 case 'dd': // 9 days / in 9 days / 9 days ago
3806 if (withoutSuffix || isFuture) {
3807 return result + (plural(num) ? 'dny' : 'dní');
3808 }
3809 else {
3810 return result + 'dny';
3811 }
3812 // break;
3813 case 'M': // a month / in a month / a month ago
3814 return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';
3815 case 'MM': // 9 months / in 9 months / 9 months ago
3816 if (withoutSuffix || isFuture) {
3817 return result + (plural(num) ? 'měsíce' : 'měsíců');
3818 }
3819 else {
3820 return result + 'měsíci';
3821 }
3822 // break;
3823 case 'y': // a year / in a year / a year ago
3824 return (withoutSuffix || isFuture) ? 'rok' : 'rokem';
3825 case 'yy': // 9 years / in 9 years / 9 years ago
3826 if (withoutSuffix || isFuture) {
3827 return result + (plural(num) ? 'roky' : 'let');
3828 }
3829 else {
3830 return result + 'lety';
3831 }
3832 // break;
3833 }
3834}
3835const ɵ0$3 = function (months, monthsShort) {
3836 let i, _monthsParse = [];
3837 for (i = 0; i < 12; i++) {
3838 // use custom parser to solve problem with July (červenec)
3839 _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');
3840 }
3841 return _monthsParse;
3842}, ɵ1$1 = function (monthsShort) {
3843 let i, _shortMonthsParse = [];
3844 for (i = 0; i < 12; i++) {
3845 _shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i');
3846 }
3847 return _shortMonthsParse;
3848}, ɵ2 = function (months) {
3849 let i, _longMonthsParse = [];
3850 for (i = 0; i < 12; i++) {
3851 _longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i');
3852 }
3853 return _longMonthsParse;
3854};
3855const csLocale = {
3856 abbr: 'cs',
3857 months: months$1,
3858 monthsShort: monthsShort$1,
3859 monthsParse: (ɵ0$3(months$1, monthsShort$1)),
3860 shortMonthsParse: (ɵ1$1(monthsShort$1)),
3861 longMonthsParse: (ɵ2(months$1)),
3862 weekdays: 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
3863 weekdaysShort: 'ne_po_út_st_čt_pá_so'.split('_'),
3864 weekdaysMin: 'ne_po_út_st_čt_pá_so'.split('_'),
3865 longDateFormat: {
3866 LT: 'H:mm',
3867 LTS: 'H:mm:ss',
3868 L: 'DD.MM.YYYY',
3869 LL: 'D. MMMM YYYY',
3870 LLL: 'D. MMMM YYYY H:mm',
3871 LLLL: 'dddd D. MMMM YYYY H:mm',
3872 l: 'D. M. YYYY'
3873 },
3874 calendar: {
3875 sameDay: '[dnes v] LT',
3876 nextDay: '[zítra v] LT',
3877 nextWeek(date) {
3878 switch (getDayOfWeek(date)) {
3879 case 0:
3880 return '[v neděli v] LT';
3881 case 1:
3882 case 2:
3883 return '[v] dddd [v] LT';
3884 case 3:
3885 return '[ve středu v] LT';
3886 case 4:
3887 return '[ve čtvrtek v] LT';
3888 case 5:
3889 return '[v pátek v] LT';
3890 case 6:
3891 return '[v sobotu v] LT';
3892 }
3893 },
3894 lastDay: '[včera v] LT',
3895 lastWeek(date) {
3896 switch (getDayOfWeek(date)) {
3897 case 0:
3898 return '[minulou neděli v] LT';
3899 case 1:
3900 case 2:
3901 return '[minulé] dddd [v] LT';
3902 case 3:
3903 return '[minulou středu v] LT';
3904 case 4:
3905 case 5:
3906 return '[minulý] dddd [v] LT';
3907 case 6:
3908 return '[minulou sobotu v] LT';
3909 }
3910 },
3911 sameElse: 'L'
3912 },
3913 relativeTime: {
3914 future: 'za %s',
3915 past: 'před %s',
3916 s: translate,
3917 ss: translate,
3918 m: translate,
3919 mm: translate,
3920 h: translate,
3921 hh: translate,
3922 d: translate,
3923 dd: translate,
3924 M: translate,
3925 MM: translate,
3926 y: translate,
3927 yy: translate
3928 },
3929 dayOfMonthOrdinalParse: /\d{1,2}\./,
3930 ordinal: '%d.',
3931 week: {
3932 dow: 1,
3933 doy: 4 // The week that contains Jan 4th is the first week of the year.
3934 }
3935};
3936
3937//! moment.js locale configuration
3938//! locale : Danish (Denmark) [da]
3939//! author : Per Hansen : https://github.com/perhp
3940const daLocale = {
3941 abbr: 'da',
3942 months: 'Januar_Februar_Marts_April_Maj_Juni_Juli_August_September_Oktober_November_December'.split('_'),
3943 monthsShort: 'Jan_Feb_Mar_Apr_Maj_Jun_Jul_Aug_Sep_Okt_Nov_Dec'.split('_'),
3944 weekdays: 'Søndag_Mandag_Tirsdag_Onsdag_Torsdag_Fredag_Lørdag'.split('_'),
3945 weekdaysShort: 'Søn_Man_Tir_Ons_Tor_Fre_Lør'.split('_'),
3946 weekdaysMin: 'Sø_Ma_Ti_On_To_Fr_Lø'.split('_'),
3947 longDateFormat: {
3948 LT: 'HH:mm',
3949 LTS: 'HH:mm:ss',
3950 L: 'DD/MM/YYYY',
3951 LL: 'D. MMMM YYYY',
3952 LLL: 'D. MMMM YYYY HH:mm',
3953 LLLL: 'dddd [d.] D. MMMM YYYY [kl.] HH:mm'
3954 },
3955 calendar: {
3956 sameDay: '[i dag kl.] LT',
3957 nextDay: '[i morgen kl.] LT',
3958 nextWeek: 'på dddd [kl.] LT',
3959 lastDay: '[i går kl.] LT',
3960 lastWeek: '[i] dddd[s kl.] LT',
3961 sameElse: 'L'
3962 },
3963 relativeTime: {
3964 future: 'om %s',
3965 past: '%s siden',
3966 s: 'få sekunder',
3967 m: 'et minut',
3968 mm: '%d minutter',
3969 h: 'en time',
3970 hh: '%d timer',
3971 d: 'en dag',
3972 dd: '%d dage',
3973 M: 'en måned',
3974 MM: '%d måneder',
3975 y: 'et år',
3976 yy: '%d år'
3977 },
3978 dayOfMonthOrdinalParse: /\d{1,2}\./,
3979 ordinal: '%d.',
3980 week: {
3981 dow: 1,
3982 doy: 4 // The week that contains Jan 4th is the first week of the year.
3983 }
3984};
3985
3986//! moment.js locale configuration
3987//! locale : German [de]
3988//! author : lluchs : https://github.com/lluchs
3989//! author: Menelion Elensúle: https://github.com/Oire
3990//! author : Mikolaj Dadela : https://github.com/mik01aj
3991function processRelativeTime(num, withoutSuffix, key, isFuture) {
3992 const format = {
3993 'm': ['eine Minute', 'einer Minute'],
3994 'h': ['eine Stunde', 'einer Stunde'],
3995 'd': ['ein Tag', 'einem Tag'],
3996 'dd': [num + ' Tage', num + ' Tagen'],
3997 'M': ['ein Monat', 'einem Monat'],
3998 'MM': [num + ' Monate', num + ' Monaten'],
3999 'y': ['ein Jahr', 'einem Jahr'],
4000 'yy': [num + ' Jahre', num + ' Jahren']
4001 };
4002 return withoutSuffix ? format[key][0] : format[key][1];
4003}
4004const deLocale = {
4005 abbr: 'de',
4006 months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
4007 monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
4008 monthsParseExact: true,
4009 weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
4010 weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
4011 weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
4012 weekdaysParseExact: true,
4013 longDateFormat: {
4014 LT: 'HH:mm',
4015 LTS: 'HH:mm:ss',
4016 L: 'DD.MM.YYYY',
4017 LL: 'D. MMMM YYYY',
4018 LLL: 'D. MMMM YYYY HH:mm',
4019 LLLL: 'dddd, D. MMMM YYYY HH:mm'
4020 },
4021 calendar: {
4022 sameDay: '[heute um] LT [Uhr]',
4023 sameElse: 'L',
4024 nextDay: '[morgen um] LT [Uhr]',
4025 nextWeek: 'dddd [um] LT [Uhr]',
4026 lastDay: '[gestern um] LT [Uhr]',
4027 lastWeek: '[letzten] dddd [um] LT [Uhr]'
4028 },
4029 relativeTime: {
4030 future: 'in %s',
4031 past: 'vor %s',
4032 s: 'ein paar Sekunden',
4033 ss: '%d Sekunden',
4034 m: processRelativeTime,
4035 mm: '%d Minuten',
4036 h: processRelativeTime,
4037 hh: '%d Stunden',
4038 d: processRelativeTime,
4039 dd: processRelativeTime,
4040 M: processRelativeTime,
4041 MM: processRelativeTime,
4042 y: processRelativeTime,
4043 yy: processRelativeTime
4044 },
4045 dayOfMonthOrdinalParse: /\d{1,2}\./,
4046 ordinal: '%d.',
4047 week: {
4048 dow: 1,
4049 doy: 4 // The week that contains Jan 4th is the first week of the year.
4050 }
4051};
4052
4053//! moment.js locale configuration
4054//! locale : English (United Kingdom) [en-gb]
4055//! author : Chris Gedrim : https://github.com/chrisgedrim
4056const enGbLocale = {
4057 abbr: 'en-gb',
4058 months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
4059 monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
4060 weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
4061 weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
4062 weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
4063 longDateFormat: {
4064 LT: 'HH:mm',
4065 LTS: 'HH:mm:ss',
4066 L: 'DD/MM/YYYY',
4067 LL: 'D MMMM YYYY',
4068 LLL: 'D MMMM YYYY HH:mm',
4069 LLLL: 'dddd, D MMMM YYYY HH:mm'
4070 },
4071 calendar: {
4072 sameDay: '[Today at] LT',
4073 nextDay: '[Tomorrow at] LT',
4074 nextWeek: 'dddd [at] LT',
4075 lastDay: '[Yesterday at] LT',
4076 lastWeek: '[Last] dddd [at] LT',
4077 sameElse: 'L'
4078 },
4079 relativeTime: {
4080 future: 'in %s',
4081 past: '%s ago',
4082 s: 'a few seconds',
4083 ss: '%d seconds',
4084 m: 'a minute',
4085 mm: '%d minutes',
4086 h: 'an hour',
4087 hh: '%d hours',
4088 d: 'a day',
4089 dd: '%d days',
4090 M: 'a month',
4091 MM: '%d months',
4092 y: 'a year',
4093 yy: '%d years'
4094 },
4095 dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
4096 ordinal(_num) {
4097 const num = Number(_num);
4098 const b = num % 10, output = (~~(num % 100 / 10) === 1) ? 'th' :
4099 (b === 1) ? 'st' :
4100 (b === 2) ? 'nd' :
4101 (b === 3) ? 'rd' : 'th';
4102 return num + output;
4103 },
4104 week: {
4105 dow: 1,
4106 doy: 4 // The week that contains Jan 4th is the first week of the year.
4107 }
4108};
4109
4110//! moment.js locale configuration
4111//! locale : Spanish (Dominican Republic) [es-do]
4112let monthsShortDot$1 = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), monthsShort$2 = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
4113let monthsParse$1 = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i];
4114let monthsRegex$1 = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
4115const esDoLocale = {
4116 abbr: 'es-do',
4117 months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
4118 monthsShort(date, format, isUTC) {
4119 if (!date) {
4120 return monthsShortDot$1;
4121 }
4122 else if (/-MMM-/.test(format)) {
4123 return monthsShort$2[getMonth(date, isUTC)];
4124 }
4125 else {
4126 return monthsShortDot$1[getMonth(date, isUTC)];
4127 }
4128 },
4129 monthsRegex: monthsRegex$1,
4130 monthsShortRegex: monthsRegex$1,
4131 monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
4132 monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
4133 monthsParse: monthsParse$1,
4134 longMonthsParse: monthsParse$1,
4135 shortMonthsParse: monthsParse$1,
4136 weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
4137 weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
4138 weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
4139 weekdaysParseExact: true,
4140 longDateFormat: {
4141 LT: 'h:mm A',
4142 LTS: 'h:mm:ss A',
4143 L: 'DD/MM/YYYY',
4144 LL: 'D [de] MMMM [de] YYYY',
4145 LLL: 'D [de] MMMM [de] YYYY h:mm A',
4146 LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A'
4147 },
4148 calendar: {
4149 sameDay(date) {
4150 return '[hoy a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4151 },
4152 nextDay(date) {
4153 return '[mañana a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4154 },
4155 nextWeek(date) {
4156 return 'dddd [a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4157 },
4158 lastDay(date) {
4159 return '[ayer a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4160 },
4161 lastWeek(date) {
4162 return '[el] dddd [pasado a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4163 },
4164 sameElse: 'L'
4165 },
4166 relativeTime: {
4167 future: 'en %s',
4168 past: 'hace %s',
4169 s: 'unos segundos',
4170 ss: '%d segundos',
4171 m: 'un minuto',
4172 mm: '%d minutos',
4173 h: 'una hora',
4174 hh: '%d horas',
4175 d: 'un día',
4176 dd: '%d días',
4177 M: 'un mes',
4178 MM: '%d meses',
4179 y: 'un año',
4180 yy: '%d años'
4181 },
4182 dayOfMonthOrdinalParse: /\d{1,2}º/,
4183 ordinal: '%dº',
4184 week: {
4185 dow: 1,
4186 doy: 4 // The week that contains Jan 4th is the first week of the year.
4187 }
4188};
4189
4190//! moment.js locale configuration
4191//! locale : Spanish [es]
4192//! author : Julio Napurí : https://github.com/julionc
4193let monthsShortDot$2 = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), monthsShort$3 = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
4194let monthsParse$2 = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i];
4195let monthsRegex$2 = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
4196const esLocale = {
4197 abbr: 'es',
4198 months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
4199 monthsShort(date, format, isUTC) {
4200 if (!date) {
4201 return monthsShortDot$2;
4202 }
4203 if (/-MMM-/.test(format)) {
4204 return monthsShort$3[getMonth(date, isUTC)];
4205 }
4206 return monthsShortDot$2[getMonth(date, isUTC)];
4207 },
4208 monthsRegex: monthsRegex$2,
4209 monthsShortRegex: monthsRegex$2,
4210 monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
4211 monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
4212 monthsParse: monthsParse$2,
4213 longMonthsParse: monthsParse$2,
4214 shortMonthsParse: monthsParse$2,
4215 weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
4216 weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
4217 weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
4218 weekdaysParseExact: true,
4219 longDateFormat: {
4220 LT: 'H:mm',
4221 LTS: 'H:mm:ss',
4222 L: 'DD/MM/YYYY',
4223 LL: 'D [de] MMMM [de] YYYY',
4224 LLL: 'D [de] MMMM [de] YYYY H:mm',
4225 LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm'
4226 },
4227 calendar: {
4228 sameDay(date) {
4229 return '[hoy a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4230 },
4231 nextDay(date) {
4232 return '[mañana a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4233 },
4234 nextWeek(date) {
4235 return 'dddd [a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4236 },
4237 lastDay(date) {
4238 return '[ayer a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4239 },
4240 lastWeek(date) {
4241 return '[el] dddd [pasado a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4242 },
4243 sameElse: 'L'
4244 },
4245 relativeTime: {
4246 future: 'en %s',
4247 past: 'hace %s',
4248 s: 'unos segundos',
4249 ss: '%d segundos',
4250 m: 'un minuto',
4251 mm: '%d minutos',
4252 h: 'una hora',
4253 hh: '%d horas',
4254 d: 'un día',
4255 dd: '%d días',
4256 M: 'un mes',
4257 MM: '%d meses',
4258 y: 'un año',
4259 yy: '%d años'
4260 },
4261 dayOfMonthOrdinalParse: /\d{1,2}º/,
4262 ordinal: '%dº',
4263 week: {
4264 dow: 1,
4265 doy: 4 // The week that contains Jan 4th is the first week of the year.
4266 }
4267};
4268
4269//! moment.js locale configuration
4270//! locale : Spanish (United States) [es-us]
4271//! author : bustta : https://github.com/bustta
4272let monthsShortDot$3 = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_');
4273let monthsShort$4 = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
4274const esUsLocale = {
4275 abbr: 'es-us',
4276 months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
4277 monthsShort(date, format, isUTC) {
4278 if (!date) {
4279 return monthsShortDot$3;
4280 }
4281 else if (/-MMM-/.test(format)) {
4282 return monthsShort$4[getMonth(date, isUTC)];
4283 }
4284 else {
4285 return monthsShortDot$3[getMonth(date, isUTC)];
4286 }
4287 },
4288 monthsParseExact: true,
4289 weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
4290 weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
4291 weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
4292 weekdaysParseExact: true,
4293 longDateFormat: {
4294 LT: 'h:mm A',
4295 LTS: 'h:mm:ss A',
4296 L: 'MM/DD/YYYY',
4297 LL: 'MMMM [de] D [de] YYYY',
4298 LLL: 'MMMM [de] D [de] YYYY h:mm A',
4299 LLLL: 'dddd, MMMM [de] D [de] YYYY h:mm A'
4300 },
4301 calendar: {
4302 sameDay(date) {
4303 return '[hoy a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4304 },
4305 nextDay(date) {
4306 return '[mañana a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4307 },
4308 nextWeek(date) {
4309 return 'dddd [a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4310 },
4311 lastDay(date) {
4312 return '[ayer a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4313 },
4314 lastWeek(date) {
4315 return '[el] dddd [pasado a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4316 },
4317 sameElse: 'L'
4318 },
4319 relativeTime: {
4320 future: 'en %s',
4321 past: 'hace %s',
4322 s: 'unos segundos',
4323 ss: '%d segundos',
4324 m: 'un minuto',
4325 mm: '%d minutos',
4326 h: 'una hora',
4327 hh: '%d horas',
4328 d: 'un día',
4329 dd: '%d días',
4330 M: 'un mes',
4331 MM: '%d meses',
4332 y: 'un año',
4333 yy: '%d años'
4334 },
4335 dayOfMonthOrdinalParse: /\d{1,2}º/,
4336 ordinal: '%dº',
4337 week: {
4338 dow: 0,
4339 doy: 6 // The week that contains Jan 1st is the first week of the year.
4340 }
4341};
4342
4343//! moment.js locale configuration
4344//! locale : Estonian [et]
4345//! author : Chris Gedrim : https://github.com/a90machado
4346const processRelativeTime$1 = function (num, withoutSuffix, key, isFuture) {
4347 const format = {
4348 s: ['mõne sekundi', 'mõni sekund', 'paar sekundit'],
4349 ss: [num + 'sekundi', num + 'sekundit'],
4350 m: ['ühe minuti', 'üks minut'],
4351 mm: [num + ' minuti', num + ' minutit'],
4352 h: ['ühe tunni', 'tund aega', 'üks tund'],
4353 hh: [num + ' tunni', num + ' tundi'],
4354 d: ['ühe päeva', 'üks päev'],
4355 M: ['kuu aja', 'kuu aega', 'üks kuu'],
4356 MM: [num + ' kuu', num + ' kuud'],
4357 y: ['ühe aasta', 'aasta', 'üks aasta'],
4358 yy: [num + ' aasta', num + ' aastat']
4359 };
4360 if (withoutSuffix) {
4361 return format[key][2] ? format[key][2] : format[key][1];
4362 }
4363 return isFuture ? format[key][0] : format[key][1];
4364};
4365const ɵ0$4 = processRelativeTime$1;
4366const etLocale = {
4367 abbr: 'et',
4368 months: 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'),
4369 monthsShort: 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),
4370 weekdays: 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'),
4371 weekdaysShort: 'P_E_T_K_N_R_L'.split('_'),
4372 weekdaysMin: 'P_E_T_K_N_R_L'.split('_'),
4373 longDateFormat: {
4374 LT: 'H:mm',
4375 LTS: 'H:mm:ss',
4376 L: 'DD.MM.YYYY',
4377 LL: 'D. MMMM YYYY',
4378 LLL: 'D. MMMM YYYY H:mm',
4379 LLLL: 'dddd, D. MMMM YYYY H:mm'
4380 },
4381 calendar: {
4382 sameDay: '[Täna,] LT',
4383 nextDay: '[Homme,] LT',
4384 nextWeek: '[Järgmine] dddd LT',
4385 lastDay: '[Eile,] LT',
4386 lastWeek: '[Eelmine] dddd LT',
4387 sameElse: 'L'
4388 },
4389 relativeTime: {
4390 future: '%s pärast',
4391 past: '%s tagasi',
4392 s: processRelativeTime$1,
4393 ss: processRelativeTime$1,
4394 m: processRelativeTime$1,
4395 mm: processRelativeTime$1,
4396 h: processRelativeTime$1,
4397 hh: processRelativeTime$1,
4398 d: processRelativeTime$1,
4399 dd: '%d päeva',
4400 M: processRelativeTime$1,
4401 MM: processRelativeTime$1,
4402 y: processRelativeTime$1,
4403 yy: processRelativeTime$1
4404 },
4405 dayOfMonthOrdinalParse: /\d{1,2}./,
4406 ordinal: '%d.',
4407 week: {
4408 dow: 1,
4409 doy: 4 // The week that contains Jan 4th is the first week of the year.
4410 }
4411};
4412
4413//! moment.js locale configuration
4414// https://github.com/moment/moment/blob/develop/locale/fi.js
4415var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '), numbersFuture = [
4416 'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden',
4417 numbersPast[7], numbersPast[8], numbersPast[9]
4418];
4419function translate$1(num, withoutSuffix, key, isFuture) {
4420 var result = '';
4421 switch (key) {
4422 case 's':
4423 return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
4424 case 'ss':
4425 return isFuture ? 'sekunnin' : 'sekuntia';
4426 case 'm':
4427 return isFuture ? 'minuutin' : 'minuutti';
4428 case 'mm':
4429 result = isFuture ? 'minuutin' : 'minuuttia';
4430 break;
4431 case 'h':
4432 return isFuture ? 'tunnin' : 'tunti';
4433 case 'hh':
4434 result = isFuture ? 'tunnin' : 'tuntia';
4435 break;
4436 case 'd':
4437 return isFuture ? 'päivän' : 'päivä';
4438 case 'dd':
4439 result = isFuture ? 'päivän' : 'päivää';
4440 break;
4441 case 'M':
4442 return isFuture ? 'kuukauden' : 'kuukausi';
4443 case 'MM':
4444 result = isFuture ? 'kuukauden' : 'kuukautta';
4445 break;
4446 case 'y':
4447 return isFuture ? 'vuoden' : 'vuosi';
4448 case 'yy':
4449 result = isFuture ? 'vuoden' : 'vuotta';
4450 break;
4451 }
4452 result = verbalNumber(num, isFuture) + ' ' + result;
4453 return result;
4454}
4455function verbalNumber(num, isFuture) {
4456 return num < 10 ? (isFuture ? numbersFuture[num] : numbersPast[num]) : num;
4457}
4458const fiLocale = {
4459 abbr: 'fi',
4460 months: 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),
4461 monthsShort: 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),
4462 weekdays: 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),
4463 weekdaysShort: 'su_ma_ti_ke_to_pe_la'.split('_'),
4464 weekdaysMin: 'su_ma_ti_ke_to_pe_la'.split('_'),
4465 longDateFormat: {
4466 LT: 'HH.mm',
4467 LTS: 'HH.mm.ss',
4468 L: 'DD.MM.YYYY',
4469 LL: 'Do MMMM[ta] YYYY',
4470 LLL: 'Do MMMM[ta] YYYY, [klo] HH.mm',
4471 LLLL: 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',
4472 l: 'D.M.YYYY',
4473 ll: 'Do MMM YYYY',
4474 lll: 'Do MMM YYYY, [klo] HH.mm',
4475 llll: 'ddd, Do MMM YYYY, [klo] HH.mm'
4476 },
4477 calendar: {
4478 sameDay: '[tänään] [klo] LT',
4479 nextDay: '[huomenna] [klo] LT',
4480 nextWeek: 'dddd [klo] LT',
4481 lastDay: '[eilen] [klo] LT',
4482 lastWeek: '[viime] dddd[na] [klo] LT',
4483 sameElse: 'L'
4484 },
4485 relativeTime: {
4486 future: '%s päästä',
4487 past: '%s sitten',
4488 s: translate$1,
4489 ss: translate$1,
4490 m: translate$1,
4491 mm: translate$1,
4492 h: translate$1,
4493 hh: translate$1,
4494 d: translate$1,
4495 dd: translate$1,
4496 M: translate$1,
4497 MM: translate$1,
4498 y: translate$1,
4499 yy: translate$1
4500 },
4501 dayOfMonthOrdinalParse: /\d{1,2}\./,
4502 ordinal: '%d.',
4503 week: {
4504 dow: 1,
4505 doy: 4 // The week that contains Jan 4th is the first week of the year.
4506 }
4507};
4508
4509//! moment.js locale configuration
4510//! locale : French [fr]
4511//! author : John Fischer : https://github.com/jfroffice
4512const frLocale = {
4513 abbr: 'fr',
4514 months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
4515 monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
4516 monthsParseExact: true,
4517 weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
4518 weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
4519 weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
4520 weekdaysParseExact: true,
4521 longDateFormat: {
4522 LT: 'HH:mm',
4523 LTS: 'HH:mm:ss',
4524 L: 'DD/MM/YYYY',
4525 LL: 'D MMMM YYYY',
4526 LLL: 'D MMMM YYYY HH:mm',
4527 LLLL: 'dddd D MMMM YYYY HH:mm'
4528 },
4529 calendar: {
4530 sameDay: '[Aujourd’hui à] LT',
4531 nextDay: '[Demain à] LT',
4532 nextWeek: 'dddd [à] LT',
4533 lastDay: '[Hier à] LT',
4534 lastWeek: 'dddd [dernier à] LT',
4535 sameElse: 'L'
4536 },
4537 relativeTime: {
4538 future: 'dans %s',
4539 past: 'il y a %s',
4540 s: 'quelques secondes',
4541 ss: '%d secondes',
4542 m: 'une minute',
4543 mm: '%d minutes',
4544 h: 'une heure',
4545 hh: '%d heures',
4546 d: 'un jour',
4547 dd: '%d jours',
4548 M: 'un mois',
4549 MM: '%d mois',
4550 y: 'un an',
4551 yy: '%d ans'
4552 },
4553 dayOfMonthOrdinalParse: /\d{1,2}(er|)/,
4554 ordinal(_num, period) {
4555 const num = Number(_num);
4556 switch (period) {
4557 // TODO: Return 'e' when day of month > 1. Move this case inside
4558 // block for masculine words below.
4559 // See https://github.com/moment/moment/issues/3375
4560 case 'D':
4561 return num + (num === 1 ? 'er' : '');
4562 // Words with masculine grammatical gender: mois, trimestre, jour
4563 default:
4564 case 'M':
4565 case 'Q':
4566 case 'DDD':
4567 case 'd':
4568 return num + (num === 1 ? 'er' : 'e');
4569 // Words with feminine grammatical gender: semaine
4570 case 'w':
4571 case 'W':
4572 return num + (num === 1 ? 're' : 'e');
4573 }
4574 },
4575 week: {
4576 dow: 1,
4577 doy: 4 // The week that contains Jan 4th is the first week of the year.
4578 }
4579};
4580
4581//! moment.js locale configuration
4582//! locale : Galician [gl]
4583//! author : Darío Beiró : https://github.com/quinobravo
4584let monthsShortDot$4 = 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split('_'), monthsShort$5 = 'xan_feb_mar_abr_mai_xuñ_xul_ago_set_out_nov_dec'.split('_');
4585let monthsParse$3 = [/^xan/i, /^feb/i, /^mar/i, /^abr/i, /^mai/i, /^xuñ/i, /^xul/i, /^ago/i, /^set/i, /^out/i, /^nov/i, /^dec/i];
4586let monthsRegex$3 = /^(xaneiro|febreiro|marzo|abril|maio|xuño|xullo|agosto|setembro|outubro|novembro|decembro|xan\.?|feb\.?|mar\.?|abr\.?|mai\.?|xuñ\.?|xul\.?|ago\.?|set\.?|out\.?|nov\.?|dec\.?)/i;
4587const glLocale = {
4588 abbr: 'gl',
4589 months: 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split('_'),
4590 monthsShort(date, format, isUTC) {
4591 if (!date) {
4592 return monthsShortDot$4;
4593 }
4594 if (/-MMM-/.test(format)) {
4595 return monthsShort$5[getMonth(date, isUTC)];
4596 }
4597 return monthsShortDot$4[getMonth(date, isUTC)];
4598 },
4599 monthsRegex: monthsRegex$3,
4600 monthsShortRegex: monthsRegex$3,
4601 monthsStrictRegex: /^(xaneiro|febreiro|marzo|abril|maio|xuño|xullo|agosto|setembro|outubro|novembro|decembro)/i,
4602 monthsShortStrictRegex: /^(xan\.?|feb\.?|mar\.?|abr\.?|mai\.?|xuñ\.?|xul\.?|ago\.?|set\.?|out\.?|nov\.?|dec\.?)/i,
4603 monthsParse: monthsParse$3,
4604 longMonthsParse: monthsParse$3,
4605 shortMonthsParse: monthsParse$3,
4606 weekdays: 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),
4607 weekdaysShort: 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),
4608 weekdaysMin: 'do_lu_ma_mé_xo_ve_sá'.split('_'),
4609 weekdaysParseExact: true,
4610 longDateFormat: {
4611 LT: 'H:mm',
4612 LTS: 'H:mm:ss',
4613 L: 'DD/MM/YYYY',
4614 LL: 'D [de] MMMM [de] YYYY',
4615 LLL: 'D [de] MMMM [de] YYYY H:mm',
4616 LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm'
4617 },
4618 calendar: {
4619 sameDay(date) {
4620 return '[hoxe á' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4621 },
4622 nextDay(date) {
4623 return '[mañan á' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4624 },
4625 nextWeek(date) {
4626 return 'dddd [á' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4627 },
4628 lastDay(date) {
4629 return '[onte á' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4630 },
4631 lastWeek(date) {
4632 return '[o] dddd [pasado á' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
4633 },
4634 sameElse: 'L'
4635 },
4636 relativeTime: {
4637 future: 'en %s',
4638 past: 'fai %s',
4639 s: 'uns segundos',
4640 ss: '%d segundos',
4641 m: 'un minuto',
4642 mm: '%d minutos',
4643 h: 'unha hora',
4644 hh: '%d horas',
4645 d: 'un día',
4646 dd: '%d días',
4647 M: 'un mes',
4648 MM: '%d meses',
4649 y: 'un ano',
4650 yy: '%d anos'
4651 },
4652 dayOfMonthOrdinalParse: /\d{1,2}º/,
4653 ordinal: '%dº',
4654 week: {
4655 dow: 1,
4656 doy: 4 // The week that contains Jan 4th is the first week of the year.
4657 }
4658};
4659
4660//! moment.js locale configuration
4661//! locale : Hebrew [he]
4662//! author : Tomer Cohen : https://github.com/tomer
4663//! author : Moshe Simantov : https://github.com/DevelopmentIL
4664//! author : Tal Ater : https://github.com/TalAter
4665const heLocale = {
4666 abbr: 'he',
4667 months: 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),
4668 monthsShort: 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),
4669 weekdays: 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),
4670 weekdaysShort: 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
4671 weekdaysMin: 'א_ב_ג_ד_ה_ו_ש'.split('_'),
4672 longDateFormat: {
4673 LT: 'HH:mm',
4674 LTS: 'HH:mm:ss',
4675 L: 'DD/MM/YYYY',
4676 LL: 'D [ב]MMMM YYYY',
4677 LLL: 'D [ב]MMMM YYYY HH:mm',
4678 LLLL: 'dddd, D [ב]MMMM YYYY HH:mm',
4679 l: 'D/M/YYYY',
4680 ll: 'D MMM YYYY',
4681 lll: 'D MMM YYYY HH:mm',
4682 llll: 'ddd, D MMM YYYY HH:mm'
4683 },
4684 calendar: {
4685 sameDay: '[היום ב־]LT',
4686 nextDay: '[מחר ב־]LT',
4687 nextWeek: 'dddd [בשעה] LT',
4688 lastDay: '[אתמול ב־]LT',
4689 lastWeek: '[ביום] dddd [האחרון בשעה] LT',
4690 sameElse: 'L'
4691 },
4692 relativeTime: {
4693 future: 'בעוד %s',
4694 past: 'לפני %s',
4695 s: 'מספר שניות',
4696 ss: '%d שניות',
4697 m: 'דקה',
4698 mm: '%d דקות',
4699 h: 'שעה',
4700 hh(num) {
4701 if (num === 2) {
4702 return 'שעתיים';
4703 }
4704 return num + ' שעות';
4705 },
4706 d: 'יום',
4707 dd(num) {
4708 if (num === 2) {
4709 return 'יומיים';
4710 }
4711 return num + ' ימים';
4712 },
4713 M: 'חודש',
4714 MM(num) {
4715 if (num === 2) {
4716 return 'חודשיים';
4717 }
4718 return num + ' חודשים';
4719 },
4720 y: 'שנה',
4721 yy(num) {
4722 if (num === 2) {
4723 return 'שנתיים';
4724 }
4725 else if (num % 10 === 0 && num !== 10) {
4726 return num + ' שנה';
4727 }
4728 return num + ' שנים';
4729 }
4730 },
4731 meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,
4732 isPM(input) {
4733 return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input);
4734 },
4735 meridiem(hour, minute, isLower) {
4736 if (hour < 5) {
4737 return 'לפנות בוקר';
4738 }
4739 else if (hour < 10) {
4740 return 'בבוקר';
4741 }
4742 else if (hour < 12) {
4743 return isLower ? 'לפנה"צ' : 'לפני הצהריים';
4744 }
4745 else if (hour < 18) {
4746 return isLower ? 'אחה"צ' : 'אחרי הצהריים';
4747 }
4748 else {
4749 return 'בערב';
4750 }
4751 }
4752};
4753
4754//! moment.js locale configuration
4755//! locale : Hindi [hi]
4756//! author : Mayank Singhal : https://github.com/mayanksinghal
4757let symbolMap$1 = {
4758 1: '१',
4759 2: '२',
4760 3: '३',
4761 4: '४',
4762 5: '५',
4763 6: '६',
4764 7: '७',
4765 8: '८',
4766 9: '९',
4767 0: '०'
4768}, numberMap$1 = {
4769 '१': '1',
4770 '२': '2',
4771 '३': '3',
4772 '४': '4',
4773 '५': '5',
4774 '६': '6',
4775 '७': '7',
4776 '८': '8',
4777 '९': '9',
4778 '०': '0'
4779};
4780const hiLocale = {
4781 abbr: 'hi',
4782 months: 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),
4783 monthsShort: 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),
4784 monthsParseExact: true,
4785 weekdays: 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
4786 weekdaysShort: 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
4787 weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
4788 longDateFormat: {
4789 LT: 'A h:mm बजे',
4790 LTS: 'A h:mm:ss बजे',
4791 L: 'DD/MM/YYYY',
4792 LL: 'D MMMM YYYY',
4793 LLL: 'D MMMM YYYY, A h:mm बजे',
4794 LLLL: 'dddd, D MMMM YYYY, A h:mm बजे'
4795 },
4796 calendar: {
4797 sameDay: '[आज] LT',
4798 nextDay: '[कल] LT',
4799 nextWeek: 'dddd, LT',
4800 lastDay: '[कल] LT',
4801 lastWeek: '[पिछले] dddd, LT',
4802 sameElse: 'L'
4803 },
4804 relativeTime: {
4805 future: '%s में',
4806 past: '%s पहले',
4807 s: 'कुछ ही क्षण',
4808 ss: '%d सेकंड',
4809 m: 'एक मिनट',
4810 mm: '%d मिनट',
4811 h: 'एक घंटा',
4812 hh: '%d घंटे',
4813 d: 'एक दिन',
4814 dd: '%d दिन',
4815 M: 'एक महीने',
4816 MM: '%d महीने',
4817 y: 'एक वर्ष',
4818 yy: '%d वर्ष'
4819 },
4820 preparse(str) {
4821 return str.replace(/[१२३४५६७८९०]/g, function (match) {
4822 return numberMap$1[match];
4823 });
4824 },
4825 postformat(str) {
4826 return str.replace(/\d/g, function (match) {
4827 return symbolMap$1[match];
4828 });
4829 },
4830 // Hindi notation for meridiems are quite fuzzy in practice. While there exists
4831 // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
4832 meridiemParse: /रात|सुबह|दोपहर|शाम/,
4833 meridiemHour(hour, meridiem) {
4834 if (hour === 12) {
4835 hour = 0;
4836 }
4837 if (meridiem === 'रात') {
4838 return hour < 4 ? hour : hour + 12;
4839 }
4840 else if (meridiem === 'सुबह') {
4841 return hour;
4842 }
4843 else if (meridiem === 'दोपहर') {
4844 return hour >= 10 ? hour : hour + 12;
4845 }
4846 else if (meridiem === 'शाम') {
4847 return hour + 12;
4848 }
4849 },
4850 meridiem(hour, minute, isLower) {
4851 if (hour < 4) {
4852 return 'रात';
4853 }
4854 else if (hour < 10) {
4855 return 'सुबह';
4856 }
4857 else if (hour < 17) {
4858 return 'दोपहर';
4859 }
4860 else if (hour < 20) {
4861 return 'शाम';
4862 }
4863 else {
4864 return 'रात';
4865 }
4866 },
4867 week: {
4868 dow: 0,
4869 doy: 6 // The week that contains Jan 1st is the first week of the year.
4870 }
4871};
4872
4873//! moment.js locale configuration
4874//! locale : Hungarian [hu]
4875//! author : Adam Brunner : https://github.com/adambrunner
4876let weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');
4877function translate$2(num, withoutSuffix, key, isFuture) {
4878 switch (key) {
4879 case 's':
4880 return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';
4881 case 'ss':
4882 return num + ((isFuture || withoutSuffix) ? ' másodperc' : ' másodperce');
4883 case 'm':
4884 return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');
4885 case 'mm':
4886 return num + (isFuture || withoutSuffix ? ' perc' : ' perce');
4887 case 'h':
4888 return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');
4889 case 'hh':
4890 return num + (isFuture || withoutSuffix ? ' óra' : ' órája');
4891 case 'd':
4892 return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');
4893 case 'dd':
4894 return num + (isFuture || withoutSuffix ? ' nap' : ' napja');
4895 case 'M':
4896 return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
4897 case 'MM':
4898 return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
4899 case 'y':
4900 return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');
4901 case 'yy':
4902 return num + (isFuture || withoutSuffix ? ' év' : ' éve');
4903 }
4904 return '';
4905}
4906function week(date, isFuture) {
4907 return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[getDayOfWeek(date)] + '] LT[-kor]';
4908}
4909const huLocale = {
4910 abbr: 'hu',
4911 months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),
4912 monthsShort: 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),
4913 weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
4914 weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
4915 weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'),
4916 longDateFormat: {
4917 LT: 'H:mm',
4918 LTS: 'H:mm:ss',
4919 L: 'YYYY.MM.DD.',
4920 LL: 'YYYY. MMMM D.',
4921 LLL: 'YYYY. MMMM D. H:mm',
4922 LLLL: 'YYYY. MMMM D., dddd H:mm'
4923 },
4924 meridiemParse: /de|du/i,
4925 isPM(input) {
4926 return input.charAt(1).toLowerCase() === 'u';
4927 },
4928 meridiem(hours, minutes, isLower) {
4929 if (hours < 12) {
4930 return isLower === true ? 'de' : 'DE';
4931 }
4932 else {
4933 return isLower === true ? 'du' : 'DU';
4934 }
4935 },
4936 calendar: {
4937 sameDay: '[ma] LT[-kor]',
4938 nextDay: '[holnap] LT[-kor]',
4939 nextWeek(date) {
4940 return week(date, true);
4941 },
4942 lastDay: '[tegnap] LT[-kor]',
4943 lastWeek(date) {
4944 return week(date, false);
4945 },
4946 sameElse: 'L'
4947 },
4948 relativeTime: {
4949 future: '%s múlva',
4950 past: '%s',
4951 s: translate$2,
4952 ss: translate$2,
4953 m: translate$2,
4954 mm: translate$2,
4955 h: translate$2,
4956 hh: translate$2,
4957 d: translate$2,
4958 dd: translate$2,
4959 M: translate$2,
4960 MM: translate$2,
4961 y: translate$2,
4962 yy: translate$2
4963 },
4964 dayOfMonthOrdinalParse: /\d{1,2}\./,
4965 ordinal: '%d.',
4966 week: {
4967 dow: 1,
4968 doy: 4 // The week that contains Jan 4th is the first week of the year.
4969 }
4970};
4971
4972//! moment.js locale configuration
4973//! locale : Croatian [hr]
4974//! author : Danijel Grmec : https://github.com/cobaltsis
4975const hrLocale = {
4976 abbr: 'hr',
4977 months: 'Siječanj_Veljača_Ožujak_Travanj_Svibanj_Lipanj_Srpanj_Kolovoz_Rujan_Listopad_Studeni_Prosinac'.split('_'),
4978 monthsShort: 'Sij_Velj_Ožu_Tra_Svi_Lip_Srp_Kol_Ruj_Lis_Stu_Pro'.split('_'),
4979 weekdays: 'Nedjelja_Ponedjeljak_Utorak_Srijeda_Četvrtak_Petak_Subota'.split('_'),
4980 weekdaysShort: 'Ned_Pon_Uto_Sri_Čet_Pet_Sub'.split('_'),
4981 weekdaysMin: 'Ne_Po_Ut_Sr_Če_Pe_Su'.split('_'),
4982 longDateFormat: {
4983 LT: 'HH:mm',
4984 LTS: 'HH:mm:ss',
4985 L: 'DD/MM/YYYY',
4986 LL: 'D MMMM YYYY',
4987 LLL: 'D MMMM YYYY HH:mm',
4988 LLLL: 'dddd, D MMMM YYYY HH:mm'
4989 },
4990 calendar: {
4991 sameDay: '[Danas u] LT',
4992 nextDay: '[Sutra u] LT',
4993 nextWeek: 'dddd [u] LT',
4994 lastDay: '[Jučer u] LT',
4995 lastWeek: '[Zadnji] dddd [u] LT',
4996 sameElse: 'L'
4997 },
4998 invalidDate: 'Neispravan datum',
4999 relativeTime: {
5000 future: 'za %s',
5001 past: '%s prije',
5002 s: 'nekoliko sekundi',
5003 ss: '%d sekundi',
5004 m: 'minuta',
5005 mm: '%d minuta',
5006 h: 'sat',
5007 hh: '%d sati',
5008 d: 'dan',
5009 dd: '%d dana',
5010 M: 'mjesec',
5011 MM: '%d mjeseci',
5012 y: 'godina',
5013 yy: '%d godina'
5014 },
5015 dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
5016 ordinal(_num) {
5017 const num = Number(_num);
5018 const b = num % 10, output = (~~(num % 100 / 10) === 1) ? '.' :
5019 (b === 1) ? '.' :
5020 (b === 2) ? '.' :
5021 (b === 3) ? '.' : '.';
5022 return num + output;
5023 },
5024 week: {
5025 dow: 1,
5026 doy: 4 // The week that contains Jan 4th is the first week of the year.
5027 }
5028};
5029
5030//! moment.js locale configuration
5031//! locale : Indonesia [id]
5032//! author : Romy Kusuma : https://github.com/rkusuma
5033//! reference: https://github.com/moment/moment/blob/develop/locale/id.js
5034const idLocale = {
5035 abbr: 'id',
5036 months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),
5037 monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'),
5038 weekdays: 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
5039 weekdaysShort: 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
5040 weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
5041 longDateFormat: {
5042 LT: 'HH.mm',
5043 LTS: 'HH.mm.ss',
5044 L: 'DD/MM/YYYY',
5045 LL: 'D MMMM YYYY',
5046 LLL: 'D MMMM YYYY [pukul] HH.mm',
5047 LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm'
5048 },
5049 meridiemParse: /pagi|siang|sore|malam/,
5050 meridiemHour(hour, meridiem) {
5051 if (hour === 12) {
5052 hour = 0;
5053 }
5054 if (meridiem === 'pagi') {
5055 return hour;
5056 }
5057 else if (meridiem === 'siang') {
5058 return hour >= 11 ? hour : hour + 12;
5059 }
5060 else if (meridiem === 'sore' || meridiem === 'malam') {
5061 return hour + 12;
5062 }
5063 },
5064 meridiem(hours, minutes, isLower) {
5065 if (hours < 11) {
5066 return 'pagi';
5067 }
5068 else if (hours < 15) {
5069 return 'siang';
5070 }
5071 else if (hours < 19) {
5072 return 'sore';
5073 }
5074 else {
5075 return 'malam';
5076 }
5077 },
5078 calendar: {
5079 sameDay: '[Hari ini pukul] LT',
5080 nextDay: '[Besok pukul] LT',
5081 nextWeek: 'dddd [pukul] LT',
5082 lastDay: '[Kemarin pukul] LT',
5083 lastWeek: 'dddd [lalu pukul] LT',
5084 sameElse: 'L'
5085 },
5086 relativeTime: {
5087 future: 'dalam %s',
5088 past: '%s yang lalu',
5089 s: 'beberapa detik',
5090 ss: '%d detik',
5091 m: 'semenit',
5092 mm: '%d menit',
5093 h: 'sejam',
5094 hh: '%d jam',
5095 d: 'sehari',
5096 dd: '%d hari',
5097 M: 'sebulan',
5098 MM: '%d bulan',
5099 y: 'setahun',
5100 yy: '%d tahun'
5101 },
5102 week: {
5103 dow: 1,
5104 doy: 7 // The week that contains Jan 1st is the first week of the year.
5105 }
5106};
5107
5108//! moment.js locale configuration
5109//! locale : Italian [it]
5110//! author : Lorenzo : https://github.com/aliem
5111//! author: Mattia Larentis: https://github.com/nostalgiaz
5112const itLocale = {
5113 abbr: 'it',
5114 months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
5115 monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
5116 weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'),
5117 weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
5118 weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
5119 longDateFormat: {
5120 LT: 'HH:mm',
5121 LTS: 'HH:mm:ss',
5122 L: 'DD/MM/YYYY',
5123 LL: 'D MMMM YYYY',
5124 LLL: 'D MMMM YYYY HH:mm',
5125 LLLL: 'dddd D MMMM YYYY HH:mm'
5126 },
5127 calendar: {
5128 sameDay: '[Oggi alle] LT',
5129 nextDay: '[Domani alle] LT',
5130 nextWeek: 'dddd [alle] LT',
5131 lastDay: '[Ieri alle] LT',
5132 lastWeek(date) {
5133 switch (getDayOfWeek(date)) {
5134 case 0:
5135 return '[la scorsa] dddd [alle] LT';
5136 default:
5137 return '[lo scorso] dddd [alle] LT';
5138 }
5139 },
5140 sameElse: 'L'
5141 },
5142 relativeTime: {
5143 future(num) {
5144 return ((/^[0-9].+$/).test(num.toString(10)) ? 'tra' : 'in') + ' ' + num;
5145 },
5146 past: '%s fa',
5147 s: 'alcuni secondi',
5148 ss: '%d secondi',
5149 m: 'un minuto',
5150 mm: '%d minuti',
5151 h: 'un\'ora',
5152 hh: '%d ore',
5153 d: 'un giorno',
5154 dd: '%d giorni',
5155 M: 'un mese',
5156 MM: '%d mesi',
5157 y: 'un anno',
5158 yy: '%d anni'
5159 },
5160 dayOfMonthOrdinalParse: /\d{1,2}º/,
5161 ordinal: '%dº',
5162 week: {
5163 dow: 1,
5164 doy: 4 // The week that contains Jan 4th is the first week of the year.
5165 }
5166};
5167
5168//! moment.js locale configuration
5169//! locale : Japanese [ja]
5170//! author : LI Long : https://github.com/baryon
5171const jaLocale = {
5172 abbr: 'ja',
5173 months: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
5174 monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
5175 weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),
5176 weekdaysShort: '日_月_火_水_木_金_土'.split('_'),
5177 weekdaysMin: '日_月_火_水_木_金_土'.split('_'),
5178 longDateFormat: {
5179 LT: 'HH:mm',
5180 LTS: 'HH:mm:ss',
5181 L: 'YYYY/MM/DD',
5182 LL: 'YYYY年M月D日',
5183 LLL: 'YYYY年M月D日 HH:mm',
5184 LLLL: 'YYYY年M月D日 HH:mm dddd',
5185 l: 'YYYY/MM/DD',
5186 ll: 'YYYY年M月D日',
5187 lll: 'YYYY年M月D日 HH:mm',
5188 llll: 'YYYY年M月D日 HH:mm dddd'
5189 },
5190 meridiemParse: /午前|午後/i,
5191 isPM(input) {
5192 return input === '午後';
5193 },
5194 meridiem(hour, minute, isLower) {
5195 if (hour < 12) {
5196 return '午前';
5197 }
5198 else {
5199 return '午後';
5200 }
5201 },
5202 calendar: {
5203 sameDay: '[今日] LT',
5204 nextDay: '[明日] LT',
5205 nextWeek: '[来週]dddd LT',
5206 lastDay: '[昨日] LT',
5207 lastWeek: '[前週]dddd LT',
5208 sameElse: 'L'
5209 },
5210 dayOfMonthOrdinalParse: /\d{1,2}日/,
5211 ordinal(num, period) {
5212 switch (period) {
5213 case 'd':
5214 case 'D':
5215 case 'DDD':
5216 return num + '日';
5217 default:
5218 return num.toString(10);
5219 }
5220 },
5221 relativeTime: {
5222 future: '%s後',
5223 past: '%s前',
5224 s: '数秒',
5225 ss: '%d秒',
5226 m: '1分',
5227 mm: '%d分',
5228 h: '1時間',
5229 hh: '%d時間',
5230 d: '1日',
5231 dd: '%d日',
5232 M: '1ヶ月',
5233 MM: '%dヶ月',
5234 y: '1年',
5235 yy: '%d年'
5236 }
5237};
5238
5239//! moment.js locale configuration
5240//! locale : Georgian [ka]
5241//! author : Irakli Janiashvili : https://github.com/irakli-janiashvili
5242//! author : Levan Tskipuri : https://github.com/tskipa
5243const kaLocale = {
5244 abbr: 'ka',
5245 months: {
5246 format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_'),
5247 standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_')
5248 },
5249 monthsShort: 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
5250 weekdays: {
5251 standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),
5252 format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'),
5253 isFormat: /(წინა|შემდეგ)/
5254 },
5255 weekdaysShort: 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
5256 weekdaysMin: 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
5257 longDateFormat: {
5258 LT: 'h:mm A',
5259 LTS: 'h:mm:ss A',
5260 L: 'DD/MM/YYYY',
5261 LL: 'D MMMM YYYY',
5262 LLL: 'D MMMM YYYY h:mm A',
5263 LLLL: 'dddd, D MMMM YYYY h:mm A'
5264 },
5265 calendar: {
5266 sameDay: '[დღეს] LT[-ზე]',
5267 nextDay: '[ხვალ] LT[-ზე]',
5268 lastDay: '[გუშინ] LT[-ზე]',
5269 nextWeek: '[შემდეგ] dddd LT[-ზე]',
5270 lastWeek: '[წინა] dddd LT-ზე',
5271 sameElse: 'L'
5272 },
5273 relativeTime: {
5274 future(s) {
5275 var st = s.toString();
5276 return (/(წამი|წუთი|საათი|წელი)/).test(st) ?
5277 st.replace(/ი$/, 'ში') :
5278 st + 'ში';
5279 },
5280 past(s) {
5281 var st = s.toString();
5282 if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(st)) {
5283 return st.replace(/(ი|ე)$/, 'ის წინ');
5284 }
5285 if ((/წელი/).test(st)) {
5286 return st.replace(/წელი$/, 'წლის წინ');
5287 }
5288 },
5289 s: 'რამდენიმე წამი',
5290 ss: '%d წამი',
5291 m: 'წუთი',
5292 mm: '%d წუთი',
5293 h: 'საათი',
5294 hh: '%d საათი',
5295 d: 'დღე',
5296 dd: '%d დღე',
5297 M: 'თვე',
5298 MM: '%d თვე',
5299 y: 'წელი',
5300 yy: '%d წელი'
5301 },
5302 dayOfMonthOrdinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,
5303 ordinal(_num, _period) {
5304 const num = Number(_num);
5305 if (num === 0) {
5306 return num.toString();
5307 }
5308 if (num === 1) {
5309 return num + '-ლი';
5310 }
5311 if ((num < 20) || (num <= 100 && (num % 20 === 0)) || (num % 100 === 0)) {
5312 return 'მე-' + num;
5313 }
5314 return num + '-ე';
5315 },
5316 week: {
5317 dow: 1,
5318 doy: 4
5319 }
5320};
5321
5322// ! moment.js locale configuration
5323// ! locale : Kazakh [kk]
5324// ! authors : Nurlan Rakhimzhanov : https://github.com/nurlan
5325const suffixes = {
5326 0: '-ші',
5327 1: '-ші',
5328 2: '-ші',
5329 3: '-ші',
5330 4: '-ші',
5331 5: '-ші',
5332 6: '-шы',
5333 7: '-ші',
5334 8: '-ші',
5335 9: '-шы',
5336 10: '-шы',
5337 20: '-шы',
5338 30: '-шы',
5339 40: '-шы',
5340 50: '-ші',
5341 60: '-шы',
5342 70: '-ші',
5343 80: '-ші',
5344 90: '-шы',
5345 100: '-ші'
5346};
5347const kkLocale = {
5348 abbr: 'kk',
5349 months: 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split('_'),
5350 monthsShort: 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),
5351 weekdays: 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split('_'),
5352 weekdaysShort: 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),
5353 weekdaysMin: 'жк_дй_сй_ср_бй_жм_сн'.split('_'),
5354 longDateFormat: {
5355 LT: 'HH:mm',
5356 LTS: 'HH:mm:ss',
5357 L: 'DD.MM.YYYY',
5358 LL: 'D MMMM YYYY',
5359 LLL: 'D MMMM YYYY HH:mm',
5360 LLLL: 'dddd, D MMMM YYYY HH:mm'
5361 },
5362 calendar: {
5363 sameDay: '[Бүгін сағат] LT',
5364 nextDay: '[Ертең сағат] LT',
5365 nextWeek: 'dddd [сағат] LT',
5366 lastDay: '[Кеше сағат] LT',
5367 lastWeek: '[Өткен аптаның] dddd [сағат] LT',
5368 sameElse: 'L'
5369 },
5370 relativeTime: {
5371 future: '%s ішінде',
5372 past: '%s бұрын',
5373 s: 'бірнеше секунд',
5374 ss: '%d секунд',
5375 m: 'бір минут',
5376 mm: '%d минут',
5377 h: 'бір сағат',
5378 hh: '%d сағат',
5379 d: 'бір күн',
5380 dd: '%d күн',
5381 M: 'бір ай',
5382 MM: '%d ай',
5383 y: 'бір жыл',
5384 yy: '%d жыл'
5385 },
5386 dayOfMonthOrdinalParse: /\d{1,2}-(ші|шы)/,
5387 ordinal(_num) {
5388 const a = _num % 10;
5389 const b = _num >= 100 ? 100 : null;
5390 return _num + (suffixes[_num] || suffixes[a] || suffixes[b]);
5391 },
5392 week: {
5393 dow: 1,
5394 doy: 7 // The week that contains Jan 7th is the first week of the year.
5395 }
5396};
5397
5398//! moment.js locale configuration
5399//! locale : Korean [ko]
5400//! author : Kyungwook, Park : https://github.com/kyungw00k
5401//! author : Jeeeyul Lee <jeeeyul@gmail.com>
5402const koLocale = {
5403 abbr: 'ko',
5404 months: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
5405 monthsShort: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
5406 weekdays: '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),
5407 weekdaysShort: '일_월_화_수_목_금_토'.split('_'),
5408 weekdaysMin: '일_월_화_수_목_금_토'.split('_'),
5409 longDateFormat: {
5410 LT: 'A h:mm',
5411 LTS: 'A h:mm:ss',
5412 L: 'YYYY.MM.DD',
5413 LL: 'YYYY년 MMMM D일',
5414 LLL: 'YYYY년 MMMM D일 A h:mm',
5415 LLLL: 'YYYY년 MMMM D일 dddd A h:mm',
5416 l: 'YYYY.MM.DD',
5417 ll: 'YYYY년 MMMM D일',
5418 lll: 'YYYY년 MMMM D일 A h:mm',
5419 llll: 'YYYY년 MMMM D일 dddd A h:mm'
5420 },
5421 calendar: {
5422 sameDay: '오늘 LT',
5423 nextDay: '내일 LT',
5424 nextWeek: 'dddd LT',
5425 lastDay: '어제 LT',
5426 lastWeek: '지난주 dddd LT',
5427 sameElse: 'L'
5428 },
5429 relativeTime: {
5430 future: '%s 후',
5431 past: '%s 전',
5432 s: '몇 초',
5433 ss: '%d초',
5434 m: '1분',
5435 mm: '%d분',
5436 h: '한 시간',
5437 hh: '%d시간',
5438 d: '하루',
5439 dd: '%d일',
5440 M: '한 달',
5441 MM: '%d달',
5442 y: '일 년',
5443 yy: '%d년'
5444 },
5445 dayOfMonthOrdinalParse: /\d{1,2}(일|월|주)/,
5446 ordinal: function (num, period) {
5447 switch (period) {
5448 case 'd':
5449 case 'D':
5450 case 'DDD':
5451 return num + '일';
5452 case 'M':
5453 return num + '월';
5454 case 'w':
5455 case 'W':
5456 return num + '주';
5457 default:
5458 return num.toString(10);
5459 }
5460 },
5461 meridiemParse: /오전|오후/,
5462 isPM: function (token) {
5463 return token === '오후';
5464 },
5465 meridiem: function (hour, minute, isUpper) {
5466 return hour < 12 ? '오전' : '오후';
5467 }
5468};
5469
5470//! moment.js locale configuration
5471//! locale : Lithuanian [lt]
5472//! author : Stanislavas Guk : https://github.com/ixoster
5473const units = {
5474 ss: 'sekundė_sekundžių_sekundes',
5475 m: 'minutė_minutės_minutę',
5476 mm: 'minutės_minučių_minutes',
5477 h: 'valanda_valandos_valandą',
5478 hh: 'valandos_valandų_valandas',
5479 d: 'diena_dienos_dieną',
5480 dd: 'dienos_dienų_dienas',
5481 M: 'mėnuo_mėnesio_mėnesį',
5482 MM: 'mėnesiai_mėnesių_mėnesius',
5483 y: 'metai_metų_metus',
5484 yy: 'metai_metų_metus'
5485};
5486function translateSeconds(num, withoutSuffix, key, isFuture) {
5487 if (withoutSuffix) {
5488 return 'kelios sekundės';
5489 }
5490 else {
5491 return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
5492 }
5493}
5494function translateSingular(num, withoutSuffix, key, isFuture) {
5495 return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]);
5496}
5497function special(num) {
5498 return num % 10 === 0 || (num > 10 && num < 20);
5499}
5500function forms(key) {
5501 return units[key].split('_');
5502}
5503function translate$3(num, withoutSuffix, key, isFuture) {
5504 let result = num + ' ';
5505 if (num === 1) {
5506 return result + translateSingular(num, withoutSuffix, key[0], isFuture);
5507 }
5508 else if (withoutSuffix) {
5509 return result + (special(num) ? forms(key)[1] : forms(key)[0]);
5510 }
5511 else {
5512 if (isFuture) {
5513 return result + forms(key)[1];
5514 }
5515 else {
5516 return result + (special(num) ? forms(key)[1] : forms(key)[2]);
5517 }
5518 }
5519}
5520const ltLocale = {
5521 abbr: 'lt',
5522 months: {
5523 format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'),
5524 standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'),
5525 isFormat: /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/
5526 },
5527 monthsShort: 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
5528 weekdays: {
5529 format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split('_'),
5530 standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'),
5531 isFormat: /dddd HH:mm/
5532 },
5533 weekdaysShort: 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
5534 weekdaysMin: 'S_P_A_T_K_Pn_Š'.split('_'),
5535 weekdaysParseExact: true,
5536 longDateFormat: {
5537 LT: 'HH:mm',
5538 LTS: 'HH:mm:ss',
5539 L: 'YYYY-MM-DD',
5540 LL: 'YYYY [m.] MMMM D [d.]',
5541 LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
5542 LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
5543 l: 'YYYY-MM-DD',
5544 ll: 'YYYY [m.] MMMM D [d.]',
5545 lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
5546 llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]'
5547 },
5548 calendar: {
5549 sameDay: '[Šiandien] LT',
5550 nextDay: '[Rytoj] LT',
5551 nextWeek: 'dddd LT',
5552 lastDay: '[Vakar] LT',
5553 lastWeek: '[Praėjusį] dddd LT',
5554 sameElse: 'L'
5555 },
5556 relativeTime: {
5557 future: 'po %s',
5558 past: 'prieš %s',
5559 s: translateSeconds,
5560 ss: translate$3,
5561 m: translateSingular,
5562 mm: translate$3,
5563 h: translateSingular,
5564 hh: translate$3,
5565 d: translateSingular,
5566 dd: translate$3,
5567 M: translateSingular,
5568 MM: translate$3,
5569 y: translateSingular,
5570 yy: translate$3
5571 },
5572 dayOfMonthOrdinalParse: /\d{1,2}-oji/,
5573 ordinal(num) {
5574 return num + '-oji';
5575 },
5576 week: {
5577 dow: 1,
5578 doy: 4 // The week that contains Jan 4th is the first week of the year.
5579 }
5580};
5581
5582//! moment.js locale configuration
5583//! locale : Latvian [lv]
5584//! author : Matiss Janis Aboltins : https://github.com/matissjanis
5585const lvLocale = {
5586 abbr: 'lv',
5587 months: 'Janvāris_Februāris_Marts_Aprīlis_Maijs_Jūnijs_Jūlijs_Augusts_Septembris_Oktobris_Novembris_Decembris'.split('_'),
5588 monthsShort: 'Jan_Feb_Mar_Apr_Mai_Jūn_Jūl_Aug_Sep_Okt_Nov_Dec'.split('_'),
5589 weekdays: 'Svētdiena_Pirmdiena_Otrdiena_Trešdiena_Ceturtdiena_Piektdiena_Sestdiena'.split('_'),
5590 weekdaysShort: 'Svētd_Pirmd_Otrd_Trešd_Ceturtd_Piektd_Sestd'.split('_'),
5591 weekdaysMin: 'Sv_Pi_Ot_Tr_Ce_Pk_Se'.split('_'),
5592 longDateFormat: {
5593 LT: 'HH:mm',
5594 LTS: 'HH:mm:ss',
5595 L: 'DD/MM/YYYY',
5596 LL: 'D MMMM YYYY',
5597 LLL: 'D MMMM YYYY HH:mm',
5598 LLLL: 'dddd, D MMMM YYYY HH:mm'
5599 },
5600 calendar: {
5601 sameDay: '[Today at] LT',
5602 nextDay: '[Tomorrow at] LT',
5603 nextWeek: 'dddd [at] LT',
5604 lastDay: '[Yesterday at] LT',
5605 lastWeek: '[Last] dddd [at] LT',
5606 sameElse: 'L'
5607 },
5608 relativeTime: {
5609 future: 'pēc %s',
5610 past: 'pirms %s',
5611 s: 'dažām sekundēm',
5612 ss: '%d sekundēm',
5613 m: 'minūtes',
5614 mm: '%d minūtēm',
5615 h: 'stundas',
5616 hh: '%d stundām',
5617 d: 'dienas',
5618 dd: '%d dienām',
5619 M: 'mēneša',
5620 MM: '%d mēnešiem',
5621 y: 'gada',
5622 yy: '%d gadiem'
5623 },
5624 dayOfMonthOrdinalParse: /\d{1,2}\./,
5625 ordinal(num) {
5626 return num + '.';
5627 },
5628 week: {
5629 dow: 1,
5630 doy: 4 // The week that contains Jan 4th is the first week of the year.
5631 }
5632};
5633
5634//! moment.js locale configuration
5635//! locale : Mongolian [mn]
5636//! author : Javkhlantugs Nyamdorj : https://github.com/javkhaanj7
5637function translate$4(num, withoutSuffix, key, isFuture) {
5638 switch (key) {
5639 case 's':
5640 return withoutSuffix ? 'хэдхэн секунд' : 'хэдхэн секундын';
5641 case 'ss':
5642 return num + (withoutSuffix ? ' секунд' : ' секундын');
5643 case 'm':
5644 case 'mm':
5645 return num + (withoutSuffix ? ' минут' : ' минутын');
5646 case 'h':
5647 case 'hh':
5648 return num + (withoutSuffix ? ' цаг' : ' цагийн');
5649 case 'd':
5650 case 'dd':
5651 return num + (withoutSuffix ? ' өдөр' : ' өдрийн');
5652 case 'M':
5653 case 'MM':
5654 return num + (withoutSuffix ? ' сар' : ' сарын');
5655 case 'y':
5656 case 'yy':
5657 return num + (withoutSuffix ? ' жил' : ' жилийн');
5658 default:
5659 return num.toString(10);
5660 }
5661}
5662const mnLocale = {
5663 abbr: 'mn',
5664 months: 'Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар'.split('_'),
5665 monthsShort: '1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split('_'),
5666 monthsParseExact: true,
5667 weekdays: 'Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба'.split('_'),
5668 weekdaysShort: 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'),
5669 weekdaysMin: 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'),
5670 weekdaysParseExact: true,
5671 longDateFormat: {
5672 LT: 'HH:mm',
5673 LTS: 'HH:mm:ss',
5674 L: 'YYYY-MM-DD',
5675 LL: 'YYYY оны MMMMын D',
5676 LLL: 'YYYY оны MMMMын D HH:mm',
5677 LLLL: 'dddd, YYYY оны MMMMын D HH:mm'
5678 },
5679 meridiemParse: /ҮӨ|ҮХ/i,
5680 isPM: function (input) {
5681 return input === 'ҮХ';
5682 },
5683 meridiem: function (hour, minute, isLower) {
5684 if (hour < 12) {
5685 return 'ҮӨ';
5686 }
5687 else {
5688 return 'ҮХ';
5689 }
5690 },
5691 calendar: {
5692 sameDay: '[Өнөөдөр] LT',
5693 nextDay: '[Маргааш] LT',
5694 nextWeek: '[Ирэх] dddd LT',
5695 lastDay: '[Өчигдөр] LT',
5696 lastWeek: '[Өнгөрсөн] dddd LT',
5697 sameElse: 'L'
5698 },
5699 relativeTime: {
5700 future: '%s дараа',
5701 past: '%s өмнө',
5702 s: translate$4,
5703 ss: translate$4,
5704 m: translate$4,
5705 mm: translate$4,
5706 h: translate$4,
5707 hh: translate$4,
5708 d: translate$4,
5709 dd: translate$4,
5710 M: translate$4,
5711 MM: translate$4,
5712 y: translate$4,
5713 yy: translate$4
5714 },
5715 dayOfMonthOrdinalParse: /\d{1,2} өдөр/,
5716 ordinal: function (num, period) {
5717 switch (period) {
5718 case 'd':
5719 case 'D':
5720 case 'DDD':
5721 return num + ' өдөр';
5722 default:
5723 return num.toString(10);
5724 }
5725 }
5726};
5727
5728//! moment.js locale configuration
5729//! locale : Norwegian Bokmål [nb]
5730//! authors : Espen Hovlandsdal : https://github.com/rexxars
5731//! Sigurd Gartmann : https://github.com/sigurdga
5732const nbLocale = {
5733 abbr: 'nb',
5734 months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
5735 monthsShort: 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),
5736 monthsParseExact: true,
5737 weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
5738 weekdaysShort: 'sø._ma._ti._on._to._fr._lø.'.split('_'),
5739 weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),
5740 weekdaysParseExact: true,
5741 longDateFormat: {
5742 LT: 'HH:mm',
5743 LTS: 'HH:mm:ss',
5744 L: 'DD.MM.YYYY',
5745 LL: 'D. MMMM YYYY',
5746 LLL: 'D. MMMM YYYY [kl.] HH:mm',
5747 LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm'
5748 },
5749 calendar: {
5750 sameDay: '[i dag kl.] LT',
5751 nextDay: '[i morgen kl.] LT',
5752 nextWeek: 'dddd [kl.] LT',
5753 lastDay: '[i går kl.] LT',
5754 lastWeek: '[forrige] dddd [kl.] LT',
5755 sameElse: 'L'
5756 },
5757 relativeTime: {
5758 future: 'om %s',
5759 past: '%s siden',
5760 s: 'noen sekunder',
5761 ss: '%d sekunder',
5762 m: 'ett minutt',
5763 mm: '%d minutter',
5764 h: 'en time',
5765 hh: '%d timer',
5766 d: 'en dag',
5767 dd: '%d dager',
5768 M: 'en måned',
5769 MM: '%d måneder',
5770 y: 'ett år',
5771 yy: '%d år'
5772 },
5773 dayOfMonthOrdinalParse: /\d{1,2}\./,
5774 ordinal: '%d.',
5775 week: {
5776 dow: 1,
5777 doy: 4 // The week that contains Jan 4th is the first week of the year.
5778 }
5779};
5780
5781//! moment.js locale configuration
5782//! locale : Dutch (Belgium) [nl-be]
5783//! author : Joris Röling : https://github.com/jorisroling
5784//! author : Jacob Middag : https://github.com/middagj
5785let monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_');
5786let monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
5787let monthsParse$4 = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];
5788let monthsRegex$4 = /^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
5789const nlBeLocale = {
5790 abbr: 'nl-be',
5791 months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
5792 monthsShort(date, format, isUTC) {
5793 if (!date) {
5794 return monthsShortWithDots;
5795 }
5796 else if (/-MMM-/.test(format)) {
5797 return monthsShortWithoutDots[getMonth(date, isUTC)];
5798 }
5799 else {
5800 return monthsShortWithDots[getMonth(date, isUTC)];
5801 }
5802 },
5803 monthsRegex: monthsRegex$4,
5804 monthsShortRegex: monthsRegex$4,
5805 monthsStrictRegex: /^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,
5806 monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
5807 monthsParse: monthsParse$4,
5808 longMonthsParse: monthsParse$4,
5809 shortMonthsParse: monthsParse$4,
5810 weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
5811 weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
5812 weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
5813 weekdaysParseExact: true,
5814 longDateFormat: {
5815 LT: 'HH:mm',
5816 LTS: 'HH:mm:ss',
5817 L: 'DD/MM/YYYY',
5818 LL: 'D MMMM YYYY',
5819 LLL: 'D MMMM YYYY HH:mm',
5820 LLLL: 'dddd D MMMM YYYY HH:mm'
5821 },
5822 calendar: {
5823 sameDay: '[vandaag om] LT',
5824 nextDay: '[morgen om] LT',
5825 nextWeek: 'dddd [om] LT',
5826 lastDay: '[gisteren om] LT',
5827 lastWeek: '[afgelopen] dddd [om] LT',
5828 sameElse: 'L'
5829 },
5830 relativeTime: {
5831 future: 'over %s',
5832 past: '%s geleden',
5833 s: 'een paar seconden',
5834 ss: '%d seconden',
5835 m: 'één minuut',
5836 mm: '%d minuten',
5837 h: 'één uur',
5838 hh: '%d uur',
5839 d: 'één dag',
5840 dd: '%d dagen',
5841 M: 'één maand',
5842 MM: '%d maanden',
5843 y: 'één jaar',
5844 yy: '%d jaar'
5845 },
5846 dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
5847 ordinal(_num) {
5848 const num = Number(_num);
5849 return num + ((num === 1 || num === 8 || num >= 20) ? 'ste' : 'de');
5850 },
5851 week: {
5852 dow: 1,
5853 doy: 4 // The week that contains Jan 4th is the first week of the year.
5854 }
5855};
5856
5857//! moment.js locale configuration
5858//! locale : Dutch [nl]
5859//! author : Joris Röling : https://github.com/jorisroling
5860//! author : Jacob Middag : https://github.com/middagj
5861let monthsShortWithDots$1 = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'), monthsShortWithoutDots$1 = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
5862let monthsParse$5 = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];
5863let monthsRegex$5 = /^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
5864const nlLocale = {
5865 abbr: 'nl',
5866 months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
5867 monthsShort(date, format, isUTC) {
5868 if (!date) {
5869 return monthsShortWithDots$1;
5870 }
5871 else if (/-MMM-/.test(format)) {
5872 return monthsShortWithoutDots$1[getMonth(date, isUTC)];
5873 }
5874 else {
5875 return monthsShortWithDots$1[getMonth(date, isUTC)];
5876 }
5877 },
5878 monthsRegex: monthsRegex$5,
5879 monthsShortRegex: monthsRegex$5,
5880 monthsStrictRegex: /^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,
5881 monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
5882 monthsParse: monthsParse$5,
5883 longMonthsParse: monthsParse$5,
5884 shortMonthsParse: monthsParse$5,
5885 weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
5886 weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
5887 weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
5888 weekdaysParseExact: true,
5889 longDateFormat: {
5890 LT: 'HH:mm',
5891 LTS: 'HH:mm:ss',
5892 L: 'DD-MM-YYYY',
5893 LL: 'D MMMM YYYY',
5894 LLL: 'D MMMM YYYY HH:mm',
5895 LLLL: 'dddd D MMMM YYYY HH:mm'
5896 },
5897 calendar: {
5898 sameDay: '[vandaag om] LT',
5899 nextDay: '[morgen om] LT',
5900 nextWeek: 'dddd [om] LT',
5901 lastDay: '[gisteren om] LT',
5902 lastWeek: '[afgelopen] dddd [om] LT',
5903 sameElse: 'L'
5904 },
5905 relativeTime: {
5906 future: 'over %s',
5907 past: '%s geleden',
5908 s: 'een paar seconden',
5909 ss: '%d seconden',
5910 m: 'één minuut',
5911 mm: '%d minuten',
5912 h: 'één uur',
5913 hh: '%d uur',
5914 d: 'één dag',
5915 dd: '%d dagen',
5916 M: 'één maand',
5917 MM: '%d maanden',
5918 y: 'één jaar',
5919 yy: '%d jaar'
5920 },
5921 dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
5922 ordinal(_num) {
5923 const num = Number(_num);
5924 return num + ((num === 1 || num === 8 || num >= 20) ? 'ste' : 'de');
5925 },
5926 week: {
5927 dow: 1,
5928 doy: 4 // The week that contains Jan 4th is the first week of the year.
5929 }
5930};
5931
5932//! moment.js locale configuration
5933//! locale : Polish [pl]
5934//! author : Rafal Hirsz : https://github.com/evoL
5935let monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_');
5936let monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');
5937function plural$1(num) {
5938 return (num % 10 < 5) && (num % 10 > 1) && ((~~(num / 10) % 10) !== 1);
5939}
5940function translate$5(num, withoutSuffix, key) {
5941 let result = num + ' ';
5942 switch (key) {
5943 case 'ss':
5944 return result + (plural$1(num) ? 'sekundy' : 'sekund');
5945 case 'm':
5946 return withoutSuffix ? 'minuta' : 'minutę';
5947 case 'mm':
5948 return result + (plural$1(num) ? 'minuty' : 'minut');
5949 case 'h':
5950 return withoutSuffix ? 'godzina' : 'godzinę';
5951 case 'hh':
5952 return result + (plural$1(num) ? 'godziny' : 'godzin');
5953 case 'MM':
5954 return result + (plural$1(num) ? 'miesiące' : 'miesięcy');
5955 case 'yy':
5956 return result + (plural$1(num) ? 'lata' : 'lat');
5957 }
5958}
5959const plLocale = {
5960 abbr: 'pl',
5961 months(date, format, isUTC) {
5962 if (!date) {
5963 return monthsNominative;
5964 }
5965 else if (format === '') {
5966 // Hack: if format empty we know this is used to generate
5967 // RegExp by moment. Give then back both valid forms of months
5968 // in RegExp ready format.
5969 return '(' + monthsSubjective[getMonth(date, isUTC)] + '|' + monthsNominative[getMonth(date, isUTC)] + ')';
5970 }
5971 else if (/D MMMM/.test(format)) {
5972 return monthsSubjective[getMonth(date, isUTC)];
5973 }
5974 else {
5975 return monthsNominative[getMonth(date, isUTC)];
5976 }
5977 },
5978 monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
5979 weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),
5980 weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
5981 weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
5982 longDateFormat: {
5983 LT: 'HH:mm',
5984 LTS: 'HH:mm:ss',
5985 L: 'DD.MM.YYYY',
5986 LL: 'D MMMM YYYY',
5987 LLL: 'D MMMM YYYY HH:mm',
5988 LLLL: 'dddd, D MMMM YYYY HH:mm'
5989 },
5990 calendar: {
5991 sameDay: '[Dziś o] LT',
5992 nextDay: '[Jutro o] LT',
5993 nextWeek(date) {
5994 switch (getDayOfWeek(date)) {
5995 case 0:
5996 return '[W niedzielę o] LT';
5997 case 2:
5998 return '[We wtorek o] LT';
5999 case 3:
6000 return '[W środę o] LT';
6001 case 5:
6002 return '[W piątek o] LT';
6003 case 6:
6004 return '[W sobotę o] LT';
6005 default:
6006 return '[W] dddd [o] LT';
6007 }
6008 },
6009 lastDay: '[Wczoraj o] LT',
6010 lastWeek(date) {
6011 switch (getDayOfWeek(date)) {
6012 case 0:
6013 return '[W zeszłą niedzielę o] LT';
6014 case 3:
6015 return '[W zeszłą środę o] LT';
6016 case 4:
6017 return '[W zeszłą czwartek o] LT';
6018 case 5:
6019 return '[W zeszłą piątek o] LT';
6020 case 6:
6021 return '[W zeszłą sobotę o] LT';
6022 default:
6023 return '[W zeszły] dddd [o] LT';
6024 }
6025 },
6026 sameElse: 'L'
6027 },
6028 relativeTime: {
6029 future: 'za %s',
6030 past: '%s temu',
6031 s: 'kilka sekund',
6032 ss: translate$5,
6033 m: translate$5,
6034 mm: translate$5,
6035 h: translate$5,
6036 hh: translate$5,
6037 d: '1 dzień',
6038 dd: '%d dni',
6039 M: 'miesiąc',
6040 MM: translate$5,
6041 y: 'rok',
6042 yy: translate$5
6043 },
6044 dayOfMonthOrdinalParse: /\d{1,2}\./,
6045 ordinal: '%d.',
6046 week: {
6047 dow: 1,
6048 doy: 4 // The week that contains Jan 4th is the first week of the year.
6049 }
6050};
6051
6052//! moment.js locale configuration
6053//! locale : Portuguese (Brazil) [pt-br]
6054//! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira
6055const ptBrLocale = {
6056 abbr: 'pt-br',
6057 months: 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),
6058 monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
6059 weekdays: 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),
6060 weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
6061 weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),
6062 weekdaysParseExact: true,
6063 longDateFormat: {
6064 LT: 'HH:mm',
6065 LTS: 'HH:mm:ss',
6066 L: 'DD/MM/YYYY',
6067 LL: 'D [de] MMMM [de] YYYY',
6068 LLL: 'D [de] MMMM [de] YYYY [às] HH:mm',
6069 LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm'
6070 },
6071 calendar: {
6072 sameDay: '[Hoje às] LT',
6073 nextDay: '[Amanhã às] LT',
6074 nextWeek: 'dddd [às] LT',
6075 lastDay: '[Ontem às] LT',
6076 lastWeek(date) {
6077 return (getDayOfWeek(date) === 0 || getDayOfWeek(date) === 6) ?
6078 '[Último] dddd [às] LT' : // Saturday + Sunday
6079 '[Última] dddd [às] LT'; // Monday - Friday
6080 },
6081 sameElse: 'L'
6082 },
6083 relativeTime: {
6084 future: 'em %s',
6085 past: '%s atrás',
6086 s: 'poucos segundos',
6087 ss: '%d segundos',
6088 m: 'um minuto',
6089 mm: '%d minutos',
6090 h: 'uma hora',
6091 hh: '%d horas',
6092 d: 'um dia',
6093 dd: '%d dias',
6094 M: 'um mês',
6095 MM: '%d meses',
6096 y: 'um ano',
6097 yy: '%d anos'
6098 },
6099 dayOfMonthOrdinalParse: /\d{1,2}º/,
6100 ordinal: '%dº'
6101};
6102
6103// ! moment.js locale configuration
6104// ! locale : Romanian [ro]
6105//! author : Vlad Gurdiga : https://github.com/gurdiga
6106//! author : Valentin Agachi : https://github.com/avaly
6107// ! author : Earle white: https://github.com/5earle
6108function relativeTimeWithPlural(num, withoutSuffix, key) {
6109 let format = {
6110 ss: 'secunde',
6111 mm: 'minute',
6112 hh: 'ore',
6113 dd: 'zile',
6114 MM: 'luni',
6115 yy: 'ani'
6116 };
6117 let separator = ' ';
6118 if (num % 100 >= 20 || (num >= 100 && num % 100 === 0)) {
6119 separator = ' de ';
6120 }
6121 return num + separator + format[key];
6122}
6123const roLocale = {
6124 abbr: 'ro',
6125 months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),
6126 monthsShort: 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),
6127 monthsParseExact: true,
6128 weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
6129 weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
6130 weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
6131 longDateFormat: {
6132 LT: 'H:mm',
6133 LTS: 'H:mm:ss',
6134 L: 'DD.MM.YYYY',
6135 LL: 'D MMMM YYYY',
6136 LLL: 'D MMMM YYYY H:mm',
6137 LLLL: 'dddd, D MMMM YYYY H:mm'
6138 },
6139 calendar: {
6140 sameDay: '[azi la] LT',
6141 nextDay: '[mâine la] LT',
6142 nextWeek: 'dddd [la] LT',
6143 lastDay: '[ieri la] LT',
6144 lastWeek: '[fosta] dddd [la] LT',
6145 sameElse: 'L'
6146 },
6147 relativeTime: {
6148 future: 'peste %s',
6149 past: '%s în urmă',
6150 s: 'câteva secunde',
6151 ss: relativeTimeWithPlural,
6152 m: 'un minut',
6153 mm: relativeTimeWithPlural,
6154 h: 'o oră',
6155 hh: relativeTimeWithPlural,
6156 d: 'o zi',
6157 dd: relativeTimeWithPlural,
6158 M: 'o lună',
6159 MM: relativeTimeWithPlural,
6160 y: 'un an',
6161 yy: relativeTimeWithPlural
6162 },
6163 week: {
6164 dow: 1,
6165 doy: 7 // The week that contains Jan 1st is the first week of the year.
6166 }
6167};
6168
6169//! moment.js locale configuration
6170//! locale : Russian [ru]
6171//! author : Viktorminator : https://github.com/Viktorminator
6172//! Author : Menelion Elensúle : https://github.com/Oire
6173//! author : Коренберг Марк : https://github.com/socketpair
6174function plural$2(word, num) {
6175 let forms = word.split('_');
6176 return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
6177}
6178function relativeTimeWithPlural$1(num, withoutSuffix, key) {
6179 let format = {
6180 ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
6181 mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
6182 hh: 'час_часа_часов',
6183 dd: 'день_дня_дней',
6184 MM: 'месяц_месяца_месяцев',
6185 yy: 'год_года_лет'
6186 };
6187 if (key === 'm') {
6188 return withoutSuffix ? 'минута' : 'минуту';
6189 }
6190 return num + ' ' + plural$2(format[key], +num);
6191}
6192let monthsParse$6 = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i];
6193// http://new.gramota.ru/spravka/rules/139-prop : § 103
6194// Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637
6195// CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753
6196const ruLocale = {
6197 abbr: 'ru',
6198 months: {
6199 format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'),
6200 standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_')
6201 },
6202 monthsShort: {
6203 // по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку ?
6204 format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'),
6205 standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_')
6206 },
6207 weekdays: {
6208 standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
6209 format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'),
6210 isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/
6211 },
6212 weekdaysShort: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
6213 weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
6214 monthsParse: monthsParse$6,
6215 longMonthsParse: monthsParse$6,
6216 shortMonthsParse: monthsParse$6,
6217 // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки
6218 monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
6219 // копия предыдущего
6220 monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
6221 // полные названия с падежами
6222 monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,
6223 // Выражение, которое соотвествует только сокращённым формам
6224 monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,
6225 longDateFormat: {
6226 LT: 'H:mm',
6227 LTS: 'H:mm:ss',
6228 L: 'DD.MM.YYYY',
6229 LL: 'D MMMM YYYY г.',
6230 LLL: 'D MMMM YYYY г., H:mm',
6231 LLLL: 'dddd, D MMMM YYYY г., H:mm'
6232 },
6233 calendar: {
6234 sameDay: '[Сегодня в] LT',
6235 nextDay: '[Завтра в] LT',
6236 lastDay: '[Вчера в] LT',
6237 nextWeek(date, now) {
6238 if (getWeek(now) !== getWeek(date)) {
6239 switch (getDayOfWeek(date)) {
6240 case 0:
6241 return '[В следующее] dddd [в] LT';
6242 case 1:
6243 case 2:
6244 case 4:
6245 return '[В следующий] dddd [в] LT';
6246 case 3:
6247 case 5:
6248 case 6:
6249 return '[В следующую] dddd [в] LT';
6250 }
6251 }
6252 else {
6253 if (getDayOfWeek(date) === 2) {
6254 return '[Во] dddd [в] LT';
6255 }
6256 else {
6257 return '[В] dddd [в] LT';
6258 }
6259 }
6260 },
6261 lastWeek(date, now) {
6262 if (getWeek(now) !== getWeek(date)) {
6263 switch (getDayOfWeek(date)) {
6264 case 0:
6265 return '[В прошлое] dddd [в] LT';
6266 case 1:
6267 case 2:
6268 case 4:
6269 return '[В прошлый] dddd [в] LT';
6270 case 3:
6271 case 5:
6272 case 6:
6273 return '[В прошлую] dddd [в] LT';
6274 }
6275 }
6276 else {
6277 if (getDayOfWeek(date) === 2) {
6278 return '[Во] dddd [в] LT';
6279 }
6280 else {
6281 return '[В] dddd [в] LT';
6282 }
6283 }
6284 },
6285 sameElse: 'L'
6286 },
6287 relativeTime: {
6288 future: 'через %s',
6289 past: '%s назад',
6290 s: 'несколько секунд',
6291 ss: relativeTimeWithPlural$1,
6292 m: relativeTimeWithPlural$1,
6293 mm: relativeTimeWithPlural$1,
6294 h: 'час',
6295 hh: relativeTimeWithPlural$1,
6296 d: 'день',
6297 dd: relativeTimeWithPlural$1,
6298 M: 'месяц',
6299 MM: relativeTimeWithPlural$1,
6300 y: 'год',
6301 yy: relativeTimeWithPlural$1
6302 },
6303 meridiemParse: /ночи|утра|дня|вечера/i,
6304 isPM(input) {
6305 return /^(дня|вечера)$/.test(input);
6306 },
6307 meridiem(hour, minute, isLower) {
6308 if (hour < 4) {
6309 return 'ночи';
6310 }
6311 else if (hour < 12) {
6312 return 'утра';
6313 }
6314 else if (hour < 17) {
6315 return 'дня';
6316 }
6317 else {
6318 return 'вечера';
6319 }
6320 },
6321 dayOfMonthOrdinalParse: /\d{1,2}-(й|го|я)/,
6322 ordinal(_num, period) {
6323 const num = Number(_num);
6324 switch (period) {
6325 case 'M':
6326 case 'd':
6327 case 'DDD':
6328 return num + '-й';
6329 case 'D':
6330 return num + '-го';
6331 case 'w':
6332 case 'W':
6333 return num + '-я';
6334 default:
6335 return num.toString(10);
6336 }
6337 },
6338 week: {
6339 dow: 1,
6340 doy: 4 // The week that contains Jan 4th is the first week of the year.
6341 }
6342};
6343
6344//! moment.js locale configuration
6345//! locale : Slovak [sk]
6346//! author : Jozef Pažin : https://github.com/atiris
6347const months$2 = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_');
6348const monthsShort$6 = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
6349function plural$3(num) {
6350 return (num > 1) && (num < 5) && (~~(num / 10) !== 1);
6351}
6352function translate$6(num, withoutSuffix, key, isFuture) {
6353 const result = num + ' ';
6354 switch (key) {
6355 case 's': // a few seconds / in a few seconds / a few seconds ago
6356 return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami';
6357 case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
6358 if (withoutSuffix || isFuture) {
6359 return result + (plural$3(num) ? 'sekundy' : 'sekúnd');
6360 }
6361 else {
6362 return result + 'sekundami';
6363 }
6364 // break;
6365 case 'm': // a minute / in a minute / a minute ago
6366 return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou');
6367 case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
6368 if (withoutSuffix || isFuture) {
6369 return result + (plural$3(num) ? 'minúty' : 'minút');
6370 }
6371 else {
6372 return result + 'minútami';
6373 }
6374 // break;
6375 case 'h': // an hour / in an hour / an hour ago
6376 return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
6377 case 'hh': // 9 hours / in 9 hours / 9 hours ago
6378 if (withoutSuffix || isFuture) {
6379 return result + (plural$3(num) ? 'hodiny' : 'hodín');
6380 }
6381 else {
6382 return result + 'hodinami';
6383 }
6384 // break;
6385 case 'd': // a day / in a day / a day ago
6386 return (withoutSuffix || isFuture) ? 'deň' : 'dňom';
6387 case 'dd': // 9 days / in 9 days / 9 days ago
6388 if (withoutSuffix || isFuture) {
6389 return result + (plural$3(num) ? 'dni' : 'dní');
6390 }
6391 else {
6392 return result + 'dňami';
6393 }
6394 // break;
6395 case 'M': // a month / in a month / a month ago
6396 return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom';
6397 case 'MM': // 9 months / in 9 months / 9 months ago
6398 if (withoutSuffix || isFuture) {
6399 return result + (plural$3(num) ? 'mesiace' : 'mesiacov');
6400 }
6401 else {
6402 return result + 'mesiacmi';
6403 }
6404 // break;
6405 case 'y': // a year / in a year / a year ago
6406 return (withoutSuffix || isFuture) ? 'rok' : 'rokom';
6407 case 'yy': // 9 years / in 9 years / 9 years ago
6408 if (withoutSuffix || isFuture) {
6409 return result + (plural$3(num) ? 'roky' : 'rokov');
6410 }
6411 else {
6412 return result + 'rokmi';
6413 }
6414 // break;
6415 }
6416}
6417const skLocale = {
6418 abbr: 'sk',
6419 months: months$2,
6420 monthsShort: monthsShort$6,
6421 weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
6422 weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'),
6423 weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'),
6424 longDateFormat: {
6425 LT: 'H:mm',
6426 LTS: 'H:mm:ss',
6427 L: 'DD.MM.YYYY',
6428 LL: 'D. MMMM YYYY',
6429 LLL: 'D. MMMM YYYY H:mm',
6430 LLLL: 'dddd D. MMMM YYYY H:mm',
6431 l: 'D. M. YYYY'
6432 },
6433 calendar: {
6434 sameDay: '[dnes o] LT',
6435 nextDay: '[zajtra o] LT',
6436 nextWeek(date) {
6437 switch (getDayOfWeek(date)) {
6438 case 0:
6439 return '[v nedeľu o] LT';
6440 case 1:
6441 case 2:
6442 return '[v] dddd [o] LT';
6443 case 3:
6444 return '[v stredu o] LT';
6445 case 4:
6446 return '[vo štvrtok o] LT';
6447 case 5:
6448 return '[v piatok o] LT';
6449 case 6:
6450 return '[v sobotu o] LT';
6451 }
6452 },
6453 lastDay: '[včera o] LT',
6454 lastWeek(date) {
6455 switch (getDayOfWeek(date)) {
6456 case 0:
6457 return '[minulú nedeľu o] LT';
6458 case 1:
6459 case 2:
6460 return '[minulý] dddd [o] LT';
6461 case 3:
6462 return '[minulú stredu o] LT';
6463 case 4:
6464 case 5:
6465 return '[minulý] dddd [o] LT';
6466 case 6:
6467 return '[minulú sobotu o] LT';
6468 }
6469 },
6470 sameElse: 'L'
6471 },
6472 relativeTime: {
6473 future: 'o %s',
6474 past: 'pred %s',
6475 s: translate$6,
6476 ss: translate$6,
6477 m: translate$6,
6478 mm: translate$6,
6479 h: translate$6,
6480 hh: translate$6,
6481 d: translate$6,
6482 dd: translate$6,
6483 M: translate$6,
6484 MM: translate$6,
6485 y: translate$6,
6486 yy: translate$6
6487 },
6488 dayOfMonthOrdinalParse: /\d{1,2}\./,
6489 ordinal: '%d.',
6490 week: {
6491 dow: 1,
6492 doy: 4 // The week that contains Jan 4th is the first week of the year.
6493 }
6494};
6495
6496//! moment.js locale configuration
6497//! locale : Slovenian [sl]
6498//! author : mihan : https://github.com/mihan
6499function processRelativeTime$2(number, withoutSuffix, key, isFuture) {
6500 var result = number + ' ';
6501 switch (key) {
6502 case 's':
6503 return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';
6504 case 'ss':
6505 if (number === 1) {
6506 result += withoutSuffix ? 'sekundo' : 'sekundi';
6507 }
6508 else if (number === 2) {
6509 result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';
6510 }
6511 else if (number < 5) {
6512 result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';
6513 }
6514 else {
6515 result += withoutSuffix || isFuture ? 'sekund' : 'sekund';
6516 }
6517 return result;
6518 case 'm':
6519 return withoutSuffix ? 'ena minuta' : 'eno minuto';
6520 case 'mm':
6521 if (number === 1) {
6522 result += withoutSuffix ? 'minuta' : 'minuto';
6523 }
6524 else if (number === 2) {
6525 result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
6526 }
6527 else if (number < 5) {
6528 result += withoutSuffix || isFuture ? 'minute' : 'minutami';
6529 }
6530 else {
6531 result += withoutSuffix || isFuture ? 'minut' : 'minutami';
6532 }
6533 return result;
6534 case 'h':
6535 return withoutSuffix ? 'ena ura' : 'eno uro';
6536 case 'hh':
6537 if (number === 1) {
6538 result += withoutSuffix ? 'ura' : 'uro';
6539 }
6540 else if (number === 2) {
6541 result += withoutSuffix || isFuture ? 'uri' : 'urama';
6542 }
6543 else if (number < 5) {
6544 result += withoutSuffix || isFuture ? 'ure' : 'urami';
6545 }
6546 else {
6547 result += withoutSuffix || isFuture ? 'ur' : 'urami';
6548 }
6549 return result;
6550 case 'd':
6551 return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
6552 case 'dd':
6553 if (number === 1) {
6554 result += withoutSuffix || isFuture ? 'dan' : 'dnem';
6555 }
6556 else if (number === 2) {
6557 result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
6558 }
6559 else {
6560 result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
6561 }
6562 return result;
6563 case 'M':
6564 return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
6565 case 'MM':
6566 if (number === 1) {
6567 result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
6568 }
6569 else if (number === 2) {
6570 result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
6571 }
6572 else if (number < 5) {
6573 result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
6574 }
6575 else {
6576 result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
6577 }
6578 return result;
6579 case 'y':
6580 return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
6581 case 'yy':
6582 if (number === 1) {
6583 result += withoutSuffix || isFuture ? 'leto' : 'letom';
6584 }
6585 else if (number === 2) {
6586 result += withoutSuffix || isFuture ? 'leti' : 'letoma';
6587 }
6588 else if (number < 5) {
6589 result += withoutSuffix || isFuture ? 'leta' : 'leti';
6590 }
6591 else {
6592 result += withoutSuffix || isFuture ? 'let' : 'leti';
6593 }
6594 return result;
6595 }
6596}
6597const slLocale = {
6598 abbr: 'sl',
6599 months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'),
6600 monthsShort: 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),
6601 monthsParseExact: true,
6602 weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
6603 weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
6604 weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'),
6605 weekdaysParseExact: true,
6606 longDateFormat: {
6607 LT: 'H:mm',
6608 LTS: 'H:mm:ss',
6609 L: 'DD.MM.YYYY',
6610 LL: 'D. MMMM YYYY',
6611 LLL: 'D. MMMM YYYY H:mm',
6612 LLLL: 'dddd, D. MMMM YYYY H:mm'
6613 },
6614 calendar: {
6615 sameDay: '[danes ob] LT',
6616 nextDay: '[jutri ob] LT',
6617 nextWeek(date) {
6618 switch (getDayOfWeek(date)) {
6619 case 0:
6620 return '[v] [nedeljo] [ob] LT';
6621 case 3:
6622 return '[v] [sredo] [ob] LT';
6623 case 6:
6624 return '[v] [soboto] [ob] LT';
6625 case 1:
6626 case 2:
6627 case 4:
6628 case 5:
6629 return '[v] dddd [ob] LT';
6630 }
6631 },
6632 lastDay: '[včeraj ob] LT',
6633 lastWeek(date) {
6634 switch (getDayOfWeek(date)) {
6635 case 0:
6636 return '[prejšnjo] [nedeljo] [ob] LT';
6637 case 3:
6638 return '[prejšnjo] [sredo] [ob] LT';
6639 case 6:
6640 return '[prejšnjo] [soboto] [ob] LT';
6641 case 1:
6642 case 2:
6643 case 4:
6644 case 5:
6645 return '[prejšnji] dddd [ob] LT';
6646 }
6647 },
6648 sameElse: 'L'
6649 },
6650 relativeTime: {
6651 future: 'čez %s',
6652 past: 'pred %s',
6653 s: processRelativeTime$2,
6654 ss: processRelativeTime$2,
6655 m: processRelativeTime$2,
6656 mm: processRelativeTime$2,
6657 h: processRelativeTime$2,
6658 hh: processRelativeTime$2,
6659 d: processRelativeTime$2,
6660 dd: processRelativeTime$2,
6661 M: processRelativeTime$2,
6662 MM: processRelativeTime$2,
6663 y: processRelativeTime$2,
6664 yy: processRelativeTime$2
6665 },
6666 dayOfMonthOrdinalParse: /\d{1,2}\./,
6667 ordinal: '%d.',
6668 week: {
6669 dow: 1,
6670 doy: 7 // The week that contains Jan 1st is the first week of the year.
6671 }
6672};
6673
6674//! moment.js locale configuration
6675//! locale : Albanian [sq]
6676//! author : Agon Cecelia : https://github.com/agoncecelia
6677const sqLocale = {
6678 abbr: 'sq',
6679 months: 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'),
6680 monthsShort: 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),
6681 weekdays: 'E Dielë_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'),
6682 weekdaysShort: 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),
6683 weekdaysMin: 'Di_He_Ma_Me_En_Pr_Sh'.split('_'),
6684 longDateFormat: {
6685 LT: 'HH:mm',
6686 LTS: 'HH:mm:ss',
6687 L: 'DD/MM/YYYY',
6688 LL: 'D MMMM YYYY',
6689 LLL: 'D MMMM YYYY HH:mm',
6690 LLLL: 'dddd, D MMMM YYYY HH:mm'
6691 },
6692 calendar: {
6693 sameDay: '[Sot në] LT',
6694 nextDay: '[Nesër në] LT',
6695 nextWeek: 'dddd [në] LT',
6696 lastDay: '[Dje në] LT',
6697 lastWeek: 'dddd [e kaluar në] LT',
6698 sameElse: 'L'
6699 },
6700 relativeTime: {
6701 future: 'në %s',
6702 past: 'para %sve',
6703 s: 'disa sekonda',
6704 ss: '%d sekonda',
6705 m: 'një minut',
6706 mm: '%d minuta',
6707 h: 'një orë',
6708 hh: '%d orë',
6709 d: 'një ditë',
6710 dd: '%d ditë',
6711 M: 'një muaj',
6712 MM: '%d muaj',
6713 y: 'një vit',
6714 yy: '%d vite'
6715 },
6716 dayOfMonthOrdinalParse: /\d{1,2}\./,
6717 ordinal: '%d.',
6718 week: {
6719 dow: 1,
6720 doy: 4 // The week that contains Jan 4th is the first week of the year.
6721 }
6722};
6723
6724//! moment.js locale configuration
6725//! locale : Swedish [sv]
6726//! author : Jens Alm : https://github.com/ulmus
6727const svLocale = {
6728 abbr: 'sv',
6729 months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),
6730 monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
6731 weekdays: 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),
6732 weekdaysShort: 'sön_mån_tis_ons_tor_fre_lör'.split('_'),
6733 weekdaysMin: 'sö_må_ti_on_to_fr_lö'.split('_'),
6734 longDateFormat: {
6735 LT: 'HH:mm',
6736 LTS: 'HH:mm:ss',
6737 L: 'YYYY-MM-DD',
6738 LL: 'D MMMM YYYY',
6739 LLL: 'D MMMM YYYY [kl.] HH:mm',
6740 LLLL: 'dddd D MMMM YYYY [kl.] HH:mm',
6741 lll: 'D MMM YYYY HH:mm',
6742 llll: 'ddd D MMM YYYY HH:mm'
6743 },
6744 calendar: {
6745 sameDay: '[Idag] LT',
6746 nextDay: '[Imorgon] LT',
6747 lastDay: '[Igår] LT',
6748 nextWeek: '[På] dddd LT',
6749 lastWeek: '[I] dddd[s] LT',
6750 sameElse: 'L'
6751 },
6752 relativeTime: {
6753 future: 'om %s',
6754 past: 'för %s sedan',
6755 s: 'några sekunder',
6756 ss: '%d sekunder',
6757 m: 'en minut',
6758 mm: '%d minuter',
6759 h: 'en timme',
6760 hh: '%d timmar',
6761 d: 'en dag',
6762 dd: '%d dagar',
6763 M: 'en månad',
6764 MM: '%d månader',
6765 y: 'ett år',
6766 yy: '%d år'
6767 },
6768 dayOfMonthOrdinalParse: /\d{1,2}(e|a)/,
6769 ordinal(_num) {
6770 const num = Number(_num);
6771 let b = num % 10, output = (~~(num % 100 / 10) === 1) ? 'e' :
6772 (b === 1) ? 'a' :
6773 (b === 2) ? 'a' :
6774 (b === 3) ? 'e' : 'e';
6775 return num + output;
6776 },
6777 week: {
6778 dow: 1,
6779 doy: 4 // The week that contains Jan 4th is the first week of the year.
6780 }
6781};
6782
6783// moment.js locale configuration
6784// locale : Thai [th]
6785// author : Watcharapol Sanitwong : https://github.com/tumit
6786const thLocale = {
6787 abbr: 'th',
6788 months: 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),
6789 monthsShort: 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split('_'),
6790 monthsParseExact: true,
6791 weekdays: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),
6792 weekdaysShort: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
6793 weekdaysMin: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
6794 weekdaysParseExact: true,
6795 longDateFormat: {
6796 LT: 'H:mm',
6797 LTS: 'H:mm:ss',
6798 L: 'DD/MM/YYYY',
6799 LL: 'D MMMM YYYY',
6800 LLL: 'D MMMM YYYY เวลา H:mm',
6801 LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm'
6802 },
6803 meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,
6804 isPM(input) {
6805 return input === 'หลังเที่ยง';
6806 },
6807 meridiem(hour, minute, isLower) {
6808 if (hour < 12) {
6809 return 'ก่อนเที่ยง';
6810 }
6811 else {
6812 return 'หลังเที่ยง';
6813 }
6814 },
6815 calendar: {
6816 sameDay: '[วันนี้ เวลา] LT',
6817 nextDay: '[พรุ่งนี้ เวลา] LT',
6818 nextWeek: 'dddd[หน้า เวลา] LT',
6819 lastDay: '[เมื่อวานนี้ เวลา] LT',
6820 lastWeek: '[วัน]dddd[ที่แล้ว เวลา] LT',
6821 sameElse: 'L'
6822 },
6823 relativeTime: {
6824 future: 'อีก %s',
6825 past: '%sที่แล้ว',
6826 s: 'ไม่กี่วินาที',
6827 ss: '%d วินาที',
6828 m: '1 นาที',
6829 mm: '%d นาที',
6830 h: '1 ชั่วโมง',
6831 hh: '%d ชั่วโมง',
6832 d: '1 วัน',
6833 dd: '%d วัน',
6834 M: '1 เดือน',
6835 MM: '%d เดือน',
6836 y: '1 ปี',
6837 yy: '%d ปี'
6838 }
6839};
6840
6841// moment.js locale configuration
6842// locale : Thai-Buddhist Era [th-be]
6843// author : Watcharapol Sanitwong : https://github.com/tumit
6844const thBeLocale = {
6845 abbr: 'th-be',
6846 months: 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),
6847 monthsShort: 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split('_'),
6848 monthsParseExact: true,
6849 weekdays: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),
6850 weekdaysShort: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
6851 weekdaysMin: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
6852 weekdaysParseExact: true,
6853 longDateFormat: {
6854 LT: 'H:mm',
6855 LTS: 'H:mm:ss',
6856 L: 'DD/MM/YYYY',
6857 LL: 'D MMMM YYYY',
6858 LLL: 'D MMMM YYYY เวลา H:mm',
6859 LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm'
6860 },
6861 meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,
6862 isPM(input) {
6863 return input === 'หลังเที่ยง';
6864 },
6865 meridiem(hour, minute, isLower) {
6866 if (hour < 12) {
6867 return 'ก่อนเที่ยง';
6868 }
6869 else {
6870 return 'หลังเที่ยง';
6871 }
6872 },
6873 calendar: {
6874 sameDay: '[วันนี้ เวลา] LT',
6875 nextDay: '[พรุ่งนี้ เวลา] LT',
6876 nextWeek: 'dddd[หน้า เวลา] LT',
6877 lastDay: '[เมื่อวานนี้ เวลา] LT',
6878 lastWeek: '[วัน]dddd[ที่แล้ว เวลา] LT',
6879 sameElse: 'L'
6880 },
6881 relativeTime: {
6882 future: 'อีก %s',
6883 past: '%sที่แล้ว',
6884 s: 'ไม่กี่วินาที',
6885 ss: '%d วินาที',
6886 m: '1 นาที',
6887 mm: '%d นาที',
6888 h: '1 ชั่วโมง',
6889 hh: '%d ชั่วโมง',
6890 d: '1 วัน',
6891 dd: '%d วัน',
6892 M: '1 เดือน',
6893 MM: '%d เดือน',
6894 y: '1 ปี',
6895 yy: '%d ปี'
6896 },
6897 preparse(str, format) {
6898 const _format = thBeLocale.longDateFormat[format]
6899 ? thBeLocale.longDateFormat[format]
6900 : format;
6901 // endsWith('YYYY')
6902 if (_format.indexOf('YYYY', _format.length - 'YYYY'.length) !== -1) {
6903 const ddMM = str.substr(0, str.length - 4);
6904 const yyyy = parseInt(str.substr(str.length - 4), 10) - 543;
6905 return ddMM + yyyy;
6906 }
6907 return str;
6908 },
6909 getFullYear(date, isUTC = false) {
6910 return 543 + (isUTC ? date.getUTCFullYear() : date.getFullYear());
6911 }
6912};
6913
6914//! moment.js locale configuration
6915//! locale : Turkish [tr]
6916//! authors : Erhan Gundogan : https://github.com/erhangundogan,
6917//! Burak Yiğit Kaya: https://github.com/BYK
6918let suffixes$1 = {
6919 1: '\'inci',
6920 5: '\'inci',
6921 8: '\'inci',
6922 70: '\'inci',
6923 80: '\'inci',
6924 2: '\'nci',
6925 7: '\'nci',
6926 20: '\'nci',
6927 50: '\'nci',
6928 3: '\'üncü',
6929 4: '\'üncü',
6930 100: '\'üncü',
6931 6: '\'ncı',
6932 9: '\'uncu',
6933 10: '\'uncu',
6934 30: '\'uncu',
6935 60: '\'ıncı',
6936 90: '\'ıncı'
6937};
6938const trLocale = {
6939 abbr: 'tr',
6940 months: 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),
6941 monthsShort: 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
6942 weekdays: 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),
6943 weekdaysShort: 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
6944 weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
6945 longDateFormat: {
6946 LT: 'HH:mm',
6947 LTS: 'HH:mm:ss',
6948 L: 'DD.MM.YYYY',
6949 LL: 'D MMMM YYYY',
6950 LLL: 'D MMMM YYYY HH:mm',
6951 LLLL: 'dddd, D MMMM YYYY HH:mm'
6952 },
6953 calendar: {
6954 sameDay: '[bugün saat] LT',
6955 nextDay: '[yarın saat] LT',
6956 nextWeek: '[gelecek] dddd [saat] LT',
6957 lastDay: '[dün] LT',
6958 lastWeek: '[geçen] dddd [saat] LT',
6959 sameElse: 'L'
6960 },
6961 relativeTime: {
6962 future: '%s sonra',
6963 past: '%s önce',
6964 s: 'birkaç saniye',
6965 ss: '%d saniye',
6966 m: 'bir dakika',
6967 mm: '%d dakika',
6968 h: 'bir saat',
6969 hh: '%d saat',
6970 d: 'bir gün',
6971 dd: '%d gün',
6972 M: 'bir ay',
6973 MM: '%d ay',
6974 y: 'bir yıl',
6975 yy: '%d yıl'
6976 },
6977 dayOfMonthOrdinalParse: /\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,
6978 ordinal(_num) {
6979 const num = Number(_num);
6980 if (num === 0) { // special case for zero
6981 return num + '\'ıncı';
6982 }
6983 let a = num % 10, b = num % 100 - a, c = num >= 100 ? 100 : null;
6984 return num + (suffixes$1[a] || suffixes$1[b] || suffixes$1[c]);
6985 },
6986 week: {
6987 dow: 1,
6988 doy: 7 // The week that contains Jan 1st is the first week of the year.
6989 }
6990};
6991
6992//! moment.js locale configuration
6993//! locale : Ukrainian [uk]
6994//! author : zemlanin : https://github.com/zemlanin
6995//! Author : Menelion Elensúle : https://github.com/Oire
6996function plural$4(word, num) {
6997 let forms = word.split('_');
6998 return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
6999}
7000function relativeTimeWithPlural$2(num, withoutSuffix, key) {
7001 let format = {
7002 ss: withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',
7003 mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
7004 hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
7005 dd: 'день_дні_днів',
7006 MM: 'місяць_місяці_місяців',
7007 yy: 'рік_роки_років'
7008 };
7009 if (key === 'm') {
7010 return withoutSuffix ? 'хвилина' : 'хвилину';
7011 }
7012 if (key === 'h') {
7013 return withoutSuffix ? 'година' : 'годину';
7014 }
7015 return num + ' ' + plural$4(format[key], +num);
7016}
7017function weekdaysCaseReplace(date, format, isUTC) {
7018 let weekdays = {
7019 nominative: 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),
7020 accusative: 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),
7021 genitive: 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')
7022 };
7023 if (!date) {
7024 return weekdays.nominative;
7025 }
7026 let nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ?
7027 'accusative' :
7028 ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ?
7029 'genitive' :
7030 'nominative');
7031 return weekdays[nounCase][getDayOfWeek(date, isUTC)];
7032}
7033function processHoursFunction(str) {
7034 return function (date) {
7035 return str + 'о' + (getHours(date) === 11 ? 'б' : '') + '] LT';
7036 };
7037}
7038const ukLocale = {
7039 abbr: 'uk',
7040 months: {
7041 format: 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'),
7042 standalone: 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_')
7043 },
7044 monthsShort: 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),
7045 weekdays: weekdaysCaseReplace,
7046 weekdaysShort: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
7047 weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
7048 longDateFormat: {
7049 LT: 'HH:mm',
7050 LTS: 'HH:mm:ss',
7051 L: 'DD.MM.YYYY',
7052 LL: 'D MMMM YYYY р.',
7053 LLL: 'D MMMM YYYY р., HH:mm',
7054 LLLL: 'dddd, D MMMM YYYY р., HH:mm'
7055 },
7056 calendar: {
7057 sameDay: processHoursFunction('[Сьогодні '),
7058 nextDay: processHoursFunction('[Завтра '),
7059 lastDay: processHoursFunction('[Вчора '),
7060 nextWeek: processHoursFunction('[У] dddd ['),
7061 lastWeek(date) {
7062 switch (getDayOfWeek(date)) {
7063 case 0:
7064 case 3:
7065 case 5:
7066 case 6:
7067 return processHoursFunction('[Минулої] dddd [')(date);
7068 case 1:
7069 case 2:
7070 case 4:
7071 return processHoursFunction('[Минулого] dddd [')(date);
7072 }
7073 },
7074 sameElse: 'L'
7075 },
7076 relativeTime: {
7077 future: 'за %s',
7078 past: '%s тому',
7079 s: 'декілька секунд',
7080 ss: relativeTimeWithPlural$2,
7081 m: relativeTimeWithPlural$2,
7082 mm: relativeTimeWithPlural$2,
7083 h: 'годину',
7084 hh: relativeTimeWithPlural$2,
7085 d: 'день',
7086 dd: relativeTimeWithPlural$2,
7087 M: 'місяць',
7088 MM: relativeTimeWithPlural$2,
7089 y: 'рік',
7090 yy: relativeTimeWithPlural$2
7091 },
7092 // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
7093 meridiemParse: /ночі|ранку|дня|вечора/,
7094 isPM(input) {
7095 return /^(дня|вечора)$/.test(input);
7096 },
7097 meridiem(hour, minute, isLower) {
7098 if (hour < 4) {
7099 return 'ночі';
7100 }
7101 else if (hour < 12) {
7102 return 'ранку';
7103 }
7104 else if (hour < 17) {
7105 return 'дня';
7106 }
7107 else {
7108 return 'вечора';
7109 }
7110 },
7111 dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/,
7112 ordinal(_num, period) {
7113 const num = Number(_num);
7114 switch (period) {
7115 case 'M':
7116 case 'd':
7117 case 'DDD':
7118 case 'w':
7119 case 'W':
7120 return num + '-й';
7121 case 'D':
7122 return num + '-го';
7123 default:
7124 return num.toString();
7125 }
7126 },
7127 week: {
7128 dow: 1,
7129 doy: 7 // The week that contains Jan 1st is the first week of the year.
7130 }
7131};
7132
7133//! moment.js locale configuration
7134//! locale : Việt Nam [vi]
7135//! author : Chris Gedrim : https://github.com/chrisgedrim
7136const viLocale = {
7137 abbr: 'vi',
7138 months: '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'.split('_'),
7139 monthsShort: 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),
7140 monthsParseExact: true,
7141 weekdays: 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'),
7142 weekdaysShort: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
7143 weekdaysMin: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
7144 weekdaysParseExact: true,
7145 meridiemParse: /sa|ch/i,
7146 isPM(input) {
7147 return /^ch$/i.test(input);
7148 },
7149 meridiem(hours, minutes, isLower) {
7150 if (hours < 12) {
7151 return isLower ? 'sa' : 'SA';
7152 }
7153 else {
7154 return isLower ? 'ch' : 'CH';
7155 }
7156 },
7157 longDateFormat: {
7158 LT: 'HH:mm',
7159 LTS: 'HH:mm:ss',
7160 L: 'DD/MM/YYYY',
7161 LL: 'D MMMM [năm] YYYY',
7162 LLL: 'D MMMM [năm] YYYY HH:mm',
7163 LLLL: 'dddd, D MMMM [năm] YYYY HH:mm',
7164 l: 'DD/M/YYYY',
7165 ll: 'D MMM YYYY',
7166 lll: 'D MMM YYYY HH:mm',
7167 llll: 'ddd, D MMM YYYY HH:mm'
7168 },
7169 calendar: {
7170 sameDay: '[Hôm nay lúc] LT',
7171 nextDay: '[Ngày mai lúc] LT',
7172 nextWeek: 'dddd [tuần tới lúc] LT',
7173 lastDay: '[Hôm qua lúc] LT',
7174 lastWeek: 'dddd [tuần trước lúc] LT',
7175 sameElse: 'L'
7176 },
7177 relativeTime: {
7178 future: '%s tới',
7179 past: '%s trước',
7180 s: 'vài giây',
7181 ss: '%d giây',
7182 m: 'một phút',
7183 mm: '%d phút',
7184 h: 'một giờ',
7185 hh: '%d giờ',
7186 d: 'một ngày',
7187 dd: '%d ngày',
7188 M: 'một tháng',
7189 MM: '%d tháng',
7190 y: 'một năm',
7191 yy: '%d năm'
7192 },
7193 dayOfMonthOrdinalParse: /\d{1,2}/,
7194 ordinal(_num) {
7195 return '' + _num;
7196 },
7197 week: {
7198 dow: 1,
7199 doy: 4 // Tuần chứa ngày 4 tháng 1 là tuần đầu tiên trong năm.
7200 }
7201};
7202
7203//! moment.js locale configuration
7204//! locale : Chinese (China) [zh-cn]
7205//! author : suupic : https://github.com/suupic
7206//! author : Zeno Zeng : https://github.com/zenozeng
7207const zhCnLocale = {
7208 abbr: 'zh-cn',
7209 months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
7210 monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
7211 weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
7212 weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'),
7213 weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
7214 longDateFormat: {
7215 LT: 'HH:mm',
7216 LTS: 'HH:mm:ss',
7217 L: 'YYYY/MM/DD',
7218 LL: 'YYYY年M月D日',
7219 LLL: 'YYYY年M月D日Ah点mm分',
7220 LLLL: 'YYYY年M月D日ddddAh点mm分',
7221 l: 'YYYY/M/D',
7222 ll: 'YYYY年M月D日',
7223 lll: 'YYYY年M月D日 HH:mm',
7224 llll: 'YYYY年M月D日dddd HH:mm'
7225 },
7226 meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
7227 meridiemHour(hour, meridiem) {
7228 if (hour === 12) {
7229 hour = 0;
7230 }
7231 if (meridiem === '凌晨' || meridiem === '早上' ||
7232 meridiem === '上午') {
7233 return hour;
7234 }
7235 else if (meridiem === '下午' || meridiem === '晚上') {
7236 return hour + 12;
7237 }
7238 else {
7239 // '中午'
7240 return hour >= 11 ? hour : hour + 12;
7241 }
7242 },
7243 meridiem(hour, minute, isLower) {
7244 let hm = hour * 100 + minute;
7245 if (hm < 600) {
7246 return '凌晨';
7247 }
7248 else if (hm < 900) {
7249 return '早上';
7250 }
7251 else if (hm < 1130) {
7252 return '上午';
7253 }
7254 else if (hm < 1230) {
7255 return '中午';
7256 }
7257 else if (hm < 1800) {
7258 return '下午';
7259 }
7260 else {
7261 return '晚上';
7262 }
7263 },
7264 calendar: {
7265 sameDay: '[今天]LT',
7266 nextDay: '[明天]LT',
7267 nextWeek: '[下]ddddLT',
7268 lastDay: '[昨天]LT',
7269 lastWeek: '[上]ddddLT',
7270 sameElse: 'L'
7271 },
7272 dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/,
7273 ordinal(_num, period) {
7274 const num = Number(_num);
7275 switch (period) {
7276 case 'd':
7277 case 'D':
7278 case 'DDD':
7279 return num + '日';
7280 case 'M':
7281 return num + '月';
7282 case 'w':
7283 case 'W':
7284 return num + '周';
7285 default:
7286 return num.toString();
7287 }
7288 },
7289 relativeTime: {
7290 future: '%s内',
7291 past: '%s前',
7292 s: '几秒',
7293 ss: '%d 秒',
7294 m: '1 分钟',
7295 mm: '%d 分钟',
7296 h: '1 小时',
7297 hh: '%d 小时',
7298 d: '1 天',
7299 dd: '%d 天',
7300 M: '1 个月',
7301 MM: '%d 个月',
7302 y: '1 年',
7303 yy: '%d 年'
7304 },
7305 week: {
7306 // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
7307 dow: 1,
7308 doy: 4 // The week that contains Jan 4th is the first week of the year.
7309 }
7310};
7311
7312/**
7313 * Generated bundle index. Do not edit.
7314 */
7315
7316export { add, arLocale, bgLocale, caLocale, csLocale, daLocale, deLocale, defineLocale, enGbLocale, endOf, esDoLocale, esLocale, esUsLocale, etLocale, fiLocale, formatDate, frLocale, getDay, getFirstDayOfMonth, getFullYear, getLocale, getMonth, getSetGlobalLocale, glLocale, heLocale, hiLocale, hrLocale, huLocale, idLocale, isAfter, isArray, isBefore, isDate, isDateValid, isDisabledDay, isFirstDayOfWeek, isSame, isSameDay, isSameMonth, isSameYear, itLocale, jaLocale, kaLocale, kkLocale, koLocale, listLocales, ltLocale, lvLocale, mnLocale, nbLocale, nlBeLocale, nlLocale, parseDate, plLocale, ptBrLocale, roLocale, ruLocale, setFullDate, shiftDate, skLocale, slLocale, sqLocale, startOf, subtract, svLocale, thBeLocale, thLocale, trLocale, ukLocale, updateLocale, utcAsLocal, viLocale, zhCnLocale, createDate as ɵa };
7317//# sourceMappingURL=ngx-bootstrap-chronos.js.map