@amateescu/portal-ui-components 0.0.34 → 0.0.37
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/README.md +113 -0
- package/dist/{Button-xgiLW4_3.js → Button-BM72-1G6.js} +107 -106
- package/dist/ButtonBase-D6nf3ymf.js +990 -0
- package/dist/{CircularProgress-Dq_bUtxt.js → CircularProgress-BlQFR6DW.js} +107 -80
- package/dist/Clear-BauR3cPE.js +8 -0
- package/dist/DefaultPropsProvider-BtPfTrMq.js +3449 -0
- package/dist/UserInfoDropdown-rBF0pwlq.js +23 -0
- package/dist/assets/KpiCard.css +1 -1
- package/dist/assets/PassportConfirmationModal.css +1 -0
- package/dist/assets/PassportErrorModal.css +1 -0
- package/dist/assets/PassportKpiCard.css +1 -0
- package/dist/assets/PassportTabHeader.css +1 -0
- package/dist/assets/index.css +1 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.d.ts +2 -1
- package/dist/components/ConfirmationModal/ConfirmationModal.d.ts.map +1 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.js +10 -2
- package/dist/components/ConfirmationModal/ConfirmationModal.stories.d.ts +1 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.stories.d.ts.map +1 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.types.d.ts +1 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.types.d.ts.map +1 -0
- package/dist/components/DebouncedPassportInput/DebouncedPassportInput.d.ts +3 -0
- package/dist/components/DebouncedPassportInput/DebouncedPassportInput.d.ts.map +1 -0
- package/dist/components/DebouncedPassportInput/DebouncedPassportInput.js +31 -0
- package/dist/components/DebouncedPassportInput/DebouncedPassportInput.stories.d.ts +23 -0
- package/dist/components/DebouncedPassportInput/DebouncedPassportInput.stories.d.ts.map +1 -0
- package/dist/components/DebouncedPassportInput/DebouncedPassportInput.types.d.ts +8 -0
- package/dist/components/DebouncedPassportInput/DebouncedPassportInput.types.d.ts.map +1 -0
- package/dist/components/ErrorModal/ErrorModal.d.ts +2 -1
- package/dist/components/ErrorModal/ErrorModal.d.ts.map +1 -0
- package/dist/components/ErrorModal/ErrorModal.js +11 -5
- package/dist/components/ErrorModal/ErrorModal.stories.d.ts +1 -0
- package/dist/components/ErrorModal/ErrorModal.stories.d.ts.map +1 -0
- package/dist/components/ErrorModal/ErrorModal.types.d.ts +1 -0
- package/dist/components/ErrorModal/ErrorModal.types.d.ts.map +1 -0
- package/dist/components/InfoModal/InfoModal.d.ts +2 -1
- package/dist/components/InfoModal/InfoModal.d.ts.map +1 -0
- package/dist/components/InfoModal/InfoModal.js +15 -3
- package/dist/components/InfoModal/InfoModal.stories.d.ts +1 -0
- package/dist/components/InfoModal/InfoModal.stories.d.ts.map +1 -0
- package/dist/components/InfoModal/InfoModal.types.d.ts +1 -0
- package/dist/components/InfoModal/InfoModal.types.d.ts.map +1 -0
- package/dist/components/KpiCard/KpiCard.d.ts +1 -0
- package/dist/components/KpiCard/KpiCard.d.ts.map +1 -0
- package/dist/components/KpiCard/KpiCard.js +29 -2401
- package/dist/components/KpiCard/KpiCard.stories.d.ts +1 -0
- package/dist/components/KpiCard/KpiCard.stories.d.ts.map +1 -0
- package/dist/components/KpiCard/KpiCard.types.d.ts +1 -0
- package/dist/components/KpiCard/KpiCard.types.d.ts.map +1 -0
- package/dist/components/LoadingAnimation/LoadingAnimation.d.ts +1 -0
- package/dist/components/LoadingAnimation/LoadingAnimation.d.ts.map +1 -0
- package/dist/components/LoadingAnimation/LoadingAnimation.js +66 -6
- package/dist/components/LoadingAnimation/LoadingAnimation.stories.d.ts +1 -0
- package/dist/components/LoadingAnimation/LoadingAnimation.stories.d.ts.map +1 -0
- package/dist/components/Login/Login.d.ts +2 -1
- package/dist/components/Login/Login.d.ts.map +1 -0
- package/dist/components/Login/Login.js +43 -8870
- package/dist/components/Login/Login.stories.d.ts +3 -2
- package/dist/components/Login/Login.stories.d.ts.map +1 -0
- package/dist/components/Login/Login.types.d.ts +1 -0
- package/dist/components/Login/Login.types.d.ts.map +1 -0
- package/dist/components/PassportAutocomplete/PassportAutocomplete.d.ts +3 -0
- package/dist/components/PassportAutocomplete/PassportAutocomplete.d.ts.map +1 -0
- package/dist/components/PassportAutocomplete/PassportAutocomplete.js +41 -0
- package/dist/components/PassportAutocomplete/PassportAutocomplete.stories.d.ts +22 -0
- package/dist/components/PassportAutocomplete/PassportAutocomplete.stories.d.ts.map +1 -0
- package/dist/components/PassportAutocomplete/PassportAutocomplete.types.d.ts +14 -0
- package/dist/components/PassportAutocomplete/PassportAutocomplete.types.d.ts.map +1 -0
- package/dist/components/PassportButton/PassportButton.d.ts +4 -0
- package/dist/components/PassportButton/PassportButton.d.ts.map +1 -0
- package/dist/components/{CustomButton/CustomButton.js → PassportButton/PassportButton.js} +10 -6
- package/dist/components/{CustomButton/CustomButton.stories.d.ts → PassportButton/PassportButton.stories.d.ts} +2 -1
- package/dist/components/PassportButton/PassportButton.stories.d.ts.map +1 -0
- package/dist/components/PassportButton/PassportButton.types.d.ts +9 -0
- package/dist/components/PassportButton/PassportButton.types.d.ts.map +1 -0
- package/dist/components/PassportConfirmationModal/PassportConfirmationModal.d.ts +9 -0
- package/dist/components/PassportConfirmationModal/PassportConfirmationModal.d.ts.map +1 -0
- package/dist/components/PassportConfirmationModal/PassportConfirmationModal.js +108 -0
- package/dist/components/{KpiWrapper/KpiWrapper.stories.d.ts → PassportConfirmationModal/PassportConfirmationModal.stories.d.ts} +5 -8
- package/dist/components/PassportConfirmationModal/PassportConfirmationModal.stories.d.ts.map +1 -0
- package/dist/components/PassportDatePicker/PassportDatePicker.d.ts +3 -0
- package/dist/components/PassportDatePicker/PassportDatePicker.d.ts.map +1 -0
- package/dist/components/PassportDatePicker/PassportDatePicker.js +1514 -0
- package/dist/components/PassportDatePicker/PassportDatePicker.stories.d.ts +25 -0
- package/dist/components/PassportDatePicker/PassportDatePicker.stories.d.ts.map +1 -0
- package/dist/components/PassportDatePicker/PassportDatePicker.types.d.ts +15 -0
- package/dist/components/PassportDatePicker/PassportDatePicker.types.d.ts.map +1 -0
- package/dist/components/PassportDateTimePicker/PassportDateTimePicker.d.ts +3 -0
- package/dist/components/PassportDateTimePicker/PassportDateTimePicker.d.ts.map +1 -0
- package/dist/components/PassportDateTimePicker/PassportDateTimePicker.js +5419 -0
- package/dist/components/PassportDateTimePicker/PassportDateTimePicker.stories.d.ts +30 -0
- package/dist/components/PassportDateTimePicker/PassportDateTimePicker.stories.d.ts.map +1 -0
- package/dist/components/PassportDateTimePicker/PassportDateTimePicker.types.d.ts +16 -0
- package/dist/components/PassportDateTimePicker/PassportDateTimePicker.types.d.ts.map +1 -0
- package/dist/components/PassportDateTimePicker/PassportDateTimePicker.types.js +1 -0
- package/dist/components/PassportDropdown/PassportDropdown.d.ts +3 -0
- package/dist/components/PassportDropdown/PassportDropdown.d.ts.map +1 -0
- package/dist/components/PassportDropdown/PassportDropdown.js +37 -0
- package/dist/components/PassportDropdown/PassportDropdown.stories.d.ts +25 -0
- package/dist/components/PassportDropdown/PassportDropdown.stories.d.ts.map +1 -0
- package/dist/components/PassportDropdown/PassportDropdown.types.d.ts +14 -0
- package/dist/components/PassportDropdown/PassportDropdown.types.d.ts.map +1 -0
- package/dist/components/PassportDropdown/PassportDropdown.types.js +1 -0
- package/dist/components/PassportErrorModal/PassportErrorModal.d.ts +8 -0
- package/dist/components/PassportErrorModal/PassportErrorModal.d.ts.map +1 -0
- package/dist/components/PassportErrorModal/PassportErrorModal.js +68 -0
- package/dist/components/PassportErrorModal/PassportErrorModal.stories.d.ts +19 -0
- package/dist/components/PassportErrorModal/PassportErrorModal.stories.d.ts.map +1 -0
- package/dist/components/PassportFooter/PassportFooter.d.ts +3 -0
- package/dist/components/PassportFooter/PassportFooter.d.ts.map +1 -0
- package/dist/components/PassportFooter/PassportFooter.js +46 -0
- package/dist/components/{CustomFooter/CustomFooter.stories.d.ts → PassportFooter/PassportFooter.stories.d.ts} +1 -0
- package/dist/components/PassportFooter/PassportFooter.stories.d.ts.map +1 -0
- package/dist/components/{CustomFooter/CustomFooter.types.d.ts → PassportFooter/PassportFooter.types.d.ts} +3 -2
- package/dist/components/PassportFooter/PassportFooter.types.d.ts.map +1 -0
- package/dist/components/PassportFooter/PassportFooter.types.js +1 -0
- package/dist/components/PassportInput/PassportInput.d.ts +3 -0
- package/dist/components/PassportInput/PassportInput.d.ts.map +1 -0
- package/dist/components/PassportInput/PassportInput.js +51 -0
- package/dist/components/PassportInput/PassportInput.stories.d.ts +24 -0
- package/dist/components/PassportInput/PassportInput.stories.d.ts.map +1 -0
- package/dist/components/PassportInput/PassportInput.types.d.ts +9 -0
- package/dist/components/PassportInput/PassportInput.types.d.ts.map +1 -0
- package/dist/components/PassportInput/PassportInput.types.js +1 -0
- package/dist/components/PassportKpiCard/PassportKpiCard.d.ts +3 -0
- package/dist/components/PassportKpiCard/PassportKpiCard.d.ts.map +1 -0
- package/dist/components/PassportKpiCard/PassportKpiCard.js +43 -0
- package/dist/components/PassportKpiCard/PassportKpiCard.stories.d.ts +21 -0
- package/dist/components/PassportKpiCard/PassportKpiCard.stories.d.ts.map +1 -0
- package/dist/components/PassportKpiCard/PassportKpiCard.types.d.ts +11 -0
- package/dist/components/PassportKpiCard/PassportKpiCard.types.d.ts.map +1 -0
- package/dist/components/PassportKpiCard/PassportKpiCard.types.js +1 -0
- package/dist/components/PassportKpiWrapper/PassportKpiWrapper.d.ts +3 -0
- package/dist/components/PassportKpiWrapper/PassportKpiWrapper.d.ts.map +1 -0
- package/dist/components/PassportKpiWrapper/PassportKpiWrapper.js +22 -0
- package/dist/components/PassportKpiWrapper/PassportKpiWrapper.stories.d.ts +23 -0
- package/dist/components/PassportKpiWrapper/PassportKpiWrapper.stories.d.ts.map +1 -0
- package/dist/components/{KpiWrapper/KpiWrapper.types.d.ts → PassportKpiWrapper/PassportKpiWrapper.types.d.ts} +2 -1
- package/dist/components/PassportKpiWrapper/PassportKpiWrapper.types.d.ts.map +1 -0
- package/dist/components/PassportKpiWrapper/PassportKpiWrapper.types.js +1 -0
- package/dist/components/PassportMultiSelect/PassportMultiSelect.d.ts +3 -0
- package/dist/components/PassportMultiSelect/PassportMultiSelect.d.ts.map +1 -0
- package/dist/components/PassportMultiSelect/PassportMultiSelect.js +72 -0
- package/dist/components/PassportMultiSelect/PassportMultiSelect.stories.d.ts +24 -0
- package/dist/components/PassportMultiSelect/PassportMultiSelect.stories.d.ts.map +1 -0
- package/dist/components/PassportMultiSelect/PassportMultiSelect.types.d.ts +12 -0
- package/dist/components/PassportMultiSelect/PassportMultiSelect.types.d.ts.map +1 -0
- package/dist/components/PassportMultiSelect/PassportMultiSelect.types.js +1 -0
- package/dist/components/PassportPagination/PassportPagination.d.ts +3 -0
- package/dist/components/PassportPagination/PassportPagination.d.ts.map +1 -0
- package/dist/components/{CustomPagination/CustomPagination.js → PassportPagination/PassportPagination.js} +215 -218
- package/dist/components/{CustomPagination/CustomPagination.stories.d.ts → PassportPagination/PassportPagination.stories.d.ts} +3 -2
- package/dist/components/PassportPagination/PassportPagination.stories.d.ts.map +1 -0
- package/dist/components/{CustomPagination/CustomPagination.types.d.ts → PassportPagination/PassportPagination.types.d.ts} +2 -1
- package/dist/components/PassportPagination/PassportPagination.types.d.ts.map +1 -0
- package/dist/components/PassportPagination/PassportPagination.types.js +1 -0
- package/dist/components/PassportTabHeader/PassportTabHeader.d.ts +7 -0
- package/dist/components/PassportTabHeader/PassportTabHeader.d.ts.map +1 -0
- package/dist/components/PassportTabHeader/PassportTabHeader.js +14 -0
- package/dist/components/PassportTabHeader/PassportTabHeader.stories.d.ts +21 -0
- package/dist/components/PassportTabHeader/PassportTabHeader.stories.d.ts.map +1 -0
- package/dist/components/PassportTextField/PassportTextField.d.ts +3 -0
- package/dist/components/PassportTextField/PassportTextField.d.ts.map +1 -0
- package/dist/components/PassportTextField/PassportTextField.js +23 -0
- package/dist/components/PassportTextField/PassportTextField.stories.d.ts +22 -0
- package/dist/components/PassportTextField/PassportTextField.stories.d.ts.map +1 -0
- package/dist/components/SideMenu/SideMenu.d.ts +1 -0
- package/dist/components/SideMenu/SideMenu.d.ts.map +1 -0
- package/dist/components/SideMenu/SideMenu.js +89 -41
- package/dist/components/SideMenu/SideMenu.stories.d.ts +1 -0
- package/dist/components/SideMenu/SideMenu.stories.d.ts.map +1 -0
- package/dist/components/SideMenu/SideMenu.types.d.ts +1 -0
- package/dist/components/SideMenu/SideMenu.types.d.ts.map +1 -0
- package/dist/components/TotalDataGrid/TotalDataGrid.d.ts +1 -0
- package/dist/components/TotalDataGrid/TotalDataGrid.d.ts.map +1 -0
- package/dist/components/TotalDataGrid/TotalDataGrid.js +3 -3
- package/dist/components/TotalDataGrid/TotalDataGrid.stories.d.ts +1 -0
- package/dist/components/TotalDataGrid/TotalDataGrid.stories.d.ts.map +1 -0
- package/dist/components/TotalDataGrid/TotalDataGrid.types.d.ts +1 -0
- package/dist/components/TotalDataGrid/TotalDataGrid.types.d.ts.map +1 -0
- package/dist/components/UserInfoDropdown/UserInfoDropdown.d.ts +1 -0
- package/dist/components/UserInfoDropdown/UserInfoDropdown.d.ts.map +1 -0
- package/dist/components/UserInfoDropdown/UserInfoDropdown.js +3 -2
- package/dist/components/UserInfoDropdown/UserInfoDropdown.stories.d.ts +1 -0
- package/dist/components/UserInfoDropdown/UserInfoDropdown.stories.d.ts.map +1 -0
- package/dist/components/UserInfoDropdown/UserInfoDropdown.types.d.ts +1 -0
- package/dist/components/UserInfoDropdown/UserInfoDropdown.types.d.ts.map +1 -0
- package/dist/components/index.d.ts +17 -4
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +51 -28
- package/dist/createSimplePaletteValueFilter-Bz8RuRaa.js +23 -0
- package/dist/{createSvgIcon-CgFXfzFk.js → createSvgIcon-B-eIQ7rU.js} +118 -124
- package/dist/extendSxProp-QNe1Nf_s.js +51 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +67 -44
- package/dist/mock.d.ts +1 -0
- package/dist/mock.d.ts.map +1 -0
- package/dist/portal-utils/chunkArray.d.ts +1 -0
- package/dist/portal-utils/chunkArray.d.ts.map +1 -0
- package/dist/portal-utils/cn.d.ts +1 -0
- package/dist/portal-utils/cn.d.ts.map +1 -0
- package/dist/portal-utils/formatters.d.ts +1 -0
- package/dist/portal-utils/formatters.d.ts.map +1 -0
- package/dist/portal-utils/formatters.js +291 -334
- package/dist/portal-utils/index.d.ts +2 -1
- package/dist/portal-utils/index.d.ts.map +1 -0
- package/dist/portal-utils/loggerService.d.ts +1 -0
- package/dist/portal-utils/loggerService.d.ts.map +1 -0
- package/dist/portal-utils/pageCount.d.ts +1 -0
- package/dist/portal-utils/pageCount.d.ts.map +1 -0
- package/dist/types/BusinessDayRange.d.ts +1 -0
- package/dist/types/BusinessDayRange.d.ts.map +1 -0
- package/dist/types/Column.d.ts +1 -0
- package/dist/types/Column.d.ts.map +1 -0
- package/dist/types/CultureStore.d.ts +1 -0
- package/dist/types/CultureStore.d.ts.map +1 -0
- package/dist/types/CustomSvg.d.ts +1 -0
- package/dist/types/CustomSvg.d.ts.map +1 -0
- package/dist/types/LoginRequest.d.ts +1 -0
- package/dist/types/LoginRequest.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/useMobilePicker-hk2kq6ev.js +19662 -0
- package/dist/useSlot-CXnK24LX.js +189 -0
- package/package.json +43 -42
- package/dist/Box-D-aleOLf.js +0 -102
- package/dist/ButtonBase-DUKuDCWw.js +0 -966
- package/dist/EllipsisOutlined-CmR4hXJ_.js +0 -2467
- package/dist/InvencoGVR-qnTq-d6S.js +0 -5
- package/dist/PurePanel-CykVuv66.js +0 -2213
- package/dist/Skeleton-BBwDqRB3.js +0 -568
- package/dist/UserInfoDropdown-Bf6STdbW.js +0 -3790
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/assets/globals.css +0 -1
- package/dist/components/ConfirmationModal/ConfirmationModal.stories.js +0 -36
- package/dist/components/CustomButton/CustomButton.d.ts +0 -3
- package/dist/components/CustomButton/CustomButton.stories.js +0 -42
- package/dist/components/CustomButton/CustomeButton.types.d.ts +0 -8
- package/dist/components/CustomFooter/CustomFooter.d.ts +0 -2
- package/dist/components/CustomFooter/CustomFooter.js +0 -32
- package/dist/components/CustomFooter/CustomFooter.stories.js +0 -40
- package/dist/components/CustomPagination/CustomPagination.d.ts +0 -3
- package/dist/components/CustomPagination/CustomPagination.stories.js +0 -25
- package/dist/components/ErrorModal/ErrorModal.stories.js +0 -33
- package/dist/components/InfoModal/InfoModal.stories.js +0 -33
- package/dist/components/KpiCard/KpiCard.stories.js +0 -26
- package/dist/components/KpiWrapper/KpiWrapper.d.ts +0 -2
- package/dist/components/KpiWrapper/KpiWrapper.js +0 -11
- package/dist/components/KpiWrapper/KpiWrapper.stories.js +0 -56
- package/dist/components/LoadingAnimation/LoadingAnimation.stories.js +0 -14
- package/dist/components/Login/Login.stories.js +0 -24209
- package/dist/components/SideMenu/SideMenu.stories.js +0 -81
- package/dist/components/TotalDataGrid/TotalDataGrid.stories.js +0 -23
- package/dist/components/UserInfoDropdown/UserInfoDropdown.stories.js +0 -36
- package/dist/context-4ttylmIf.js +0 -7356
- package/dist/createSimplePaletteValueFilter-evt-Xthj.js +0 -3444
- package/dist/index-BBBjHj3B.js +0 -411
- package/dist/index-Dz00OoV7.js +0 -1687
- package/dist/objectWithoutPropertiesLoose-BTau6TOn.js +0 -33
- package/dist/useSlot-Baxtq84W.js +0 -188
- /package/dist/assets/{CustomFooter.css → PassportFooter.css} +0 -0
- /package/dist/assets/{KpiWrapper.css → PassportKpiWrapper.css} +0 -0
- /package/dist/components/{CustomButton/CustomeButton.types.js → DebouncedPassportInput/DebouncedPassportInput.types.js} +0 -0
- /package/dist/components/{CustomFooter/CustomFooter.types.js → PassportAutocomplete/PassportAutocomplete.types.js} +0 -0
- /package/dist/components/{CustomPagination/CustomPagination.types.js → PassportButton/PassportButton.types.js} +0 -0
- /package/dist/components/{KpiWrapper/KpiWrapper.types.js → PassportDatePicker/PassportDatePicker.types.js} +0 -0
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
3
|
-
return typeof t == "function" ? t(e) : t && typeof t == "object" &&
|
|
1
|
+
const W = /* @__PURE__ */ Symbol.for("constructDateFrom");
|
|
2
|
+
function g(t, e) {
|
|
3
|
+
return typeof t == "function" ? t(e) : t && typeof t == "object" && W in t ? t[W](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
return
|
|
5
|
+
function f(t, e) {
|
|
6
|
+
return g(e || t, t);
|
|
7
7
|
}
|
|
8
|
-
let
|
|
9
|
-
function
|
|
10
|
-
return
|
|
8
|
+
let L = {};
|
|
9
|
+
function S() {
|
|
10
|
+
return L;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
|
|
12
|
+
function M(t, e) {
|
|
13
|
+
const n = S(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, a = f(t, e?.in), i = a.getDay(), o = (i < r ? 7 : 0) + i - r;
|
|
14
|
+
return a.setDate(a.getDate() - o), a.setHours(0, 0, 0, 0), a;
|
|
16
15
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
16
|
+
function D(t, e) {
|
|
17
|
+
return M(t, { ...e, weekStartsOn: 1 });
|
|
19
18
|
}
|
|
20
|
-
function
|
|
21
|
-
const n =
|
|
19
|
+
function C(t, e) {
|
|
20
|
+
const n = f(t, e?.in), r = n.getFullYear(), a = g(n, 0);
|
|
22
21
|
a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
23
|
-
const i =
|
|
24
|
-
|
|
25
|
-
const c =
|
|
22
|
+
const i = D(a), o = g(n, 0);
|
|
23
|
+
o.setFullYear(r, 0, 4), o.setHours(0, 0, 0, 0);
|
|
24
|
+
const c = D(o);
|
|
26
25
|
return n.getTime() >= i.getTime() ? r + 1 : n.getTime() >= c.getTime() ? r : r - 1;
|
|
27
26
|
}
|
|
28
|
-
function
|
|
29
|
-
const e =
|
|
27
|
+
function F(t) {
|
|
28
|
+
const e = f(t), n = new Date(
|
|
30
29
|
Date.UTC(
|
|
31
30
|
e.getFullYear(),
|
|
32
31
|
e.getMonth(),
|
|
@@ -39,40 +38,40 @@ function $(t) {
|
|
|
39
38
|
);
|
|
40
39
|
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
41
40
|
}
|
|
42
|
-
function
|
|
43
|
-
const n =
|
|
41
|
+
function G(t, ...e) {
|
|
42
|
+
const n = g.bind(
|
|
44
43
|
null,
|
|
45
44
|
e.find((r) => typeof r == "object")
|
|
46
45
|
);
|
|
47
46
|
return e.map(n);
|
|
48
47
|
}
|
|
49
|
-
function
|
|
50
|
-
const n =
|
|
48
|
+
function Y(t, e) {
|
|
49
|
+
const n = f(t, e?.in);
|
|
51
50
|
return n.setHours(0, 0, 0, 0), n;
|
|
52
51
|
}
|
|
53
|
-
function
|
|
54
|
-
const [r, a] =
|
|
55
|
-
n
|
|
52
|
+
function Q(t, e, n) {
|
|
53
|
+
const [r, a] = G(
|
|
54
|
+
n?.in,
|
|
56
55
|
t,
|
|
57
56
|
e
|
|
58
|
-
), i =
|
|
59
|
-
return Math.round((c -
|
|
57
|
+
), i = Y(r), o = Y(a), c = +i - F(i), m = +o - F(o);
|
|
58
|
+
return Math.round((c - m) / 864e5);
|
|
60
59
|
}
|
|
61
|
-
function
|
|
62
|
-
const n =
|
|
63
|
-
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0),
|
|
60
|
+
function V(t, e) {
|
|
61
|
+
const n = C(t, e), r = g(t, 0);
|
|
62
|
+
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), D(r);
|
|
64
63
|
}
|
|
65
|
-
function
|
|
64
|
+
function X(t) {
|
|
66
65
|
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
67
66
|
}
|
|
68
|
-
function
|
|
69
|
-
return !(!
|
|
67
|
+
function _(t) {
|
|
68
|
+
return !(!X(t) && typeof t != "number" || isNaN(+f(t)));
|
|
70
69
|
}
|
|
71
|
-
function
|
|
72
|
-
const n =
|
|
70
|
+
function I(t, e) {
|
|
71
|
+
const n = f(t, e?.in);
|
|
73
72
|
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
74
73
|
}
|
|
75
|
-
const
|
|
74
|
+
const j = {
|
|
76
75
|
lessThanXSeconds: {
|
|
77
76
|
one: "less than a second",
|
|
78
77
|
other: "less than {{count}} seconds"
|
|
@@ -134,77 +133,77 @@ const J = {
|
|
|
134
133
|
one: "almost 1 year",
|
|
135
134
|
other: "almost {{count}} years"
|
|
136
135
|
}
|
|
137
|
-
},
|
|
136
|
+
}, B = (t, e, n) => {
|
|
138
137
|
let r;
|
|
139
|
-
const a =
|
|
140
|
-
return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n
|
|
138
|
+
const a = j[t];
|
|
139
|
+
return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
141
140
|
};
|
|
142
|
-
function
|
|
141
|
+
function v(t) {
|
|
143
142
|
return (e = {}) => {
|
|
144
143
|
const n = e.width ? String(e.width) : t.defaultWidth;
|
|
145
144
|
return t.formats[n] || t.formats[t.defaultWidth];
|
|
146
145
|
};
|
|
147
146
|
}
|
|
148
|
-
const
|
|
147
|
+
const R = {
|
|
149
148
|
full: "EEEE, MMMM do, y",
|
|
150
149
|
long: "MMMM do, y",
|
|
151
150
|
medium: "MMM d, y",
|
|
152
151
|
short: "MM/dd/yyyy"
|
|
153
|
-
},
|
|
152
|
+
}, A = {
|
|
154
153
|
full: "h:mm:ss a zzzz",
|
|
155
154
|
long: "h:mm:ss a z",
|
|
156
155
|
medium: "h:mm:ss a",
|
|
157
156
|
short: "h:mm a"
|
|
158
|
-
},
|
|
157
|
+
}, J = {
|
|
159
158
|
full: "{{date}} 'at' {{time}}",
|
|
160
159
|
long: "{{date}} 'at' {{time}}",
|
|
161
160
|
medium: "{{date}}, {{time}}",
|
|
162
161
|
short: "{{date}}, {{time}}"
|
|
163
|
-
},
|
|
164
|
-
date:
|
|
165
|
-
formats:
|
|
162
|
+
}, U = {
|
|
163
|
+
date: v({
|
|
164
|
+
formats: R,
|
|
166
165
|
defaultWidth: "full"
|
|
167
166
|
}),
|
|
168
|
-
time:
|
|
169
|
-
formats:
|
|
167
|
+
time: v({
|
|
168
|
+
formats: A,
|
|
170
169
|
defaultWidth: "full"
|
|
171
170
|
}),
|
|
172
|
-
dateTime:
|
|
173
|
-
formats:
|
|
171
|
+
dateTime: v({
|
|
172
|
+
formats: J,
|
|
174
173
|
defaultWidth: "full"
|
|
175
174
|
})
|
|
176
|
-
},
|
|
175
|
+
}, z = {
|
|
177
176
|
lastWeek: "'last' eeee 'at' p",
|
|
178
177
|
yesterday: "'yesterday at' p",
|
|
179
178
|
today: "'today at' p",
|
|
180
179
|
tomorrow: "'tomorrow at' p",
|
|
181
180
|
nextWeek: "eeee 'at' p",
|
|
182
181
|
other: "P"
|
|
183
|
-
},
|
|
184
|
-
function
|
|
182
|
+
}, K = (t, e, n, r) => z[t];
|
|
183
|
+
function P(t) {
|
|
185
184
|
return (e, n) => {
|
|
186
|
-
const r = n
|
|
185
|
+
const r = n?.context ? String(n.context) : "standalone";
|
|
187
186
|
let a;
|
|
188
187
|
if (r === "formatting" && t.formattingValues) {
|
|
189
|
-
const
|
|
190
|
-
a = t.formattingValues[c] || t.formattingValues[
|
|
188
|
+
const o = t.defaultFormattingWidth || t.defaultWidth, c = n?.width ? String(n.width) : o;
|
|
189
|
+
a = t.formattingValues[c] || t.formattingValues[o];
|
|
191
190
|
} else {
|
|
192
|
-
const
|
|
193
|
-
a = t.values[c] || t.values[
|
|
191
|
+
const o = t.defaultWidth, c = n?.width ? String(n.width) : t.defaultWidth;
|
|
192
|
+
a = t.values[c] || t.values[o];
|
|
194
193
|
}
|
|
195
194
|
const i = t.argumentCallback ? t.argumentCallback(e) : e;
|
|
196
195
|
return a[i];
|
|
197
196
|
};
|
|
198
197
|
}
|
|
199
|
-
const
|
|
198
|
+
const Z = {
|
|
200
199
|
narrow: ["B", "A"],
|
|
201
200
|
abbreviated: ["BC", "AD"],
|
|
202
201
|
wide: ["Before Christ", "Anno Domini"]
|
|
203
|
-
},
|
|
202
|
+
}, tt = {
|
|
204
203
|
narrow: ["1", "2", "3", "4"],
|
|
205
204
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
206
205
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
207
|
-
},
|
|
206
|
+
}, et = {
|
|
208
207
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
209
208
|
abbreviated: [
|
|
210
209
|
"Jan",
|
|
@@ -234,7 +233,7 @@ const rt = {
|
|
|
234
233
|
"November",
|
|
235
234
|
"December"
|
|
236
235
|
]
|
|
237
|
-
},
|
|
236
|
+
}, nt = {
|
|
238
237
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
239
238
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
240
239
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -247,7 +246,7 @@ const rt = {
|
|
|
247
246
|
"Friday",
|
|
248
247
|
"Saturday"
|
|
249
248
|
]
|
|
250
|
-
},
|
|
249
|
+
}, rt = {
|
|
251
250
|
narrow: {
|
|
252
251
|
am: "a",
|
|
253
252
|
pm: "p",
|
|
@@ -278,7 +277,7 @@ const rt = {
|
|
|
278
277
|
evening: "evening",
|
|
279
278
|
night: "night"
|
|
280
279
|
}
|
|
281
|
-
},
|
|
280
|
+
}, at = {
|
|
282
281
|
narrow: {
|
|
283
282
|
am: "a",
|
|
284
283
|
pm: "p",
|
|
@@ -309,7 +308,7 @@ const rt = {
|
|
|
309
308
|
evening: "in the evening",
|
|
310
309
|
night: "at night"
|
|
311
310
|
}
|
|
312
|
-
},
|
|
311
|
+
}, it = (t, e) => {
|
|
313
312
|
const n = Number(t), r = n % 100;
|
|
314
313
|
if (r > 20 || r < 10)
|
|
315
314
|
switch (r % 10) {
|
|
@@ -321,89 +320,89 @@ const rt = {
|
|
|
321
320
|
return n + "rd";
|
|
322
321
|
}
|
|
323
322
|
return n + "th";
|
|
324
|
-
},
|
|
325
|
-
ordinalNumber:
|
|
326
|
-
era:
|
|
327
|
-
values:
|
|
323
|
+
}, ot = {
|
|
324
|
+
ordinalNumber: it,
|
|
325
|
+
era: P({
|
|
326
|
+
values: Z,
|
|
328
327
|
defaultWidth: "wide"
|
|
329
328
|
}),
|
|
330
|
-
quarter:
|
|
331
|
-
values:
|
|
329
|
+
quarter: P({
|
|
330
|
+
values: tt,
|
|
332
331
|
defaultWidth: "wide",
|
|
333
332
|
argumentCallback: (t) => t - 1
|
|
334
333
|
}),
|
|
335
|
-
month:
|
|
336
|
-
values:
|
|
334
|
+
month: P({
|
|
335
|
+
values: et,
|
|
337
336
|
defaultWidth: "wide"
|
|
338
337
|
}),
|
|
339
|
-
day:
|
|
340
|
-
values:
|
|
338
|
+
day: P({
|
|
339
|
+
values: nt,
|
|
341
340
|
defaultWidth: "wide"
|
|
342
341
|
}),
|
|
343
|
-
dayPeriod:
|
|
344
|
-
values:
|
|
342
|
+
dayPeriod: P({
|
|
343
|
+
values: rt,
|
|
345
344
|
defaultWidth: "wide",
|
|
346
|
-
formattingValues:
|
|
345
|
+
formattingValues: at,
|
|
347
346
|
defaultFormattingWidth: "wide"
|
|
348
347
|
})
|
|
349
348
|
};
|
|
350
|
-
function
|
|
349
|
+
function p(t) {
|
|
351
350
|
return (e, n = {}) => {
|
|
352
351
|
const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], i = e.match(a);
|
|
353
352
|
if (!i)
|
|
354
353
|
return null;
|
|
355
|
-
const
|
|
354
|
+
const o = i[0], c = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], m = Array.isArray(c) ? ct(c, (u) => u.test(o)) : (
|
|
356
355
|
// [TODO] -- I challenge you to fix the type
|
|
357
|
-
|
|
356
|
+
st(c, (u) => u.test(o))
|
|
358
357
|
);
|
|
359
|
-
let
|
|
360
|
-
|
|
358
|
+
let h;
|
|
359
|
+
h = t.valueCallback ? t.valueCallback(m) : m, h = n.valueCallback ? (
|
|
361
360
|
// [TODO] -- I challenge you to fix the type
|
|
362
|
-
n.valueCallback(
|
|
363
|
-
) :
|
|
364
|
-
const
|
|
365
|
-
return { value:
|
|
361
|
+
n.valueCallback(h)
|
|
362
|
+
) : h;
|
|
363
|
+
const d = e.slice(o.length);
|
|
364
|
+
return { value: h, rest: d };
|
|
366
365
|
};
|
|
367
366
|
}
|
|
368
|
-
function
|
|
367
|
+
function st(t, e) {
|
|
369
368
|
for (const n in t)
|
|
370
369
|
if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
|
|
371
370
|
return n;
|
|
372
371
|
}
|
|
373
|
-
function
|
|
372
|
+
function ct(t, e) {
|
|
374
373
|
for (let n = 0; n < t.length; n++)
|
|
375
374
|
if (e(t[n]))
|
|
376
375
|
return n;
|
|
377
376
|
}
|
|
378
|
-
function
|
|
377
|
+
function ut(t) {
|
|
379
378
|
return (e, n = {}) => {
|
|
380
379
|
const r = e.match(t.matchPattern);
|
|
381
380
|
if (!r) return null;
|
|
382
381
|
const a = r[0], i = e.match(t.parsePattern);
|
|
383
382
|
if (!i) return null;
|
|
384
|
-
let
|
|
385
|
-
|
|
383
|
+
let o = t.valueCallback ? t.valueCallback(i[0]) : i[0];
|
|
384
|
+
o = n.valueCallback ? n.valueCallback(o) : o;
|
|
386
385
|
const c = e.slice(a.length);
|
|
387
|
-
return { value:
|
|
386
|
+
return { value: o, rest: c };
|
|
388
387
|
};
|
|
389
388
|
}
|
|
390
|
-
const
|
|
389
|
+
const dt = /^(\d+)(th|st|nd|rd)?/i, mt = /\d+/i, ft = {
|
|
391
390
|
narrow: /^(b|a)/i,
|
|
392
391
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
393
392
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
394
|
-
},
|
|
393
|
+
}, ht = {
|
|
395
394
|
any: [/^b/i, /^(a|c)/i]
|
|
396
|
-
},
|
|
395
|
+
}, lt = {
|
|
397
396
|
narrow: /^[1234]/i,
|
|
398
397
|
abbreviated: /^q[1234]/i,
|
|
399
398
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
400
|
-
},
|
|
399
|
+
}, gt = {
|
|
401
400
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
402
|
-
},
|
|
401
|
+
}, wt = {
|
|
403
402
|
narrow: /^[jfmasond]/i,
|
|
404
403
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
405
404
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
406
|
-
},
|
|
405
|
+
}, yt = {
|
|
407
406
|
narrow: [
|
|
408
407
|
/^j/i,
|
|
409
408
|
/^f/i,
|
|
@@ -432,18 +431,18 @@ const lt = /^(\d+)(th|st|nd|rd)?/i, gt = /\d+/i, wt = {
|
|
|
432
431
|
/^n/i,
|
|
433
432
|
/^d/i
|
|
434
433
|
]
|
|
435
|
-
},
|
|
434
|
+
}, bt = {
|
|
436
435
|
narrow: /^[smtwf]/i,
|
|
437
436
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
438
437
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
439
438
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
440
|
-
},
|
|
439
|
+
}, Pt = {
|
|
441
440
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
442
441
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
443
|
-
},
|
|
442
|
+
}, pt = {
|
|
444
443
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
445
444
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
446
|
-
},
|
|
445
|
+
}, Mt = {
|
|
447
446
|
any: {
|
|
448
447
|
am: /^a/i,
|
|
449
448
|
pm: /^p/i,
|
|
@@ -454,99 +453,97 @@ const lt = /^(\d+)(th|st|nd|rd)?/i, gt = /\d+/i, wt = {
|
|
|
454
453
|
evening: /evening/i,
|
|
455
454
|
night: /night/i
|
|
456
455
|
}
|
|
457
|
-
},
|
|
458
|
-
ordinalNumber:
|
|
459
|
-
matchPattern:
|
|
460
|
-
parsePattern:
|
|
456
|
+
}, xt = {
|
|
457
|
+
ordinalNumber: ut({
|
|
458
|
+
matchPattern: dt,
|
|
459
|
+
parsePattern: mt,
|
|
461
460
|
valueCallback: (t) => parseInt(t, 10)
|
|
462
461
|
}),
|
|
463
|
-
era:
|
|
464
|
-
matchPatterns:
|
|
462
|
+
era: p({
|
|
463
|
+
matchPatterns: ft,
|
|
465
464
|
defaultMatchWidth: "wide",
|
|
466
|
-
parsePatterns:
|
|
465
|
+
parsePatterns: ht,
|
|
467
466
|
defaultParseWidth: "any"
|
|
468
467
|
}),
|
|
469
|
-
quarter:
|
|
470
|
-
matchPatterns:
|
|
468
|
+
quarter: p({
|
|
469
|
+
matchPatterns: lt,
|
|
471
470
|
defaultMatchWidth: "wide",
|
|
472
|
-
parsePatterns:
|
|
471
|
+
parsePatterns: gt,
|
|
473
472
|
defaultParseWidth: "any",
|
|
474
473
|
valueCallback: (t) => t + 1
|
|
475
474
|
}),
|
|
476
|
-
month:
|
|
477
|
-
matchPatterns:
|
|
475
|
+
month: p({
|
|
476
|
+
matchPatterns: wt,
|
|
478
477
|
defaultMatchWidth: "wide",
|
|
479
|
-
parsePatterns:
|
|
478
|
+
parsePatterns: yt,
|
|
480
479
|
defaultParseWidth: "any"
|
|
481
480
|
}),
|
|
482
|
-
day:
|
|
483
|
-
matchPatterns:
|
|
481
|
+
day: p({
|
|
482
|
+
matchPatterns: bt,
|
|
484
483
|
defaultMatchWidth: "wide",
|
|
485
|
-
parsePatterns:
|
|
484
|
+
parsePatterns: Pt,
|
|
486
485
|
defaultParseWidth: "any"
|
|
487
486
|
}),
|
|
488
|
-
dayPeriod:
|
|
489
|
-
matchPatterns:
|
|
487
|
+
dayPeriod: p({
|
|
488
|
+
matchPatterns: pt,
|
|
490
489
|
defaultMatchWidth: "any",
|
|
491
|
-
parsePatterns:
|
|
490
|
+
parsePatterns: Mt,
|
|
492
491
|
defaultParseWidth: "any"
|
|
493
492
|
})
|
|
494
|
-
},
|
|
493
|
+
}, Dt = {
|
|
495
494
|
code: "en-US",
|
|
496
|
-
formatDistance:
|
|
497
|
-
formatLong:
|
|
498
|
-
formatRelative:
|
|
499
|
-
localize:
|
|
500
|
-
match:
|
|
495
|
+
formatDistance: B,
|
|
496
|
+
formatLong: U,
|
|
497
|
+
formatRelative: K,
|
|
498
|
+
localize: ot,
|
|
499
|
+
match: xt,
|
|
501
500
|
options: {
|
|
502
501
|
weekStartsOn: 0,
|
|
503
502
|
firstWeekContainsDate: 1
|
|
504
503
|
}
|
|
505
504
|
};
|
|
506
|
-
function
|
|
507
|
-
const n =
|
|
508
|
-
return
|
|
505
|
+
function St(t, e) {
|
|
506
|
+
const n = f(t, e?.in);
|
|
507
|
+
return Q(n, I(n)) + 1;
|
|
509
508
|
}
|
|
510
|
-
function
|
|
511
|
-
const n =
|
|
509
|
+
function Ot(t, e) {
|
|
510
|
+
const n = f(t, e?.in), r = +D(n) - +V(n);
|
|
512
511
|
return Math.round(r / 6048e5) + 1;
|
|
513
512
|
}
|
|
514
|
-
function
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
return +n >= +c ? r + 1 : +n >= +d ? r : r - 1;
|
|
513
|
+
function q(t, e) {
|
|
514
|
+
const n = f(t, e?.in), r = n.getFullYear(), a = S(), i = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, o = g(e?.in || t, 0);
|
|
515
|
+
o.setFullYear(r + 1, 0, i), o.setHours(0, 0, 0, 0);
|
|
516
|
+
const c = M(o, e), m = g(e?.in || t, 0);
|
|
517
|
+
m.setFullYear(r, 0, i), m.setHours(0, 0, 0, 0);
|
|
518
|
+
const h = M(m, e);
|
|
519
|
+
return +n >= +c ? r + 1 : +n >= +h ? r : r - 1;
|
|
522
520
|
}
|
|
523
|
-
function
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), v(i, e);
|
|
521
|
+
function vt(t, e) {
|
|
522
|
+
const n = S(), r = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, a = q(t, e), i = g(e?.in || t, 0);
|
|
523
|
+
return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), M(i, e);
|
|
527
524
|
}
|
|
528
|
-
function
|
|
529
|
-
const n =
|
|
525
|
+
function kt(t, e) {
|
|
526
|
+
const n = f(t, e?.in), r = +M(n, e) - +vt(n, e);
|
|
530
527
|
return Math.round(r / 6048e5) + 1;
|
|
531
528
|
}
|
|
532
|
-
function
|
|
529
|
+
function s(t, e) {
|
|
533
530
|
const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
|
|
534
531
|
return n + r;
|
|
535
532
|
}
|
|
536
|
-
const
|
|
533
|
+
const l = {
|
|
537
534
|
// Year
|
|
538
535
|
y(t, e) {
|
|
539
536
|
const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
540
|
-
return
|
|
537
|
+
return s(e === "yy" ? r % 100 : r, e.length);
|
|
541
538
|
},
|
|
542
539
|
// Month
|
|
543
540
|
M(t, e) {
|
|
544
541
|
const n = t.getMonth();
|
|
545
|
-
return e === "M" ? String(n + 1) :
|
|
542
|
+
return e === "M" ? String(n + 1) : s(n + 1, 2);
|
|
546
543
|
},
|
|
547
544
|
// Day of the month
|
|
548
545
|
d(t, e) {
|
|
549
|
-
return
|
|
546
|
+
return s(t.getDate(), e.length);
|
|
550
547
|
},
|
|
551
548
|
// AM or PM
|
|
552
549
|
a(t, e) {
|
|
@@ -559,42 +556,41 @@ const w = {
|
|
|
559
556
|
return n;
|
|
560
557
|
case "aaaaa":
|
|
561
558
|
return n[0];
|
|
562
|
-
case "aaaa":
|
|
563
559
|
default:
|
|
564
560
|
return n === "am" ? "a.m." : "p.m.";
|
|
565
561
|
}
|
|
566
562
|
},
|
|
567
563
|
// Hour [1-12]
|
|
568
564
|
h(t, e) {
|
|
569
|
-
return
|
|
565
|
+
return s(t.getHours() % 12 || 12, e.length);
|
|
570
566
|
},
|
|
571
567
|
// Hour [0-23]
|
|
572
568
|
H(t, e) {
|
|
573
|
-
return
|
|
569
|
+
return s(t.getHours(), e.length);
|
|
574
570
|
},
|
|
575
571
|
// Minute
|
|
576
572
|
m(t, e) {
|
|
577
|
-
return
|
|
573
|
+
return s(t.getMinutes(), e.length);
|
|
578
574
|
},
|
|
579
575
|
// Second
|
|
580
576
|
s(t, e) {
|
|
581
|
-
return
|
|
577
|
+
return s(t.getSeconds(), e.length);
|
|
582
578
|
},
|
|
583
579
|
// Fraction of second
|
|
584
580
|
S(t, e) {
|
|
585
581
|
const n = e.length, r = t.getMilliseconds(), a = Math.trunc(
|
|
586
582
|
r * Math.pow(10, n - 3)
|
|
587
583
|
);
|
|
588
|
-
return
|
|
584
|
+
return s(a, e.length);
|
|
589
585
|
}
|
|
590
|
-
},
|
|
586
|
+
}, y = {
|
|
591
587
|
midnight: "midnight",
|
|
592
588
|
noon: "noon",
|
|
593
589
|
morning: "morning",
|
|
594
590
|
afternoon: "afternoon",
|
|
595
591
|
evening: "evening",
|
|
596
592
|
night: "night"
|
|
597
|
-
},
|
|
593
|
+
}, N = {
|
|
598
594
|
// Era
|
|
599
595
|
G: function(t, e, n) {
|
|
600
596
|
const r = t.getFullYear() > 0 ? 1 : 0;
|
|
@@ -607,8 +603,6 @@ const w = {
|
|
|
607
603
|
// A, B
|
|
608
604
|
case "GGGGG":
|
|
609
605
|
return n.era(r, { width: "narrow" });
|
|
610
|
-
// Anno Domini, Before Christ
|
|
611
|
-
case "GGGG":
|
|
612
606
|
default:
|
|
613
607
|
return n.era(r, { width: "wide" });
|
|
614
608
|
}
|
|
@@ -619,21 +613,21 @@ const w = {
|
|
|
619
613
|
const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
|
|
620
614
|
return n.ordinalNumber(a, { unit: "year" });
|
|
621
615
|
}
|
|
622
|
-
return
|
|
616
|
+
return l.y(t, e);
|
|
623
617
|
},
|
|
624
618
|
// Local week-numbering year
|
|
625
619
|
Y: function(t, e, n, r) {
|
|
626
|
-
const a =
|
|
620
|
+
const a = q(t, r), i = a > 0 ? a : 1 - a;
|
|
627
621
|
if (e === "YY") {
|
|
628
|
-
const
|
|
629
|
-
return o
|
|
622
|
+
const o = i % 100;
|
|
623
|
+
return s(o, 2);
|
|
630
624
|
}
|
|
631
|
-
return e === "Yo" ? n.ordinalNumber(i, { unit: "year" }) :
|
|
625
|
+
return e === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : s(i, e.length);
|
|
632
626
|
},
|
|
633
627
|
// ISO week-numbering year
|
|
634
628
|
R: function(t, e) {
|
|
635
|
-
const n =
|
|
636
|
-
return
|
|
629
|
+
const n = C(t);
|
|
630
|
+
return s(n, e.length);
|
|
637
631
|
},
|
|
638
632
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
639
633
|
// The main difference between `y` and `u` localizers are B.C. years:
|
|
@@ -646,7 +640,7 @@ const w = {
|
|
|
646
640
|
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
647
641
|
u: function(t, e) {
|
|
648
642
|
const n = t.getFullYear();
|
|
649
|
-
return
|
|
643
|
+
return s(n, e.length);
|
|
650
644
|
},
|
|
651
645
|
// Quarter
|
|
652
646
|
Q: function(t, e, n) {
|
|
@@ -657,7 +651,7 @@ const w = {
|
|
|
657
651
|
return String(r);
|
|
658
652
|
// 01, 02, 03, 04
|
|
659
653
|
case "QQ":
|
|
660
|
-
return
|
|
654
|
+
return s(r, 2);
|
|
661
655
|
// 1st, 2nd, 3rd, 4th
|
|
662
656
|
case "Qo":
|
|
663
657
|
return n.ordinalNumber(r, { unit: "quarter" });
|
|
@@ -673,8 +667,6 @@ const w = {
|
|
|
673
667
|
width: "narrow",
|
|
674
668
|
context: "formatting"
|
|
675
669
|
});
|
|
676
|
-
// 1st quarter, 2nd quarter, ...
|
|
677
|
-
case "QQQQ":
|
|
678
670
|
default:
|
|
679
671
|
return n.quarter(r, {
|
|
680
672
|
width: "wide",
|
|
@@ -691,7 +683,7 @@ const w = {
|
|
|
691
683
|
return String(r);
|
|
692
684
|
// 01, 02, 03, 04
|
|
693
685
|
case "qq":
|
|
694
|
-
return
|
|
686
|
+
return s(r, 2);
|
|
695
687
|
// 1st, 2nd, 3rd, 4th
|
|
696
688
|
case "qo":
|
|
697
689
|
return n.ordinalNumber(r, { unit: "quarter" });
|
|
@@ -707,8 +699,6 @@ const w = {
|
|
|
707
699
|
width: "narrow",
|
|
708
700
|
context: "standalone"
|
|
709
701
|
});
|
|
710
|
-
// 1st quarter, 2nd quarter, ...
|
|
711
|
-
case "qqqq":
|
|
712
702
|
default:
|
|
713
703
|
return n.quarter(r, {
|
|
714
704
|
width: "wide",
|
|
@@ -722,7 +712,7 @@ const w = {
|
|
|
722
712
|
switch (e) {
|
|
723
713
|
case "M":
|
|
724
714
|
case "MM":
|
|
725
|
-
return
|
|
715
|
+
return l.M(t, e);
|
|
726
716
|
// 1st, 2nd, ..., 12th
|
|
727
717
|
case "Mo":
|
|
728
718
|
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
@@ -738,8 +728,6 @@ const w = {
|
|
|
738
728
|
width: "narrow",
|
|
739
729
|
context: "formatting"
|
|
740
730
|
});
|
|
741
|
-
// January, February, ..., December
|
|
742
|
-
case "MMMM":
|
|
743
731
|
default:
|
|
744
732
|
return n.month(r, { width: "wide", context: "formatting" });
|
|
745
733
|
}
|
|
@@ -753,7 +741,7 @@ const w = {
|
|
|
753
741
|
return String(r + 1);
|
|
754
742
|
// 01, 02, ..., 12
|
|
755
743
|
case "LL":
|
|
756
|
-
return
|
|
744
|
+
return s(r + 1, 2);
|
|
757
745
|
// 1st, 2nd, ..., 12th
|
|
758
746
|
case "Lo":
|
|
759
747
|
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
@@ -769,30 +757,28 @@ const w = {
|
|
|
769
757
|
width: "narrow",
|
|
770
758
|
context: "standalone"
|
|
771
759
|
});
|
|
772
|
-
// January, February, ..., December
|
|
773
|
-
case "LLLL":
|
|
774
760
|
default:
|
|
775
761
|
return n.month(r, { width: "wide", context: "standalone" });
|
|
776
762
|
}
|
|
777
763
|
},
|
|
778
764
|
// Local week of year
|
|
779
765
|
w: function(t, e, n, r) {
|
|
780
|
-
const a =
|
|
781
|
-
return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) :
|
|
766
|
+
const a = kt(t, r);
|
|
767
|
+
return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : s(a, e.length);
|
|
782
768
|
},
|
|
783
769
|
// ISO week of year
|
|
784
770
|
I: function(t, e, n) {
|
|
785
|
-
const r =
|
|
786
|
-
return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) :
|
|
771
|
+
const r = Ot(t);
|
|
772
|
+
return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : s(r, e.length);
|
|
787
773
|
},
|
|
788
774
|
// Day of the month
|
|
789
775
|
d: function(t, e, n) {
|
|
790
|
-
return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) :
|
|
776
|
+
return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : l.d(t, e);
|
|
791
777
|
},
|
|
792
778
|
// Day of year
|
|
793
779
|
D: function(t, e, n) {
|
|
794
|
-
const r =
|
|
795
|
-
return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) :
|
|
780
|
+
const r = St(t);
|
|
781
|
+
return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : s(r, e.length);
|
|
796
782
|
},
|
|
797
783
|
// Day of week
|
|
798
784
|
E: function(t, e, n) {
|
|
@@ -818,8 +804,6 @@ const w = {
|
|
|
818
804
|
width: "short",
|
|
819
805
|
context: "formatting"
|
|
820
806
|
});
|
|
821
|
-
// Tuesday
|
|
822
|
-
case "EEEE":
|
|
823
807
|
default:
|
|
824
808
|
return n.day(r, {
|
|
825
809
|
width: "wide",
|
|
@@ -836,7 +820,7 @@ const w = {
|
|
|
836
820
|
return String(i);
|
|
837
821
|
// Padded numerical value
|
|
838
822
|
case "ee":
|
|
839
|
-
return
|
|
823
|
+
return s(i, 2);
|
|
840
824
|
// 1st, 2nd, ..., 7th
|
|
841
825
|
case "eo":
|
|
842
826
|
return n.ordinalNumber(i, { unit: "day" });
|
|
@@ -857,8 +841,6 @@ const w = {
|
|
|
857
841
|
width: "short",
|
|
858
842
|
context: "formatting"
|
|
859
843
|
});
|
|
860
|
-
// Tuesday
|
|
861
|
-
case "eeee":
|
|
862
844
|
default:
|
|
863
845
|
return n.day(a, {
|
|
864
846
|
width: "wide",
|
|
@@ -875,7 +857,7 @@ const w = {
|
|
|
875
857
|
return String(i);
|
|
876
858
|
// Padded numerical value
|
|
877
859
|
case "cc":
|
|
878
|
-
return
|
|
860
|
+
return s(i, e.length);
|
|
879
861
|
// 1st, 2nd, ..., 7th
|
|
880
862
|
case "co":
|
|
881
863
|
return n.ordinalNumber(i, { unit: "day" });
|
|
@@ -896,8 +878,6 @@ const w = {
|
|
|
896
878
|
width: "short",
|
|
897
879
|
context: "standalone"
|
|
898
880
|
});
|
|
899
|
-
// Tuesday
|
|
900
|
-
case "cccc":
|
|
901
881
|
default:
|
|
902
882
|
return n.day(a, {
|
|
903
883
|
width: "wide",
|
|
@@ -914,7 +894,7 @@ const w = {
|
|
|
914
894
|
return String(a);
|
|
915
895
|
// 02
|
|
916
896
|
case "ii":
|
|
917
|
-
return
|
|
897
|
+
return s(a, e.length);
|
|
918
898
|
// 2nd
|
|
919
899
|
case "io":
|
|
920
900
|
return n.ordinalNumber(a, { unit: "day" });
|
|
@@ -936,8 +916,6 @@ const w = {
|
|
|
936
916
|
width: "short",
|
|
937
917
|
context: "formatting"
|
|
938
918
|
});
|
|
939
|
-
// Tuesday
|
|
940
|
-
case "iiii":
|
|
941
919
|
default:
|
|
942
920
|
return n.day(r, {
|
|
943
921
|
width: "wide",
|
|
@@ -965,7 +943,6 @@ const w = {
|
|
|
965
943
|
width: "narrow",
|
|
966
944
|
context: "formatting"
|
|
967
945
|
});
|
|
968
|
-
case "aaaa":
|
|
969
946
|
default:
|
|
970
947
|
return n.dayPeriod(a, {
|
|
971
948
|
width: "wide",
|
|
@@ -977,7 +954,7 @@ const w = {
|
|
|
977
954
|
b: function(t, e, n) {
|
|
978
955
|
const r = t.getHours();
|
|
979
956
|
let a;
|
|
980
|
-
switch (r === 12 ? a =
|
|
957
|
+
switch (r === 12 ? a = y.noon : r === 0 ? a = y.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
|
|
981
958
|
case "b":
|
|
982
959
|
case "bb":
|
|
983
960
|
return n.dayPeriod(a, {
|
|
@@ -994,7 +971,6 @@ const w = {
|
|
|
994
971
|
width: "narrow",
|
|
995
972
|
context: "formatting"
|
|
996
973
|
});
|
|
997
|
-
case "bbbb":
|
|
998
974
|
default:
|
|
999
975
|
return n.dayPeriod(a, {
|
|
1000
976
|
width: "wide",
|
|
@@ -1006,7 +982,7 @@ const w = {
|
|
|
1006
982
|
B: function(t, e, n) {
|
|
1007
983
|
const r = t.getHours();
|
|
1008
984
|
let a;
|
|
1009
|
-
switch (r >= 17 ? a =
|
|
985
|
+
switch (r >= 17 ? a = y.evening : r >= 12 ? a = y.afternoon : r >= 4 ? a = y.morning : a = y.night, e) {
|
|
1010
986
|
case "B":
|
|
1011
987
|
case "BB":
|
|
1012
988
|
case "BBB":
|
|
@@ -1019,7 +995,6 @@ const w = {
|
|
|
1019
995
|
width: "narrow",
|
|
1020
996
|
context: "formatting"
|
|
1021
997
|
});
|
|
1022
|
-
case "BBBB":
|
|
1023
998
|
default:
|
|
1024
999
|
return n.dayPeriod(a, {
|
|
1025
1000
|
width: "wide",
|
|
@@ -1033,33 +1008,33 @@ const w = {
|
|
|
1033
1008
|
let r = t.getHours() % 12;
|
|
1034
1009
|
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
1035
1010
|
}
|
|
1036
|
-
return
|
|
1011
|
+
return l.h(t, e);
|
|
1037
1012
|
},
|
|
1038
1013
|
// Hour [0-23]
|
|
1039
1014
|
H: function(t, e, n) {
|
|
1040
|
-
return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) :
|
|
1015
|
+
return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : l.H(t, e);
|
|
1041
1016
|
},
|
|
1042
1017
|
// Hour [0-11]
|
|
1043
1018
|
K: function(t, e, n) {
|
|
1044
1019
|
const r = t.getHours() % 12;
|
|
1045
|
-
return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) :
|
|
1020
|
+
return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : s(r, e.length);
|
|
1046
1021
|
},
|
|
1047
1022
|
// Hour [1-24]
|
|
1048
1023
|
k: function(t, e, n) {
|
|
1049
1024
|
let r = t.getHours();
|
|
1050
|
-
return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) :
|
|
1025
|
+
return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : s(r, e.length);
|
|
1051
1026
|
},
|
|
1052
1027
|
// Minute
|
|
1053
1028
|
m: function(t, e, n) {
|
|
1054
|
-
return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) :
|
|
1029
|
+
return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : l.m(t, e);
|
|
1055
1030
|
},
|
|
1056
1031
|
// Second
|
|
1057
1032
|
s: function(t, e, n) {
|
|
1058
|
-
return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) :
|
|
1033
|
+
return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : l.s(t, e);
|
|
1059
1034
|
},
|
|
1060
1035
|
// Fraction of second
|
|
1061
1036
|
S: function(t, e) {
|
|
1062
|
-
return
|
|
1037
|
+
return l.S(t, e);
|
|
1063
1038
|
},
|
|
1064
1039
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1065
1040
|
X: function(t, e, n) {
|
|
@@ -1069,21 +1044,16 @@ const w = {
|
|
|
1069
1044
|
switch (e) {
|
|
1070
1045
|
// Hours and optional minutes
|
|
1071
1046
|
case "X":
|
|
1072
|
-
return
|
|
1047
|
+
return E(r);
|
|
1073
1048
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1074
1049
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1075
1050
|
// so this token always has the same output as `XX`
|
|
1076
1051
|
case "XXXX":
|
|
1077
1052
|
case "XX":
|
|
1078
|
-
return
|
|
1079
|
-
// Hours, minutes and optional seconds with `:` delimiter
|
|
1080
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1081
|
-
// so this token always has the same output as `XXX`
|
|
1082
|
-
case "XXXXX":
|
|
1083
|
-
case "XXX":
|
|
1053
|
+
return w(r);
|
|
1084
1054
|
// Hours and minutes with `:` delimiter
|
|
1085
1055
|
default:
|
|
1086
|
-
return
|
|
1056
|
+
return w(r, ":");
|
|
1087
1057
|
}
|
|
1088
1058
|
},
|
|
1089
1059
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
@@ -1092,21 +1062,16 @@ const w = {
|
|
|
1092
1062
|
switch (e) {
|
|
1093
1063
|
// Hours and optional minutes
|
|
1094
1064
|
case "x":
|
|
1095
|
-
return
|
|
1065
|
+
return E(r);
|
|
1096
1066
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1097
1067
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1098
1068
|
// so this token always has the same output as `xx`
|
|
1099
1069
|
case "xxxx":
|
|
1100
1070
|
case "xx":
|
|
1101
|
-
return
|
|
1102
|
-
// Hours, minutes and optional seconds with `:` delimiter
|
|
1103
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1104
|
-
// so this token always has the same output as `xxx`
|
|
1105
|
-
case "xxxxx":
|
|
1106
|
-
case "xxx":
|
|
1071
|
+
return w(r);
|
|
1107
1072
|
// Hours and minutes with `:` delimiter
|
|
1108
1073
|
default:
|
|
1109
|
-
return
|
|
1074
|
+
return w(r, ":");
|
|
1110
1075
|
}
|
|
1111
1076
|
},
|
|
1112
1077
|
// Timezone (GMT)
|
|
@@ -1117,11 +1082,9 @@ const w = {
|
|
|
1117
1082
|
case "O":
|
|
1118
1083
|
case "OO":
|
|
1119
1084
|
case "OOO":
|
|
1120
|
-
return "GMT" +
|
|
1121
|
-
// Long
|
|
1122
|
-
case "OOOO":
|
|
1085
|
+
return "GMT" + T(r, ":");
|
|
1123
1086
|
default:
|
|
1124
|
-
return "GMT" +
|
|
1087
|
+
return "GMT" + w(r, ":");
|
|
1125
1088
|
}
|
|
1126
1089
|
},
|
|
1127
1090
|
// Timezone (specific non-location)
|
|
@@ -1132,35 +1095,33 @@ const w = {
|
|
|
1132
1095
|
case "z":
|
|
1133
1096
|
case "zz":
|
|
1134
1097
|
case "zzz":
|
|
1135
|
-
return "GMT" +
|
|
1136
|
-
// Long
|
|
1137
|
-
case "zzzz":
|
|
1098
|
+
return "GMT" + T(r, ":");
|
|
1138
1099
|
default:
|
|
1139
|
-
return "GMT" +
|
|
1100
|
+
return "GMT" + w(r, ":");
|
|
1140
1101
|
}
|
|
1141
1102
|
},
|
|
1142
1103
|
// Seconds timestamp
|
|
1143
1104
|
t: function(t, e, n) {
|
|
1144
1105
|
const r = Math.trunc(+t / 1e3);
|
|
1145
|
-
return
|
|
1106
|
+
return s(r, e.length);
|
|
1146
1107
|
},
|
|
1147
1108
|
// Milliseconds timestamp
|
|
1148
1109
|
T: function(t, e, n) {
|
|
1149
|
-
return
|
|
1110
|
+
return s(+t, e.length);
|
|
1150
1111
|
}
|
|
1151
1112
|
};
|
|
1152
|
-
function
|
|
1113
|
+
function T(t, e = "") {
|
|
1153
1114
|
const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), i = r % 60;
|
|
1154
|
-
return i === 0 ? n + String(a) : n + String(a) + e +
|
|
1115
|
+
return i === 0 ? n + String(a) : n + String(a) + e + s(i, 2);
|
|
1155
1116
|
}
|
|
1156
|
-
function
|
|
1157
|
-
return t % 60 === 0 ? (t > 0 ? "-" : "+") +
|
|
1117
|
+
function E(t, e) {
|
|
1118
|
+
return t % 60 === 0 ? (t > 0 ? "-" : "+") + s(Math.abs(t) / 60, 2) : w(t, e);
|
|
1158
1119
|
}
|
|
1159
|
-
function
|
|
1160
|
-
const n = t > 0 ? "-" : "+", r = Math.abs(t), a =
|
|
1120
|
+
function w(t, e = "") {
|
|
1121
|
+
const n = t > 0 ? "-" : "+", r = Math.abs(t), a = s(Math.trunc(r / 60), 2), i = s(r % 60, 2);
|
|
1161
1122
|
return n + a + e + i;
|
|
1162
1123
|
}
|
|
1163
|
-
const
|
|
1124
|
+
const $ = (t, e) => {
|
|
1164
1125
|
switch (t) {
|
|
1165
1126
|
case "P":
|
|
1166
1127
|
return e.date({ width: "short" });
|
|
@@ -1168,11 +1129,10 @@ const L = (t, e) => {
|
|
|
1168
1129
|
return e.date({ width: "medium" });
|
|
1169
1130
|
case "PPP":
|
|
1170
1131
|
return e.date({ width: "long" });
|
|
1171
|
-
case "PPPP":
|
|
1172
1132
|
default:
|
|
1173
1133
|
return e.date({ width: "full" });
|
|
1174
1134
|
}
|
|
1175
|
-
},
|
|
1135
|
+
}, H = (t, e) => {
|
|
1176
1136
|
switch (t) {
|
|
1177
1137
|
case "p":
|
|
1178
1138
|
return e.time({ width: "short" });
|
|
@@ -1180,14 +1140,13 @@ const L = (t, e) => {
|
|
|
1180
1140
|
return e.time({ width: "medium" });
|
|
1181
1141
|
case "ppp":
|
|
1182
1142
|
return e.time({ width: "long" });
|
|
1183
|
-
case "pppp":
|
|
1184
1143
|
default:
|
|
1185
1144
|
return e.time({ width: "full" });
|
|
1186
1145
|
}
|
|
1187
|
-
},
|
|
1146
|
+
}, Wt = (t, e) => {
|
|
1188
1147
|
const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
|
|
1189
1148
|
if (!a)
|
|
1190
|
-
return
|
|
1149
|
+
return $(t, e);
|
|
1191
1150
|
let i;
|
|
1192
1151
|
switch (r) {
|
|
1193
1152
|
case "P":
|
|
@@ -1199,88 +1158,86 @@ const L = (t, e) => {
|
|
|
1199
1158
|
case "PPP":
|
|
1200
1159
|
i = e.dateTime({ width: "long" });
|
|
1201
1160
|
break;
|
|
1202
|
-
case "PPPP":
|
|
1203
1161
|
default:
|
|
1204
1162
|
i = e.dateTime({ width: "full" });
|
|
1205
1163
|
break;
|
|
1206
1164
|
}
|
|
1207
|
-
return i.replace("{{date}}",
|
|
1208
|
-
},
|
|
1209
|
-
p:
|
|
1210
|
-
P:
|
|
1211
|
-
},
|
|
1212
|
-
function
|
|
1213
|
-
return
|
|
1165
|
+
return i.replace("{{date}}", $(r, e)).replace("{{time}}", H(a, e));
|
|
1166
|
+
}, Ft = {
|
|
1167
|
+
p: H,
|
|
1168
|
+
P: Wt
|
|
1169
|
+
}, Yt = /^D+$/, Nt = /^Y+$/, Tt = ["D", "DD", "YY", "YYYY"];
|
|
1170
|
+
function Et(t) {
|
|
1171
|
+
return Yt.test(t);
|
|
1214
1172
|
}
|
|
1215
|
-
function
|
|
1216
|
-
return
|
|
1173
|
+
function $t(t) {
|
|
1174
|
+
return Nt.test(t);
|
|
1217
1175
|
}
|
|
1218
|
-
function
|
|
1219
|
-
const r =
|
|
1220
|
-
if (console.warn(r),
|
|
1176
|
+
function Ct(t, e, n) {
|
|
1177
|
+
const r = qt(t, e, n);
|
|
1178
|
+
if (console.warn(r), Tt.includes(t)) throw new RangeError(r);
|
|
1221
1179
|
}
|
|
1222
|
-
function
|
|
1180
|
+
function qt(t, e, n) {
|
|
1223
1181
|
const r = t[0] === "Y" ? "years" : "days of the month";
|
|
1224
1182
|
return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1225
1183
|
}
|
|
1226
|
-
const
|
|
1227
|
-
function
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
if (!R(c))
|
|
1184
|
+
const Ht = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Lt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Gt = /^'([^]*?)'?$/, Qt = /''/g, Vt = /[a-zA-Z]/;
|
|
1185
|
+
function k(t, e, n) {
|
|
1186
|
+
const r = S(), a = r.locale ?? Dt, i = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, c = f(t, n?.in);
|
|
1187
|
+
if (!_(c))
|
|
1231
1188
|
throw new RangeError("Invalid time value");
|
|
1232
|
-
let
|
|
1233
|
-
const
|
|
1234
|
-
if (
|
|
1235
|
-
const
|
|
1236
|
-
return
|
|
1189
|
+
let m = e.match(Lt).map((d) => {
|
|
1190
|
+
const u = d[0];
|
|
1191
|
+
if (u === "p" || u === "P") {
|
|
1192
|
+
const O = Ft[u];
|
|
1193
|
+
return O(d, a.formatLong);
|
|
1237
1194
|
}
|
|
1238
|
-
return
|
|
1239
|
-
}).join("").match(
|
|
1240
|
-
if (
|
|
1195
|
+
return d;
|
|
1196
|
+
}).join("").match(Ht).map((d) => {
|
|
1197
|
+
if (d === "''")
|
|
1241
1198
|
return { isToken: !1, value: "'" };
|
|
1242
|
-
const
|
|
1243
|
-
if (
|
|
1244
|
-
return { isToken: !1, value:
|
|
1245
|
-
if (
|
|
1246
|
-
return { isToken: !0, value:
|
|
1247
|
-
if (
|
|
1199
|
+
const u = d[0];
|
|
1200
|
+
if (u === "'")
|
|
1201
|
+
return { isToken: !1, value: Xt(d) };
|
|
1202
|
+
if (N[u])
|
|
1203
|
+
return { isToken: !0, value: d };
|
|
1204
|
+
if (u.match(Vt))
|
|
1248
1205
|
throw new RangeError(
|
|
1249
|
-
"Format string contains an unescaped latin alphabet character `" +
|
|
1206
|
+
"Format string contains an unescaped latin alphabet character `" + u + "`"
|
|
1250
1207
|
);
|
|
1251
|
-
return { isToken: !1, value:
|
|
1208
|
+
return { isToken: !1, value: d };
|
|
1252
1209
|
});
|
|
1253
|
-
a.localize.preprocessor && (
|
|
1254
|
-
const
|
|
1210
|
+
a.localize.preprocessor && (m = a.localize.preprocessor(c, m));
|
|
1211
|
+
const h = {
|
|
1255
1212
|
firstWeekContainsDate: i,
|
|
1256
|
-
weekStartsOn:
|
|
1213
|
+
weekStartsOn: o,
|
|
1257
1214
|
locale: a
|
|
1258
1215
|
};
|
|
1259
|
-
return
|
|
1260
|
-
if (!
|
|
1261
|
-
const
|
|
1262
|
-
(
|
|
1263
|
-
const
|
|
1264
|
-
return
|
|
1216
|
+
return m.map((d) => {
|
|
1217
|
+
if (!d.isToken) return d.value;
|
|
1218
|
+
const u = d.value;
|
|
1219
|
+
($t(u) || Et(u)) && Ct(u, e, String(t));
|
|
1220
|
+
const O = N[u[0]];
|
|
1221
|
+
return O(c, u, a.localize, h);
|
|
1265
1222
|
}).join("");
|
|
1266
1223
|
}
|
|
1267
|
-
function
|
|
1268
|
-
const e = t.match(
|
|
1269
|
-
return e ? e[1].replace(
|
|
1224
|
+
function Xt(t) {
|
|
1225
|
+
const e = t.match(Gt);
|
|
1226
|
+
return e ? e[1].replace(Qt, "'") : t;
|
|
1270
1227
|
}
|
|
1271
|
-
const
|
|
1272
|
-
function
|
|
1273
|
-
let n = Math.abs(e).toLocaleString(
|
|
1228
|
+
const b = "en-US";
|
|
1229
|
+
function _t(t, e) {
|
|
1230
|
+
let n = Math.abs(e).toLocaleString(b, {
|
|
1274
1231
|
useGrouping: !1
|
|
1275
1232
|
});
|
|
1276
|
-
return e < 0 ? n = `${t.settings.numbersPrefixNegative}${n}${t.settings.numbersSuffixNegative}` : n = `${t.settings.numbersPrefixPositive}${n}${t.settings.numbersSuffixPositive}`,
|
|
1233
|
+
return e < 0 ? n = `${t.settings.numbersPrefixNegative}${n}${t.settings.numbersSuffixNegative}` : n = `${t.settings.numbersPrefixPositive}${n}${t.settings.numbersSuffixPositive}`, x(
|
|
1277
1234
|
n,
|
|
1278
1235
|
t.settings.decimalSeparator,
|
|
1279
1236
|
t.settings.thousandsSeparator
|
|
1280
1237
|
);
|
|
1281
1238
|
}
|
|
1282
|
-
function
|
|
1283
|
-
let n = Math.abs(e).toLocaleString(
|
|
1239
|
+
function It(t, e) {
|
|
1240
|
+
let n = Math.abs(e).toLocaleString(b, {
|
|
1284
1241
|
minimumFractionDigits: e < 0 ? t.settings.numbersDecimalPrecisionNegative : t.settings.numbersDecimalPrecisionPositive,
|
|
1285
1242
|
maximumFractionDigits: e < 0 ? Math.max(
|
|
1286
1243
|
t.settings.numbersDecimalPrecisionNegativeOptional,
|
|
@@ -1291,15 +1248,15 @@ function At(t, e) {
|
|
|
1291
1248
|
),
|
|
1292
1249
|
useGrouping: !1
|
|
1293
1250
|
});
|
|
1294
|
-
return e < 0 ? n = `${t.settings.numbersPrefixNegative}${n}${t.settings.numbersSuffixNegative}` : n = `${t.settings.numbersPrefixPositive}${n}${t.settings.numbersSuffixPositive}`,
|
|
1251
|
+
return e < 0 ? n = `${t.settings.numbersPrefixNegative}${n}${t.settings.numbersSuffixNegative}` : n = `${t.settings.numbersPrefixPositive}${n}${t.settings.numbersSuffixPositive}`, x(
|
|
1295
1252
|
n,
|
|
1296
1253
|
t.settings.decimalSeparator,
|
|
1297
1254
|
t.settings.thousandsSeparator
|
|
1298
1255
|
);
|
|
1299
1256
|
}
|
|
1300
|
-
function
|
|
1257
|
+
function jt(t, e) {
|
|
1301
1258
|
if (isNaN(e)) return "";
|
|
1302
|
-
let n = Math.abs(e).toLocaleString(
|
|
1259
|
+
let n = Math.abs(e).toLocaleString(b, {
|
|
1303
1260
|
minimumFractionDigits: e < 0 ? t.settings.currencyNegMinimumFractionDigits : t.settings.currencyMinimumFractionDigits,
|
|
1304
1261
|
minimumIntegerDigits: e < 0 ? t.settings.currencyNegMinimumIntegerDigits : t.settings.currencyMinimumIntegerDigits,
|
|
1305
1262
|
maximumFractionDigits: e < 0 ? Math.max(
|
|
@@ -1311,16 +1268,16 @@ function Jt(t, e) {
|
|
|
1311
1268
|
),
|
|
1312
1269
|
useGrouping: !1
|
|
1313
1270
|
});
|
|
1314
|
-
return e < 0 ? n = `${t.settings.currencyPrefixNegative}${n}${t.settings.currencySuffixNegative}` : n = `${t.settings.currencyPrefixPositive}${n}${t.settings.currencySuffixPositive}`,
|
|
1271
|
+
return e < 0 ? n = `${t.settings.currencyPrefixNegative}${n}${t.settings.currencySuffixNegative}` : n = `${t.settings.currencyPrefixPositive}${n}${t.settings.currencySuffixPositive}`, x(
|
|
1315
1272
|
n,
|
|
1316
1273
|
t.settings.decimalSeparator,
|
|
1317
1274
|
t.settings.thousandsSeparator
|
|
1318
1275
|
);
|
|
1319
1276
|
}
|
|
1320
|
-
function
|
|
1277
|
+
function Bt(t, e) {
|
|
1321
1278
|
if (isNaN(e)) return "";
|
|
1322
|
-
const n =
|
|
1323
|
-
e.toLocaleString(
|
|
1279
|
+
const n = x(
|
|
1280
|
+
e.toLocaleString(b, {
|
|
1324
1281
|
style: "currency",
|
|
1325
1282
|
currency: t.settings.currencyCode,
|
|
1326
1283
|
minimumFractionDigits: t.settings.fuelUnitPriceDecimalPrecisionPositive,
|
|
@@ -1331,38 +1288,38 @@ function Ut(t, e) {
|
|
|
1331
1288
|
);
|
|
1332
1289
|
return `${t.settings.fuelUnitPricePrefixPositive}${n}${t.settings.fuelUnitPriceSuffixPositive}`;
|
|
1333
1290
|
}
|
|
1334
|
-
function
|
|
1335
|
-
return isNaN(t) ? "" : t.toLocaleString(
|
|
1291
|
+
function Rt(t) {
|
|
1292
|
+
return isNaN(t) ? "" : t.toLocaleString(b, {
|
|
1336
1293
|
minimumFractionDigits: 0,
|
|
1337
1294
|
maximumFractionDigits: 2,
|
|
1338
1295
|
useGrouping: !1
|
|
1339
1296
|
});
|
|
1340
1297
|
}
|
|
1341
|
-
function
|
|
1298
|
+
function At(t, e, n) {
|
|
1342
1299
|
if (isNaN(e) && (e = 0), e === 0) return "";
|
|
1343
|
-
let r = Math.abs(e).toLocaleString(
|
|
1300
|
+
let r = Math.abs(e).toLocaleString(b, {
|
|
1344
1301
|
minimumFractionDigits: e < 0 ? t.settings.fuelVolumeDecimalPrecisionNegative : t.settings.fuelVolumeDecimalPrecisionPositive,
|
|
1345
1302
|
useGrouping: !1
|
|
1346
1303
|
});
|
|
1347
|
-
return r =
|
|
1304
|
+
return r = x(
|
|
1348
1305
|
r,
|
|
1349
1306
|
t.settings.decimalSeparator,
|
|
1350
1307
|
t.settings.thousandsSeparator
|
|
1351
1308
|
), r = `${e < 0 ? t.settings.fuelVolumePrefixNegative : t.settings.fuelVolumePrefixPositive}${r}${e < 0 ? t.settings.fuelVolumeSuffixNegative : t.settings.fuelVolumeSuffixPositive}`, r + (n ? "" : ` ${t.settings.fuelVolumeSign}`);
|
|
1352
1309
|
}
|
|
1353
|
-
function
|
|
1310
|
+
function Jt(t, e) {
|
|
1354
1311
|
const n = t.settings.dateFormat;
|
|
1355
|
-
return
|
|
1312
|
+
return k(new Date(e), n);
|
|
1356
1313
|
}
|
|
1357
|
-
function
|
|
1314
|
+
function Ut(t, e) {
|
|
1358
1315
|
const n = t.settings.timeFormat;
|
|
1359
|
-
return
|
|
1316
|
+
return k(new Date(e), `${n}`);
|
|
1360
1317
|
}
|
|
1361
|
-
function
|
|
1318
|
+
function zt(t, e) {
|
|
1362
1319
|
const n = t.settings.dateFormat, r = t.settings.timeFormat;
|
|
1363
|
-
return
|
|
1320
|
+
return k(new Date(e), `${n} ${r}`);
|
|
1364
1321
|
}
|
|
1365
|
-
function
|
|
1322
|
+
function x(t, e = ".", n = ",") {
|
|
1366
1323
|
const [r, a] = t.split("."), i = r.replace(
|
|
1367
1324
|
/\B(?=(\d{3})+(?!\d))/g,
|
|
1368
1325
|
n
|
|
@@ -1370,13 +1327,13 @@ function k(t, e = ".", n = ",") {
|
|
|
1370
1327
|
return a ? `${i}${e}${a}` : i;
|
|
1371
1328
|
}
|
|
1372
1329
|
export {
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1330
|
+
jt as currency,
|
|
1331
|
+
Jt as date,
|
|
1332
|
+
zt as datetime,
|
|
1333
|
+
It as decimal,
|
|
1334
|
+
Bt as fuelUnitPrice,
|
|
1335
|
+
At as fuelVolume,
|
|
1336
|
+
Rt as hours,
|
|
1337
|
+
_t as number,
|
|
1338
|
+
Ut as time
|
|
1382
1339
|
};
|