@esic-lab/data-core-ui 0.0.25 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/STO-logo-ADYYAPS3.svg +92 -0
- package/dist/index.css +2 -1
- package/dist/index.d.mts +33 -470
- package/dist/index.d.ts +33 -470
- package/dist/index.js +2149 -210
- package/dist/index.mjs +2147 -208
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -311,6 +311,28 @@ var require_dayjs_min = __commonJS({
|
|
|
311
311
|
}
|
|
312
312
|
});
|
|
313
313
|
|
|
314
|
+
// node_modules/dayjs/plugin/buddhistEra.js
|
|
315
|
+
var require_buddhistEra = __commonJS({
|
|
316
|
+
"node_modules/dayjs/plugin/buddhistEra.js"(exports2, module2) {
|
|
317
|
+
"use strict";
|
|
318
|
+
!(function(t, e) {
|
|
319
|
+
"object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_buddhistEra = e();
|
|
320
|
+
})(exports2, (function() {
|
|
321
|
+
"use strict";
|
|
322
|
+
return function(t, e) {
|
|
323
|
+
var n = e.prototype, i = n.format;
|
|
324
|
+
n.format = function(t2) {
|
|
325
|
+
var e2 = this, n2 = (t2 || "YYYY-MM-DDTHH:mm:ssZ").replace(/(\[[^\]]+])|BBBB|BB/g, (function(t3, n3) {
|
|
326
|
+
var i2, o = String(e2.$y + 543), f = "BB" === t3 ? [o.slice(-2), 2] : [o, 4];
|
|
327
|
+
return n3 || (i2 = e2.$utils()).s.apply(i2, f.concat(["0"]));
|
|
328
|
+
}));
|
|
329
|
+
return i.bind(this)(n2);
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
}));
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
|
|
314
336
|
// node_modules/dayjs/locale/th.js
|
|
315
337
|
var require_th = __commonJS({
|
|
316
338
|
"node_modules/dayjs/locale/th.js"(exports2, module2) {
|
|
@@ -330,134 +352,6 @@ var require_th = __commonJS({
|
|
|
330
352
|
}
|
|
331
353
|
});
|
|
332
354
|
|
|
333
|
-
// node_modules/dayjs/plugin/customParseFormat.js
|
|
334
|
-
var require_customParseFormat = __commonJS({
|
|
335
|
-
"node_modules/dayjs/plugin/customParseFormat.js"(exports2, module2) {
|
|
336
|
-
"use strict";
|
|
337
|
-
!(function(e, t) {
|
|
338
|
-
"object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_customParseFormat = t();
|
|
339
|
-
})(exports2, (function() {
|
|
340
|
-
"use strict";
|
|
341
|
-
var e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d/, r = /\d\d/, i = /\d\d?/, o = /\d*[^-_:/,()\s\d]+/, s = {}, a = function(e2) {
|
|
342
|
-
return (e2 = +e2) + (e2 > 68 ? 1900 : 2e3);
|
|
343
|
-
};
|
|
344
|
-
var f = function(e2) {
|
|
345
|
-
return function(t2) {
|
|
346
|
-
this[e2] = +t2;
|
|
347
|
-
};
|
|
348
|
-
}, h = [/[+-]\d\d:?(\d\d)?|Z/, function(e2) {
|
|
349
|
-
(this.zone || (this.zone = {})).offset = (function(e3) {
|
|
350
|
-
if (!e3) return 0;
|
|
351
|
-
if ("Z" === e3) return 0;
|
|
352
|
-
var t2 = e3.match(/([+-]|\d\d)/g), n2 = 60 * t2[1] + (+t2[2] || 0);
|
|
353
|
-
return 0 === n2 ? 0 : "+" === t2[0] ? -n2 : n2;
|
|
354
|
-
})(e2);
|
|
355
|
-
}], u = function(e2) {
|
|
356
|
-
var t2 = s[e2];
|
|
357
|
-
return t2 && (t2.indexOf ? t2 : t2.s.concat(t2.f));
|
|
358
|
-
}, d = function(e2, t2) {
|
|
359
|
-
var n2, r2 = s.meridiem;
|
|
360
|
-
if (r2) {
|
|
361
|
-
for (var i2 = 1; i2 <= 24; i2 += 1) if (e2.indexOf(r2(i2, 0, t2)) > -1) {
|
|
362
|
-
n2 = i2 > 12;
|
|
363
|
-
break;
|
|
364
|
-
}
|
|
365
|
-
} else n2 = e2 === (t2 ? "pm" : "PM");
|
|
366
|
-
return n2;
|
|
367
|
-
}, c = { A: [o, function(e2) {
|
|
368
|
-
this.afternoon = d(e2, false);
|
|
369
|
-
}], a: [o, function(e2) {
|
|
370
|
-
this.afternoon = d(e2, true);
|
|
371
|
-
}], Q: [n, function(e2) {
|
|
372
|
-
this.month = 3 * (e2 - 1) + 1;
|
|
373
|
-
}], S: [n, function(e2) {
|
|
374
|
-
this.milliseconds = 100 * +e2;
|
|
375
|
-
}], SS: [r, function(e2) {
|
|
376
|
-
this.milliseconds = 10 * +e2;
|
|
377
|
-
}], SSS: [/\d{3}/, function(e2) {
|
|
378
|
-
this.milliseconds = +e2;
|
|
379
|
-
}], s: [i, f("seconds")], ss: [i, f("seconds")], m: [i, f("minutes")], mm: [i, f("minutes")], H: [i, f("hours")], h: [i, f("hours")], HH: [i, f("hours")], hh: [i, f("hours")], D: [i, f("day")], DD: [r, f("day")], Do: [o, function(e2) {
|
|
380
|
-
var t2 = s.ordinal, n2 = e2.match(/\d+/);
|
|
381
|
-
if (this.day = n2[0], t2) for (var r2 = 1; r2 <= 31; r2 += 1) t2(r2).replace(/\[|\]/g, "") === e2 && (this.day = r2);
|
|
382
|
-
}], w: [i, f("week")], ww: [r, f("week")], M: [i, f("month")], MM: [r, f("month")], MMM: [o, function(e2) {
|
|
383
|
-
var t2 = u("months"), n2 = (u("monthsShort") || t2.map((function(e3) {
|
|
384
|
-
return e3.slice(0, 3);
|
|
385
|
-
}))).indexOf(e2) + 1;
|
|
386
|
-
if (n2 < 1) throw new Error();
|
|
387
|
-
this.month = n2 % 12 || n2;
|
|
388
|
-
}], MMMM: [o, function(e2) {
|
|
389
|
-
var t2 = u("months").indexOf(e2) + 1;
|
|
390
|
-
if (t2 < 1) throw new Error();
|
|
391
|
-
this.month = t2 % 12 || t2;
|
|
392
|
-
}], Y: [/[+-]?\d+/, f("year")], YY: [r, function(e2) {
|
|
393
|
-
this.year = a(e2);
|
|
394
|
-
}], YYYY: [/\d{4}/, f("year")], Z: h, ZZ: h };
|
|
395
|
-
function l(n2) {
|
|
396
|
-
var r2, i2;
|
|
397
|
-
r2 = n2, i2 = s && s.formats;
|
|
398
|
-
for (var o2 = (n2 = r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(t2, n3, r3) {
|
|
399
|
-
var o3 = r3 && r3.toUpperCase();
|
|
400
|
-
return n3 || i2[r3] || e[r3] || i2[o3].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(e2, t3, n4) {
|
|
401
|
-
return t3 || n4.slice(1);
|
|
402
|
-
}));
|
|
403
|
-
}))).match(t), a2 = o2.length, f2 = 0; f2 < a2; f2 += 1) {
|
|
404
|
-
var h2 = o2[f2], u2 = c[h2], d2 = u2 && u2[0], l2 = u2 && u2[1];
|
|
405
|
-
o2[f2] = l2 ? { regex: d2, parser: l2 } : h2.replace(/^\[|\]$/g, "");
|
|
406
|
-
}
|
|
407
|
-
return function(e2) {
|
|
408
|
-
for (var t2 = {}, n3 = 0, r3 = 0; n3 < a2; n3 += 1) {
|
|
409
|
-
var i3 = o2[n3];
|
|
410
|
-
if ("string" == typeof i3) r3 += i3.length;
|
|
411
|
-
else {
|
|
412
|
-
var s2 = i3.regex, f3 = i3.parser, h3 = e2.slice(r3), u3 = s2.exec(h3)[0];
|
|
413
|
-
f3.call(t2, u3), e2 = e2.replace(u3, "");
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
return (function(e3) {
|
|
417
|
-
var t3 = e3.afternoon;
|
|
418
|
-
if (void 0 !== t3) {
|
|
419
|
-
var n4 = e3.hours;
|
|
420
|
-
t3 ? n4 < 12 && (e3.hours += 12) : 12 === n4 && (e3.hours = 0), delete e3.afternoon;
|
|
421
|
-
}
|
|
422
|
-
})(t2), t2;
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
return function(e2, t2, n2) {
|
|
426
|
-
n2.p.customParseFormat = true, e2 && e2.parseTwoDigitYear && (a = e2.parseTwoDigitYear);
|
|
427
|
-
var r2 = t2.prototype, i2 = r2.parse;
|
|
428
|
-
r2.parse = function(e3) {
|
|
429
|
-
var t3 = e3.date, r3 = e3.utc, o2 = e3.args;
|
|
430
|
-
this.$u = r3;
|
|
431
|
-
var a2 = o2[1];
|
|
432
|
-
if ("string" == typeof a2) {
|
|
433
|
-
var f2 = true === o2[2], h2 = true === o2[3], u2 = f2 || h2, d2 = o2[2];
|
|
434
|
-
h2 && (d2 = o2[2]), s = this.$locale(), !f2 && d2 && (s = n2.Ls[d2]), this.$d = (function(e4, t4, n3, r4) {
|
|
435
|
-
try {
|
|
436
|
-
if (["x", "X"].indexOf(t4) > -1) return new Date(("X" === t4 ? 1e3 : 1) * e4);
|
|
437
|
-
var i3 = l(t4)(e4), o3 = i3.year, s2 = i3.month, a3 = i3.day, f3 = i3.hours, h3 = i3.minutes, u3 = i3.seconds, d3 = i3.milliseconds, c3 = i3.zone, m2 = i3.week, M2 = /* @__PURE__ */ new Date(), Y = a3 || (o3 || s2 ? 1 : M2.getDate()), p = o3 || M2.getFullYear(), v = 0;
|
|
438
|
-
o3 && !s2 || (v = s2 > 0 ? s2 - 1 : M2.getMonth());
|
|
439
|
-
var D, w = f3 || 0, g = h3 || 0, y = u3 || 0, L = d3 || 0;
|
|
440
|
-
return c3 ? new Date(Date.UTC(p, v, Y, w, g, y, L + 60 * c3.offset * 1e3)) : n3 ? new Date(Date.UTC(p, v, Y, w, g, y, L)) : (D = new Date(p, v, Y, w, g, y, L), m2 && (D = r4(D).week(m2).toDate()), D);
|
|
441
|
-
} catch (e5) {
|
|
442
|
-
return /* @__PURE__ */ new Date("");
|
|
443
|
-
}
|
|
444
|
-
})(t3, a2, r3, n2), this.init(), d2 && true !== d2 && (this.$L = this.locale(d2).$L), u2 && t3 != this.format(a2) && (this.$d = /* @__PURE__ */ new Date("")), s = {};
|
|
445
|
-
} else if (a2 instanceof Array) for (var c2 = a2.length, m = 1; m <= c2; m += 1) {
|
|
446
|
-
o2[1] = a2[m - 1];
|
|
447
|
-
var M = n2.apply(this, o2);
|
|
448
|
-
if (M.isValid()) {
|
|
449
|
-
this.$d = M.$d, this.$L = M.$L, this.init();
|
|
450
|
-
break;
|
|
451
|
-
}
|
|
452
|
-
m === c2 && (this.$d = /* @__PURE__ */ new Date(""));
|
|
453
|
-
}
|
|
454
|
-
else i2.call(this, e3);
|
|
455
|
-
};
|
|
456
|
-
};
|
|
457
|
-
}));
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
|
|
461
355
|
// src/index.ts
|
|
462
356
|
var index_exports = {};
|
|
463
357
|
__export(index_exports, {
|
|
@@ -1336,18 +1230,2023 @@ function ColorPickerBasic({
|
|
|
1336
1230
|
|
|
1337
1231
|
// src/DatePicker/DatePickerBasic/DatePickerBasic.tsx
|
|
1338
1232
|
var import_antd5 = require("antd");
|
|
1233
|
+
var import_th_TH2 = __toESM(require("antd/locale/th_TH"));
|
|
1339
1234
|
var import_dayjs = __toESM(require_dayjs_min());
|
|
1340
|
-
|
|
1341
|
-
|
|
1235
|
+
|
|
1236
|
+
// node_modules/date-fns/constants.js
|
|
1237
|
+
var daysInYear = 365.2425;
|
|
1238
|
+
var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
|
|
1239
|
+
var minTime = -maxTime;
|
|
1240
|
+
var millisecondsInWeek = 6048e5;
|
|
1241
|
+
var millisecondsInDay = 864e5;
|
|
1242
|
+
var secondsInHour = 3600;
|
|
1243
|
+
var secondsInDay = secondsInHour * 24;
|
|
1244
|
+
var secondsInWeek = secondsInDay * 7;
|
|
1245
|
+
var secondsInYear = secondsInDay * daysInYear;
|
|
1246
|
+
var secondsInMonth = secondsInYear / 12;
|
|
1247
|
+
var secondsInQuarter = secondsInMonth * 3;
|
|
1248
|
+
var constructFromSymbol = Symbol.for("constructDateFrom");
|
|
1249
|
+
|
|
1250
|
+
// node_modules/date-fns/constructFrom.js
|
|
1251
|
+
function constructFrom(date, value) {
|
|
1252
|
+
if (typeof date === "function") return date(value);
|
|
1253
|
+
if (date && typeof date === "object" && constructFromSymbol in date)
|
|
1254
|
+
return date[constructFromSymbol](value);
|
|
1255
|
+
if (date instanceof Date) return new date.constructor(value);
|
|
1256
|
+
return new Date(value);
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
// node_modules/date-fns/toDate.js
|
|
1260
|
+
function toDate(argument, context) {
|
|
1261
|
+
return constructFrom(context || argument, argument);
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
// node_modules/date-fns/_lib/defaultOptions.js
|
|
1265
|
+
var defaultOptions = {};
|
|
1266
|
+
function getDefaultOptions() {
|
|
1267
|
+
return defaultOptions;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
// node_modules/date-fns/startOfWeek.js
|
|
1271
|
+
function startOfWeek(date, options) {
|
|
1272
|
+
const defaultOptions2 = getDefaultOptions();
|
|
1273
|
+
const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
|
|
1274
|
+
const _date = toDate(date, options?.in);
|
|
1275
|
+
const day = _date.getDay();
|
|
1276
|
+
const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
1277
|
+
_date.setDate(_date.getDate() - diff);
|
|
1278
|
+
_date.setHours(0, 0, 0, 0);
|
|
1279
|
+
return _date;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
// node_modules/date-fns/startOfISOWeek.js
|
|
1283
|
+
function startOfISOWeek(date, options) {
|
|
1284
|
+
return startOfWeek(date, { ...options, weekStartsOn: 1 });
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
// node_modules/date-fns/getISOWeekYear.js
|
|
1288
|
+
function getISOWeekYear(date, options) {
|
|
1289
|
+
const _date = toDate(date, options?.in);
|
|
1290
|
+
const year = _date.getFullYear();
|
|
1291
|
+
const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
|
|
1292
|
+
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
|
|
1293
|
+
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
|
|
1294
|
+
const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
|
|
1295
|
+
const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
|
|
1296
|
+
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
|
|
1297
|
+
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
|
|
1298
|
+
const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
|
|
1299
|
+
if (_date.getTime() >= startOfNextYear.getTime()) {
|
|
1300
|
+
return year + 1;
|
|
1301
|
+
} else if (_date.getTime() >= startOfThisYear.getTime()) {
|
|
1302
|
+
return year;
|
|
1303
|
+
} else {
|
|
1304
|
+
return year - 1;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
// node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
|
|
1309
|
+
function getTimezoneOffsetInMilliseconds(date) {
|
|
1310
|
+
const _date = toDate(date);
|
|
1311
|
+
const utcDate = new Date(
|
|
1312
|
+
Date.UTC(
|
|
1313
|
+
_date.getFullYear(),
|
|
1314
|
+
_date.getMonth(),
|
|
1315
|
+
_date.getDate(),
|
|
1316
|
+
_date.getHours(),
|
|
1317
|
+
_date.getMinutes(),
|
|
1318
|
+
_date.getSeconds(),
|
|
1319
|
+
_date.getMilliseconds()
|
|
1320
|
+
)
|
|
1321
|
+
);
|
|
1322
|
+
utcDate.setUTCFullYear(_date.getFullYear());
|
|
1323
|
+
return +date - +utcDate;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
// node_modules/date-fns/_lib/normalizeDates.js
|
|
1327
|
+
function normalizeDates(context, ...dates) {
|
|
1328
|
+
const normalize = constructFrom.bind(
|
|
1329
|
+
null,
|
|
1330
|
+
context || dates.find((date) => typeof date === "object")
|
|
1331
|
+
);
|
|
1332
|
+
return dates.map(normalize);
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
// node_modules/date-fns/startOfDay.js
|
|
1336
|
+
function startOfDay(date, options) {
|
|
1337
|
+
const _date = toDate(date, options?.in);
|
|
1338
|
+
_date.setHours(0, 0, 0, 0);
|
|
1339
|
+
return _date;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
// node_modules/date-fns/differenceInCalendarDays.js
|
|
1343
|
+
function differenceInCalendarDays(laterDate, earlierDate, options) {
|
|
1344
|
+
const [laterDate_, earlierDate_] = normalizeDates(
|
|
1345
|
+
options?.in,
|
|
1346
|
+
laterDate,
|
|
1347
|
+
earlierDate
|
|
1348
|
+
);
|
|
1349
|
+
const laterStartOfDay = startOfDay(laterDate_);
|
|
1350
|
+
const earlierStartOfDay = startOfDay(earlierDate_);
|
|
1351
|
+
const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
|
|
1352
|
+
const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
|
|
1353
|
+
return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
// node_modules/date-fns/startOfISOWeekYear.js
|
|
1357
|
+
function startOfISOWeekYear(date, options) {
|
|
1358
|
+
const year = getISOWeekYear(date, options);
|
|
1359
|
+
const fourthOfJanuary = constructFrom(options?.in || date, 0);
|
|
1360
|
+
fourthOfJanuary.setFullYear(year, 0, 4);
|
|
1361
|
+
fourthOfJanuary.setHours(0, 0, 0, 0);
|
|
1362
|
+
return startOfISOWeek(fourthOfJanuary);
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
// node_modules/date-fns/isDate.js
|
|
1366
|
+
function isDate(value) {
|
|
1367
|
+
return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
// node_modules/date-fns/isValid.js
|
|
1371
|
+
function isValid(date) {
|
|
1372
|
+
return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
// node_modules/date-fns/startOfYear.js
|
|
1376
|
+
function startOfYear(date, options) {
|
|
1377
|
+
const date_ = toDate(date, options?.in);
|
|
1378
|
+
date_.setFullYear(date_.getFullYear(), 0, 1);
|
|
1379
|
+
date_.setHours(0, 0, 0, 0);
|
|
1380
|
+
return date_;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
// node_modules/date-fns/locale/en-US/_lib/formatDistance.js
|
|
1384
|
+
var formatDistanceLocale = {
|
|
1385
|
+
lessThanXSeconds: {
|
|
1386
|
+
one: "less than a second",
|
|
1387
|
+
other: "less than {{count}} seconds"
|
|
1388
|
+
},
|
|
1389
|
+
xSeconds: {
|
|
1390
|
+
one: "1 second",
|
|
1391
|
+
other: "{{count}} seconds"
|
|
1392
|
+
},
|
|
1393
|
+
halfAMinute: "half a minute",
|
|
1394
|
+
lessThanXMinutes: {
|
|
1395
|
+
one: "less than a minute",
|
|
1396
|
+
other: "less than {{count}} minutes"
|
|
1397
|
+
},
|
|
1398
|
+
xMinutes: {
|
|
1399
|
+
one: "1 minute",
|
|
1400
|
+
other: "{{count}} minutes"
|
|
1401
|
+
},
|
|
1402
|
+
aboutXHours: {
|
|
1403
|
+
one: "about 1 hour",
|
|
1404
|
+
other: "about {{count}} hours"
|
|
1405
|
+
},
|
|
1406
|
+
xHours: {
|
|
1407
|
+
one: "1 hour",
|
|
1408
|
+
other: "{{count}} hours"
|
|
1409
|
+
},
|
|
1410
|
+
xDays: {
|
|
1411
|
+
one: "1 day",
|
|
1412
|
+
other: "{{count}} days"
|
|
1413
|
+
},
|
|
1414
|
+
aboutXWeeks: {
|
|
1415
|
+
one: "about 1 week",
|
|
1416
|
+
other: "about {{count}} weeks"
|
|
1417
|
+
},
|
|
1418
|
+
xWeeks: {
|
|
1419
|
+
one: "1 week",
|
|
1420
|
+
other: "{{count}} weeks"
|
|
1421
|
+
},
|
|
1422
|
+
aboutXMonths: {
|
|
1423
|
+
one: "about 1 month",
|
|
1424
|
+
other: "about {{count}} months"
|
|
1425
|
+
},
|
|
1426
|
+
xMonths: {
|
|
1427
|
+
one: "1 month",
|
|
1428
|
+
other: "{{count}} months"
|
|
1429
|
+
},
|
|
1430
|
+
aboutXYears: {
|
|
1431
|
+
one: "about 1 year",
|
|
1432
|
+
other: "about {{count}} years"
|
|
1433
|
+
},
|
|
1434
|
+
xYears: {
|
|
1435
|
+
one: "1 year",
|
|
1436
|
+
other: "{{count}} years"
|
|
1437
|
+
},
|
|
1438
|
+
overXYears: {
|
|
1439
|
+
one: "over 1 year",
|
|
1440
|
+
other: "over {{count}} years"
|
|
1441
|
+
},
|
|
1442
|
+
almostXYears: {
|
|
1443
|
+
one: "almost 1 year",
|
|
1444
|
+
other: "almost {{count}} years"
|
|
1445
|
+
}
|
|
1446
|
+
};
|
|
1447
|
+
var formatDistance = (token, count, options) => {
|
|
1448
|
+
let result;
|
|
1449
|
+
const tokenValue = formatDistanceLocale[token];
|
|
1450
|
+
if (typeof tokenValue === "string") {
|
|
1451
|
+
result = tokenValue;
|
|
1452
|
+
} else if (count === 1) {
|
|
1453
|
+
result = tokenValue.one;
|
|
1454
|
+
} else {
|
|
1455
|
+
result = tokenValue.other.replace("{{count}}", count.toString());
|
|
1456
|
+
}
|
|
1457
|
+
if (options?.addSuffix) {
|
|
1458
|
+
if (options.comparison && options.comparison > 0) {
|
|
1459
|
+
return "in " + result;
|
|
1460
|
+
} else {
|
|
1461
|
+
return result + " ago";
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
return result;
|
|
1465
|
+
};
|
|
1466
|
+
|
|
1467
|
+
// node_modules/date-fns/locale/_lib/buildFormatLongFn.js
|
|
1468
|
+
function buildFormatLongFn(args) {
|
|
1469
|
+
return (options = {}) => {
|
|
1470
|
+
const width = options.width ? String(options.width) : args.defaultWidth;
|
|
1471
|
+
const format2 = args.formats[width] || args.formats[args.defaultWidth];
|
|
1472
|
+
return format2;
|
|
1473
|
+
};
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
// node_modules/date-fns/locale/en-US/_lib/formatLong.js
|
|
1477
|
+
var dateFormats = {
|
|
1478
|
+
full: "EEEE, MMMM do, y",
|
|
1479
|
+
long: "MMMM do, y",
|
|
1480
|
+
medium: "MMM d, y",
|
|
1481
|
+
short: "MM/dd/yyyy"
|
|
1482
|
+
};
|
|
1483
|
+
var timeFormats = {
|
|
1484
|
+
full: "h:mm:ss a zzzz",
|
|
1485
|
+
long: "h:mm:ss a z",
|
|
1486
|
+
medium: "h:mm:ss a",
|
|
1487
|
+
short: "h:mm a"
|
|
1488
|
+
};
|
|
1489
|
+
var dateTimeFormats = {
|
|
1490
|
+
full: "{{date}} 'at' {{time}}",
|
|
1491
|
+
long: "{{date}} 'at' {{time}}",
|
|
1492
|
+
medium: "{{date}}, {{time}}",
|
|
1493
|
+
short: "{{date}}, {{time}}"
|
|
1494
|
+
};
|
|
1495
|
+
var formatLong = {
|
|
1496
|
+
date: buildFormatLongFn({
|
|
1497
|
+
formats: dateFormats,
|
|
1498
|
+
defaultWidth: "full"
|
|
1499
|
+
}),
|
|
1500
|
+
time: buildFormatLongFn({
|
|
1501
|
+
formats: timeFormats,
|
|
1502
|
+
defaultWidth: "full"
|
|
1503
|
+
}),
|
|
1504
|
+
dateTime: buildFormatLongFn({
|
|
1505
|
+
formats: dateTimeFormats,
|
|
1506
|
+
defaultWidth: "full"
|
|
1507
|
+
})
|
|
1508
|
+
};
|
|
1509
|
+
|
|
1510
|
+
// node_modules/date-fns/locale/en-US/_lib/formatRelative.js
|
|
1511
|
+
var formatRelativeLocale = {
|
|
1512
|
+
lastWeek: "'last' eeee 'at' p",
|
|
1513
|
+
yesterday: "'yesterday at' p",
|
|
1514
|
+
today: "'today at' p",
|
|
1515
|
+
tomorrow: "'tomorrow at' p",
|
|
1516
|
+
nextWeek: "eeee 'at' p",
|
|
1517
|
+
other: "P"
|
|
1518
|
+
};
|
|
1519
|
+
var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
|
|
1520
|
+
|
|
1521
|
+
// node_modules/date-fns/locale/_lib/buildLocalizeFn.js
|
|
1522
|
+
function buildLocalizeFn(args) {
|
|
1523
|
+
return (value, options) => {
|
|
1524
|
+
const context = options?.context ? String(options.context) : "standalone";
|
|
1525
|
+
let valuesArray;
|
|
1526
|
+
if (context === "formatting" && args.formattingValues) {
|
|
1527
|
+
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
1528
|
+
const width = options?.width ? String(options.width) : defaultWidth;
|
|
1529
|
+
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
1530
|
+
} else {
|
|
1531
|
+
const defaultWidth = args.defaultWidth;
|
|
1532
|
+
const width = options?.width ? String(options.width) : args.defaultWidth;
|
|
1533
|
+
valuesArray = args.values[width] || args.values[defaultWidth];
|
|
1534
|
+
}
|
|
1535
|
+
const index = args.argumentCallback ? args.argumentCallback(value) : value;
|
|
1536
|
+
return valuesArray[index];
|
|
1537
|
+
};
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
// node_modules/date-fns/locale/en-US/_lib/localize.js
|
|
1541
|
+
var eraValues = {
|
|
1542
|
+
narrow: ["B", "A"],
|
|
1543
|
+
abbreviated: ["BC", "AD"],
|
|
1544
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
1545
|
+
};
|
|
1546
|
+
var quarterValues = {
|
|
1547
|
+
narrow: ["1", "2", "3", "4"],
|
|
1548
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
1549
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
1550
|
+
};
|
|
1551
|
+
var monthValues = {
|
|
1552
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
1553
|
+
abbreviated: [
|
|
1554
|
+
"Jan",
|
|
1555
|
+
"Feb",
|
|
1556
|
+
"Mar",
|
|
1557
|
+
"Apr",
|
|
1558
|
+
"May",
|
|
1559
|
+
"Jun",
|
|
1560
|
+
"Jul",
|
|
1561
|
+
"Aug",
|
|
1562
|
+
"Sep",
|
|
1563
|
+
"Oct",
|
|
1564
|
+
"Nov",
|
|
1565
|
+
"Dec"
|
|
1566
|
+
],
|
|
1567
|
+
wide: [
|
|
1568
|
+
"January",
|
|
1569
|
+
"February",
|
|
1570
|
+
"March",
|
|
1571
|
+
"April",
|
|
1572
|
+
"May",
|
|
1573
|
+
"June",
|
|
1574
|
+
"July",
|
|
1575
|
+
"August",
|
|
1576
|
+
"September",
|
|
1577
|
+
"October",
|
|
1578
|
+
"November",
|
|
1579
|
+
"December"
|
|
1580
|
+
]
|
|
1581
|
+
};
|
|
1582
|
+
var dayValues = {
|
|
1583
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
1584
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
1585
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
1586
|
+
wide: [
|
|
1587
|
+
"Sunday",
|
|
1588
|
+
"Monday",
|
|
1589
|
+
"Tuesday",
|
|
1590
|
+
"Wednesday",
|
|
1591
|
+
"Thursday",
|
|
1592
|
+
"Friday",
|
|
1593
|
+
"Saturday"
|
|
1594
|
+
]
|
|
1595
|
+
};
|
|
1596
|
+
var dayPeriodValues = {
|
|
1597
|
+
narrow: {
|
|
1598
|
+
am: "a",
|
|
1599
|
+
pm: "p",
|
|
1600
|
+
midnight: "mi",
|
|
1601
|
+
noon: "n",
|
|
1602
|
+
morning: "morning",
|
|
1603
|
+
afternoon: "afternoon",
|
|
1604
|
+
evening: "evening",
|
|
1605
|
+
night: "night"
|
|
1606
|
+
},
|
|
1607
|
+
abbreviated: {
|
|
1608
|
+
am: "AM",
|
|
1609
|
+
pm: "PM",
|
|
1610
|
+
midnight: "midnight",
|
|
1611
|
+
noon: "noon",
|
|
1612
|
+
morning: "morning",
|
|
1613
|
+
afternoon: "afternoon",
|
|
1614
|
+
evening: "evening",
|
|
1615
|
+
night: "night"
|
|
1616
|
+
},
|
|
1617
|
+
wide: {
|
|
1618
|
+
am: "a.m.",
|
|
1619
|
+
pm: "p.m.",
|
|
1620
|
+
midnight: "midnight",
|
|
1621
|
+
noon: "noon",
|
|
1622
|
+
morning: "morning",
|
|
1623
|
+
afternoon: "afternoon",
|
|
1624
|
+
evening: "evening",
|
|
1625
|
+
night: "night"
|
|
1626
|
+
}
|
|
1627
|
+
};
|
|
1628
|
+
var formattingDayPeriodValues = {
|
|
1629
|
+
narrow: {
|
|
1630
|
+
am: "a",
|
|
1631
|
+
pm: "p",
|
|
1632
|
+
midnight: "mi",
|
|
1633
|
+
noon: "n",
|
|
1634
|
+
morning: "in the morning",
|
|
1635
|
+
afternoon: "in the afternoon",
|
|
1636
|
+
evening: "in the evening",
|
|
1637
|
+
night: "at night"
|
|
1638
|
+
},
|
|
1639
|
+
abbreviated: {
|
|
1640
|
+
am: "AM",
|
|
1641
|
+
pm: "PM",
|
|
1642
|
+
midnight: "midnight",
|
|
1643
|
+
noon: "noon",
|
|
1644
|
+
morning: "in the morning",
|
|
1645
|
+
afternoon: "in the afternoon",
|
|
1646
|
+
evening: "in the evening",
|
|
1647
|
+
night: "at night"
|
|
1648
|
+
},
|
|
1649
|
+
wide: {
|
|
1650
|
+
am: "a.m.",
|
|
1651
|
+
pm: "p.m.",
|
|
1652
|
+
midnight: "midnight",
|
|
1653
|
+
noon: "noon",
|
|
1654
|
+
morning: "in the morning",
|
|
1655
|
+
afternoon: "in the afternoon",
|
|
1656
|
+
evening: "in the evening",
|
|
1657
|
+
night: "at night"
|
|
1658
|
+
}
|
|
1659
|
+
};
|
|
1660
|
+
var ordinalNumber = (dirtyNumber, _options) => {
|
|
1661
|
+
const number = Number(dirtyNumber);
|
|
1662
|
+
const rem100 = number % 100;
|
|
1663
|
+
if (rem100 > 20 || rem100 < 10) {
|
|
1664
|
+
switch (rem100 % 10) {
|
|
1665
|
+
case 1:
|
|
1666
|
+
return number + "st";
|
|
1667
|
+
case 2:
|
|
1668
|
+
return number + "nd";
|
|
1669
|
+
case 3:
|
|
1670
|
+
return number + "rd";
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
return number + "th";
|
|
1674
|
+
};
|
|
1675
|
+
var localize = {
|
|
1676
|
+
ordinalNumber,
|
|
1677
|
+
era: buildLocalizeFn({
|
|
1678
|
+
values: eraValues,
|
|
1679
|
+
defaultWidth: "wide"
|
|
1680
|
+
}),
|
|
1681
|
+
quarter: buildLocalizeFn({
|
|
1682
|
+
values: quarterValues,
|
|
1683
|
+
defaultWidth: "wide",
|
|
1684
|
+
argumentCallback: (quarter) => quarter - 1
|
|
1685
|
+
}),
|
|
1686
|
+
month: buildLocalizeFn({
|
|
1687
|
+
values: monthValues,
|
|
1688
|
+
defaultWidth: "wide"
|
|
1689
|
+
}),
|
|
1690
|
+
day: buildLocalizeFn({
|
|
1691
|
+
values: dayValues,
|
|
1692
|
+
defaultWidth: "wide"
|
|
1693
|
+
}),
|
|
1694
|
+
dayPeriod: buildLocalizeFn({
|
|
1695
|
+
values: dayPeriodValues,
|
|
1696
|
+
defaultWidth: "wide",
|
|
1697
|
+
formattingValues: formattingDayPeriodValues,
|
|
1698
|
+
defaultFormattingWidth: "wide"
|
|
1699
|
+
})
|
|
1700
|
+
};
|
|
1701
|
+
|
|
1702
|
+
// node_modules/date-fns/locale/_lib/buildMatchFn.js
|
|
1703
|
+
function buildMatchFn(args) {
|
|
1704
|
+
return (string, options = {}) => {
|
|
1705
|
+
const width = options.width;
|
|
1706
|
+
const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
1707
|
+
const matchResult = string.match(matchPattern);
|
|
1708
|
+
if (!matchResult) {
|
|
1709
|
+
return null;
|
|
1710
|
+
}
|
|
1711
|
+
const matchedString = matchResult[0];
|
|
1712
|
+
const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
1713
|
+
const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
|
|
1714
|
+
// [TODO] -- I challenge you to fix the type
|
|
1715
|
+
findKey(parsePatterns, (pattern) => pattern.test(matchedString))
|
|
1716
|
+
);
|
|
1717
|
+
let value;
|
|
1718
|
+
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
1719
|
+
value = options.valueCallback ? (
|
|
1720
|
+
// [TODO] -- I challenge you to fix the type
|
|
1721
|
+
options.valueCallback(value)
|
|
1722
|
+
) : value;
|
|
1723
|
+
const rest = string.slice(matchedString.length);
|
|
1724
|
+
return { value, rest };
|
|
1725
|
+
};
|
|
1726
|
+
}
|
|
1727
|
+
function findKey(object, predicate) {
|
|
1728
|
+
for (const key in object) {
|
|
1729
|
+
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
|
|
1730
|
+
return key;
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
return void 0;
|
|
1734
|
+
}
|
|
1735
|
+
function findIndex(array, predicate) {
|
|
1736
|
+
for (let key = 0; key < array.length; key++) {
|
|
1737
|
+
if (predicate(array[key])) {
|
|
1738
|
+
return key;
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
return void 0;
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
// node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
|
|
1745
|
+
function buildMatchPatternFn(args) {
|
|
1746
|
+
return (string, options = {}) => {
|
|
1747
|
+
const matchResult = string.match(args.matchPattern);
|
|
1748
|
+
if (!matchResult) return null;
|
|
1749
|
+
const matchedString = matchResult[0];
|
|
1750
|
+
const parseResult = string.match(args.parsePattern);
|
|
1751
|
+
if (!parseResult) return null;
|
|
1752
|
+
let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
1753
|
+
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
1754
|
+
const rest = string.slice(matchedString.length);
|
|
1755
|
+
return { value, rest };
|
|
1756
|
+
};
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
// node_modules/date-fns/locale/en-US/_lib/match.js
|
|
1760
|
+
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
|
|
1761
|
+
var parseOrdinalNumberPattern = /\d+/i;
|
|
1762
|
+
var matchEraPatterns = {
|
|
1763
|
+
narrow: /^(b|a)/i,
|
|
1764
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
1765
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
1766
|
+
};
|
|
1767
|
+
var parseEraPatterns = {
|
|
1768
|
+
any: [/^b/i, /^(a|c)/i]
|
|
1769
|
+
};
|
|
1770
|
+
var matchQuarterPatterns = {
|
|
1771
|
+
narrow: /^[1234]/i,
|
|
1772
|
+
abbreviated: /^q[1234]/i,
|
|
1773
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
1774
|
+
};
|
|
1775
|
+
var parseQuarterPatterns = {
|
|
1776
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1777
|
+
};
|
|
1778
|
+
var matchMonthPatterns = {
|
|
1779
|
+
narrow: /^[jfmasond]/i,
|
|
1780
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
1781
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
1782
|
+
};
|
|
1783
|
+
var parseMonthPatterns = {
|
|
1784
|
+
narrow: [
|
|
1785
|
+
/^j/i,
|
|
1786
|
+
/^f/i,
|
|
1787
|
+
/^m/i,
|
|
1788
|
+
/^a/i,
|
|
1789
|
+
/^m/i,
|
|
1790
|
+
/^j/i,
|
|
1791
|
+
/^j/i,
|
|
1792
|
+
/^a/i,
|
|
1793
|
+
/^s/i,
|
|
1794
|
+
/^o/i,
|
|
1795
|
+
/^n/i,
|
|
1796
|
+
/^d/i
|
|
1797
|
+
],
|
|
1798
|
+
any: [
|
|
1799
|
+
/^ja/i,
|
|
1800
|
+
/^f/i,
|
|
1801
|
+
/^mar/i,
|
|
1802
|
+
/^ap/i,
|
|
1803
|
+
/^may/i,
|
|
1804
|
+
/^jun/i,
|
|
1805
|
+
/^jul/i,
|
|
1806
|
+
/^au/i,
|
|
1807
|
+
/^s/i,
|
|
1808
|
+
/^o/i,
|
|
1809
|
+
/^n/i,
|
|
1810
|
+
/^d/i
|
|
1811
|
+
]
|
|
1812
|
+
};
|
|
1813
|
+
var matchDayPatterns = {
|
|
1814
|
+
narrow: /^[smtwf]/i,
|
|
1815
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
1816
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
1817
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
1818
|
+
};
|
|
1819
|
+
var parseDayPatterns = {
|
|
1820
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
1821
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
1822
|
+
};
|
|
1823
|
+
var matchDayPeriodPatterns = {
|
|
1824
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
1825
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
1826
|
+
};
|
|
1827
|
+
var parseDayPeriodPatterns = {
|
|
1828
|
+
any: {
|
|
1829
|
+
am: /^a/i,
|
|
1830
|
+
pm: /^p/i,
|
|
1831
|
+
midnight: /^mi/i,
|
|
1832
|
+
noon: /^no/i,
|
|
1833
|
+
morning: /morning/i,
|
|
1834
|
+
afternoon: /afternoon/i,
|
|
1835
|
+
evening: /evening/i,
|
|
1836
|
+
night: /night/i
|
|
1837
|
+
}
|
|
1838
|
+
};
|
|
1839
|
+
var match = {
|
|
1840
|
+
ordinalNumber: buildMatchPatternFn({
|
|
1841
|
+
matchPattern: matchOrdinalNumberPattern,
|
|
1842
|
+
parsePattern: parseOrdinalNumberPattern,
|
|
1843
|
+
valueCallback: (value) => parseInt(value, 10)
|
|
1844
|
+
}),
|
|
1845
|
+
era: buildMatchFn({
|
|
1846
|
+
matchPatterns: matchEraPatterns,
|
|
1847
|
+
defaultMatchWidth: "wide",
|
|
1848
|
+
parsePatterns: parseEraPatterns,
|
|
1849
|
+
defaultParseWidth: "any"
|
|
1850
|
+
}),
|
|
1851
|
+
quarter: buildMatchFn({
|
|
1852
|
+
matchPatterns: matchQuarterPatterns,
|
|
1853
|
+
defaultMatchWidth: "wide",
|
|
1854
|
+
parsePatterns: parseQuarterPatterns,
|
|
1855
|
+
defaultParseWidth: "any",
|
|
1856
|
+
valueCallback: (index) => index + 1
|
|
1857
|
+
}),
|
|
1858
|
+
month: buildMatchFn({
|
|
1859
|
+
matchPatterns: matchMonthPatterns,
|
|
1860
|
+
defaultMatchWidth: "wide",
|
|
1861
|
+
parsePatterns: parseMonthPatterns,
|
|
1862
|
+
defaultParseWidth: "any"
|
|
1863
|
+
}),
|
|
1864
|
+
day: buildMatchFn({
|
|
1865
|
+
matchPatterns: matchDayPatterns,
|
|
1866
|
+
defaultMatchWidth: "wide",
|
|
1867
|
+
parsePatterns: parseDayPatterns,
|
|
1868
|
+
defaultParseWidth: "any"
|
|
1869
|
+
}),
|
|
1870
|
+
dayPeriod: buildMatchFn({
|
|
1871
|
+
matchPatterns: matchDayPeriodPatterns,
|
|
1872
|
+
defaultMatchWidth: "any",
|
|
1873
|
+
parsePatterns: parseDayPeriodPatterns,
|
|
1874
|
+
defaultParseWidth: "any"
|
|
1875
|
+
})
|
|
1876
|
+
};
|
|
1877
|
+
|
|
1878
|
+
// node_modules/date-fns/locale/en-US.js
|
|
1879
|
+
var enUS = {
|
|
1880
|
+
code: "en-US",
|
|
1881
|
+
formatDistance,
|
|
1882
|
+
formatLong,
|
|
1883
|
+
formatRelative,
|
|
1884
|
+
localize,
|
|
1885
|
+
match,
|
|
1886
|
+
options: {
|
|
1887
|
+
weekStartsOn: 0,
|
|
1888
|
+
firstWeekContainsDate: 1
|
|
1889
|
+
}
|
|
1890
|
+
};
|
|
1891
|
+
|
|
1892
|
+
// node_modules/date-fns/getDayOfYear.js
|
|
1893
|
+
function getDayOfYear(date, options) {
|
|
1894
|
+
const _date = toDate(date, options?.in);
|
|
1895
|
+
const diff = differenceInCalendarDays(_date, startOfYear(_date));
|
|
1896
|
+
const dayOfYear = diff + 1;
|
|
1897
|
+
return dayOfYear;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
// node_modules/date-fns/getISOWeek.js
|
|
1901
|
+
function getISOWeek(date, options) {
|
|
1902
|
+
const _date = toDate(date, options?.in);
|
|
1903
|
+
const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
|
|
1904
|
+
return Math.round(diff / millisecondsInWeek) + 1;
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
// node_modules/date-fns/getWeekYear.js
|
|
1908
|
+
function getWeekYear(date, options) {
|
|
1909
|
+
const _date = toDate(date, options?.in);
|
|
1910
|
+
const year = _date.getFullYear();
|
|
1911
|
+
const defaultOptions2 = getDefaultOptions();
|
|
1912
|
+
const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
|
|
1913
|
+
const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
|
|
1914
|
+
firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
|
|
1915
|
+
firstWeekOfNextYear.setHours(0, 0, 0, 0);
|
|
1916
|
+
const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
|
|
1917
|
+
const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
|
|
1918
|
+
firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
|
|
1919
|
+
firstWeekOfThisYear.setHours(0, 0, 0, 0);
|
|
1920
|
+
const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
|
|
1921
|
+
if (+_date >= +startOfNextYear) {
|
|
1922
|
+
return year + 1;
|
|
1923
|
+
} else if (+_date >= +startOfThisYear) {
|
|
1924
|
+
return year;
|
|
1925
|
+
} else {
|
|
1926
|
+
return year - 1;
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
// node_modules/date-fns/startOfWeekYear.js
|
|
1931
|
+
function startOfWeekYear(date, options) {
|
|
1932
|
+
const defaultOptions2 = getDefaultOptions();
|
|
1933
|
+
const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
|
|
1934
|
+
const year = getWeekYear(date, options);
|
|
1935
|
+
const firstWeek = constructFrom(options?.in || date, 0);
|
|
1936
|
+
firstWeek.setFullYear(year, 0, firstWeekContainsDate);
|
|
1937
|
+
firstWeek.setHours(0, 0, 0, 0);
|
|
1938
|
+
const _date = startOfWeek(firstWeek, options);
|
|
1939
|
+
return _date;
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
// node_modules/date-fns/getWeek.js
|
|
1943
|
+
function getWeek(date, options) {
|
|
1944
|
+
const _date = toDate(date, options?.in);
|
|
1945
|
+
const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
|
|
1946
|
+
return Math.round(diff / millisecondsInWeek) + 1;
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
// node_modules/date-fns/_lib/addLeadingZeros.js
|
|
1950
|
+
function addLeadingZeros(number, targetLength) {
|
|
1951
|
+
const sign = number < 0 ? "-" : "";
|
|
1952
|
+
const output = Math.abs(number).toString().padStart(targetLength, "0");
|
|
1953
|
+
return sign + output;
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
// node_modules/date-fns/_lib/format/lightFormatters.js
|
|
1957
|
+
var lightFormatters = {
|
|
1958
|
+
// Year
|
|
1959
|
+
y(date, token) {
|
|
1960
|
+
const signedYear = date.getFullYear();
|
|
1961
|
+
const year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
1962
|
+
return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
|
|
1963
|
+
},
|
|
1964
|
+
// Month
|
|
1965
|
+
M(date, token) {
|
|
1966
|
+
const month = date.getMonth();
|
|
1967
|
+
return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
|
|
1968
|
+
},
|
|
1969
|
+
// Day of the month
|
|
1970
|
+
d(date, token) {
|
|
1971
|
+
return addLeadingZeros(date.getDate(), token.length);
|
|
1972
|
+
},
|
|
1973
|
+
// AM or PM
|
|
1974
|
+
a(date, token) {
|
|
1975
|
+
const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1976
|
+
switch (token) {
|
|
1977
|
+
case "a":
|
|
1978
|
+
case "aa":
|
|
1979
|
+
return dayPeriodEnumValue.toUpperCase();
|
|
1980
|
+
case "aaa":
|
|
1981
|
+
return dayPeriodEnumValue;
|
|
1982
|
+
case "aaaaa":
|
|
1983
|
+
return dayPeriodEnumValue[0];
|
|
1984
|
+
case "aaaa":
|
|
1985
|
+
default:
|
|
1986
|
+
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
|
|
1987
|
+
}
|
|
1988
|
+
},
|
|
1989
|
+
// Hour [1-12]
|
|
1990
|
+
h(date, token) {
|
|
1991
|
+
return addLeadingZeros(date.getHours() % 12 || 12, token.length);
|
|
1992
|
+
},
|
|
1993
|
+
// Hour [0-23]
|
|
1994
|
+
H(date, token) {
|
|
1995
|
+
return addLeadingZeros(date.getHours(), token.length);
|
|
1996
|
+
},
|
|
1997
|
+
// Minute
|
|
1998
|
+
m(date, token) {
|
|
1999
|
+
return addLeadingZeros(date.getMinutes(), token.length);
|
|
2000
|
+
},
|
|
2001
|
+
// Second
|
|
2002
|
+
s(date, token) {
|
|
2003
|
+
return addLeadingZeros(date.getSeconds(), token.length);
|
|
2004
|
+
},
|
|
2005
|
+
// Fraction of second
|
|
2006
|
+
S(date, token) {
|
|
2007
|
+
const numberOfDigits = token.length;
|
|
2008
|
+
const milliseconds = date.getMilliseconds();
|
|
2009
|
+
const fractionalSeconds = Math.trunc(
|
|
2010
|
+
milliseconds * Math.pow(10, numberOfDigits - 3)
|
|
2011
|
+
);
|
|
2012
|
+
return addLeadingZeros(fractionalSeconds, token.length);
|
|
2013
|
+
}
|
|
2014
|
+
};
|
|
2015
|
+
|
|
2016
|
+
// node_modules/date-fns/_lib/format/formatters.js
|
|
2017
|
+
var dayPeriodEnum = {
|
|
2018
|
+
am: "am",
|
|
2019
|
+
pm: "pm",
|
|
2020
|
+
midnight: "midnight",
|
|
2021
|
+
noon: "noon",
|
|
2022
|
+
morning: "morning",
|
|
2023
|
+
afternoon: "afternoon",
|
|
2024
|
+
evening: "evening",
|
|
2025
|
+
night: "night"
|
|
2026
|
+
};
|
|
2027
|
+
var formatters = {
|
|
2028
|
+
// Era
|
|
2029
|
+
G: function(date, token, localize3) {
|
|
2030
|
+
const era = date.getFullYear() > 0 ? 1 : 0;
|
|
2031
|
+
switch (token) {
|
|
2032
|
+
// AD, BC
|
|
2033
|
+
case "G":
|
|
2034
|
+
case "GG":
|
|
2035
|
+
case "GGG":
|
|
2036
|
+
return localize3.era(era, { width: "abbreviated" });
|
|
2037
|
+
// A, B
|
|
2038
|
+
case "GGGGG":
|
|
2039
|
+
return localize3.era(era, { width: "narrow" });
|
|
2040
|
+
// Anno Domini, Before Christ
|
|
2041
|
+
case "GGGG":
|
|
2042
|
+
default:
|
|
2043
|
+
return localize3.era(era, { width: "wide" });
|
|
2044
|
+
}
|
|
2045
|
+
},
|
|
2046
|
+
// Year
|
|
2047
|
+
y: function(date, token, localize3) {
|
|
2048
|
+
if (token === "yo") {
|
|
2049
|
+
const signedYear = date.getFullYear();
|
|
2050
|
+
const year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
2051
|
+
return localize3.ordinalNumber(year, { unit: "year" });
|
|
2052
|
+
}
|
|
2053
|
+
return lightFormatters.y(date, token);
|
|
2054
|
+
},
|
|
2055
|
+
// Local week-numbering year
|
|
2056
|
+
Y: function(date, token, localize3, options) {
|
|
2057
|
+
const signedWeekYear = getWeekYear(date, options);
|
|
2058
|
+
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
|
2059
|
+
if (token === "YY") {
|
|
2060
|
+
const twoDigitYear = weekYear % 100;
|
|
2061
|
+
return addLeadingZeros(twoDigitYear, 2);
|
|
2062
|
+
}
|
|
2063
|
+
if (token === "Yo") {
|
|
2064
|
+
return localize3.ordinalNumber(weekYear, { unit: "year" });
|
|
2065
|
+
}
|
|
2066
|
+
return addLeadingZeros(weekYear, token.length);
|
|
2067
|
+
},
|
|
2068
|
+
// ISO week-numbering year
|
|
2069
|
+
R: function(date, token) {
|
|
2070
|
+
const isoWeekYear = getISOWeekYear(date);
|
|
2071
|
+
return addLeadingZeros(isoWeekYear, token.length);
|
|
2072
|
+
},
|
|
2073
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
|
2074
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
|
2075
|
+
// | Year | `y` | `u` |
|
|
2076
|
+
// |------|-----|-----|
|
|
2077
|
+
// | AC 1 | 1 | 1 |
|
|
2078
|
+
// | BC 1 | 1 | 0 |
|
|
2079
|
+
// | BC 2 | 2 | -1 |
|
|
2080
|
+
// Also `yy` always returns the last two digits of a year,
|
|
2081
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
2082
|
+
u: function(date, token) {
|
|
2083
|
+
const year = date.getFullYear();
|
|
2084
|
+
return addLeadingZeros(year, token.length);
|
|
2085
|
+
},
|
|
2086
|
+
// Quarter
|
|
2087
|
+
Q: function(date, token, localize3) {
|
|
2088
|
+
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
|
2089
|
+
switch (token) {
|
|
2090
|
+
// 1, 2, 3, 4
|
|
2091
|
+
case "Q":
|
|
2092
|
+
return String(quarter);
|
|
2093
|
+
// 01, 02, 03, 04
|
|
2094
|
+
case "QQ":
|
|
2095
|
+
return addLeadingZeros(quarter, 2);
|
|
2096
|
+
// 1st, 2nd, 3rd, 4th
|
|
2097
|
+
case "Qo":
|
|
2098
|
+
return localize3.ordinalNumber(quarter, { unit: "quarter" });
|
|
2099
|
+
// Q1, Q2, Q3, Q4
|
|
2100
|
+
case "QQQ":
|
|
2101
|
+
return localize3.quarter(quarter, {
|
|
2102
|
+
width: "abbreviated",
|
|
2103
|
+
context: "formatting"
|
|
2104
|
+
});
|
|
2105
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
2106
|
+
case "QQQQQ":
|
|
2107
|
+
return localize3.quarter(quarter, {
|
|
2108
|
+
width: "narrow",
|
|
2109
|
+
context: "formatting"
|
|
2110
|
+
});
|
|
2111
|
+
// 1st quarter, 2nd quarter, ...
|
|
2112
|
+
case "QQQQ":
|
|
2113
|
+
default:
|
|
2114
|
+
return localize3.quarter(quarter, {
|
|
2115
|
+
width: "wide",
|
|
2116
|
+
context: "formatting"
|
|
2117
|
+
});
|
|
2118
|
+
}
|
|
2119
|
+
},
|
|
2120
|
+
// Stand-alone quarter
|
|
2121
|
+
q: function(date, token, localize3) {
|
|
2122
|
+
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
|
2123
|
+
switch (token) {
|
|
2124
|
+
// 1, 2, 3, 4
|
|
2125
|
+
case "q":
|
|
2126
|
+
return String(quarter);
|
|
2127
|
+
// 01, 02, 03, 04
|
|
2128
|
+
case "qq":
|
|
2129
|
+
return addLeadingZeros(quarter, 2);
|
|
2130
|
+
// 1st, 2nd, 3rd, 4th
|
|
2131
|
+
case "qo":
|
|
2132
|
+
return localize3.ordinalNumber(quarter, { unit: "quarter" });
|
|
2133
|
+
// Q1, Q2, Q3, Q4
|
|
2134
|
+
case "qqq":
|
|
2135
|
+
return localize3.quarter(quarter, {
|
|
2136
|
+
width: "abbreviated",
|
|
2137
|
+
context: "standalone"
|
|
2138
|
+
});
|
|
2139
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
2140
|
+
case "qqqqq":
|
|
2141
|
+
return localize3.quarter(quarter, {
|
|
2142
|
+
width: "narrow",
|
|
2143
|
+
context: "standalone"
|
|
2144
|
+
});
|
|
2145
|
+
// 1st quarter, 2nd quarter, ...
|
|
2146
|
+
case "qqqq":
|
|
2147
|
+
default:
|
|
2148
|
+
return localize3.quarter(quarter, {
|
|
2149
|
+
width: "wide",
|
|
2150
|
+
context: "standalone"
|
|
2151
|
+
});
|
|
2152
|
+
}
|
|
2153
|
+
},
|
|
2154
|
+
// Month
|
|
2155
|
+
M: function(date, token, localize3) {
|
|
2156
|
+
const month = date.getMonth();
|
|
2157
|
+
switch (token) {
|
|
2158
|
+
case "M":
|
|
2159
|
+
case "MM":
|
|
2160
|
+
return lightFormatters.M(date, token);
|
|
2161
|
+
// 1st, 2nd, ..., 12th
|
|
2162
|
+
case "Mo":
|
|
2163
|
+
return localize3.ordinalNumber(month + 1, { unit: "month" });
|
|
2164
|
+
// Jan, Feb, ..., Dec
|
|
2165
|
+
case "MMM":
|
|
2166
|
+
return localize3.month(month, {
|
|
2167
|
+
width: "abbreviated",
|
|
2168
|
+
context: "formatting"
|
|
2169
|
+
});
|
|
2170
|
+
// J, F, ..., D
|
|
2171
|
+
case "MMMMM":
|
|
2172
|
+
return localize3.month(month, {
|
|
2173
|
+
width: "narrow",
|
|
2174
|
+
context: "formatting"
|
|
2175
|
+
});
|
|
2176
|
+
// January, February, ..., December
|
|
2177
|
+
case "MMMM":
|
|
2178
|
+
default:
|
|
2179
|
+
return localize3.month(month, { width: "wide", context: "formatting" });
|
|
2180
|
+
}
|
|
2181
|
+
},
|
|
2182
|
+
// Stand-alone month
|
|
2183
|
+
L: function(date, token, localize3) {
|
|
2184
|
+
const month = date.getMonth();
|
|
2185
|
+
switch (token) {
|
|
2186
|
+
// 1, 2, ..., 12
|
|
2187
|
+
case "L":
|
|
2188
|
+
return String(month + 1);
|
|
2189
|
+
// 01, 02, ..., 12
|
|
2190
|
+
case "LL":
|
|
2191
|
+
return addLeadingZeros(month + 1, 2);
|
|
2192
|
+
// 1st, 2nd, ..., 12th
|
|
2193
|
+
case "Lo":
|
|
2194
|
+
return localize3.ordinalNumber(month + 1, { unit: "month" });
|
|
2195
|
+
// Jan, Feb, ..., Dec
|
|
2196
|
+
case "LLL":
|
|
2197
|
+
return localize3.month(month, {
|
|
2198
|
+
width: "abbreviated",
|
|
2199
|
+
context: "standalone"
|
|
2200
|
+
});
|
|
2201
|
+
// J, F, ..., D
|
|
2202
|
+
case "LLLLL":
|
|
2203
|
+
return localize3.month(month, {
|
|
2204
|
+
width: "narrow",
|
|
2205
|
+
context: "standalone"
|
|
2206
|
+
});
|
|
2207
|
+
// January, February, ..., December
|
|
2208
|
+
case "LLLL":
|
|
2209
|
+
default:
|
|
2210
|
+
return localize3.month(month, { width: "wide", context: "standalone" });
|
|
2211
|
+
}
|
|
2212
|
+
},
|
|
2213
|
+
// Local week of year
|
|
2214
|
+
w: function(date, token, localize3, options) {
|
|
2215
|
+
const week = getWeek(date, options);
|
|
2216
|
+
if (token === "wo") {
|
|
2217
|
+
return localize3.ordinalNumber(week, { unit: "week" });
|
|
2218
|
+
}
|
|
2219
|
+
return addLeadingZeros(week, token.length);
|
|
2220
|
+
},
|
|
2221
|
+
// ISO week of year
|
|
2222
|
+
I: function(date, token, localize3) {
|
|
2223
|
+
const isoWeek = getISOWeek(date);
|
|
2224
|
+
if (token === "Io") {
|
|
2225
|
+
return localize3.ordinalNumber(isoWeek, { unit: "week" });
|
|
2226
|
+
}
|
|
2227
|
+
return addLeadingZeros(isoWeek, token.length);
|
|
2228
|
+
},
|
|
2229
|
+
// Day of the month
|
|
2230
|
+
d: function(date, token, localize3) {
|
|
2231
|
+
if (token === "do") {
|
|
2232
|
+
return localize3.ordinalNumber(date.getDate(), { unit: "date" });
|
|
2233
|
+
}
|
|
2234
|
+
return lightFormatters.d(date, token);
|
|
2235
|
+
},
|
|
2236
|
+
// Day of year
|
|
2237
|
+
D: function(date, token, localize3) {
|
|
2238
|
+
const dayOfYear = getDayOfYear(date);
|
|
2239
|
+
if (token === "Do") {
|
|
2240
|
+
return localize3.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
|
|
2241
|
+
}
|
|
2242
|
+
return addLeadingZeros(dayOfYear, token.length);
|
|
2243
|
+
},
|
|
2244
|
+
// Day of week
|
|
2245
|
+
E: function(date, token, localize3) {
|
|
2246
|
+
const dayOfWeek = date.getDay();
|
|
2247
|
+
switch (token) {
|
|
2248
|
+
// Tue
|
|
2249
|
+
case "E":
|
|
2250
|
+
case "EE":
|
|
2251
|
+
case "EEE":
|
|
2252
|
+
return localize3.day(dayOfWeek, {
|
|
2253
|
+
width: "abbreviated",
|
|
2254
|
+
context: "formatting"
|
|
2255
|
+
});
|
|
2256
|
+
// T
|
|
2257
|
+
case "EEEEE":
|
|
2258
|
+
return localize3.day(dayOfWeek, {
|
|
2259
|
+
width: "narrow",
|
|
2260
|
+
context: "formatting"
|
|
2261
|
+
});
|
|
2262
|
+
// Tu
|
|
2263
|
+
case "EEEEEE":
|
|
2264
|
+
return localize3.day(dayOfWeek, {
|
|
2265
|
+
width: "short",
|
|
2266
|
+
context: "formatting"
|
|
2267
|
+
});
|
|
2268
|
+
// Tuesday
|
|
2269
|
+
case "EEEE":
|
|
2270
|
+
default:
|
|
2271
|
+
return localize3.day(dayOfWeek, {
|
|
2272
|
+
width: "wide",
|
|
2273
|
+
context: "formatting"
|
|
2274
|
+
});
|
|
2275
|
+
}
|
|
2276
|
+
},
|
|
2277
|
+
// Local day of week
|
|
2278
|
+
e: function(date, token, localize3, options) {
|
|
2279
|
+
const dayOfWeek = date.getDay();
|
|
2280
|
+
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
2281
|
+
switch (token) {
|
|
2282
|
+
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
2283
|
+
case "e":
|
|
2284
|
+
return String(localDayOfWeek);
|
|
2285
|
+
// Padded numerical value
|
|
2286
|
+
case "ee":
|
|
2287
|
+
return addLeadingZeros(localDayOfWeek, 2);
|
|
2288
|
+
// 1st, 2nd, ..., 7th
|
|
2289
|
+
case "eo":
|
|
2290
|
+
return localize3.ordinalNumber(localDayOfWeek, { unit: "day" });
|
|
2291
|
+
case "eee":
|
|
2292
|
+
return localize3.day(dayOfWeek, {
|
|
2293
|
+
width: "abbreviated",
|
|
2294
|
+
context: "formatting"
|
|
2295
|
+
});
|
|
2296
|
+
// T
|
|
2297
|
+
case "eeeee":
|
|
2298
|
+
return localize3.day(dayOfWeek, {
|
|
2299
|
+
width: "narrow",
|
|
2300
|
+
context: "formatting"
|
|
2301
|
+
});
|
|
2302
|
+
// Tu
|
|
2303
|
+
case "eeeeee":
|
|
2304
|
+
return localize3.day(dayOfWeek, {
|
|
2305
|
+
width: "short",
|
|
2306
|
+
context: "formatting"
|
|
2307
|
+
});
|
|
2308
|
+
// Tuesday
|
|
2309
|
+
case "eeee":
|
|
2310
|
+
default:
|
|
2311
|
+
return localize3.day(dayOfWeek, {
|
|
2312
|
+
width: "wide",
|
|
2313
|
+
context: "formatting"
|
|
2314
|
+
});
|
|
2315
|
+
}
|
|
2316
|
+
},
|
|
2317
|
+
// Stand-alone local day of week
|
|
2318
|
+
c: function(date, token, localize3, options) {
|
|
2319
|
+
const dayOfWeek = date.getDay();
|
|
2320
|
+
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
2321
|
+
switch (token) {
|
|
2322
|
+
// Numerical value (same as in `e`)
|
|
2323
|
+
case "c":
|
|
2324
|
+
return String(localDayOfWeek);
|
|
2325
|
+
// Padded numerical value
|
|
2326
|
+
case "cc":
|
|
2327
|
+
return addLeadingZeros(localDayOfWeek, token.length);
|
|
2328
|
+
// 1st, 2nd, ..., 7th
|
|
2329
|
+
case "co":
|
|
2330
|
+
return localize3.ordinalNumber(localDayOfWeek, { unit: "day" });
|
|
2331
|
+
case "ccc":
|
|
2332
|
+
return localize3.day(dayOfWeek, {
|
|
2333
|
+
width: "abbreviated",
|
|
2334
|
+
context: "standalone"
|
|
2335
|
+
});
|
|
2336
|
+
// T
|
|
2337
|
+
case "ccccc":
|
|
2338
|
+
return localize3.day(dayOfWeek, {
|
|
2339
|
+
width: "narrow",
|
|
2340
|
+
context: "standalone"
|
|
2341
|
+
});
|
|
2342
|
+
// Tu
|
|
2343
|
+
case "cccccc":
|
|
2344
|
+
return localize3.day(dayOfWeek, {
|
|
2345
|
+
width: "short",
|
|
2346
|
+
context: "standalone"
|
|
2347
|
+
});
|
|
2348
|
+
// Tuesday
|
|
2349
|
+
case "cccc":
|
|
2350
|
+
default:
|
|
2351
|
+
return localize3.day(dayOfWeek, {
|
|
2352
|
+
width: "wide",
|
|
2353
|
+
context: "standalone"
|
|
2354
|
+
});
|
|
2355
|
+
}
|
|
2356
|
+
},
|
|
2357
|
+
// ISO day of week
|
|
2358
|
+
i: function(date, token, localize3) {
|
|
2359
|
+
const dayOfWeek = date.getDay();
|
|
2360
|
+
const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
|
2361
|
+
switch (token) {
|
|
2362
|
+
// 2
|
|
2363
|
+
case "i":
|
|
2364
|
+
return String(isoDayOfWeek);
|
|
2365
|
+
// 02
|
|
2366
|
+
case "ii":
|
|
2367
|
+
return addLeadingZeros(isoDayOfWeek, token.length);
|
|
2368
|
+
// 2nd
|
|
2369
|
+
case "io":
|
|
2370
|
+
return localize3.ordinalNumber(isoDayOfWeek, { unit: "day" });
|
|
2371
|
+
// Tue
|
|
2372
|
+
case "iii":
|
|
2373
|
+
return localize3.day(dayOfWeek, {
|
|
2374
|
+
width: "abbreviated",
|
|
2375
|
+
context: "formatting"
|
|
2376
|
+
});
|
|
2377
|
+
// T
|
|
2378
|
+
case "iiiii":
|
|
2379
|
+
return localize3.day(dayOfWeek, {
|
|
2380
|
+
width: "narrow",
|
|
2381
|
+
context: "formatting"
|
|
2382
|
+
});
|
|
2383
|
+
// Tu
|
|
2384
|
+
case "iiiiii":
|
|
2385
|
+
return localize3.day(dayOfWeek, {
|
|
2386
|
+
width: "short",
|
|
2387
|
+
context: "formatting"
|
|
2388
|
+
});
|
|
2389
|
+
// Tuesday
|
|
2390
|
+
case "iiii":
|
|
2391
|
+
default:
|
|
2392
|
+
return localize3.day(dayOfWeek, {
|
|
2393
|
+
width: "wide",
|
|
2394
|
+
context: "formatting"
|
|
2395
|
+
});
|
|
2396
|
+
}
|
|
2397
|
+
},
|
|
2398
|
+
// AM or PM
|
|
2399
|
+
a: function(date, token, localize3) {
|
|
2400
|
+
const hours = date.getHours();
|
|
2401
|
+
const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
2402
|
+
switch (token) {
|
|
2403
|
+
case "a":
|
|
2404
|
+
case "aa":
|
|
2405
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2406
|
+
width: "abbreviated",
|
|
2407
|
+
context: "formatting"
|
|
2408
|
+
});
|
|
2409
|
+
case "aaa":
|
|
2410
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2411
|
+
width: "abbreviated",
|
|
2412
|
+
context: "formatting"
|
|
2413
|
+
}).toLowerCase();
|
|
2414
|
+
case "aaaaa":
|
|
2415
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2416
|
+
width: "narrow",
|
|
2417
|
+
context: "formatting"
|
|
2418
|
+
});
|
|
2419
|
+
case "aaaa":
|
|
2420
|
+
default:
|
|
2421
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2422
|
+
width: "wide",
|
|
2423
|
+
context: "formatting"
|
|
2424
|
+
});
|
|
2425
|
+
}
|
|
2426
|
+
},
|
|
2427
|
+
// AM, PM, midnight, noon
|
|
2428
|
+
b: function(date, token, localize3) {
|
|
2429
|
+
const hours = date.getHours();
|
|
2430
|
+
let dayPeriodEnumValue;
|
|
2431
|
+
if (hours === 12) {
|
|
2432
|
+
dayPeriodEnumValue = dayPeriodEnum.noon;
|
|
2433
|
+
} else if (hours === 0) {
|
|
2434
|
+
dayPeriodEnumValue = dayPeriodEnum.midnight;
|
|
2435
|
+
} else {
|
|
2436
|
+
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
2437
|
+
}
|
|
2438
|
+
switch (token) {
|
|
2439
|
+
case "b":
|
|
2440
|
+
case "bb":
|
|
2441
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2442
|
+
width: "abbreviated",
|
|
2443
|
+
context: "formatting"
|
|
2444
|
+
});
|
|
2445
|
+
case "bbb":
|
|
2446
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2447
|
+
width: "abbreviated",
|
|
2448
|
+
context: "formatting"
|
|
2449
|
+
}).toLowerCase();
|
|
2450
|
+
case "bbbbb":
|
|
2451
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2452
|
+
width: "narrow",
|
|
2453
|
+
context: "formatting"
|
|
2454
|
+
});
|
|
2455
|
+
case "bbbb":
|
|
2456
|
+
default:
|
|
2457
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2458
|
+
width: "wide",
|
|
2459
|
+
context: "formatting"
|
|
2460
|
+
});
|
|
2461
|
+
}
|
|
2462
|
+
},
|
|
2463
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
2464
|
+
B: function(date, token, localize3) {
|
|
2465
|
+
const hours = date.getHours();
|
|
2466
|
+
let dayPeriodEnumValue;
|
|
2467
|
+
if (hours >= 17) {
|
|
2468
|
+
dayPeriodEnumValue = dayPeriodEnum.evening;
|
|
2469
|
+
} else if (hours >= 12) {
|
|
2470
|
+
dayPeriodEnumValue = dayPeriodEnum.afternoon;
|
|
2471
|
+
} else if (hours >= 4) {
|
|
2472
|
+
dayPeriodEnumValue = dayPeriodEnum.morning;
|
|
2473
|
+
} else {
|
|
2474
|
+
dayPeriodEnumValue = dayPeriodEnum.night;
|
|
2475
|
+
}
|
|
2476
|
+
switch (token) {
|
|
2477
|
+
case "B":
|
|
2478
|
+
case "BB":
|
|
2479
|
+
case "BBB":
|
|
2480
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2481
|
+
width: "abbreviated",
|
|
2482
|
+
context: "formatting"
|
|
2483
|
+
});
|
|
2484
|
+
case "BBBBB":
|
|
2485
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2486
|
+
width: "narrow",
|
|
2487
|
+
context: "formatting"
|
|
2488
|
+
});
|
|
2489
|
+
case "BBBB":
|
|
2490
|
+
default:
|
|
2491
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2492
|
+
width: "wide",
|
|
2493
|
+
context: "formatting"
|
|
2494
|
+
});
|
|
2495
|
+
}
|
|
2496
|
+
},
|
|
2497
|
+
// Hour [1-12]
|
|
2498
|
+
h: function(date, token, localize3) {
|
|
2499
|
+
if (token === "ho") {
|
|
2500
|
+
let hours = date.getHours() % 12;
|
|
2501
|
+
if (hours === 0) hours = 12;
|
|
2502
|
+
return localize3.ordinalNumber(hours, { unit: "hour" });
|
|
2503
|
+
}
|
|
2504
|
+
return lightFormatters.h(date, token);
|
|
2505
|
+
},
|
|
2506
|
+
// Hour [0-23]
|
|
2507
|
+
H: function(date, token, localize3) {
|
|
2508
|
+
if (token === "Ho") {
|
|
2509
|
+
return localize3.ordinalNumber(date.getHours(), { unit: "hour" });
|
|
2510
|
+
}
|
|
2511
|
+
return lightFormatters.H(date, token);
|
|
2512
|
+
},
|
|
2513
|
+
// Hour [0-11]
|
|
2514
|
+
K: function(date, token, localize3) {
|
|
2515
|
+
const hours = date.getHours() % 12;
|
|
2516
|
+
if (token === "Ko") {
|
|
2517
|
+
return localize3.ordinalNumber(hours, { unit: "hour" });
|
|
2518
|
+
}
|
|
2519
|
+
return addLeadingZeros(hours, token.length);
|
|
2520
|
+
},
|
|
2521
|
+
// Hour [1-24]
|
|
2522
|
+
k: function(date, token, localize3) {
|
|
2523
|
+
let hours = date.getHours();
|
|
2524
|
+
if (hours === 0) hours = 24;
|
|
2525
|
+
if (token === "ko") {
|
|
2526
|
+
return localize3.ordinalNumber(hours, { unit: "hour" });
|
|
2527
|
+
}
|
|
2528
|
+
return addLeadingZeros(hours, token.length);
|
|
2529
|
+
},
|
|
2530
|
+
// Minute
|
|
2531
|
+
m: function(date, token, localize3) {
|
|
2532
|
+
if (token === "mo") {
|
|
2533
|
+
return localize3.ordinalNumber(date.getMinutes(), { unit: "minute" });
|
|
2534
|
+
}
|
|
2535
|
+
return lightFormatters.m(date, token);
|
|
2536
|
+
},
|
|
2537
|
+
// Second
|
|
2538
|
+
s: function(date, token, localize3) {
|
|
2539
|
+
if (token === "so") {
|
|
2540
|
+
return localize3.ordinalNumber(date.getSeconds(), { unit: "second" });
|
|
2541
|
+
}
|
|
2542
|
+
return lightFormatters.s(date, token);
|
|
2543
|
+
},
|
|
2544
|
+
// Fraction of second
|
|
2545
|
+
S: function(date, token) {
|
|
2546
|
+
return lightFormatters.S(date, token);
|
|
2547
|
+
},
|
|
2548
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
2549
|
+
X: function(date, token, _localize) {
|
|
2550
|
+
const timezoneOffset = date.getTimezoneOffset();
|
|
2551
|
+
if (timezoneOffset === 0) {
|
|
2552
|
+
return "Z";
|
|
2553
|
+
}
|
|
2554
|
+
switch (token) {
|
|
2555
|
+
// Hours and optional minutes
|
|
2556
|
+
case "X":
|
|
2557
|
+
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
2558
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
2559
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2560
|
+
// so this token always has the same output as `XX`
|
|
2561
|
+
case "XXXX":
|
|
2562
|
+
case "XX":
|
|
2563
|
+
return formatTimezone(timezoneOffset);
|
|
2564
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
2565
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2566
|
+
// so this token always has the same output as `XXX`
|
|
2567
|
+
case "XXXXX":
|
|
2568
|
+
case "XXX":
|
|
2569
|
+
// Hours and minutes with `:` delimiter
|
|
2570
|
+
default:
|
|
2571
|
+
return formatTimezone(timezoneOffset, ":");
|
|
2572
|
+
}
|
|
2573
|
+
},
|
|
2574
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
2575
|
+
x: function(date, token, _localize) {
|
|
2576
|
+
const timezoneOffset = date.getTimezoneOffset();
|
|
2577
|
+
switch (token) {
|
|
2578
|
+
// Hours and optional minutes
|
|
2579
|
+
case "x":
|
|
2580
|
+
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
2581
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
2582
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2583
|
+
// so this token always has the same output as `xx`
|
|
2584
|
+
case "xxxx":
|
|
2585
|
+
case "xx":
|
|
2586
|
+
return formatTimezone(timezoneOffset);
|
|
2587
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
2588
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2589
|
+
// so this token always has the same output as `xxx`
|
|
2590
|
+
case "xxxxx":
|
|
2591
|
+
case "xxx":
|
|
2592
|
+
// Hours and minutes with `:` delimiter
|
|
2593
|
+
default:
|
|
2594
|
+
return formatTimezone(timezoneOffset, ":");
|
|
2595
|
+
}
|
|
2596
|
+
},
|
|
2597
|
+
// Timezone (GMT)
|
|
2598
|
+
O: function(date, token, _localize) {
|
|
2599
|
+
const timezoneOffset = date.getTimezoneOffset();
|
|
2600
|
+
switch (token) {
|
|
2601
|
+
// Short
|
|
2602
|
+
case "O":
|
|
2603
|
+
case "OO":
|
|
2604
|
+
case "OOO":
|
|
2605
|
+
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
2606
|
+
// Long
|
|
2607
|
+
case "OOOO":
|
|
2608
|
+
default:
|
|
2609
|
+
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
2610
|
+
}
|
|
2611
|
+
},
|
|
2612
|
+
// Timezone (specific non-location)
|
|
2613
|
+
z: function(date, token, _localize) {
|
|
2614
|
+
const timezoneOffset = date.getTimezoneOffset();
|
|
2615
|
+
switch (token) {
|
|
2616
|
+
// Short
|
|
2617
|
+
case "z":
|
|
2618
|
+
case "zz":
|
|
2619
|
+
case "zzz":
|
|
2620
|
+
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
2621
|
+
// Long
|
|
2622
|
+
case "zzzz":
|
|
2623
|
+
default:
|
|
2624
|
+
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
2625
|
+
}
|
|
2626
|
+
},
|
|
2627
|
+
// Seconds timestamp
|
|
2628
|
+
t: function(date, token, _localize) {
|
|
2629
|
+
const timestamp = Math.trunc(+date / 1e3);
|
|
2630
|
+
return addLeadingZeros(timestamp, token.length);
|
|
2631
|
+
},
|
|
2632
|
+
// Milliseconds timestamp
|
|
2633
|
+
T: function(date, token, _localize) {
|
|
2634
|
+
return addLeadingZeros(+date, token.length);
|
|
2635
|
+
}
|
|
2636
|
+
};
|
|
2637
|
+
function formatTimezoneShort(offset, delimiter = "") {
|
|
2638
|
+
const sign = offset > 0 ? "-" : "+";
|
|
2639
|
+
const absOffset = Math.abs(offset);
|
|
2640
|
+
const hours = Math.trunc(absOffset / 60);
|
|
2641
|
+
const minutes = absOffset % 60;
|
|
2642
|
+
if (minutes === 0) {
|
|
2643
|
+
return sign + String(hours);
|
|
2644
|
+
}
|
|
2645
|
+
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
|
|
2646
|
+
}
|
|
2647
|
+
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
|
|
2648
|
+
if (offset % 60 === 0) {
|
|
2649
|
+
const sign = offset > 0 ? "-" : "+";
|
|
2650
|
+
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
|
|
2651
|
+
}
|
|
2652
|
+
return formatTimezone(offset, delimiter);
|
|
2653
|
+
}
|
|
2654
|
+
function formatTimezone(offset, delimiter = "") {
|
|
2655
|
+
const sign = offset > 0 ? "-" : "+";
|
|
2656
|
+
const absOffset = Math.abs(offset);
|
|
2657
|
+
const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
|
|
2658
|
+
const minutes = addLeadingZeros(absOffset % 60, 2);
|
|
2659
|
+
return sign + hours + delimiter + minutes;
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
// node_modules/date-fns/_lib/format/longFormatters.js
|
|
2663
|
+
var dateLongFormatter = (pattern, formatLong3) => {
|
|
2664
|
+
switch (pattern) {
|
|
2665
|
+
case "P":
|
|
2666
|
+
return formatLong3.date({ width: "short" });
|
|
2667
|
+
case "PP":
|
|
2668
|
+
return formatLong3.date({ width: "medium" });
|
|
2669
|
+
case "PPP":
|
|
2670
|
+
return formatLong3.date({ width: "long" });
|
|
2671
|
+
case "PPPP":
|
|
2672
|
+
default:
|
|
2673
|
+
return formatLong3.date({ width: "full" });
|
|
2674
|
+
}
|
|
2675
|
+
};
|
|
2676
|
+
var timeLongFormatter = (pattern, formatLong3) => {
|
|
2677
|
+
switch (pattern) {
|
|
2678
|
+
case "p":
|
|
2679
|
+
return formatLong3.time({ width: "short" });
|
|
2680
|
+
case "pp":
|
|
2681
|
+
return formatLong3.time({ width: "medium" });
|
|
2682
|
+
case "ppp":
|
|
2683
|
+
return formatLong3.time({ width: "long" });
|
|
2684
|
+
case "pppp":
|
|
2685
|
+
default:
|
|
2686
|
+
return formatLong3.time({ width: "full" });
|
|
2687
|
+
}
|
|
2688
|
+
};
|
|
2689
|
+
var dateTimeLongFormatter = (pattern, formatLong3) => {
|
|
2690
|
+
const matchResult = pattern.match(/(P+)(p+)?/) || [];
|
|
2691
|
+
const datePattern = matchResult[1];
|
|
2692
|
+
const timePattern = matchResult[2];
|
|
2693
|
+
if (!timePattern) {
|
|
2694
|
+
return dateLongFormatter(pattern, formatLong3);
|
|
2695
|
+
}
|
|
2696
|
+
let dateTimeFormat;
|
|
2697
|
+
switch (datePattern) {
|
|
2698
|
+
case "P":
|
|
2699
|
+
dateTimeFormat = formatLong3.dateTime({ width: "short" });
|
|
2700
|
+
break;
|
|
2701
|
+
case "PP":
|
|
2702
|
+
dateTimeFormat = formatLong3.dateTime({ width: "medium" });
|
|
2703
|
+
break;
|
|
2704
|
+
case "PPP":
|
|
2705
|
+
dateTimeFormat = formatLong3.dateTime({ width: "long" });
|
|
2706
|
+
break;
|
|
2707
|
+
case "PPPP":
|
|
2708
|
+
default:
|
|
2709
|
+
dateTimeFormat = formatLong3.dateTime({ width: "full" });
|
|
2710
|
+
break;
|
|
2711
|
+
}
|
|
2712
|
+
return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong3)).replace("{{time}}", timeLongFormatter(timePattern, formatLong3));
|
|
2713
|
+
};
|
|
2714
|
+
var longFormatters = {
|
|
2715
|
+
p: timeLongFormatter,
|
|
2716
|
+
P: dateTimeLongFormatter
|
|
2717
|
+
};
|
|
2718
|
+
|
|
2719
|
+
// node_modules/date-fns/_lib/protectedTokens.js
|
|
2720
|
+
var dayOfYearTokenRE = /^D+$/;
|
|
2721
|
+
var weekYearTokenRE = /^Y+$/;
|
|
2722
|
+
var throwTokens = ["D", "DD", "YY", "YYYY"];
|
|
2723
|
+
function isProtectedDayOfYearToken(token) {
|
|
2724
|
+
return dayOfYearTokenRE.test(token);
|
|
2725
|
+
}
|
|
2726
|
+
function isProtectedWeekYearToken(token) {
|
|
2727
|
+
return weekYearTokenRE.test(token);
|
|
2728
|
+
}
|
|
2729
|
+
function warnOrThrowProtectedError(token, format2, input) {
|
|
2730
|
+
const _message = message(token, format2, input);
|
|
2731
|
+
console.warn(_message);
|
|
2732
|
+
if (throwTokens.includes(token)) throw new RangeError(_message);
|
|
2733
|
+
}
|
|
2734
|
+
function message(token, format2, input) {
|
|
2735
|
+
const subject = token[0] === "Y" ? "years" : "days of the month";
|
|
2736
|
+
return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format2}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2739
|
+
// node_modules/date-fns/format.js
|
|
2740
|
+
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
|
2741
|
+
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
2742
|
+
var escapedStringRegExp = /^'([^]*?)'?$/;
|
|
2743
|
+
var doubleQuoteRegExp = /''/g;
|
|
2744
|
+
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
2745
|
+
function format(date, formatStr, options) {
|
|
2746
|
+
const defaultOptions2 = getDefaultOptions();
|
|
2747
|
+
const locale = options?.locale ?? defaultOptions2.locale ?? enUS;
|
|
2748
|
+
const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
|
|
2749
|
+
const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
|
|
2750
|
+
const originalDate = toDate(date, options?.in);
|
|
2751
|
+
if (!isValid(originalDate)) {
|
|
2752
|
+
throw new RangeError("Invalid time value");
|
|
2753
|
+
}
|
|
2754
|
+
let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => {
|
|
2755
|
+
const firstCharacter = substring[0];
|
|
2756
|
+
if (firstCharacter === "p" || firstCharacter === "P") {
|
|
2757
|
+
const longFormatter = longFormatters[firstCharacter];
|
|
2758
|
+
return longFormatter(substring, locale.formatLong);
|
|
2759
|
+
}
|
|
2760
|
+
return substring;
|
|
2761
|
+
}).join("").match(formattingTokensRegExp).map((substring) => {
|
|
2762
|
+
if (substring === "''") {
|
|
2763
|
+
return { isToken: false, value: "'" };
|
|
2764
|
+
}
|
|
2765
|
+
const firstCharacter = substring[0];
|
|
2766
|
+
if (firstCharacter === "'") {
|
|
2767
|
+
return { isToken: false, value: cleanEscapedString(substring) };
|
|
2768
|
+
}
|
|
2769
|
+
if (formatters[firstCharacter]) {
|
|
2770
|
+
return { isToken: true, value: substring };
|
|
2771
|
+
}
|
|
2772
|
+
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
|
2773
|
+
throw new RangeError(
|
|
2774
|
+
"Format string contains an unescaped latin alphabet character `" + firstCharacter + "`"
|
|
2775
|
+
);
|
|
2776
|
+
}
|
|
2777
|
+
return { isToken: false, value: substring };
|
|
2778
|
+
});
|
|
2779
|
+
if (locale.localize.preprocessor) {
|
|
2780
|
+
parts = locale.localize.preprocessor(originalDate, parts);
|
|
2781
|
+
}
|
|
2782
|
+
const formatterOptions = {
|
|
2783
|
+
firstWeekContainsDate,
|
|
2784
|
+
weekStartsOn,
|
|
2785
|
+
locale
|
|
2786
|
+
};
|
|
2787
|
+
return parts.map((part) => {
|
|
2788
|
+
if (!part.isToken) return part.value;
|
|
2789
|
+
const token = part.value;
|
|
2790
|
+
if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token) || !options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {
|
|
2791
|
+
warnOrThrowProtectedError(token, formatStr, String(date));
|
|
2792
|
+
}
|
|
2793
|
+
const formatter = formatters[token[0]];
|
|
2794
|
+
return formatter(originalDate, token, locale.localize, formatterOptions);
|
|
2795
|
+
}).join("");
|
|
2796
|
+
}
|
|
2797
|
+
function cleanEscapedString(input) {
|
|
2798
|
+
const matched = input.match(escapedStringRegExp);
|
|
2799
|
+
if (!matched) {
|
|
2800
|
+
return input;
|
|
2801
|
+
}
|
|
2802
|
+
return matched[1].replace(doubleQuoteRegExp, "'");
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
// src/DatePicker/DatePickerBasic/DatePickerBasic.tsx
|
|
2806
|
+
var import_buddhistEra = __toESM(require_buddhistEra());
|
|
2807
|
+
|
|
2808
|
+
// node_modules/date-fns/locale/th/_lib/formatDistance.js
|
|
2809
|
+
var formatDistanceLocale2 = {
|
|
2810
|
+
lessThanXSeconds: {
|
|
2811
|
+
one: "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 1 \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35",
|
|
2812
|
+
other: "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 {{count}} \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35"
|
|
2813
|
+
},
|
|
2814
|
+
xSeconds: {
|
|
2815
|
+
one: "1 \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35",
|
|
2816
|
+
other: "{{count}} \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35"
|
|
2817
|
+
},
|
|
2818
|
+
halfAMinute: "\u0E04\u0E23\u0E36\u0E48\u0E07\u0E19\u0E32\u0E17\u0E35",
|
|
2819
|
+
lessThanXMinutes: {
|
|
2820
|
+
one: "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 1 \u0E19\u0E32\u0E17\u0E35",
|
|
2821
|
+
other: "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 {{count}} \u0E19\u0E32\u0E17\u0E35"
|
|
2822
|
+
},
|
|
2823
|
+
xMinutes: {
|
|
2824
|
+
one: "1 \u0E19\u0E32\u0E17\u0E35",
|
|
2825
|
+
other: "{{count}} \u0E19\u0E32\u0E17\u0E35"
|
|
2826
|
+
},
|
|
2827
|
+
aboutXHours: {
|
|
2828
|
+
one: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 1 \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07",
|
|
2829
|
+
other: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 {{count}} \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07"
|
|
2830
|
+
},
|
|
2831
|
+
xHours: {
|
|
2832
|
+
one: "1 \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07",
|
|
2833
|
+
other: "{{count}} \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07"
|
|
2834
|
+
},
|
|
2835
|
+
xDays: {
|
|
2836
|
+
one: "1 \u0E27\u0E31\u0E19",
|
|
2837
|
+
other: "{{count}} \u0E27\u0E31\u0E19"
|
|
2838
|
+
},
|
|
2839
|
+
aboutXWeeks: {
|
|
2840
|
+
one: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 1 \u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C",
|
|
2841
|
+
other: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 {{count}} \u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C"
|
|
2842
|
+
},
|
|
2843
|
+
xWeeks: {
|
|
2844
|
+
one: "1 \u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C",
|
|
2845
|
+
other: "{{count}} \u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C"
|
|
2846
|
+
},
|
|
2847
|
+
aboutXMonths: {
|
|
2848
|
+
one: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 1 \u0E40\u0E14\u0E37\u0E2D\u0E19",
|
|
2849
|
+
other: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 {{count}} \u0E40\u0E14\u0E37\u0E2D\u0E19"
|
|
2850
|
+
},
|
|
2851
|
+
xMonths: {
|
|
2852
|
+
one: "1 \u0E40\u0E14\u0E37\u0E2D\u0E19",
|
|
2853
|
+
other: "{{count}} \u0E40\u0E14\u0E37\u0E2D\u0E19"
|
|
2854
|
+
},
|
|
2855
|
+
aboutXYears: {
|
|
2856
|
+
one: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 1 \u0E1B\u0E35",
|
|
2857
|
+
other: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 {{count}} \u0E1B\u0E35"
|
|
2858
|
+
},
|
|
2859
|
+
xYears: {
|
|
2860
|
+
one: "1 \u0E1B\u0E35",
|
|
2861
|
+
other: "{{count}} \u0E1B\u0E35"
|
|
2862
|
+
},
|
|
2863
|
+
overXYears: {
|
|
2864
|
+
one: "\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32 1 \u0E1B\u0E35",
|
|
2865
|
+
other: "\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32 {{count}} \u0E1B\u0E35"
|
|
2866
|
+
},
|
|
2867
|
+
almostXYears: {
|
|
2868
|
+
one: "\u0E40\u0E01\u0E37\u0E2D\u0E1A 1 \u0E1B\u0E35",
|
|
2869
|
+
other: "\u0E40\u0E01\u0E37\u0E2D\u0E1A {{count}} \u0E1B\u0E35"
|
|
2870
|
+
}
|
|
2871
|
+
};
|
|
2872
|
+
var formatDistance2 = (token, count, options) => {
|
|
2873
|
+
let result;
|
|
2874
|
+
const tokenValue = formatDistanceLocale2[token];
|
|
2875
|
+
if (typeof tokenValue === "string") {
|
|
2876
|
+
result = tokenValue;
|
|
2877
|
+
} else if (count === 1) {
|
|
2878
|
+
result = tokenValue.one;
|
|
2879
|
+
} else {
|
|
2880
|
+
result = tokenValue.other.replace("{{count}}", String(count));
|
|
2881
|
+
}
|
|
2882
|
+
if (options?.addSuffix) {
|
|
2883
|
+
if (options.comparison && options.comparison > 0) {
|
|
2884
|
+
if (token === "halfAMinute") {
|
|
2885
|
+
return "\u0E43\u0E19" + result;
|
|
2886
|
+
} else {
|
|
2887
|
+
return "\u0E43\u0E19 " + result;
|
|
2888
|
+
}
|
|
2889
|
+
} else {
|
|
2890
|
+
return result + "\u0E17\u0E35\u0E48\u0E1C\u0E48\u0E32\u0E19\u0E21\u0E32";
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
return result;
|
|
2894
|
+
};
|
|
2895
|
+
|
|
2896
|
+
// node_modules/date-fns/locale/th/_lib/formatLong.js
|
|
2897
|
+
var dateFormats2 = {
|
|
2898
|
+
full: "\u0E27\u0E31\u0E19EEEE\u0E17\u0E35\u0E48 do MMMM y",
|
|
2899
|
+
long: "do MMMM y",
|
|
2900
|
+
medium: "d MMM y",
|
|
2901
|
+
short: "dd/MM/yyyy"
|
|
2902
|
+
};
|
|
2903
|
+
var timeFormats2 = {
|
|
2904
|
+
full: "H:mm:ss \u0E19. zzzz",
|
|
2905
|
+
long: "H:mm:ss \u0E19. z",
|
|
2906
|
+
medium: "H:mm:ss \u0E19.",
|
|
2907
|
+
short: "H:mm \u0E19."
|
|
2908
|
+
};
|
|
2909
|
+
var dateTimeFormats2 = {
|
|
2910
|
+
full: "{{date}} '\u0E40\u0E27\u0E25\u0E32' {{time}}",
|
|
2911
|
+
long: "{{date}} '\u0E40\u0E27\u0E25\u0E32' {{time}}",
|
|
2912
|
+
medium: "{{date}}, {{time}}",
|
|
2913
|
+
short: "{{date}}, {{time}}"
|
|
2914
|
+
};
|
|
2915
|
+
var formatLong2 = {
|
|
2916
|
+
date: buildFormatLongFn({
|
|
2917
|
+
formats: dateFormats2,
|
|
2918
|
+
defaultWidth: "full"
|
|
2919
|
+
}),
|
|
2920
|
+
time: buildFormatLongFn({
|
|
2921
|
+
formats: timeFormats2,
|
|
2922
|
+
defaultWidth: "medium"
|
|
2923
|
+
}),
|
|
2924
|
+
dateTime: buildFormatLongFn({
|
|
2925
|
+
formats: dateTimeFormats2,
|
|
2926
|
+
defaultWidth: "full"
|
|
2927
|
+
})
|
|
2928
|
+
};
|
|
2929
|
+
|
|
2930
|
+
// node_modules/date-fns/locale/th/_lib/formatRelative.js
|
|
2931
|
+
var formatRelativeLocale2 = {
|
|
2932
|
+
lastWeek: "eeee'\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27\u0E40\u0E27\u0E25\u0E32' p",
|
|
2933
|
+
yesterday: "'\u0E40\u0E21\u0E37\u0E48\u0E2D\u0E27\u0E32\u0E19\u0E19\u0E35\u0E49\u0E40\u0E27\u0E25\u0E32' p",
|
|
2934
|
+
today: "'\u0E27\u0E31\u0E19\u0E19\u0E35\u0E49\u0E40\u0E27\u0E25\u0E32' p",
|
|
2935
|
+
tomorrow: "'\u0E1E\u0E23\u0E38\u0E48\u0E07\u0E19\u0E35\u0E49\u0E40\u0E27\u0E25\u0E32' p",
|
|
2936
|
+
nextWeek: "eeee '\u0E40\u0E27\u0E25\u0E32' p",
|
|
2937
|
+
other: "P"
|
|
2938
|
+
};
|
|
2939
|
+
var formatRelative2 = (token, _date, _baseDate, _options) => formatRelativeLocale2[token];
|
|
2940
|
+
|
|
2941
|
+
// node_modules/date-fns/locale/th/_lib/localize.js
|
|
2942
|
+
var eraValues2 = {
|
|
2943
|
+
narrow: ["B", "\u0E04\u0E28"],
|
|
2944
|
+
abbreviated: ["BC", "\u0E04.\u0E28."],
|
|
2945
|
+
wide: ["\u0E1B\u0E35\u0E01\u0E48\u0E2D\u0E19\u0E04\u0E23\u0E34\u0E2A\u0E15\u0E01\u0E32\u0E25", "\u0E04\u0E23\u0E34\u0E2A\u0E15\u0E4C\u0E28\u0E31\u0E01\u0E23\u0E32\u0E0A"]
|
|
2946
|
+
};
|
|
2947
|
+
var quarterValues2 = {
|
|
2948
|
+
narrow: ["1", "2", "3", "4"],
|
|
2949
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
2950
|
+
wide: ["\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A\u0E41\u0E23\u0E01", "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A\u0E17\u0E35\u0E48\u0E2A\u0E2D\u0E07", "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A\u0E17\u0E35\u0E48\u0E2A\u0E32\u0E21", "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A\u0E17\u0E35\u0E48\u0E2A\u0E35\u0E48"]
|
|
2951
|
+
};
|
|
2952
|
+
var dayValues2 = {
|
|
2953
|
+
narrow: ["\u0E2D\u0E32.", "\u0E08.", "\u0E2D.", "\u0E1E.", "\u0E1E\u0E24.", "\u0E28.", "\u0E2A."],
|
|
2954
|
+
short: ["\u0E2D\u0E32.", "\u0E08.", "\u0E2D.", "\u0E1E.", "\u0E1E\u0E24.", "\u0E28.", "\u0E2A."],
|
|
2955
|
+
abbreviated: ["\u0E2D\u0E32.", "\u0E08.", "\u0E2D.", "\u0E1E.", "\u0E1E\u0E24.", "\u0E28.", "\u0E2A."],
|
|
2956
|
+
wide: ["\u0E2D\u0E32\u0E17\u0E34\u0E15\u0E22\u0E4C", "\u0E08\u0E31\u0E19\u0E17\u0E23\u0E4C", "\u0E2D\u0E31\u0E07\u0E04\u0E32\u0E23", "\u0E1E\u0E38\u0E18", "\u0E1E\u0E24\u0E2B\u0E31\u0E2A\u0E1A\u0E14\u0E35", "\u0E28\u0E38\u0E01\u0E23\u0E4C", "\u0E40\u0E2A\u0E32\u0E23\u0E4C"]
|
|
2957
|
+
};
|
|
2958
|
+
var monthValues2 = {
|
|
2959
|
+
narrow: [
|
|
2960
|
+
"\u0E21.\u0E04.",
|
|
2961
|
+
"\u0E01.\u0E1E.",
|
|
2962
|
+
"\u0E21\u0E35.\u0E04.",
|
|
2963
|
+
"\u0E40\u0E21.\u0E22.",
|
|
2964
|
+
"\u0E1E.\u0E04.",
|
|
2965
|
+
"\u0E21\u0E34.\u0E22.",
|
|
2966
|
+
"\u0E01.\u0E04.",
|
|
2967
|
+
"\u0E2A.\u0E04.",
|
|
2968
|
+
"\u0E01.\u0E22.",
|
|
2969
|
+
"\u0E15.\u0E04.",
|
|
2970
|
+
"\u0E1E.\u0E22.",
|
|
2971
|
+
"\u0E18.\u0E04."
|
|
2972
|
+
],
|
|
2973
|
+
abbreviated: [
|
|
2974
|
+
"\u0E21.\u0E04.",
|
|
2975
|
+
"\u0E01.\u0E1E.",
|
|
2976
|
+
"\u0E21\u0E35.\u0E04.",
|
|
2977
|
+
"\u0E40\u0E21.\u0E22.",
|
|
2978
|
+
"\u0E1E.\u0E04.",
|
|
2979
|
+
"\u0E21\u0E34.\u0E22.",
|
|
2980
|
+
"\u0E01.\u0E04.",
|
|
2981
|
+
"\u0E2A.\u0E04.",
|
|
2982
|
+
"\u0E01.\u0E22.",
|
|
2983
|
+
"\u0E15.\u0E04.",
|
|
2984
|
+
"\u0E1E.\u0E22.",
|
|
2985
|
+
"\u0E18.\u0E04."
|
|
2986
|
+
],
|
|
2987
|
+
wide: [
|
|
2988
|
+
"\u0E21\u0E01\u0E23\u0E32\u0E04\u0E21",
|
|
2989
|
+
"\u0E01\u0E38\u0E21\u0E20\u0E32\u0E1E\u0E31\u0E19\u0E18\u0E4C",
|
|
2990
|
+
"\u0E21\u0E35\u0E19\u0E32\u0E04\u0E21",
|
|
2991
|
+
"\u0E40\u0E21\u0E29\u0E32\u0E22\u0E19",
|
|
2992
|
+
"\u0E1E\u0E24\u0E29\u0E20\u0E32\u0E04\u0E21",
|
|
2993
|
+
"\u0E21\u0E34\u0E16\u0E38\u0E19\u0E32\u0E22\u0E19",
|
|
2994
|
+
"\u0E01\u0E23\u0E01\u0E0E\u0E32\u0E04\u0E21",
|
|
2995
|
+
"\u0E2A\u0E34\u0E07\u0E2B\u0E32\u0E04\u0E21",
|
|
2996
|
+
"\u0E01\u0E31\u0E19\u0E22\u0E32\u0E22\u0E19",
|
|
2997
|
+
"\u0E15\u0E38\u0E25\u0E32\u0E04\u0E21",
|
|
2998
|
+
"\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19",
|
|
2999
|
+
"\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21"
|
|
3000
|
+
]
|
|
3001
|
+
};
|
|
3002
|
+
var dayPeriodValues2 = {
|
|
3003
|
+
narrow: {
|
|
3004
|
+
am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3005
|
+
pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3006
|
+
midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
|
|
3007
|
+
noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3008
|
+
morning: "\u0E40\u0E0A\u0E49\u0E32",
|
|
3009
|
+
afternoon: "\u0E1A\u0E48\u0E32\u0E22",
|
|
3010
|
+
evening: "\u0E40\u0E22\u0E47\u0E19",
|
|
3011
|
+
night: "\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
|
|
3012
|
+
},
|
|
3013
|
+
abbreviated: {
|
|
3014
|
+
am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3015
|
+
pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3016
|
+
midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
|
|
3017
|
+
noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3018
|
+
morning: "\u0E40\u0E0A\u0E49\u0E32",
|
|
3019
|
+
afternoon: "\u0E1A\u0E48\u0E32\u0E22",
|
|
3020
|
+
evening: "\u0E40\u0E22\u0E47\u0E19",
|
|
3021
|
+
night: "\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
|
|
3022
|
+
},
|
|
3023
|
+
wide: {
|
|
3024
|
+
am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3025
|
+
pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3026
|
+
midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
|
|
3027
|
+
noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3028
|
+
morning: "\u0E40\u0E0A\u0E49\u0E32",
|
|
3029
|
+
afternoon: "\u0E1A\u0E48\u0E32\u0E22",
|
|
3030
|
+
evening: "\u0E40\u0E22\u0E47\u0E19",
|
|
3031
|
+
night: "\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
|
|
3032
|
+
}
|
|
3033
|
+
};
|
|
3034
|
+
var formattingDayPeriodValues2 = {
|
|
3035
|
+
narrow: {
|
|
3036
|
+
am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3037
|
+
pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3038
|
+
midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
|
|
3039
|
+
noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3040
|
+
morning: "\u0E15\u0E2D\u0E19\u0E40\u0E0A\u0E49\u0E32",
|
|
3041
|
+
afternoon: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E27\u0E31\u0E19",
|
|
3042
|
+
evening: "\u0E15\u0E2D\u0E19\u0E40\u0E22\u0E47\u0E19",
|
|
3043
|
+
night: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
|
|
3044
|
+
},
|
|
3045
|
+
abbreviated: {
|
|
3046
|
+
am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3047
|
+
pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3048
|
+
midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
|
|
3049
|
+
noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3050
|
+
morning: "\u0E15\u0E2D\u0E19\u0E40\u0E0A\u0E49\u0E32",
|
|
3051
|
+
afternoon: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E27\u0E31\u0E19",
|
|
3052
|
+
evening: "\u0E15\u0E2D\u0E19\u0E40\u0E22\u0E47\u0E19",
|
|
3053
|
+
night: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
|
|
3054
|
+
},
|
|
3055
|
+
wide: {
|
|
3056
|
+
am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3057
|
+
pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3058
|
+
midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
|
|
3059
|
+
noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3060
|
+
morning: "\u0E15\u0E2D\u0E19\u0E40\u0E0A\u0E49\u0E32",
|
|
3061
|
+
afternoon: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E27\u0E31\u0E19",
|
|
3062
|
+
evening: "\u0E15\u0E2D\u0E19\u0E40\u0E22\u0E47\u0E19",
|
|
3063
|
+
night: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
|
|
3064
|
+
}
|
|
3065
|
+
};
|
|
3066
|
+
var ordinalNumber2 = (dirtyNumber, _options) => {
|
|
3067
|
+
return String(dirtyNumber);
|
|
3068
|
+
};
|
|
3069
|
+
var localize2 = {
|
|
3070
|
+
ordinalNumber: ordinalNumber2,
|
|
3071
|
+
era: buildLocalizeFn({
|
|
3072
|
+
values: eraValues2,
|
|
3073
|
+
defaultWidth: "wide"
|
|
3074
|
+
}),
|
|
3075
|
+
quarter: buildLocalizeFn({
|
|
3076
|
+
values: quarterValues2,
|
|
3077
|
+
defaultWidth: "wide",
|
|
3078
|
+
argumentCallback: (quarter) => quarter - 1
|
|
3079
|
+
}),
|
|
3080
|
+
month: buildLocalizeFn({
|
|
3081
|
+
values: monthValues2,
|
|
3082
|
+
defaultWidth: "wide"
|
|
3083
|
+
}),
|
|
3084
|
+
day: buildLocalizeFn({
|
|
3085
|
+
values: dayValues2,
|
|
3086
|
+
defaultWidth: "wide"
|
|
3087
|
+
}),
|
|
3088
|
+
dayPeriod: buildLocalizeFn({
|
|
3089
|
+
values: dayPeriodValues2,
|
|
3090
|
+
defaultWidth: "wide",
|
|
3091
|
+
formattingValues: formattingDayPeriodValues2,
|
|
3092
|
+
defaultFormattingWidth: "wide"
|
|
3093
|
+
})
|
|
3094
|
+
};
|
|
3095
|
+
|
|
3096
|
+
// node_modules/date-fns/locale/th/_lib/match.js
|
|
3097
|
+
var matchOrdinalNumberPattern2 = /^\d+/i;
|
|
3098
|
+
var parseOrdinalNumberPattern2 = /\d+/i;
|
|
3099
|
+
var matchEraPatterns2 = {
|
|
3100
|
+
narrow: /^([bB]|[aA]|คศ)/i,
|
|
3101
|
+
abbreviated: /^([bB]\.?\s?[cC]\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?|ค\.?ศ\.?)/i,
|
|
3102
|
+
wide: /^(ก่อนคริสตกาล|คริสต์ศักราช|คริสตกาล)/i
|
|
3103
|
+
};
|
|
3104
|
+
var parseEraPatterns2 = {
|
|
3105
|
+
any: [/^[bB]/i, /^(^[aA]|ค\.?ศ\.?|คริสตกาล|คริสต์ศักราช|)/i]
|
|
3106
|
+
};
|
|
3107
|
+
var matchQuarterPatterns2 = {
|
|
3108
|
+
narrow: /^[1234]/i,
|
|
3109
|
+
abbreviated: /^q[1234]/i,
|
|
3110
|
+
wide: /^ไตรมาส(ที่)? ?[1234]/i
|
|
3111
|
+
};
|
|
3112
|
+
var parseQuarterPatterns2 = {
|
|
3113
|
+
any: [/(1|แรก|หนึ่ง)/i, /(2|สอง)/i, /(3|สาม)/i, /(4|สี่)/i]
|
|
3114
|
+
};
|
|
3115
|
+
var matchMonthPatterns2 = {
|
|
3116
|
+
narrow: /^(ม\.?ค\.?|ก\.?พ\.?|มี\.?ค\.?|เม\.?ย\.?|พ\.?ค\.?|มิ\.?ย\.?|ก\.?ค\.?|ส\.?ค\.?|ก\.?ย\.?|ต\.?ค\.?|พ\.?ย\.?|ธ\.?ค\.?)/i,
|
|
3117
|
+
abbreviated: /^(ม\.?ค\.?|ก\.?พ\.?|มี\.?ค\.?|เม\.?ย\.?|พ\.?ค\.?|มิ\.?ย\.?|ก\.?ค\.?|ส\.?ค\.?|ก\.?ย\.?|ต\.?ค\.?|พ\.?ย\.?|ธ\.?ค\.?')/i,
|
|
3118
|
+
wide: /^(มกราคม|กุมภาพันธ์|มีนาคม|เมษายน|พฤษภาคม|มิถุนายน|กรกฎาคม|สิงหาคม|กันยายน|ตุลาคม|พฤศจิกายน|ธันวาคม)/i
|
|
3119
|
+
};
|
|
3120
|
+
var parseMonthPatterns2 = {
|
|
3121
|
+
wide: [
|
|
3122
|
+
/^มก/i,
|
|
3123
|
+
/^กุม/i,
|
|
3124
|
+
/^มี/i,
|
|
3125
|
+
/^เม/i,
|
|
3126
|
+
/^พฤษ/i,
|
|
3127
|
+
/^มิ/i,
|
|
3128
|
+
/^กรก/i,
|
|
3129
|
+
/^ส/i,
|
|
3130
|
+
/^กัน/i,
|
|
3131
|
+
/^ต/i,
|
|
3132
|
+
/^พฤศ/i,
|
|
3133
|
+
/^ธ/i
|
|
3134
|
+
],
|
|
3135
|
+
any: [
|
|
3136
|
+
/^ม\.?ค\.?/i,
|
|
3137
|
+
/^ก\.?พ\.?/i,
|
|
3138
|
+
/^มี\.?ค\.?/i,
|
|
3139
|
+
/^เม\.?ย\.?/i,
|
|
3140
|
+
/^พ\.?ค\.?/i,
|
|
3141
|
+
/^มิ\.?ย\.?/i,
|
|
3142
|
+
/^ก\.?ค\.?/i,
|
|
3143
|
+
/^ส\.?ค\.?/i,
|
|
3144
|
+
/^ก\.?ย\.?/i,
|
|
3145
|
+
/^ต\.?ค\.?/i,
|
|
3146
|
+
/^พ\.?ย\.?/i,
|
|
3147
|
+
/^ธ\.?ค\.?/i
|
|
3148
|
+
]
|
|
3149
|
+
};
|
|
3150
|
+
var matchDayPatterns2 = {
|
|
3151
|
+
narrow: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
|
|
3152
|
+
short: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
|
|
3153
|
+
abbreviated: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
|
|
3154
|
+
wide: /^(อาทิตย์|จันทร์|อังคาร|พุธ|พฤหัสบดี|ศุกร์|เสาร์)/i
|
|
3155
|
+
};
|
|
3156
|
+
var parseDayPatterns2 = {
|
|
3157
|
+
wide: [/^อา/i, /^จั/i, /^อั/i, /^พุธ/i, /^พฤ/i, /^ศ/i, /^เส/i],
|
|
3158
|
+
any: [/^อา/i, /^จ/i, /^อ/i, /^พ(?!ฤ)/i, /^พฤ/i, /^ศ/i, /^ส/i]
|
|
3159
|
+
};
|
|
3160
|
+
var matchDayPeriodPatterns2 = {
|
|
3161
|
+
any: /^(ก่อนเที่ยง|หลังเที่ยง|เที่ยงคืน|เที่ยง|(ตอน.*?)?.*(เที่ยง|เช้า|บ่าย|เย็น|กลางคืน))/i
|
|
3162
|
+
};
|
|
3163
|
+
var parseDayPeriodPatterns2 = {
|
|
3164
|
+
any: {
|
|
3165
|
+
am: /^ก่อนเที่ยง/i,
|
|
3166
|
+
pm: /^หลังเที่ยง/i,
|
|
3167
|
+
midnight: /^เที่ยงคืน/i,
|
|
3168
|
+
noon: /^เที่ยง/i,
|
|
3169
|
+
morning: /เช้า/i,
|
|
3170
|
+
afternoon: /บ่าย/i,
|
|
3171
|
+
evening: /เย็น/i,
|
|
3172
|
+
night: /กลางคืน/i
|
|
3173
|
+
}
|
|
3174
|
+
};
|
|
3175
|
+
var match2 = {
|
|
3176
|
+
ordinalNumber: buildMatchPatternFn({
|
|
3177
|
+
matchPattern: matchOrdinalNumberPattern2,
|
|
3178
|
+
parsePattern: parseOrdinalNumberPattern2,
|
|
3179
|
+
valueCallback: (value) => parseInt(value, 10)
|
|
3180
|
+
}),
|
|
3181
|
+
era: buildMatchFn({
|
|
3182
|
+
matchPatterns: matchEraPatterns2,
|
|
3183
|
+
defaultMatchWidth: "wide",
|
|
3184
|
+
parsePatterns: parseEraPatterns2,
|
|
3185
|
+
defaultParseWidth: "any"
|
|
3186
|
+
}),
|
|
3187
|
+
quarter: buildMatchFn({
|
|
3188
|
+
matchPatterns: matchQuarterPatterns2,
|
|
3189
|
+
defaultMatchWidth: "wide",
|
|
3190
|
+
parsePatterns: parseQuarterPatterns2,
|
|
3191
|
+
defaultParseWidth: "any",
|
|
3192
|
+
valueCallback: (index) => index + 1
|
|
3193
|
+
}),
|
|
3194
|
+
month: buildMatchFn({
|
|
3195
|
+
matchPatterns: matchMonthPatterns2,
|
|
3196
|
+
defaultMatchWidth: "wide",
|
|
3197
|
+
parsePatterns: parseMonthPatterns2,
|
|
3198
|
+
defaultParseWidth: "any"
|
|
3199
|
+
}),
|
|
3200
|
+
day: buildMatchFn({
|
|
3201
|
+
matchPatterns: matchDayPatterns2,
|
|
3202
|
+
defaultMatchWidth: "wide",
|
|
3203
|
+
parsePatterns: parseDayPatterns2,
|
|
3204
|
+
defaultParseWidth: "any"
|
|
3205
|
+
}),
|
|
3206
|
+
dayPeriod: buildMatchFn({
|
|
3207
|
+
matchPatterns: matchDayPeriodPatterns2,
|
|
3208
|
+
defaultMatchWidth: "any",
|
|
3209
|
+
parsePatterns: parseDayPeriodPatterns2,
|
|
3210
|
+
defaultParseWidth: "any"
|
|
3211
|
+
})
|
|
3212
|
+
};
|
|
3213
|
+
|
|
3214
|
+
// node_modules/date-fns/locale/th.js
|
|
3215
|
+
var th = {
|
|
3216
|
+
code: "th",
|
|
3217
|
+
formatDistance: formatDistance2,
|
|
3218
|
+
formatLong: formatLong2,
|
|
3219
|
+
formatRelative: formatRelative2,
|
|
3220
|
+
localize: localize2,
|
|
3221
|
+
match: match2,
|
|
3222
|
+
options: {
|
|
3223
|
+
weekStartsOn: 0,
|
|
3224
|
+
firstWeekContainsDate: 1
|
|
3225
|
+
}
|
|
3226
|
+
};
|
|
3227
|
+
|
|
3228
|
+
// src/DatePicker/convertToBuddhist.ts
|
|
3229
|
+
var import_th_TH = __toESM(require("antd/es/date-picker/locale/th_TH"));
|
|
3230
|
+
var buddhistLocale = {
|
|
3231
|
+
...import_th_TH.default,
|
|
3232
|
+
lang: {
|
|
3233
|
+
...import_th_TH.default.lang,
|
|
3234
|
+
fieldDateFormat: "BBBB-MM-DD",
|
|
3235
|
+
fieldDateTimeFormat: "BBBB-MM-DD HH:mm:ss",
|
|
3236
|
+
yearFormat: "BBBB",
|
|
3237
|
+
cellYearFormat: "BBBB"
|
|
3238
|
+
}
|
|
3239
|
+
};
|
|
3240
|
+
|
|
3241
|
+
// src/DatePicker/DatePickerBasic/DatePickerBasic.tsx
|
|
1342
3242
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3243
|
+
import_dayjs.default.extend(import_buddhistEra.default);
|
|
1343
3244
|
function DatePickerBasic({
|
|
1344
3245
|
value,
|
|
1345
3246
|
onChange,
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
showError,
|
|
1350
|
-
errorMessage,
|
|
3247
|
+
required,
|
|
3248
|
+
label,
|
|
3249
|
+
error,
|
|
1351
3250
|
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
|
|
1352
3251
|
disabled,
|
|
1353
3252
|
defaultValue,
|
|
@@ -1357,12 +3256,10 @@ function DatePickerBasic({
|
|
|
1357
3256
|
className,
|
|
1358
3257
|
size
|
|
1359
3258
|
}) {
|
|
1360
|
-
const dateFormat = "DD/MM/YYYY";
|
|
1361
|
-
import_dayjs.default.locale("th_TH");
|
|
1362
3259
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1363
3260
|
import_antd5.ConfigProvider,
|
|
1364
3261
|
{
|
|
1365
|
-
locale:
|
|
3262
|
+
locale: import_th_TH2.default,
|
|
1366
3263
|
theme: {
|
|
1367
3264
|
token: {
|
|
1368
3265
|
fontFamily: "Kanit",
|
|
@@ -1371,32 +3268,33 @@ function DatePickerBasic({
|
|
|
1371
3268
|
},
|
|
1372
3269
|
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "container-input", children: [
|
|
1373
3270
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
1374
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "body-1", children:
|
|
1375
|
-
" ",
|
|
1376
|
-
require2 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-red-500", children: "*" })
|
|
3271
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "body-1", children: label }),
|
|
3272
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1377
3273
|
] }),
|
|
1378
3274
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1379
3275
|
import_antd5.DatePicker,
|
|
1380
3276
|
{
|
|
1381
3277
|
className: `body-1 w-full ${className ?? ""}`,
|
|
1382
|
-
value,
|
|
3278
|
+
value: value ? (0, import_dayjs.default)(value) : null,
|
|
1383
3279
|
placeholder,
|
|
1384
|
-
onChange
|
|
3280
|
+
onChange: (date) => {
|
|
3281
|
+
onChange(date ? date.toDate() : null);
|
|
3282
|
+
},
|
|
1385
3283
|
allowClear: true,
|
|
1386
3284
|
disabled,
|
|
1387
|
-
format:
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
3285
|
+
format: (date) => date ? format(date.toDate(), "dd/MM/yyyy", { locale: th }).replace(
|
|
3286
|
+
/\d{4}$/,
|
|
3287
|
+
(y) => String(parseInt(y) + 543)
|
|
3288
|
+
) : "",
|
|
3289
|
+
defaultValue: defaultValue ? (0, import_dayjs.default)(defaultValue) : null,
|
|
3290
|
+
disabledDate: (d) => disabledDate ? disabledDate(d.toDate()) : false,
|
|
3291
|
+
minDate: minDate ? (0, import_dayjs.default)(minDate) : void 0,
|
|
3292
|
+
maxDate: maxDate ? (0, import_dayjs.default)(maxDate) : void 0,
|
|
3293
|
+
size,
|
|
3294
|
+
locale: buddhistLocale
|
|
1393
3295
|
}
|
|
1394
3296
|
),
|
|
1395
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.
|
|
1396
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1397
|
-
" ",
|
|
1398
|
-
showError && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1399
|
-
] })
|
|
3297
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1400
3298
|
] })
|
|
1401
3299
|
}
|
|
1402
3300
|
);
|
|
@@ -1404,21 +3302,19 @@ function DatePickerBasic({
|
|
|
1404
3302
|
|
|
1405
3303
|
// src/DatePicker/DatePickerRangePicker/DatePickerRangePicker.tsx
|
|
1406
3304
|
var import_antd6 = require("antd");
|
|
1407
|
-
var
|
|
1408
|
-
var
|
|
1409
|
-
var import_customParseFormat = __toESM(require_customParseFormat());
|
|
3305
|
+
var import_th_TH3 = __toESM(require("antd/locale/th_TH"));
|
|
3306
|
+
var import_th2 = __toESM(require_th());
|
|
1410
3307
|
var import_dayjs2 = __toESM(require_dayjs_min());
|
|
3308
|
+
var import_buddhistEra2 = __toESM(require_buddhistEra());
|
|
1411
3309
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1412
|
-
import_dayjs2.default.extend(
|
|
3310
|
+
import_dayjs2.default.extend(import_buddhistEra2.default);
|
|
1413
3311
|
function DatePickerRangePicker({
|
|
1414
3312
|
value,
|
|
1415
3313
|
onChange,
|
|
1416
3314
|
placeholder = ["\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19", "\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14"],
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
showError,
|
|
1421
|
-
errorMessage,
|
|
3315
|
+
label,
|
|
3316
|
+
required,
|
|
3317
|
+
error,
|
|
1422
3318
|
disabled,
|
|
1423
3319
|
minDate,
|
|
1424
3320
|
maxDate,
|
|
@@ -1428,12 +3324,10 @@ function DatePickerRangePicker({
|
|
|
1428
3324
|
onOpenChange,
|
|
1429
3325
|
onCalendarChange
|
|
1430
3326
|
}) {
|
|
1431
|
-
const dateFormat = "DD/MM/YYYY";
|
|
1432
|
-
import_dayjs2.default.locale("th_TH");
|
|
1433
3327
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1434
3328
|
import_antd6.ConfigProvider,
|
|
1435
3329
|
{
|
|
1436
|
-
locale:
|
|
3330
|
+
locale: import_th_TH3.default,
|
|
1437
3331
|
theme: {
|
|
1438
3332
|
token: {
|
|
1439
3333
|
fontFamily: "Kanit",
|
|
@@ -1442,33 +3336,58 @@ function DatePickerRangePicker({
|
|
|
1442
3336
|
},
|
|
1443
3337
|
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "container-input", children: [
|
|
1444
3338
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
|
|
1445
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "body-1", children:
|
|
3339
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "body-1", children: label }),
|
|
1446
3340
|
" ",
|
|
1447
|
-
|
|
3341
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1448
3342
|
] }),
|
|
1449
3343
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1450
3344
|
import_antd6.DatePicker.RangePicker,
|
|
1451
3345
|
{
|
|
1452
|
-
format:
|
|
1453
|
-
|
|
3346
|
+
format: (date) => date ? format(date.toDate(), "dd/MM/yyyy", { locale: th }).replace(
|
|
3347
|
+
/\d{4}$/,
|
|
3348
|
+
(y) => String(parseInt(y) + 543)
|
|
3349
|
+
) : "",
|
|
3350
|
+
value: value ? [
|
|
3351
|
+
value[0] ? (0, import_dayjs2.default)(value[0]) : null,
|
|
3352
|
+
value[1] ? (0, import_dayjs2.default)(value[1]) : null
|
|
3353
|
+
] : null,
|
|
1454
3354
|
placeholder,
|
|
1455
3355
|
className: `body-1 w-full ${className ?? ""}`,
|
|
1456
|
-
onChange,
|
|
3356
|
+
onChange: (dates, dateStrings) => {
|
|
3357
|
+
if (!dates) {
|
|
3358
|
+
onChange(null);
|
|
3359
|
+
} else {
|
|
3360
|
+
onChange([
|
|
3361
|
+
dates[0] ? dates[0].toDate() : null,
|
|
3362
|
+
dates[1] ? dates[1].toDate() : null
|
|
3363
|
+
]);
|
|
3364
|
+
}
|
|
3365
|
+
},
|
|
1457
3366
|
allowClear: true,
|
|
1458
3367
|
disabled,
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
3368
|
+
disabledDate: (d) => disabledDate ? disabledDate(d.toDate()) : false,
|
|
3369
|
+
minDate: minDate ? (0, import_dayjs2.default)(minDate) : void 0,
|
|
3370
|
+
maxDate: maxDate ? (0, import_dayjs2.default)(maxDate) : void 0,
|
|
1462
3371
|
size,
|
|
1463
3372
|
onOpenChange,
|
|
1464
|
-
onCalendarChange
|
|
3373
|
+
onCalendarChange: (dates, dateStrings, info) => {
|
|
3374
|
+
if (!dates) {
|
|
3375
|
+
onCalendarChange?.([null, null], dateStrings, info);
|
|
3376
|
+
} else {
|
|
3377
|
+
onCalendarChange?.(
|
|
3378
|
+
[
|
|
3379
|
+
dates[0] ? dates[0].toDate() : null,
|
|
3380
|
+
dates[1] ? dates[1].toDate() : null
|
|
3381
|
+
],
|
|
3382
|
+
dateStrings,
|
|
3383
|
+
info
|
|
3384
|
+
);
|
|
3385
|
+
}
|
|
3386
|
+
},
|
|
3387
|
+
locale: buddhistLocale
|
|
1465
3388
|
}
|
|
1466
3389
|
),
|
|
1467
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.
|
|
1468
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1469
|
-
" ",
|
|
1470
|
-
showError && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1471
|
-
] })
|
|
3390
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1472
3391
|
] })
|
|
1473
3392
|
}
|
|
1474
3393
|
);
|
|
@@ -1476,11 +3395,23 @@ function DatePickerRangePicker({
|
|
|
1476
3395
|
|
|
1477
3396
|
// src/TimePicker/TimePickerBasic/TimePickerBasic.tsx
|
|
1478
3397
|
var import_antd7 = require("antd");
|
|
3398
|
+
var import_dayjs3 = __toESM(require_dayjs_min());
|
|
3399
|
+
var import_th_TH4 = __toESM(require("antd/locale/th_TH"));
|
|
1479
3400
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1480
|
-
function TimePickerBasic({
|
|
3401
|
+
function TimePickerBasic({
|
|
3402
|
+
value,
|
|
3403
|
+
onChange,
|
|
3404
|
+
required,
|
|
3405
|
+
label,
|
|
3406
|
+
error,
|
|
3407
|
+
placeholder,
|
|
3408
|
+
disabled,
|
|
3409
|
+
className
|
|
3410
|
+
}) {
|
|
1481
3411
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1482
3412
|
import_antd7.ConfigProvider,
|
|
1483
3413
|
{
|
|
3414
|
+
locale: import_th_TH4.default,
|
|
1484
3415
|
theme: {
|
|
1485
3416
|
token: {
|
|
1486
3417
|
fontFamily: "Kanit"
|
|
@@ -1488,27 +3419,25 @@ function TimePickerBasic({ value, onChange, require: require2, title, bottomText
|
|
|
1488
3419
|
},
|
|
1489
3420
|
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "container-input", children: [
|
|
1490
3421
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
|
|
1491
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "body-1", children:
|
|
3422
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "body-1", children: label }),
|
|
1492
3423
|
" ",
|
|
1493
|
-
|
|
3424
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1494
3425
|
] }),
|
|
1495
3426
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1496
3427
|
import_antd7.TimePicker,
|
|
1497
3428
|
{
|
|
1498
3429
|
format: "HH:mm",
|
|
1499
3430
|
className: `body-1 w-full ${className ?? ""}`,
|
|
1500
|
-
value,
|
|
3431
|
+
value: value ? (0, import_dayjs3.default)(value) : null,
|
|
1501
3432
|
placeholder,
|
|
1502
|
-
onChange
|
|
3433
|
+
onChange: (time) => {
|
|
3434
|
+
onChange(time ? time.toDate() : null);
|
|
3435
|
+
},
|
|
1503
3436
|
allowClear: true,
|
|
1504
3437
|
disabled
|
|
1505
3438
|
}
|
|
1506
3439
|
),
|
|
1507
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.
|
|
1508
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1509
|
-
" ",
|
|
1510
|
-
showError && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1511
|
-
] })
|
|
3440
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1512
3441
|
] })
|
|
1513
3442
|
}
|
|
1514
3443
|
);
|
|
@@ -1516,22 +3445,23 @@ function TimePickerBasic({ value, onChange, require: require2, title, bottomText
|
|
|
1516
3445
|
|
|
1517
3446
|
// src/TimePicker/TimePickerRangePicker/TimerPickerRangePicker.tsx
|
|
1518
3447
|
var import_antd8 = require("antd");
|
|
3448
|
+
var import_th_TH5 = __toESM(require("antd/locale/th_TH"));
|
|
3449
|
+
var import_dayjs4 = __toESM(require_dayjs_min());
|
|
1519
3450
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1520
3451
|
function TimePickerRangePicker({
|
|
1521
3452
|
value,
|
|
1522
3453
|
onChange,
|
|
1523
3454
|
placeholder = ["\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19", "\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14"],
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
showError,
|
|
1528
|
-
errorMessage,
|
|
3455
|
+
label,
|
|
3456
|
+
required,
|
|
3457
|
+
error,
|
|
1529
3458
|
disabled,
|
|
1530
3459
|
className
|
|
1531
3460
|
}) {
|
|
1532
3461
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1533
3462
|
import_antd8.ConfigProvider,
|
|
1534
3463
|
{
|
|
3464
|
+
locale: import_th_TH5.default,
|
|
1535
3465
|
theme: {
|
|
1536
3466
|
token: {
|
|
1537
3467
|
fontFamily: "Kanit"
|
|
@@ -1539,27 +3469,36 @@ function TimePickerRangePicker({
|
|
|
1539
3469
|
},
|
|
1540
3470
|
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "container-input", children: [
|
|
1541
3471
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
|
|
1542
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "body-1", children:
|
|
3472
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "body-1", children: label }),
|
|
1543
3473
|
" ",
|
|
1544
|
-
|
|
3474
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1545
3475
|
] }),
|
|
1546
3476
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1547
3477
|
import_antd8.TimePicker.RangePicker,
|
|
1548
3478
|
{
|
|
1549
3479
|
format: "HH:mm",
|
|
1550
|
-
value
|
|
3480
|
+
value: value ? [
|
|
3481
|
+
value[0] ? (0, import_dayjs4.default)(value[0]) : null,
|
|
3482
|
+
value[1] ? (0, import_dayjs4.default)(value[1]) : null
|
|
3483
|
+
] : null,
|
|
1551
3484
|
placeholder,
|
|
1552
3485
|
className: `body-1 w-full ${className ?? ""}`,
|
|
1553
|
-
onChange,
|
|
3486
|
+
onChange: (dates, dateStrings) => {
|
|
3487
|
+
if (!dates) {
|
|
3488
|
+
onChange(null);
|
|
3489
|
+
} else {
|
|
3490
|
+
onChange([
|
|
3491
|
+
dates[0] ? dates[0].toDate() : null,
|
|
3492
|
+
dates[1] ? dates[1].toDate() : null
|
|
3493
|
+
]);
|
|
3494
|
+
}
|
|
3495
|
+
},
|
|
1554
3496
|
allowClear: true,
|
|
1555
|
-
disabled
|
|
3497
|
+
disabled,
|
|
3498
|
+
showNow: true
|
|
1556
3499
|
}
|
|
1557
3500
|
),
|
|
1558
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.
|
|
1559
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1560
|
-
" ",
|
|
1561
|
-
showError && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1562
|
-
] })
|
|
3501
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1563
3502
|
] })
|
|
1564
3503
|
}
|
|
1565
3504
|
);
|
|
@@ -1609,13 +3548,13 @@ function _defineProperty(e, r, t) {
|
|
|
1609
3548
|
// node_modules/@ant-design/fast-color/es/FastColor.js
|
|
1610
3549
|
var round = Math.round;
|
|
1611
3550
|
function splitColorStr(str, parseNum) {
|
|
1612
|
-
const
|
|
1613
|
-
const numList =
|
|
3551
|
+
const match3 = str.replace(/^[^(]*\((.*)/, "$1").replace(/\).*/, "").match(/\d*\.?\d+%?/g) || [];
|
|
3552
|
+
const numList = match3.map((item) => parseFloat(item));
|
|
1614
3553
|
for (let i = 0; i < 3; i += 1) {
|
|
1615
|
-
numList[i] = parseNum(numList[i] || 0,
|
|
3554
|
+
numList[i] = parseNum(numList[i] || 0, match3[i] || "", i);
|
|
1616
3555
|
}
|
|
1617
|
-
if (
|
|
1618
|
-
numList[3] =
|
|
3556
|
+
if (match3[3]) {
|
|
3557
|
+
numList[3] = match3[3].includes("%") ? numList[3] / 100 : numList[3];
|
|
1619
3558
|
} else {
|
|
1620
3559
|
numList[3] = 1;
|
|
1621
3560
|
}
|