@paperless/core 0.1.0-alpha.436 → 0.1.0-alpha.438
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/CHANGELOG.md +22 -0
- package/dist/build/p-04296717.entry.js +2 -0
- package/dist/{paperless/p-8fb43cc7.entry.js.map → build/p-04296717.entry.js.map} +1 -1
- package/dist/build/p-0e18b4ce.entry.js +2 -0
- package/dist/{paperless/p-ebd4ba56.entry.js.map → build/p-0e18b4ce.entry.js.map} +1 -1
- package/dist/{paperless/p-756c06ec.entry.js → build/p-1d6b036c.entry.js} +2 -2
- package/dist/build/{p-58b52568.entry.js → p-1f55126f.entry.js} +2 -2
- package/dist/{paperless/p-78948e08.entry.js → build/p-20cc75be.entry.js} +2 -2
- package/dist/build/{p-b7b1de31.entry.js → p-322be6d8.entry.js} +2 -2
- package/dist/build/{p-5d118f66.entry.js → p-33b6520e.entry.js} +2 -2
- package/dist/build/{p-f07793f6.entry.js → p-3bd4c1c1.entry.js} +2 -2
- package/dist/build/{p-0cb97c5e.entry.js → p-47e461b7.entry.js} +2 -2
- package/dist/build/{p-b13a0ee4.entry.js → p-49104ffe.entry.js} +2 -2
- package/dist/{paperless/p-ac7b48ff.entry.js → build/p-4b99a4fe.entry.js} +2 -2
- package/dist/build/{p-464569dc.entry.js → p-5e5f3eaa.entry.js} +2 -2
- package/dist/build/{p-464569dc.entry.js.map → p-5e5f3eaa.entry.js.map} +1 -1
- package/dist/build/{p-a2bd1a79.entry.js → p-6782f5df.entry.js} +2 -2
- package/dist/{paperless/p-a2bd1a79.entry.js.map → build/p-6782f5df.entry.js.map} +1 -1
- package/dist/build/{p-ea824ef3.entry.js → p-688264c9.entry.js} +2 -2
- package/dist/build/{p-c87da93e.entry.js → p-69b621a7.entry.js} +2 -2
- package/dist/build/{p-c87da93e.entry.js.map → p-69b621a7.entry.js.map} +1 -1
- package/dist/build/p-6ccf5cdd.js +3 -0
- package/dist/build/p-6ccf5cdd.js.map +1 -0
- package/dist/build/{p-ebc2ae62.entry.js → p-733a0d79.entry.js} +2 -2
- package/dist/build/{p-45dfd940.entry.js → p-7e26a901.entry.js} +2 -2
- package/dist/build/{p-cccc37c0.entry.js → p-81a99f72.entry.js} +2 -2
- package/dist/build/p-842f87c8.entry.js +2 -0
- package/dist/build/p-842f87c8.entry.js.map +1 -0
- package/dist/{paperless/p-6f82a1e7.entry.js → build/p-8569fa3c.entry.js} +2 -2
- package/dist/build/{p-036a82fc.entry.js → p-886a1eda.entry.js} +2 -2
- package/dist/build/p-886a1eda.entry.js.map +1 -0
- package/dist/build/{p-1b5292a3.entry.js → p-8f453ef2.entry.js} +2 -2
- package/dist/build/p-8fefda1f.entry.js +2 -0
- package/dist/build/{p-a3fcf8b6.entry.js.map → p-8fefda1f.entry.js.map} +1 -1
- package/dist/{paperless/p-f34ed23f.entry.js → build/p-97ddf9d4.entry.js} +2 -2
- package/dist/build/p-97ddf9d4.entry.js.map +1 -0
- package/dist/{paperless/p-57411b2b.entry.js → build/p-a0790d7b.entry.js} +2 -2
- package/dist/{paperless/p-5a31cb9e.entry.js → build/p-a751f1a4.entry.js} +2 -2
- package/dist/build/p-ae248aef.js +2 -0
- package/dist/build/p-ae248aef.js.map +1 -0
- package/dist/build/p-aefd84a3.entry.js +2 -0
- package/dist/build/{p-e3f29ba8.entry.js.map → p-aefd84a3.entry.js.map} +1 -1
- package/dist/build/{p-3d8b5cc4.entry.js → p-af38f227.entry.js} +2 -2
- package/dist/{paperless/p-93fb216c.entry.js → build/p-af92e53c.entry.js} +2 -2
- package/dist/build/p-b5234526.entry.js +2 -0
- package/dist/{paperless/p-d012d066.entry.js.map → build/p-b5234526.entry.js.map} +1 -1
- package/dist/build/{p-7b94bc6a.entry.js → p-b5b591c7.entry.js} +2 -2
- package/dist/{paperless/p-5236b565.entry.js → build/p-c6d9e720.entry.js} +2 -2
- package/dist/build/p-d24d95d2.entry.js +2 -0
- package/dist/build/{p-ef2eee59.entry.js.map → p-d24d95d2.entry.js.map} +1 -1
- package/dist/build/{p-31afbb45.entry.js → p-d2529f77.entry.js} +2 -2
- package/dist/build/{p-e0d7a4ee.entry.js → p-d51ede49.entry.js} +2 -2
- package/dist/build/p-dd9d3dd6.entry.js +2 -0
- package/dist/build/{p-b0eeab26.entry.js.map → p-dd9d3dd6.entry.js.map} +1 -1
- package/dist/build/{p-10ad607e.entry.js → p-e8a815d7.entry.js} +2 -2
- package/dist/build/{p-c6ef7b79.entry.js → p-f3207ec2.entry.js} +2 -2
- package/dist/build/{p-0a3f2fe8.entry.js → p-f429073e.entry.js} +2 -2
- package/dist/build/{p-dc01e9eb.entry.js → p-f59afce6.entry.js} +2 -2
- package/dist/{paperless/p-471be252.entry.js → build/p-f695dc3c.entry.js} +2 -2
- package/dist/build/{p-78ce77d2.entry.js → p-f9aaa75c.entry.js} +2 -2
- package/dist/build/p-fef32402.js +2 -0
- package/dist/{cjs/floating-ui.dom.esm-4cb215a4.js.map → build/p-fef32402.js.map} +1 -1
- package/dist/build/paperless.css +1 -1
- package/dist/build/paperless.esm.js +1 -1
- package/dist/build/paperless.esm.js.map +1 -1
- package/dist/cjs/{floating-ui.dom.esm-4cb215a4.js → floating-ui.dom.esm-62336770.js} +19 -9
- package/dist/cjs/floating-ui.dom.esm-62336770.js.map +1 -0
- package/dist/cjs/{index-040ec3f9.js → index-b59a0544.js} +65 -224
- package/dist/cjs/index-b59a0544.js.map +1 -0
- package/dist/cjs/{index-13ea09e0.js → index-dfc4dfec.js} +82 -34
- package/dist/cjs/index-dfc4dfec.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/p-accordion.cjs.entry.js +1 -1
- package/dist/cjs/p-attachment.cjs.entry.js +1 -1
- package/dist/cjs/p-avatar-group.cjs.entry.js +1 -1
- package/dist/cjs/p-avatar.cjs.entry.js +1 -1
- package/dist/cjs/p-backdrop.cjs.entry.js +2 -2
- package/dist/cjs/p-backdrop.cjs.entry.js.map +1 -1
- package/dist/cjs/p-button_3.cjs.entry.js +4 -4
- package/dist/cjs/p-calendar.cjs.entry.js +8 -27
- package/dist/cjs/p-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/p-card-body.cjs.entry.js +1 -1
- package/dist/cjs/p-card-container.cjs.entry.js +1 -1
- package/dist/cjs/p-card-header.cjs.entry.js +1 -1
- package/dist/cjs/p-content-slider.cjs.entry.js +1 -1
- package/dist/cjs/p-counter.cjs.entry.js +1 -1
- package/dist/cjs/p-datepicker.cjs.entry.js +434 -1475
- package/dist/cjs/p-datepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/p-divider.cjs.entry.js +2 -2
- package/dist/cjs/p-drawer-body_3.cjs.entry.js +1 -1
- package/dist/cjs/p-drawer.cjs.entry.js +1 -1
- package/dist/cjs/p-dropdown-menu-container.cjs.entry.js +2 -2
- package/dist/cjs/p-dropdown-menu-container.cjs.entry.js.map +1 -1
- package/dist/cjs/p-dropdown_2.cjs.entry.js +4 -4
- package/dist/cjs/p-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/p-helper_3.cjs.entry.js +3 -3
- package/dist/cjs/p-helper_3.cjs.entry.js.map +1 -1
- package/dist/cjs/p-illustration_6.cjs.entry.js +6 -6
- package/dist/cjs/p-illustration_6.cjs.entry.js.map +1 -1
- package/dist/cjs/p-info-panel.cjs.entry.js +1 -1
- package/dist/cjs/p-label_3.cjs.entry.js +4 -4
- package/dist/cjs/p-label_3.cjs.entry.js.map +1 -1
- package/dist/cjs/p-layout.cjs.entry.js +1 -1
- package/dist/cjs/p-modal-body_4.cjs.entry.js +5 -5
- package/dist/cjs/p-modal-body_4.cjs.entry.js.map +1 -1
- package/dist/cjs/p-modal.cjs.entry.js +1 -1
- package/dist/cjs/p-navbar.cjs.entry.js +1 -1
- package/dist/cjs/p-navigation-item.cjs.entry.js +1 -1
- package/dist/cjs/p-page-size-select_3.cjs.entry.js +3 -3
- package/dist/cjs/p-page-size-select_3.cjs.entry.js.map +1 -1
- package/dist/cjs/p-profile.cjs.entry.js +1 -1
- package/dist/cjs/p-select.cjs.entry.js +1 -1
- package/dist/cjs/p-slider-indicator.cjs.entry.js +1 -1
- package/dist/cjs/p-status.cjs.entry.js +1 -1
- package/dist/cjs/p-stepper-item.cjs.entry.js +1 -1
- package/dist/cjs/p-stepper-line.cjs.entry.js +1 -1
- package/dist/cjs/p-stepper.cjs.entry.js +1 -1
- package/dist/cjs/p-tab-group.cjs.entry.js +1 -1
- package/dist/cjs/p-tab-item.cjs.entry.js +1 -1
- package/dist/cjs/p-table-column.cjs.entry.js +1 -1
- package/dist/cjs/p-table-column.cjs.entry.js.map +1 -1
- package/dist/cjs/p-table.cjs.entry.js +2 -2
- package/dist/cjs/p-table.cjs.entry.js.map +1 -1
- package/dist/cjs/p-toast-container.cjs.entry.js +1 -1
- package/dist/cjs/p-toast.cjs.entry.js +1 -1
- package/dist/cjs/p-tooltip.cjs.entry.js +6 -4
- package/dist/cjs/p-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/paperless.cjs.js +2 -2
- package/dist/cjs/paperless.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/atoms/backdrop/backdrop.component.css +1 -1
- package/dist/collection/components/atoms/button/button.component.css +1 -1
- package/dist/collection/components/atoms/divider/divider.component.css +1 -1
- package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.css +1 -1
- package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.css +1 -1
- package/dist/collection/components/atoms/helper/helper.component.css +1 -1
- package/dist/collection/components/atoms/icon/icon.component.css +1 -1
- package/dist/collection/components/atoms/label/label.component.css +1 -1
- package/dist/collection/components/atoms/loader/loader.component.css +1 -1
- package/dist/collection/components/atoms/modal-body/modal-body.component.css +1 -1
- package/dist/collection/components/atoms/modal-container/modal-container.component.css +1 -1
- package/dist/collection/components/atoms/modal-footer/modal-footer.component.css +1 -1
- package/dist/collection/components/atoms/modal-header/modal-header.component.css +1 -1
- package/dist/collection/components/atoms/pagination-item/pagination-item.component.css +1 -1
- package/dist/collection/components/atoms/segment-container/segment-container.component.css +1 -1
- package/dist/collection/components/atoms/segment-item/segment-item.component.css +1 -1
- package/dist/collection/components/atoms/table-container/table-container.component.css +1 -1
- package/dist/collection/components/atoms/tooltip/tooltip.component.css +1 -1
- package/dist/collection/components/atoms/tooltip/tooltip.component.js +3 -1
- package/dist/collection/components/atoms/tooltip/tooltip.component.js.map +1 -1
- package/dist/collection/components/helpers/table-column/table-column.component.js +2 -2
- package/dist/collection/components/helpers/table-column/table-column.component.js.map +1 -1
- package/dist/collection/components/molecules/dropdown/dropdown.component.css +1 -1
- package/dist/collection/components/molecules/input-group/input-group.component.css +1 -1
- package/dist/collection/components/molecules/pagination/pagination.component.css +1 -1
- package/dist/collection/components/molecules/table-cell/table-cell.component.css +1 -1
- package/dist/collection/components/molecules/table-footer/table-footer.component.css +1 -1
- package/dist/collection/components/molecules/table-header/table-header.component.css +1 -1
- package/dist/collection/components/molecules/table-row/table-row.component.css +1 -1
- package/dist/collection/components/organisms/table/table.component.css +1 -1
- package/dist/collection/types/table.js.map +1 -1
- package/dist/components/backdrop.component.js +1 -1
- package/dist/components/backdrop.component.js.map +1 -1
- package/dist/components/button.component.js +1 -1
- package/dist/components/calendar.component.js +70 -249
- package/dist/components/calendar.component.js.map +1 -1
- package/dist/components/divider.component.js +1 -1
- package/dist/components/dropdown-menu-container.component.js +1 -1
- package/dist/components/dropdown-menu-container.component.js.map +1 -1
- package/dist/components/dropdown-menu-item.component.js +1 -1
- package/dist/components/dropdown-menu-item.component.js.map +1 -1
- package/dist/components/dropdown.component.js +1 -1
- package/dist/components/dropdown.component.js.map +1 -1
- package/dist/components/floating-ui.dom.esm.js +18 -8
- package/dist/components/floating-ui.dom.esm.js.map +1 -1
- package/dist/components/helper.component.js +1 -1
- package/dist/components/helper.component.js.map +1 -1
- package/dist/components/icon.component.js +1 -1
- package/dist/components/input-group.component.js +1 -1
- package/dist/components/input-group.component.js.map +1 -1
- package/dist/components/label.component.js +1 -1
- package/dist/components/loader.component.js +1 -1
- package/dist/components/modal-body.component.js +1 -1
- package/dist/components/modal-body.component.js.map +1 -1
- package/dist/components/modal-container.component.js +1 -1
- package/dist/components/modal-container.component.js.map +1 -1
- package/dist/components/modal-footer.component.js +1 -1
- package/dist/components/modal-header.component.js +1 -1
- package/dist/components/modal-header.component.js.map +1 -1
- package/dist/components/p-datepicker.js +432 -1473
- package/dist/components/p-datepicker.js.map +1 -1
- package/dist/components/p-table-column.js.map +1 -1
- package/dist/components/p-table.js +1 -1
- package/dist/components/p-table.js.map +1 -1
- package/dist/components/pagination-item.component.js +1 -1
- package/dist/components/pagination-item.component.js.map +1 -1
- package/dist/components/pagination.component.js +1 -1
- package/dist/components/pagination.component.js.map +1 -1
- package/dist/components/segment-container.component.js +1 -1
- package/dist/components/segment-container.component.js.map +1 -1
- package/dist/components/segment-item.component.js +1 -1
- package/dist/components/segment-item.component.js.map +1 -1
- package/dist/components/table-cell.component.js +1 -1
- package/dist/components/table-cell.component.js.map +1 -1
- package/dist/components/table-container.component.js +1 -1
- package/dist/components/table-container.component.js.map +1 -1
- package/dist/components/table-footer.component.js +1 -1
- package/dist/components/table-footer.component.js.map +1 -1
- package/dist/components/table-header.component.js +1 -1
- package/dist/components/table-header.component.js.map +1 -1
- package/dist/components/table-row.component.js +1 -1
- package/dist/components/table-row.component.js.map +1 -1
- package/dist/components/tooltip.component.js +4 -2
- package/dist/components/tooltip.component.js.map +1 -1
- package/dist/esm/{floating-ui.dom.esm-82b72251.js → floating-ui.dom.esm-314a52b2.js} +19 -9
- package/dist/esm/floating-ui.dom.esm-314a52b2.js.map +1 -0
- package/dist/esm/{index-94339e77.js → index-2c1bdb40.js} +82 -34
- package/dist/esm/index-2c1bdb40.js.map +1 -0
- package/dist/esm/{index-340e085c.js → index-934ac6da.js} +65 -225
- package/dist/esm/index-934ac6da.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/p-accordion.entry.js +1 -1
- package/dist/esm/p-attachment.entry.js +1 -1
- package/dist/esm/p-avatar-group.entry.js +1 -1
- package/dist/esm/p-avatar.entry.js +1 -1
- package/dist/esm/p-backdrop.entry.js +2 -2
- package/dist/esm/p-backdrop.entry.js.map +1 -1
- package/dist/esm/p-button_3.entry.js +4 -4
- package/dist/esm/p-calendar.entry.js +8 -27
- package/dist/esm/p-calendar.entry.js.map +1 -1
- package/dist/esm/p-card-body.entry.js +1 -1
- package/dist/esm/p-card-container.entry.js +1 -1
- package/dist/esm/p-card-header.entry.js +1 -1
- package/dist/esm/p-content-slider.entry.js +1 -1
- package/dist/esm/p-counter.entry.js +1 -1
- package/dist/esm/p-datepicker.entry.js +433 -1474
- package/dist/esm/p-datepicker.entry.js.map +1 -1
- package/dist/esm/p-divider.entry.js +2 -2
- package/dist/esm/p-drawer-body_3.entry.js +1 -1
- package/dist/esm/p-drawer.entry.js +1 -1
- package/dist/esm/p-dropdown-menu-container.entry.js +2 -2
- package/dist/esm/p-dropdown-menu-container.entry.js.map +1 -1
- package/dist/esm/p-dropdown_2.entry.js +4 -4
- package/dist/esm/p-dropdown_2.entry.js.map +1 -1
- package/dist/esm/p-helper_3.entry.js +3 -3
- package/dist/esm/p-helper_3.entry.js.map +1 -1
- package/dist/esm/p-illustration_6.entry.js +6 -6
- package/dist/esm/p-illustration_6.entry.js.map +1 -1
- package/dist/esm/p-info-panel.entry.js +1 -1
- package/dist/esm/p-label_3.entry.js +4 -4
- package/dist/esm/p-label_3.entry.js.map +1 -1
- package/dist/esm/p-layout.entry.js +1 -1
- package/dist/esm/p-modal-body_4.entry.js +5 -5
- package/dist/esm/p-modal-body_4.entry.js.map +1 -1
- package/dist/esm/p-modal.entry.js +1 -1
- package/dist/esm/p-navbar.entry.js +1 -1
- package/dist/esm/p-navigation-item.entry.js +1 -1
- package/dist/esm/p-page-size-select_3.entry.js +3 -3
- package/dist/esm/p-page-size-select_3.entry.js.map +1 -1
- package/dist/esm/p-profile.entry.js +1 -1
- package/dist/esm/p-select.entry.js +1 -1
- package/dist/esm/p-slider-indicator.entry.js +1 -1
- package/dist/esm/p-status.entry.js +1 -1
- package/dist/esm/p-stepper-item.entry.js +1 -1
- package/dist/esm/p-stepper-line.entry.js +1 -1
- package/dist/esm/p-stepper.entry.js +1 -1
- package/dist/esm/p-tab-group.entry.js +1 -1
- package/dist/esm/p-tab-item.entry.js +1 -1
- package/dist/esm/p-table-column.entry.js +1 -1
- package/dist/esm/p-table-column.entry.js.map +1 -1
- package/dist/esm/p-table.entry.js +2 -2
- package/dist/esm/p-table.entry.js.map +1 -1
- package/dist/esm/p-toast-container.entry.js +1 -1
- package/dist/esm/p-toast.entry.js +1 -1
- package/dist/esm/p-tooltip.entry.js +6 -4
- package/dist/esm/p-tooltip.entry.js.map +1 -1
- package/dist/esm/paperless.js +3 -3
- package/dist/esm/paperless.js.map +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/p-04296717.entry.js +2 -0
- package/dist/{build/p-8fb43cc7.entry.js.map → paperless/p-04296717.entry.js.map} +1 -1
- package/dist/paperless/p-0e18b4ce.entry.js +2 -0
- package/dist/{build/p-ebd4ba56.entry.js.map → paperless/p-0e18b4ce.entry.js.map} +1 -1
- package/dist/{build/p-756c06ec.entry.js → paperless/p-1d6b036c.entry.js} +2 -2
- package/dist/paperless/{p-58b52568.entry.js → p-1f55126f.entry.js} +2 -2
- package/dist/{build/p-78948e08.entry.js → paperless/p-20cc75be.entry.js} +2 -2
- package/dist/paperless/{p-b7b1de31.entry.js → p-322be6d8.entry.js} +2 -2
- package/dist/paperless/{p-5d118f66.entry.js → p-33b6520e.entry.js} +2 -2
- package/dist/paperless/{p-f07793f6.entry.js → p-3bd4c1c1.entry.js} +2 -2
- package/dist/paperless/{p-0cb97c5e.entry.js → p-47e461b7.entry.js} +2 -2
- package/dist/paperless/{p-b13a0ee4.entry.js → p-49104ffe.entry.js} +2 -2
- package/dist/{build/p-ac7b48ff.entry.js → paperless/p-4b99a4fe.entry.js} +2 -2
- package/dist/paperless/{p-464569dc.entry.js → p-5e5f3eaa.entry.js} +2 -2
- package/dist/paperless/{p-464569dc.entry.js.map → p-5e5f3eaa.entry.js.map} +1 -1
- package/dist/paperless/{p-a2bd1a79.entry.js → p-6782f5df.entry.js} +2 -2
- package/dist/{build/p-a2bd1a79.entry.js.map → paperless/p-6782f5df.entry.js.map} +1 -1
- package/dist/paperless/{p-ea824ef3.entry.js → p-688264c9.entry.js} +2 -2
- package/dist/paperless/{p-c87da93e.entry.js → p-69b621a7.entry.js} +2 -2
- package/dist/paperless/{p-c87da93e.entry.js.map → p-69b621a7.entry.js.map} +1 -1
- package/dist/paperless/p-6ccf5cdd.js +3 -0
- package/dist/paperless/p-6ccf5cdd.js.map +1 -0
- package/dist/paperless/{p-ebc2ae62.entry.js → p-733a0d79.entry.js} +2 -2
- package/dist/paperless/{p-45dfd940.entry.js → p-7e26a901.entry.js} +2 -2
- package/dist/paperless/{p-cccc37c0.entry.js → p-81a99f72.entry.js} +2 -2
- package/dist/paperless/p-842f87c8.entry.js +2 -0
- package/dist/paperless/p-842f87c8.entry.js.map +1 -0
- package/dist/{build/p-6f82a1e7.entry.js → paperless/p-8569fa3c.entry.js} +2 -2
- package/dist/paperless/{p-036a82fc.entry.js → p-886a1eda.entry.js} +2 -2
- package/dist/paperless/p-886a1eda.entry.js.map +1 -0
- package/dist/paperless/{p-1b5292a3.entry.js → p-8f453ef2.entry.js} +2 -2
- package/dist/paperless/p-8fefda1f.entry.js +2 -0
- package/dist/paperless/{p-a3fcf8b6.entry.js.map → p-8fefda1f.entry.js.map} +1 -1
- package/dist/{build/p-f34ed23f.entry.js → paperless/p-97ddf9d4.entry.js} +2 -2
- package/dist/paperless/p-97ddf9d4.entry.js.map +1 -0
- package/dist/{build/p-57411b2b.entry.js → paperless/p-a0790d7b.entry.js} +2 -2
- package/dist/{build/p-5a31cb9e.entry.js → paperless/p-a751f1a4.entry.js} +2 -2
- package/dist/paperless/p-ae248aef.js +2 -0
- package/dist/paperless/p-ae248aef.js.map +1 -0
- package/dist/paperless/p-aefd84a3.entry.js +2 -0
- package/dist/paperless/{p-e3f29ba8.entry.js.map → p-aefd84a3.entry.js.map} +1 -1
- package/dist/paperless/{p-3d8b5cc4.entry.js → p-af38f227.entry.js} +2 -2
- package/dist/{build/p-93fb216c.entry.js → paperless/p-af92e53c.entry.js} +2 -2
- package/dist/paperless/p-b5234526.entry.js +2 -0
- package/dist/{build/p-d012d066.entry.js.map → paperless/p-b5234526.entry.js.map} +1 -1
- package/dist/paperless/{p-7b94bc6a.entry.js → p-b5b591c7.entry.js} +2 -2
- package/dist/{build/p-5236b565.entry.js → paperless/p-c6d9e720.entry.js} +2 -2
- package/dist/paperless/p-d24d95d2.entry.js +2 -0
- package/dist/paperless/{p-ef2eee59.entry.js.map → p-d24d95d2.entry.js.map} +1 -1
- package/dist/paperless/{p-31afbb45.entry.js → p-d2529f77.entry.js} +2 -2
- package/dist/paperless/{p-e0d7a4ee.entry.js → p-d51ede49.entry.js} +2 -2
- package/dist/paperless/p-dd9d3dd6.entry.js +2 -0
- package/dist/paperless/{p-b0eeab26.entry.js.map → p-dd9d3dd6.entry.js.map} +1 -1
- package/dist/paperless/{p-10ad607e.entry.js → p-e8a815d7.entry.js} +2 -2
- package/dist/paperless/{p-c6ef7b79.entry.js → p-f3207ec2.entry.js} +2 -2
- package/dist/paperless/{p-0a3f2fe8.entry.js → p-f429073e.entry.js} +2 -2
- package/dist/paperless/{p-dc01e9eb.entry.js → p-f59afce6.entry.js} +2 -2
- package/dist/{build/p-471be252.entry.js → paperless/p-f695dc3c.entry.js} +2 -2
- package/dist/paperless/{p-78ce77d2.entry.js → p-f9aaa75c.entry.js} +2 -2
- package/dist/paperless/p-fef32402.js +2 -0
- package/dist/paperless/p-fef32402.js.map +1 -0
- package/dist/paperless/paperless.css +1 -1
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/paperless/paperless.esm.js.map +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/types/components/helpers/table-column/table-column.component.d.ts +1 -1
- package/dist/types/components.d.ts +8 -2
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/dist/types/types/table.d.ts +7 -7
- package/hydrate/index.js +583 -1785
- package/package.json +6 -6
- package/dist/build/p-036a82fc.entry.js.map +0 -1
- package/dist/build/p-07c853db.entry.js +0 -2
- package/dist/build/p-07c853db.entry.js.map +0 -1
- package/dist/build/p-8fb43cc7.entry.js +0 -2
- package/dist/build/p-a3fcf8b6.entry.js +0 -2
- package/dist/build/p-ac1af618.js +0 -3
- package/dist/build/p-ac1af618.js.map +0 -1
- package/dist/build/p-b0eeab26.entry.js +0 -2
- package/dist/build/p-b273ac6d.js +0 -2
- package/dist/build/p-b273ac6d.js.map +0 -1
- package/dist/build/p-d012d066.entry.js +0 -2
- package/dist/build/p-e3f29ba8.entry.js +0 -2
- package/dist/build/p-e621e34c.js +0 -2
- package/dist/build/p-e621e34c.js.map +0 -1
- package/dist/build/p-ebd4ba56.entry.js +0 -2
- package/dist/build/p-ef2eee59.entry.js +0 -2
- package/dist/build/p-f34ed23f.entry.js.map +0 -1
- package/dist/cjs/index-040ec3f9.js.map +0 -1
- package/dist/cjs/index-13ea09e0.js.map +0 -1
- package/dist/esm/floating-ui.dom.esm-82b72251.js.map +0 -1
- package/dist/esm/index-340e085c.js.map +0 -1
- package/dist/esm/index-94339e77.js.map +0 -1
- package/dist/paperless/p-036a82fc.entry.js.map +0 -1
- package/dist/paperless/p-07c853db.entry.js +0 -2
- package/dist/paperless/p-07c853db.entry.js.map +0 -1
- package/dist/paperless/p-8fb43cc7.entry.js +0 -2
- package/dist/paperless/p-a3fcf8b6.entry.js +0 -2
- package/dist/paperless/p-ac1af618.js +0 -3
- package/dist/paperless/p-ac1af618.js.map +0 -1
- package/dist/paperless/p-b0eeab26.entry.js +0 -2
- package/dist/paperless/p-b273ac6d.js +0 -2
- package/dist/paperless/p-b273ac6d.js.map +0 -1
- package/dist/paperless/p-d012d066.entry.js +0 -2
- package/dist/paperless/p-e3f29ba8.entry.js +0 -2
- package/dist/paperless/p-e621e34c.js +0 -2
- package/dist/paperless/p-e621e34c.js.map +0 -1
- package/dist/paperless/p-ebd4ba56.entry.js +0 -2
- package/dist/paperless/p-ef2eee59.entry.js +0 -2
- package/dist/paperless/p-f34ed23f.entry.js.map +0 -1
- /package/dist/build/{p-756c06ec.entry.js.map → p-1d6b036c.entry.js.map} +0 -0
- /package/dist/build/{p-58b52568.entry.js.map → p-1f55126f.entry.js.map} +0 -0
- /package/dist/build/{p-78948e08.entry.js.map → p-20cc75be.entry.js.map} +0 -0
- /package/dist/build/{p-b7b1de31.entry.js.map → p-322be6d8.entry.js.map} +0 -0
- /package/dist/build/{p-5d118f66.entry.js.map → p-33b6520e.entry.js.map} +0 -0
- /package/dist/build/{p-f07793f6.entry.js.map → p-3bd4c1c1.entry.js.map} +0 -0
- /package/dist/build/{p-0cb97c5e.entry.js.map → p-47e461b7.entry.js.map} +0 -0
- /package/dist/build/{p-b13a0ee4.entry.js.map → p-49104ffe.entry.js.map} +0 -0
- /package/dist/build/{p-ac7b48ff.entry.js.map → p-4b99a4fe.entry.js.map} +0 -0
- /package/dist/build/{p-ea824ef3.entry.js.map → p-688264c9.entry.js.map} +0 -0
- /package/dist/build/{p-ebc2ae62.entry.js.map → p-733a0d79.entry.js.map} +0 -0
- /package/dist/build/{p-45dfd940.entry.js.map → p-7e26a901.entry.js.map} +0 -0
- /package/dist/build/{p-cccc37c0.entry.js.map → p-81a99f72.entry.js.map} +0 -0
- /package/dist/build/{p-6f82a1e7.entry.js.map → p-8569fa3c.entry.js.map} +0 -0
- /package/dist/build/{p-1b5292a3.entry.js.map → p-8f453ef2.entry.js.map} +0 -0
- /package/dist/build/{p-57411b2b.entry.js.map → p-a0790d7b.entry.js.map} +0 -0
- /package/dist/build/{p-5a31cb9e.entry.js.map → p-a751f1a4.entry.js.map} +0 -0
- /package/dist/build/{p-3d8b5cc4.entry.js.map → p-af38f227.entry.js.map} +0 -0
- /package/dist/build/{p-93fb216c.entry.js.map → p-af92e53c.entry.js.map} +0 -0
- /package/dist/build/{p-7b94bc6a.entry.js.map → p-b5b591c7.entry.js.map} +0 -0
- /package/dist/build/{p-5236b565.entry.js.map → p-c6d9e720.entry.js.map} +0 -0
- /package/dist/build/{p-31afbb45.entry.js.map → p-d2529f77.entry.js.map} +0 -0
- /package/dist/build/{p-e0d7a4ee.entry.js.map → p-d51ede49.entry.js.map} +0 -0
- /package/dist/build/{p-10ad607e.entry.js.map → p-e8a815d7.entry.js.map} +0 -0
- /package/dist/build/{p-c6ef7b79.entry.js.map → p-f3207ec2.entry.js.map} +0 -0
- /package/dist/build/{p-0a3f2fe8.entry.js.map → p-f429073e.entry.js.map} +0 -0
- /package/dist/build/{p-dc01e9eb.entry.js.map → p-f59afce6.entry.js.map} +0 -0
- /package/dist/build/{p-471be252.entry.js.map → p-f695dc3c.entry.js.map} +0 -0
- /package/dist/build/{p-78ce77d2.entry.js.map → p-f9aaa75c.entry.js.map} +0 -0
- /package/dist/paperless/{p-756c06ec.entry.js.map → p-1d6b036c.entry.js.map} +0 -0
- /package/dist/paperless/{p-58b52568.entry.js.map → p-1f55126f.entry.js.map} +0 -0
- /package/dist/paperless/{p-78948e08.entry.js.map → p-20cc75be.entry.js.map} +0 -0
- /package/dist/paperless/{p-b7b1de31.entry.js.map → p-322be6d8.entry.js.map} +0 -0
- /package/dist/paperless/{p-5d118f66.entry.js.map → p-33b6520e.entry.js.map} +0 -0
- /package/dist/paperless/{p-f07793f6.entry.js.map → p-3bd4c1c1.entry.js.map} +0 -0
- /package/dist/paperless/{p-0cb97c5e.entry.js.map → p-47e461b7.entry.js.map} +0 -0
- /package/dist/paperless/{p-b13a0ee4.entry.js.map → p-49104ffe.entry.js.map} +0 -0
- /package/dist/paperless/{p-ac7b48ff.entry.js.map → p-4b99a4fe.entry.js.map} +0 -0
- /package/dist/paperless/{p-ea824ef3.entry.js.map → p-688264c9.entry.js.map} +0 -0
- /package/dist/paperless/{p-ebc2ae62.entry.js.map → p-733a0d79.entry.js.map} +0 -0
- /package/dist/paperless/{p-45dfd940.entry.js.map → p-7e26a901.entry.js.map} +0 -0
- /package/dist/paperless/{p-cccc37c0.entry.js.map → p-81a99f72.entry.js.map} +0 -0
- /package/dist/paperless/{p-6f82a1e7.entry.js.map → p-8569fa3c.entry.js.map} +0 -0
- /package/dist/paperless/{p-1b5292a3.entry.js.map → p-8f453ef2.entry.js.map} +0 -0
- /package/dist/paperless/{p-57411b2b.entry.js.map → p-a0790d7b.entry.js.map} +0 -0
- /package/dist/paperless/{p-5a31cb9e.entry.js.map → p-a751f1a4.entry.js.map} +0 -0
- /package/dist/paperless/{p-3d8b5cc4.entry.js.map → p-af38f227.entry.js.map} +0 -0
- /package/dist/paperless/{p-93fb216c.entry.js.map → p-af92e53c.entry.js.map} +0 -0
- /package/dist/paperless/{p-7b94bc6a.entry.js.map → p-b5b591c7.entry.js.map} +0 -0
- /package/dist/paperless/{p-5236b565.entry.js.map → p-c6d9e720.entry.js.map} +0 -0
- /package/dist/paperless/{p-31afbb45.entry.js.map → p-d2529f77.entry.js.map} +0 -0
- /package/dist/paperless/{p-e0d7a4ee.entry.js.map → p-d51ede49.entry.js.map} +0 -0
- /package/dist/paperless/{p-10ad607e.entry.js.map → p-e8a815d7.entry.js.map} +0 -0
- /package/dist/paperless/{p-c6ef7b79.entry.js.map → p-f3207ec2.entry.js.map} +0 -0
- /package/dist/paperless/{p-0a3f2fe8.entry.js.map → p-f429073e.entry.js.map} +0 -0
- /package/dist/paperless/{p-dc01e9eb.entry.js.map → p-f59afce6.entry.js.map} +0 -0
- /package/dist/paperless/{p-471be252.entry.js.map → p-f695dc3c.entry.js.map} +0 -0
- /package/dist/paperless/{p-78ce77d2.entry.js.map → p-f9aaa75c.entry.js.map} +0 -0
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$1 } from './icon.component.js';
|
|
3
3
|
|
|
4
|
+
function _typeof(obj) {
|
|
5
|
+
"@babel/helpers - typeof";
|
|
6
|
+
|
|
7
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
8
|
+
return typeof obj;
|
|
9
|
+
} : function (obj) {
|
|
10
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
11
|
+
}, _typeof(obj);
|
|
12
|
+
}
|
|
13
|
+
|
|
4
14
|
function toInteger(dirtyNumber) {
|
|
5
15
|
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
6
16
|
return NaN;
|
|
7
17
|
}
|
|
8
|
-
|
|
9
18
|
var number = Number(dirtyNumber);
|
|
10
|
-
|
|
11
19
|
if (isNaN(number)) {
|
|
12
20
|
return number;
|
|
13
21
|
}
|
|
14
|
-
|
|
15
22
|
return number < 0 ? Math.ceil(number) : Math.floor(number);
|
|
16
23
|
}
|
|
17
24
|
|
|
@@ -21,7 +28,6 @@ function requiredArgs(required, args) {
|
|
|
21
28
|
}
|
|
22
29
|
}
|
|
23
30
|
|
|
24
|
-
function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
|
|
25
31
|
/**
|
|
26
32
|
* @name toDate
|
|
27
33
|
* @category Common Helpers
|
|
@@ -52,12 +58,12 @@ function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "func
|
|
|
52
58
|
* const result = toDate(1392098430000)
|
|
53
59
|
* //=> Tue Feb 11 2014 11:30:30
|
|
54
60
|
*/
|
|
55
|
-
|
|
56
61
|
function toDate(argument) {
|
|
57
62
|
requiredArgs(1, arguments);
|
|
58
|
-
var argStr = Object.prototype.toString.call(argument);
|
|
63
|
+
var argStr = Object.prototype.toString.call(argument);
|
|
59
64
|
|
|
60
|
-
|
|
65
|
+
// Clone the date
|
|
66
|
+
if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
|
|
61
67
|
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
|
62
68
|
return new Date(argument.getTime());
|
|
63
69
|
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
|
@@ -65,11 +71,10 @@ function toDate(argument) {
|
|
|
65
71
|
} else {
|
|
66
72
|
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
|
67
73
|
// eslint-disable-next-line no-console
|
|
68
|
-
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
|
|
69
|
-
|
|
74
|
+
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
|
|
75
|
+
// eslint-disable-next-line no-console
|
|
70
76
|
console.warn(new Error().stack);
|
|
71
77
|
}
|
|
72
|
-
|
|
73
78
|
return new Date(NaN);
|
|
74
79
|
}
|
|
75
80
|
}
|
|
@@ -92,21 +97,17 @@ function toDate(argument) {
|
|
|
92
97
|
* const result = addDays(new Date(2014, 8, 1), 10)
|
|
93
98
|
* //=> Thu Sep 11 2014 00:00:00
|
|
94
99
|
*/
|
|
95
|
-
|
|
96
100
|
function addDays(dirtyDate, dirtyAmount) {
|
|
97
101
|
requiredArgs(2, arguments);
|
|
98
102
|
var date = toDate(dirtyDate);
|
|
99
103
|
var amount = toInteger(dirtyAmount);
|
|
100
|
-
|
|
101
104
|
if (isNaN(amount)) {
|
|
102
105
|
return new Date(NaN);
|
|
103
106
|
}
|
|
104
|
-
|
|
105
107
|
if (!amount) {
|
|
106
108
|
// If 0 days, no-op to avoid changing times in the hour before end of DST
|
|
107
109
|
return date;
|
|
108
110
|
}
|
|
109
|
-
|
|
110
111
|
date.setDate(date.getDate() + amount);
|
|
111
112
|
return date;
|
|
112
113
|
}
|
|
@@ -129,22 +130,20 @@ function addDays(dirtyDate, dirtyAmount) {
|
|
|
129
130
|
* const result = addMonths(new Date(2014, 8, 1), 5)
|
|
130
131
|
* //=> Sun Feb 01 2015 00:00:00
|
|
131
132
|
*/
|
|
132
|
-
|
|
133
133
|
function addMonths(dirtyDate, dirtyAmount) {
|
|
134
134
|
requiredArgs(2, arguments);
|
|
135
135
|
var date = toDate(dirtyDate);
|
|
136
136
|
var amount = toInteger(dirtyAmount);
|
|
137
|
-
|
|
138
137
|
if (isNaN(amount)) {
|
|
139
138
|
return new Date(NaN);
|
|
140
139
|
}
|
|
141
|
-
|
|
142
140
|
if (!amount) {
|
|
143
141
|
// If 0 months, no-op to avoid changing times in the hour before end of DST
|
|
144
142
|
return date;
|
|
145
143
|
}
|
|
144
|
+
var dayOfMonth = date.getDate();
|
|
146
145
|
|
|
147
|
-
|
|
146
|
+
// The JS Date object supports date math by accepting out-of-bounds values for
|
|
148
147
|
// month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
|
|
149
148
|
// new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
|
|
150
149
|
// want except that dates will wrap around the end of a month, meaning that
|
|
@@ -152,11 +151,9 @@ function addMonths(dirtyDate, dirtyAmount) {
|
|
|
152
151
|
// we'll default to the end of the desired month by adding 1 to the desired
|
|
153
152
|
// month and using a date of 0 to back up one day to the end of the desired
|
|
154
153
|
// month.
|
|
155
|
-
|
|
156
154
|
var endOfDesiredMonth = new Date(date.getTime());
|
|
157
155
|
endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
|
|
158
156
|
var daysInMonth = endOfDesiredMonth.getDate();
|
|
159
|
-
|
|
160
157
|
if (dayOfMonth >= daysInMonth) {
|
|
161
158
|
// If we're already at the end of the month, then this is the correct date
|
|
162
159
|
// and we're done.
|
|
@@ -192,7 +189,6 @@ function addMonths(dirtyDate, dirtyAmount) {
|
|
|
192
189
|
* const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
|
|
193
190
|
* //=> Thu Jul 10 2014 12:45:30.750
|
|
194
191
|
*/
|
|
195
|
-
|
|
196
192
|
function addMilliseconds(dirtyDate, dirtyAmount) {
|
|
197
193
|
requiredArgs(2, arguments);
|
|
198
194
|
var timestamp = toDate(dirtyDate).getTime();
|
|
@@ -240,7 +236,6 @@ function getTimezoneOffsetInMilliseconds(date) {
|
|
|
240
236
|
* const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
|
|
241
237
|
* //=> Tue Sep 02 2014 00:00:00
|
|
242
238
|
*/
|
|
243
|
-
|
|
244
239
|
function startOfDay(dirtyDate) {
|
|
245
240
|
requiredArgs(1, arguments);
|
|
246
241
|
var date = toDate(dirtyDate);
|
|
@@ -266,7 +261,6 @@ function startOfDay(dirtyDate) {
|
|
|
266
261
|
* const result = addYears(new Date(2014, 8, 1), 5)
|
|
267
262
|
* //=> Sun Sep 01 2019 00:00:00
|
|
268
263
|
*/
|
|
269
|
-
|
|
270
264
|
function addYears(dirtyDate, dirtyAmount) {
|
|
271
265
|
requiredArgs(2, arguments);
|
|
272
266
|
var amount = toInteger(dirtyAmount);
|
|
@@ -301,7 +295,6 @@ function addYears(dirtyDate, dirtyAmount) {
|
|
|
301
295
|
* const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
|
|
302
296
|
* //=> false
|
|
303
297
|
*/
|
|
304
|
-
|
|
305
298
|
function isSameDay(dirtyDateLeft, dirtyDateRight) {
|
|
306
299
|
requiredArgs(2, arguments);
|
|
307
300
|
var dateLeftStartOfDay = startOfDay(dirtyDateLeft);
|
|
@@ -309,7 +302,6 @@ function isSameDay(dirtyDateLeft, dirtyDateRight) {
|
|
|
309
302
|
return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();
|
|
310
303
|
}
|
|
311
304
|
|
|
312
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
313
305
|
/**
|
|
314
306
|
* @name isDate
|
|
315
307
|
* @category Common Helpers
|
|
@@ -342,7 +334,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
342
334
|
* const result = isDate({})
|
|
343
335
|
* //=> false
|
|
344
336
|
*/
|
|
345
|
-
|
|
346
337
|
function isDate(value) {
|
|
347
338
|
requiredArgs(1, arguments);
|
|
348
339
|
return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
|
|
@@ -379,14 +370,11 @@ function isDate(value) {
|
|
|
379
370
|
* const result = isValid(new Date(''))
|
|
380
371
|
* //=> false
|
|
381
372
|
*/
|
|
382
|
-
|
|
383
373
|
function isValid(dirtyDate) {
|
|
384
374
|
requiredArgs(1, arguments);
|
|
385
|
-
|
|
386
375
|
if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
|
|
387
376
|
return false;
|
|
388
377
|
}
|
|
389
|
-
|
|
390
378
|
var date = toDate(dirtyDate);
|
|
391
379
|
return !isNaN(Number(date));
|
|
392
380
|
}
|
|
@@ -409,7 +397,6 @@ function isValid(dirtyDate) {
|
|
|
409
397
|
* const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
|
|
410
398
|
* //=> Tue Sep 30 2014 23:59:59.999
|
|
411
399
|
*/
|
|
412
|
-
|
|
413
400
|
function endOfMonth(dirtyDate) {
|
|
414
401
|
requiredArgs(1, arguments);
|
|
415
402
|
var date = toDate(dirtyDate);
|
|
@@ -437,7 +424,6 @@ function endOfMonth(dirtyDate) {
|
|
|
437
424
|
* const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
|
|
438
425
|
* //=> Mon Sep 01 2014 00:00:00
|
|
439
426
|
*/
|
|
440
|
-
|
|
441
427
|
function startOfMonth(dirtyDate) {
|
|
442
428
|
requiredArgs(1, arguments);
|
|
443
429
|
var date = toDate(dirtyDate);
|
|
@@ -464,7 +450,6 @@ function startOfMonth(dirtyDate) {
|
|
|
464
450
|
* const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
|
|
465
451
|
* //=> Thu Jul 10 2014 12:45:29.250
|
|
466
452
|
*/
|
|
467
|
-
|
|
468
453
|
function subMilliseconds(dirtyDate, dirtyAmount) {
|
|
469
454
|
requiredArgs(2, arguments);
|
|
470
455
|
var amount = toInteger(dirtyAmount);
|
|
@@ -506,7 +491,6 @@ function getUTCISOWeekYear(dirtyDate) {
|
|
|
506
491
|
fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
|
|
507
492
|
fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
|
|
508
493
|
var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
|
|
509
|
-
|
|
510
494
|
if (date.getTime() >= startOfNextYear.getTime()) {
|
|
511
495
|
return year + 1;
|
|
512
496
|
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
|
@@ -530,24 +514,24 @@ var MILLISECONDS_IN_WEEK$1 = 604800000;
|
|
|
530
514
|
function getUTCISOWeek(dirtyDate) {
|
|
531
515
|
requiredArgs(1, arguments);
|
|
532
516
|
var date = toDate(dirtyDate);
|
|
533
|
-
var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
|
|
517
|
+
var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
|
|
518
|
+
|
|
519
|
+
// Round the number of days to the nearest integer
|
|
534
520
|
// because the number of milliseconds in a week is not constant
|
|
535
521
|
// (e.g. it's different in the week of the daylight saving time clock shift)
|
|
536
|
-
|
|
537
522
|
return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
|
|
538
523
|
}
|
|
539
524
|
|
|
540
525
|
function startOfUTCWeek(dirtyDate, options) {
|
|
541
526
|
var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
542
|
-
|
|
543
527
|
requiredArgs(1, arguments);
|
|
544
528
|
var defaultOptions = getDefaultOptions();
|
|
545
|
-
var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
|
|
529
|
+
var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
|
|
546
530
|
|
|
531
|
+
// Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
547
532
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
548
533
|
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
|
549
534
|
}
|
|
550
|
-
|
|
551
535
|
var date = toDate(dirtyDate);
|
|
552
536
|
var day = date.getUTCDay();
|
|
553
537
|
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
@@ -558,17 +542,16 @@ function startOfUTCWeek(dirtyDate, options) {
|
|
|
558
542
|
|
|
559
543
|
function getUTCWeekYear(dirtyDate, options) {
|
|
560
544
|
var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
561
|
-
|
|
562
545
|
requiredArgs(1, arguments);
|
|
563
546
|
var date = toDate(dirtyDate);
|
|
564
547
|
var year = date.getUTCFullYear();
|
|
565
548
|
var defaultOptions = getDefaultOptions();
|
|
566
|
-
var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
|
|
549
|
+
var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
|
|
567
550
|
|
|
551
|
+
// Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
|
568
552
|
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
569
553
|
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
|
570
554
|
}
|
|
571
|
-
|
|
572
555
|
var firstWeekOfNextYear = new Date(0);
|
|
573
556
|
firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
|
|
574
557
|
firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
|
|
@@ -577,7 +560,6 @@ function getUTCWeekYear(dirtyDate, options) {
|
|
|
577
560
|
firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
|
|
578
561
|
firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
|
|
579
562
|
var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
|
|
580
|
-
|
|
581
563
|
if (date.getTime() >= startOfNextYear.getTime()) {
|
|
582
564
|
return year + 1;
|
|
583
565
|
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
|
@@ -589,7 +571,6 @@ function getUTCWeekYear(dirtyDate, options) {
|
|
|
589
571
|
|
|
590
572
|
function startOfUTCWeekYear(dirtyDate, options) {
|
|
591
573
|
var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
592
|
-
|
|
593
574
|
requiredArgs(1, arguments);
|
|
594
575
|
var defaultOptions = getDefaultOptions();
|
|
595
576
|
var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
|
|
@@ -605,21 +586,20 @@ var MILLISECONDS_IN_WEEK = 604800000;
|
|
|
605
586
|
function getUTCWeek(dirtyDate, options) {
|
|
606
587
|
requiredArgs(1, arguments);
|
|
607
588
|
var date = toDate(dirtyDate);
|
|
608
|
-
var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
|
|
589
|
+
var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
|
|
590
|
+
|
|
591
|
+
// Round the number of days to the nearest integer
|
|
609
592
|
// because the number of milliseconds in a week is not constant
|
|
610
593
|
// (e.g. it's different in the week of the daylight saving time clock shift)
|
|
611
|
-
|
|
612
594
|
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
|
|
613
595
|
}
|
|
614
596
|
|
|
615
597
|
function addLeadingZeros(number, targetLength) {
|
|
616
598
|
var sign = number < 0 ? '-' : '';
|
|
617
599
|
var output = Math.abs(number).toString();
|
|
618
|
-
|
|
619
600
|
while (output.length < targetLength) {
|
|
620
601
|
output = '0' + output;
|
|
621
602
|
}
|
|
622
|
-
|
|
623
603
|
return sign + output;
|
|
624
604
|
}
|
|
625
605
|
|
|
@@ -635,7 +615,6 @@ function addLeadingZeros(number, targetLength) {
|
|
|
635
615
|
*
|
|
636
616
|
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
637
617
|
*/
|
|
638
|
-
|
|
639
618
|
var formatters$1 = {
|
|
640
619
|
// Year
|
|
641
620
|
y: function y(date, token) {
|
|
@@ -647,8 +626,9 @@ var formatters$1 = {
|
|
|
647
626
|
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
|
648
627
|
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
|
649
628
|
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
|
650
|
-
var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
651
629
|
|
|
630
|
+
var signedYear = date.getUTCFullYear();
|
|
631
|
+
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
652
632
|
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
653
633
|
return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
|
|
654
634
|
},
|
|
@@ -664,18 +644,14 @@ var formatters$1 = {
|
|
|
664
644
|
// AM or PM
|
|
665
645
|
a: function a(date, token) {
|
|
666
646
|
var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
|
|
667
|
-
|
|
668
647
|
switch (token) {
|
|
669
648
|
case 'a':
|
|
670
649
|
case 'aa':
|
|
671
650
|
return dayPeriodEnumValue.toUpperCase();
|
|
672
|
-
|
|
673
651
|
case 'aaa':
|
|
674
652
|
return dayPeriodEnumValue;
|
|
675
|
-
|
|
676
653
|
case 'aaaaa':
|
|
677
654
|
return dayPeriodEnumValue[0];
|
|
678
|
-
|
|
679
655
|
case 'aaaa':
|
|
680
656
|
default:
|
|
681
657
|
return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
|
|
@@ -716,7 +692,6 @@ var dayPeriodEnum = {
|
|
|
716
692
|
evening: 'evening',
|
|
717
693
|
night: 'night'
|
|
718
694
|
};
|
|
719
|
-
|
|
720
695
|
/*
|
|
721
696
|
* | | Unit | | Unit |
|
|
722
697
|
* |-----|--------------------------------|-----|--------------------------------|
|
|
@@ -762,11 +737,11 @@ var dayPeriodEnum = {
|
|
|
762
737
|
* - `P` is long localized date format
|
|
763
738
|
* - `p` is long localized time format
|
|
764
739
|
*/
|
|
740
|
+
|
|
765
741
|
var formatters = {
|
|
766
742
|
// Era
|
|
767
743
|
G: function G(date, token, localize) {
|
|
768
744
|
var era = date.getUTCFullYear() > 0 ? 1 : 0;
|
|
769
|
-
|
|
770
745
|
switch (token) {
|
|
771
746
|
// AD, BC
|
|
772
747
|
case 'G':
|
|
@@ -776,13 +751,11 @@ var formatters = {
|
|
|
776
751
|
width: 'abbreviated'
|
|
777
752
|
});
|
|
778
753
|
// A, B
|
|
779
|
-
|
|
780
754
|
case 'GGGGG':
|
|
781
755
|
return localize.era(era, {
|
|
782
756
|
width: 'narrow'
|
|
783
757
|
});
|
|
784
758
|
// Anno Domini, Before Christ
|
|
785
|
-
|
|
786
759
|
case 'GGGG':
|
|
787
760
|
default:
|
|
788
761
|
return localize.era(era, {
|
|
@@ -794,41 +767,42 @@ var formatters = {
|
|
|
794
767
|
y: function y(date, token, localize) {
|
|
795
768
|
// Ordinal number
|
|
796
769
|
if (token === 'yo') {
|
|
797
|
-
var signedYear = date.getUTCFullYear();
|
|
798
|
-
|
|
770
|
+
var signedYear = date.getUTCFullYear();
|
|
771
|
+
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
799
772
|
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
800
773
|
return localize.ordinalNumber(year, {
|
|
801
774
|
unit: 'year'
|
|
802
775
|
});
|
|
803
776
|
}
|
|
804
|
-
|
|
805
777
|
return formatters$1.y(date, token);
|
|
806
778
|
},
|
|
807
779
|
// Local week-numbering year
|
|
808
780
|
Y: function Y(date, token, localize, options) {
|
|
809
|
-
var signedWeekYear = getUTCWeekYear(date, options);
|
|
810
|
-
|
|
811
|
-
var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
|
781
|
+
var signedWeekYear = getUTCWeekYear(date, options);
|
|
782
|
+
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
783
|
+
var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
|
812
784
|
|
|
785
|
+
// Two digit year
|
|
813
786
|
if (token === 'YY') {
|
|
814
787
|
var twoDigitYear = weekYear % 100;
|
|
815
788
|
return addLeadingZeros(twoDigitYear, 2);
|
|
816
|
-
}
|
|
817
|
-
|
|
789
|
+
}
|
|
818
790
|
|
|
791
|
+
// Ordinal number
|
|
819
792
|
if (token === 'Yo') {
|
|
820
793
|
return localize.ordinalNumber(weekYear, {
|
|
821
794
|
unit: 'year'
|
|
822
795
|
});
|
|
823
|
-
}
|
|
824
|
-
|
|
796
|
+
}
|
|
825
797
|
|
|
798
|
+
// Padding
|
|
826
799
|
return addLeadingZeros(weekYear, token.length);
|
|
827
800
|
},
|
|
828
801
|
// ISO week-numbering year
|
|
829
802
|
R: function R(date, token) {
|
|
830
|
-
var isoWeekYear = getUTCISOWeekYear(date);
|
|
803
|
+
var isoWeekYear = getUTCISOWeekYear(date);
|
|
831
804
|
|
|
805
|
+
// Padding
|
|
832
806
|
return addLeadingZeros(isoWeekYear, token.length);
|
|
833
807
|
},
|
|
834
808
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
@@ -847,37 +821,31 @@ var formatters = {
|
|
|
847
821
|
// Quarter
|
|
848
822
|
Q: function Q(date, token, localize) {
|
|
849
823
|
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
850
|
-
|
|
851
824
|
switch (token) {
|
|
852
825
|
// 1, 2, 3, 4
|
|
853
826
|
case 'Q':
|
|
854
827
|
return String(quarter);
|
|
855
828
|
// 01, 02, 03, 04
|
|
856
|
-
|
|
857
829
|
case 'QQ':
|
|
858
830
|
return addLeadingZeros(quarter, 2);
|
|
859
831
|
// 1st, 2nd, 3rd, 4th
|
|
860
|
-
|
|
861
832
|
case 'Qo':
|
|
862
833
|
return localize.ordinalNumber(quarter, {
|
|
863
834
|
unit: 'quarter'
|
|
864
835
|
});
|
|
865
836
|
// Q1, Q2, Q3, Q4
|
|
866
|
-
|
|
867
837
|
case 'QQQ':
|
|
868
838
|
return localize.quarter(quarter, {
|
|
869
839
|
width: 'abbreviated',
|
|
870
840
|
context: 'formatting'
|
|
871
841
|
});
|
|
872
842
|
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
873
|
-
|
|
874
843
|
case 'QQQQQ':
|
|
875
844
|
return localize.quarter(quarter, {
|
|
876
845
|
width: 'narrow',
|
|
877
846
|
context: 'formatting'
|
|
878
847
|
});
|
|
879
848
|
// 1st quarter, 2nd quarter, ...
|
|
880
|
-
|
|
881
849
|
case 'QQQQ':
|
|
882
850
|
default:
|
|
883
851
|
return localize.quarter(quarter, {
|
|
@@ -889,37 +857,31 @@ var formatters = {
|
|
|
889
857
|
// Stand-alone quarter
|
|
890
858
|
q: function q(date, token, localize) {
|
|
891
859
|
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
892
|
-
|
|
893
860
|
switch (token) {
|
|
894
861
|
// 1, 2, 3, 4
|
|
895
862
|
case 'q':
|
|
896
863
|
return String(quarter);
|
|
897
864
|
// 01, 02, 03, 04
|
|
898
|
-
|
|
899
865
|
case 'qq':
|
|
900
866
|
return addLeadingZeros(quarter, 2);
|
|
901
867
|
// 1st, 2nd, 3rd, 4th
|
|
902
|
-
|
|
903
868
|
case 'qo':
|
|
904
869
|
return localize.ordinalNumber(quarter, {
|
|
905
870
|
unit: 'quarter'
|
|
906
871
|
});
|
|
907
872
|
// Q1, Q2, Q3, Q4
|
|
908
|
-
|
|
909
873
|
case 'qqq':
|
|
910
874
|
return localize.quarter(quarter, {
|
|
911
875
|
width: 'abbreviated',
|
|
912
876
|
context: 'standalone'
|
|
913
877
|
});
|
|
914
878
|
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
915
|
-
|
|
916
879
|
case 'qqqqq':
|
|
917
880
|
return localize.quarter(quarter, {
|
|
918
881
|
width: 'narrow',
|
|
919
882
|
context: 'standalone'
|
|
920
883
|
});
|
|
921
884
|
// 1st quarter, 2nd quarter, ...
|
|
922
|
-
|
|
923
885
|
case 'qqqq':
|
|
924
886
|
default:
|
|
925
887
|
return localize.quarter(quarter, {
|
|
@@ -931,33 +893,28 @@ var formatters = {
|
|
|
931
893
|
// Month
|
|
932
894
|
M: function M(date, token, localize) {
|
|
933
895
|
var month = date.getUTCMonth();
|
|
934
|
-
|
|
935
896
|
switch (token) {
|
|
936
897
|
case 'M':
|
|
937
898
|
case 'MM':
|
|
938
899
|
return formatters$1.M(date, token);
|
|
939
900
|
// 1st, 2nd, ..., 12th
|
|
940
|
-
|
|
941
901
|
case 'Mo':
|
|
942
902
|
return localize.ordinalNumber(month + 1, {
|
|
943
903
|
unit: 'month'
|
|
944
904
|
});
|
|
945
905
|
// Jan, Feb, ..., Dec
|
|
946
|
-
|
|
947
906
|
case 'MMM':
|
|
948
907
|
return localize.month(month, {
|
|
949
908
|
width: 'abbreviated',
|
|
950
909
|
context: 'formatting'
|
|
951
910
|
});
|
|
952
911
|
// J, F, ..., D
|
|
953
|
-
|
|
954
912
|
case 'MMMMM':
|
|
955
913
|
return localize.month(month, {
|
|
956
914
|
width: 'narrow',
|
|
957
915
|
context: 'formatting'
|
|
958
916
|
});
|
|
959
917
|
// January, February, ..., December
|
|
960
|
-
|
|
961
918
|
case 'MMMM':
|
|
962
919
|
default:
|
|
963
920
|
return localize.month(month, {
|
|
@@ -969,37 +926,31 @@ var formatters = {
|
|
|
969
926
|
// Stand-alone month
|
|
970
927
|
L: function L(date, token, localize) {
|
|
971
928
|
var month = date.getUTCMonth();
|
|
972
|
-
|
|
973
929
|
switch (token) {
|
|
974
930
|
// 1, 2, ..., 12
|
|
975
931
|
case 'L':
|
|
976
932
|
return String(month + 1);
|
|
977
933
|
// 01, 02, ..., 12
|
|
978
|
-
|
|
979
934
|
case 'LL':
|
|
980
935
|
return addLeadingZeros(month + 1, 2);
|
|
981
936
|
// 1st, 2nd, ..., 12th
|
|
982
|
-
|
|
983
937
|
case 'Lo':
|
|
984
938
|
return localize.ordinalNumber(month + 1, {
|
|
985
939
|
unit: 'month'
|
|
986
940
|
});
|
|
987
941
|
// Jan, Feb, ..., Dec
|
|
988
|
-
|
|
989
942
|
case 'LLL':
|
|
990
943
|
return localize.month(month, {
|
|
991
944
|
width: 'abbreviated',
|
|
992
945
|
context: 'standalone'
|
|
993
946
|
});
|
|
994
947
|
// J, F, ..., D
|
|
995
|
-
|
|
996
948
|
case 'LLLLL':
|
|
997
949
|
return localize.month(month, {
|
|
998
950
|
width: 'narrow',
|
|
999
951
|
context: 'standalone'
|
|
1000
952
|
});
|
|
1001
953
|
// January, February, ..., December
|
|
1002
|
-
|
|
1003
954
|
case 'LLLL':
|
|
1004
955
|
default:
|
|
1005
956
|
return localize.month(month, {
|
|
@@ -1011,25 +962,21 @@ var formatters = {
|
|
|
1011
962
|
// Local week of year
|
|
1012
963
|
w: function w(date, token, localize, options) {
|
|
1013
964
|
var week = getUTCWeek(date, options);
|
|
1014
|
-
|
|
1015
965
|
if (token === 'wo') {
|
|
1016
966
|
return localize.ordinalNumber(week, {
|
|
1017
967
|
unit: 'week'
|
|
1018
968
|
});
|
|
1019
969
|
}
|
|
1020
|
-
|
|
1021
970
|
return addLeadingZeros(week, token.length);
|
|
1022
971
|
},
|
|
1023
972
|
// ISO week of year
|
|
1024
973
|
I: function I(date, token, localize) {
|
|
1025
974
|
var isoWeek = getUTCISOWeek(date);
|
|
1026
|
-
|
|
1027
975
|
if (token === 'Io') {
|
|
1028
976
|
return localize.ordinalNumber(isoWeek, {
|
|
1029
977
|
unit: 'week'
|
|
1030
978
|
});
|
|
1031
979
|
}
|
|
1032
|
-
|
|
1033
980
|
return addLeadingZeros(isoWeek, token.length);
|
|
1034
981
|
},
|
|
1035
982
|
// Day of the month
|
|
@@ -1039,25 +986,21 @@ var formatters = {
|
|
|
1039
986
|
unit: 'date'
|
|
1040
987
|
});
|
|
1041
988
|
}
|
|
1042
|
-
|
|
1043
989
|
return formatters$1.d(date, token);
|
|
1044
990
|
},
|
|
1045
991
|
// Day of year
|
|
1046
992
|
D: function D(date, token, localize) {
|
|
1047
993
|
var dayOfYear = getUTCDayOfYear(date);
|
|
1048
|
-
|
|
1049
994
|
if (token === 'Do') {
|
|
1050
995
|
return localize.ordinalNumber(dayOfYear, {
|
|
1051
996
|
unit: 'dayOfYear'
|
|
1052
997
|
});
|
|
1053
998
|
}
|
|
1054
|
-
|
|
1055
999
|
return addLeadingZeros(dayOfYear, token.length);
|
|
1056
1000
|
},
|
|
1057
1001
|
// Day of week
|
|
1058
1002
|
E: function E(date, token, localize) {
|
|
1059
1003
|
var dayOfWeek = date.getUTCDay();
|
|
1060
|
-
|
|
1061
1004
|
switch (token) {
|
|
1062
1005
|
// Tue
|
|
1063
1006
|
case 'E':
|
|
@@ -1068,21 +1011,18 @@ var formatters = {
|
|
|
1068
1011
|
context: 'formatting'
|
|
1069
1012
|
});
|
|
1070
1013
|
// T
|
|
1071
|
-
|
|
1072
1014
|
case 'EEEEE':
|
|
1073
1015
|
return localize.day(dayOfWeek, {
|
|
1074
1016
|
width: 'narrow',
|
|
1075
1017
|
context: 'formatting'
|
|
1076
1018
|
});
|
|
1077
1019
|
// Tu
|
|
1078
|
-
|
|
1079
1020
|
case 'EEEEEE':
|
|
1080
1021
|
return localize.day(dayOfWeek, {
|
|
1081
1022
|
width: 'short',
|
|
1082
1023
|
context: 'formatting'
|
|
1083
1024
|
});
|
|
1084
1025
|
// Tuesday
|
|
1085
|
-
|
|
1086
1026
|
case 'EEEE':
|
|
1087
1027
|
default:
|
|
1088
1028
|
return localize.day(dayOfWeek, {
|
|
@@ -1095,43 +1035,36 @@ var formatters = {
|
|
|
1095
1035
|
e: function e(date, token, localize, options) {
|
|
1096
1036
|
var dayOfWeek = date.getUTCDay();
|
|
1097
1037
|
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
1098
|
-
|
|
1099
1038
|
switch (token) {
|
|
1100
1039
|
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
1101
1040
|
case 'e':
|
|
1102
1041
|
return String(localDayOfWeek);
|
|
1103
1042
|
// Padded numerical value
|
|
1104
|
-
|
|
1105
1043
|
case 'ee':
|
|
1106
1044
|
return addLeadingZeros(localDayOfWeek, 2);
|
|
1107
1045
|
// 1st, 2nd, ..., 7th
|
|
1108
|
-
|
|
1109
1046
|
case 'eo':
|
|
1110
1047
|
return localize.ordinalNumber(localDayOfWeek, {
|
|
1111
1048
|
unit: 'day'
|
|
1112
1049
|
});
|
|
1113
|
-
|
|
1114
1050
|
case 'eee':
|
|
1115
1051
|
return localize.day(dayOfWeek, {
|
|
1116
1052
|
width: 'abbreviated',
|
|
1117
1053
|
context: 'formatting'
|
|
1118
1054
|
});
|
|
1119
1055
|
// T
|
|
1120
|
-
|
|
1121
1056
|
case 'eeeee':
|
|
1122
1057
|
return localize.day(dayOfWeek, {
|
|
1123
1058
|
width: 'narrow',
|
|
1124
1059
|
context: 'formatting'
|
|
1125
1060
|
});
|
|
1126
1061
|
// Tu
|
|
1127
|
-
|
|
1128
1062
|
case 'eeeeee':
|
|
1129
1063
|
return localize.day(dayOfWeek, {
|
|
1130
1064
|
width: 'short',
|
|
1131
1065
|
context: 'formatting'
|
|
1132
1066
|
});
|
|
1133
1067
|
// Tuesday
|
|
1134
|
-
|
|
1135
1068
|
case 'eeee':
|
|
1136
1069
|
default:
|
|
1137
1070
|
return localize.day(dayOfWeek, {
|
|
@@ -1144,43 +1077,36 @@ var formatters = {
|
|
|
1144
1077
|
c: function c(date, token, localize, options) {
|
|
1145
1078
|
var dayOfWeek = date.getUTCDay();
|
|
1146
1079
|
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
1147
|
-
|
|
1148
1080
|
switch (token) {
|
|
1149
1081
|
// Numerical value (same as in `e`)
|
|
1150
1082
|
case 'c':
|
|
1151
1083
|
return String(localDayOfWeek);
|
|
1152
1084
|
// Padded numerical value
|
|
1153
|
-
|
|
1154
1085
|
case 'cc':
|
|
1155
1086
|
return addLeadingZeros(localDayOfWeek, token.length);
|
|
1156
1087
|
// 1st, 2nd, ..., 7th
|
|
1157
|
-
|
|
1158
1088
|
case 'co':
|
|
1159
1089
|
return localize.ordinalNumber(localDayOfWeek, {
|
|
1160
1090
|
unit: 'day'
|
|
1161
1091
|
});
|
|
1162
|
-
|
|
1163
1092
|
case 'ccc':
|
|
1164
1093
|
return localize.day(dayOfWeek, {
|
|
1165
1094
|
width: 'abbreviated',
|
|
1166
1095
|
context: 'standalone'
|
|
1167
1096
|
});
|
|
1168
1097
|
// T
|
|
1169
|
-
|
|
1170
1098
|
case 'ccccc':
|
|
1171
1099
|
return localize.day(dayOfWeek, {
|
|
1172
1100
|
width: 'narrow',
|
|
1173
1101
|
context: 'standalone'
|
|
1174
1102
|
});
|
|
1175
1103
|
// Tu
|
|
1176
|
-
|
|
1177
1104
|
case 'cccccc':
|
|
1178
1105
|
return localize.day(dayOfWeek, {
|
|
1179
1106
|
width: 'short',
|
|
1180
1107
|
context: 'standalone'
|
|
1181
1108
|
});
|
|
1182
1109
|
// Tuesday
|
|
1183
|
-
|
|
1184
1110
|
case 'cccc':
|
|
1185
1111
|
default:
|
|
1186
1112
|
return localize.day(dayOfWeek, {
|
|
@@ -1193,44 +1119,37 @@ var formatters = {
|
|
|
1193
1119
|
i: function i(date, token, localize) {
|
|
1194
1120
|
var dayOfWeek = date.getUTCDay();
|
|
1195
1121
|
var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
|
1196
|
-
|
|
1197
1122
|
switch (token) {
|
|
1198
1123
|
// 2
|
|
1199
1124
|
case 'i':
|
|
1200
1125
|
return String(isoDayOfWeek);
|
|
1201
1126
|
// 02
|
|
1202
|
-
|
|
1203
1127
|
case 'ii':
|
|
1204
1128
|
return addLeadingZeros(isoDayOfWeek, token.length);
|
|
1205
1129
|
// 2nd
|
|
1206
|
-
|
|
1207
1130
|
case 'io':
|
|
1208
1131
|
return localize.ordinalNumber(isoDayOfWeek, {
|
|
1209
1132
|
unit: 'day'
|
|
1210
1133
|
});
|
|
1211
1134
|
// Tue
|
|
1212
|
-
|
|
1213
1135
|
case 'iii':
|
|
1214
1136
|
return localize.day(dayOfWeek, {
|
|
1215
1137
|
width: 'abbreviated',
|
|
1216
1138
|
context: 'formatting'
|
|
1217
1139
|
});
|
|
1218
1140
|
// T
|
|
1219
|
-
|
|
1220
1141
|
case 'iiiii':
|
|
1221
1142
|
return localize.day(dayOfWeek, {
|
|
1222
1143
|
width: 'narrow',
|
|
1223
1144
|
context: 'formatting'
|
|
1224
1145
|
});
|
|
1225
1146
|
// Tu
|
|
1226
|
-
|
|
1227
1147
|
case 'iiiiii':
|
|
1228
1148
|
return localize.day(dayOfWeek, {
|
|
1229
1149
|
width: 'short',
|
|
1230
1150
|
context: 'formatting'
|
|
1231
1151
|
});
|
|
1232
1152
|
// Tuesday
|
|
1233
|
-
|
|
1234
1153
|
case 'iiii':
|
|
1235
1154
|
default:
|
|
1236
1155
|
return localize.day(dayOfWeek, {
|
|
@@ -1243,7 +1162,6 @@ var formatters = {
|
|
|
1243
1162
|
a: function a(date, token, localize) {
|
|
1244
1163
|
var hours = date.getUTCHours();
|
|
1245
1164
|
var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
|
|
1246
|
-
|
|
1247
1165
|
switch (token) {
|
|
1248
1166
|
case 'a':
|
|
1249
1167
|
case 'aa':
|
|
@@ -1251,19 +1169,16 @@ var formatters = {
|
|
|
1251
1169
|
width: 'abbreviated',
|
|
1252
1170
|
context: 'formatting'
|
|
1253
1171
|
});
|
|
1254
|
-
|
|
1255
1172
|
case 'aaa':
|
|
1256
1173
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
1257
1174
|
width: 'abbreviated',
|
|
1258
1175
|
context: 'formatting'
|
|
1259
1176
|
}).toLowerCase();
|
|
1260
|
-
|
|
1261
1177
|
case 'aaaaa':
|
|
1262
1178
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
1263
1179
|
width: 'narrow',
|
|
1264
1180
|
context: 'formatting'
|
|
1265
1181
|
});
|
|
1266
|
-
|
|
1267
1182
|
case 'aaaa':
|
|
1268
1183
|
default:
|
|
1269
1184
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
@@ -1276,7 +1191,6 @@ var formatters = {
|
|
|
1276
1191
|
b: function b(date, token, localize) {
|
|
1277
1192
|
var hours = date.getUTCHours();
|
|
1278
1193
|
var dayPeriodEnumValue;
|
|
1279
|
-
|
|
1280
1194
|
if (hours === 12) {
|
|
1281
1195
|
dayPeriodEnumValue = dayPeriodEnum.noon;
|
|
1282
1196
|
} else if (hours === 0) {
|
|
@@ -1284,7 +1198,6 @@ var formatters = {
|
|
|
1284
1198
|
} else {
|
|
1285
1199
|
dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
|
|
1286
1200
|
}
|
|
1287
|
-
|
|
1288
1201
|
switch (token) {
|
|
1289
1202
|
case 'b':
|
|
1290
1203
|
case 'bb':
|
|
@@ -1292,19 +1205,16 @@ var formatters = {
|
|
|
1292
1205
|
width: 'abbreviated',
|
|
1293
1206
|
context: 'formatting'
|
|
1294
1207
|
});
|
|
1295
|
-
|
|
1296
1208
|
case 'bbb':
|
|
1297
1209
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
1298
1210
|
width: 'abbreviated',
|
|
1299
1211
|
context: 'formatting'
|
|
1300
1212
|
}).toLowerCase();
|
|
1301
|
-
|
|
1302
1213
|
case 'bbbbb':
|
|
1303
1214
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
1304
1215
|
width: 'narrow',
|
|
1305
1216
|
context: 'formatting'
|
|
1306
1217
|
});
|
|
1307
|
-
|
|
1308
1218
|
case 'bbbb':
|
|
1309
1219
|
default:
|
|
1310
1220
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
@@ -1317,7 +1227,6 @@ var formatters = {
|
|
|
1317
1227
|
B: function B(date, token, localize) {
|
|
1318
1228
|
var hours = date.getUTCHours();
|
|
1319
1229
|
var dayPeriodEnumValue;
|
|
1320
|
-
|
|
1321
1230
|
if (hours >= 17) {
|
|
1322
1231
|
dayPeriodEnumValue = dayPeriodEnum.evening;
|
|
1323
1232
|
} else if (hours >= 12) {
|
|
@@ -1327,7 +1236,6 @@ var formatters = {
|
|
|
1327
1236
|
} else {
|
|
1328
1237
|
dayPeriodEnumValue = dayPeriodEnum.night;
|
|
1329
1238
|
}
|
|
1330
|
-
|
|
1331
1239
|
switch (token) {
|
|
1332
1240
|
case 'B':
|
|
1333
1241
|
case 'BB':
|
|
@@ -1336,13 +1244,11 @@ var formatters = {
|
|
|
1336
1244
|
width: 'abbreviated',
|
|
1337
1245
|
context: 'formatting'
|
|
1338
1246
|
});
|
|
1339
|
-
|
|
1340
1247
|
case 'BBBBB':
|
|
1341
1248
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
1342
1249
|
width: 'narrow',
|
|
1343
1250
|
context: 'formatting'
|
|
1344
1251
|
});
|
|
1345
|
-
|
|
1346
1252
|
case 'BBBB':
|
|
1347
1253
|
default:
|
|
1348
1254
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
@@ -1360,7 +1266,6 @@ var formatters = {
|
|
|
1360
1266
|
unit: 'hour'
|
|
1361
1267
|
});
|
|
1362
1268
|
}
|
|
1363
|
-
|
|
1364
1269
|
return formatters$1.h(date, token);
|
|
1365
1270
|
},
|
|
1366
1271
|
// Hour [0-23]
|
|
@@ -1370,32 +1275,27 @@ var formatters = {
|
|
|
1370
1275
|
unit: 'hour'
|
|
1371
1276
|
});
|
|
1372
1277
|
}
|
|
1373
|
-
|
|
1374
1278
|
return formatters$1.H(date, token);
|
|
1375
1279
|
},
|
|
1376
1280
|
// Hour [0-11]
|
|
1377
1281
|
K: function K(date, token, localize) {
|
|
1378
1282
|
var hours = date.getUTCHours() % 12;
|
|
1379
|
-
|
|
1380
1283
|
if (token === 'Ko') {
|
|
1381
1284
|
return localize.ordinalNumber(hours, {
|
|
1382
1285
|
unit: 'hour'
|
|
1383
1286
|
});
|
|
1384
1287
|
}
|
|
1385
|
-
|
|
1386
1288
|
return addLeadingZeros(hours, token.length);
|
|
1387
1289
|
},
|
|
1388
1290
|
// Hour [1-24]
|
|
1389
1291
|
k: function k(date, token, localize) {
|
|
1390
1292
|
var hours = date.getUTCHours();
|
|
1391
1293
|
if (hours === 0) hours = 24;
|
|
1392
|
-
|
|
1393
1294
|
if (token === 'ko') {
|
|
1394
1295
|
return localize.ordinalNumber(hours, {
|
|
1395
1296
|
unit: 'hour'
|
|
1396
1297
|
});
|
|
1397
1298
|
}
|
|
1398
|
-
|
|
1399
1299
|
return addLeadingZeros(hours, token.length);
|
|
1400
1300
|
},
|
|
1401
1301
|
// Minute
|
|
@@ -1405,7 +1305,6 @@ var formatters = {
|
|
|
1405
1305
|
unit: 'minute'
|
|
1406
1306
|
});
|
|
1407
1307
|
}
|
|
1408
|
-
|
|
1409
1308
|
return formatters$1.m(date, token);
|
|
1410
1309
|
},
|
|
1411
1310
|
// Second
|
|
@@ -1415,7 +1314,6 @@ var formatters = {
|
|
|
1415
1314
|
unit: 'second'
|
|
1416
1315
|
});
|
|
1417
1316
|
}
|
|
1418
|
-
|
|
1419
1317
|
return formatters$1.s(date, token);
|
|
1420
1318
|
},
|
|
1421
1319
|
// Fraction of second
|
|
@@ -1426,30 +1324,27 @@ var formatters = {
|
|
|
1426
1324
|
X: function X(date, token, _localize, options) {
|
|
1427
1325
|
var originalDate = options._originalDate || date;
|
|
1428
1326
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1429
|
-
|
|
1430
1327
|
if (timezoneOffset === 0) {
|
|
1431
1328
|
return 'Z';
|
|
1432
1329
|
}
|
|
1433
|
-
|
|
1434
1330
|
switch (token) {
|
|
1435
1331
|
// Hours and optional minutes
|
|
1436
1332
|
case 'X':
|
|
1437
1333
|
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
1334
|
+
|
|
1438
1335
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1439
1336
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1440
1337
|
// so this token always has the same output as `XX`
|
|
1441
|
-
|
|
1442
1338
|
case 'XXXX':
|
|
1443
1339
|
case 'XX':
|
|
1444
1340
|
// Hours and minutes without `:` delimiter
|
|
1445
1341
|
return formatTimezone(timezoneOffset);
|
|
1342
|
+
|
|
1446
1343
|
// Hours, minutes and optional seconds with `:` delimiter
|
|
1447
1344
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1448
1345
|
// so this token always has the same output as `XXX`
|
|
1449
|
-
|
|
1450
1346
|
case 'XXXXX':
|
|
1451
1347
|
case 'XXX': // Hours and minutes with `:` delimiter
|
|
1452
|
-
|
|
1453
1348
|
default:
|
|
1454
1349
|
return formatTimezone(timezoneOffset, ':');
|
|
1455
1350
|
}
|
|
@@ -1458,26 +1353,24 @@ var formatters = {
|
|
|
1458
1353
|
x: function x(date, token, _localize, options) {
|
|
1459
1354
|
var originalDate = options._originalDate || date;
|
|
1460
1355
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1461
|
-
|
|
1462
1356
|
switch (token) {
|
|
1463
1357
|
// Hours and optional minutes
|
|
1464
1358
|
case 'x':
|
|
1465
1359
|
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
1360
|
+
|
|
1466
1361
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1467
1362
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1468
1363
|
// so this token always has the same output as `xx`
|
|
1469
|
-
|
|
1470
1364
|
case 'xxxx':
|
|
1471
1365
|
case 'xx':
|
|
1472
1366
|
// Hours and minutes without `:` delimiter
|
|
1473
1367
|
return formatTimezone(timezoneOffset);
|
|
1368
|
+
|
|
1474
1369
|
// Hours, minutes and optional seconds with `:` delimiter
|
|
1475
1370
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1476
1371
|
// so this token always has the same output as `xxx`
|
|
1477
|
-
|
|
1478
1372
|
case 'xxxxx':
|
|
1479
1373
|
case 'xxx': // Hours and minutes with `:` delimiter
|
|
1480
|
-
|
|
1481
1374
|
default:
|
|
1482
1375
|
return formatTimezone(timezoneOffset, ':');
|
|
1483
1376
|
}
|
|
@@ -1486,7 +1379,6 @@ var formatters = {
|
|
|
1486
1379
|
O: function O(date, token, _localize, options) {
|
|
1487
1380
|
var originalDate = options._originalDate || date;
|
|
1488
1381
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1489
|
-
|
|
1490
1382
|
switch (token) {
|
|
1491
1383
|
// Short
|
|
1492
1384
|
case 'O':
|
|
@@ -1494,7 +1386,6 @@ var formatters = {
|
|
|
1494
1386
|
case 'OOO':
|
|
1495
1387
|
return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
|
|
1496
1388
|
// Long
|
|
1497
|
-
|
|
1498
1389
|
case 'OOOO':
|
|
1499
1390
|
default:
|
|
1500
1391
|
return 'GMT' + formatTimezone(timezoneOffset, ':');
|
|
@@ -1504,7 +1395,6 @@ var formatters = {
|
|
|
1504
1395
|
z: function z(date, token, _localize, options) {
|
|
1505
1396
|
var originalDate = options._originalDate || date;
|
|
1506
1397
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1507
|
-
|
|
1508
1398
|
switch (token) {
|
|
1509
1399
|
// Short
|
|
1510
1400
|
case 'z':
|
|
@@ -1512,7 +1402,6 @@ var formatters = {
|
|
|
1512
1402
|
case 'zzz':
|
|
1513
1403
|
return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
|
|
1514
1404
|
// Long
|
|
1515
|
-
|
|
1516
1405
|
case 'zzzz':
|
|
1517
1406
|
default:
|
|
1518
1407
|
return 'GMT' + formatTimezone(timezoneOffset, ':');
|
|
@@ -1531,30 +1420,24 @@ var formatters = {
|
|
|
1531
1420
|
return addLeadingZeros(timestamp, token.length);
|
|
1532
1421
|
}
|
|
1533
1422
|
};
|
|
1534
|
-
|
|
1535
1423
|
function formatTimezoneShort(offset, dirtyDelimiter) {
|
|
1536
1424
|
var sign = offset > 0 ? '-' : '+';
|
|
1537
1425
|
var absOffset = Math.abs(offset);
|
|
1538
1426
|
var hours = Math.floor(absOffset / 60);
|
|
1539
1427
|
var minutes = absOffset % 60;
|
|
1540
|
-
|
|
1541
1428
|
if (minutes === 0) {
|
|
1542
1429
|
return sign + String(hours);
|
|
1543
1430
|
}
|
|
1544
|
-
|
|
1545
1431
|
var delimiter = dirtyDelimiter || '';
|
|
1546
1432
|
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
|
|
1547
1433
|
}
|
|
1548
|
-
|
|
1549
1434
|
function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
|
|
1550
1435
|
if (offset % 60 === 0) {
|
|
1551
1436
|
var sign = offset > 0 ? '-' : '+';
|
|
1552
1437
|
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
|
|
1553
1438
|
}
|
|
1554
|
-
|
|
1555
1439
|
return formatTimezone(offset, dirtyDelimiter);
|
|
1556
1440
|
}
|
|
1557
|
-
|
|
1558
1441
|
function formatTimezone(offset, dirtyDelimiter) {
|
|
1559
1442
|
var delimiter = dirtyDelimiter || '';
|
|
1560
1443
|
var sign = offset > 0 ? '-' : '+';
|
|
@@ -1570,17 +1453,14 @@ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
|
|
|
1570
1453
|
return formatLong.date({
|
|
1571
1454
|
width: 'short'
|
|
1572
1455
|
});
|
|
1573
|
-
|
|
1574
1456
|
case 'PP':
|
|
1575
1457
|
return formatLong.date({
|
|
1576
1458
|
width: 'medium'
|
|
1577
1459
|
});
|
|
1578
|
-
|
|
1579
1460
|
case 'PPP':
|
|
1580
1461
|
return formatLong.date({
|
|
1581
1462
|
width: 'long'
|
|
1582
1463
|
});
|
|
1583
|
-
|
|
1584
1464
|
case 'PPPP':
|
|
1585
1465
|
default:
|
|
1586
1466
|
return formatLong.date({
|
|
@@ -1588,24 +1468,20 @@ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
|
|
|
1588
1468
|
});
|
|
1589
1469
|
}
|
|
1590
1470
|
};
|
|
1591
|
-
|
|
1592
1471
|
var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
|
|
1593
1472
|
switch (pattern) {
|
|
1594
1473
|
case 'p':
|
|
1595
1474
|
return formatLong.time({
|
|
1596
1475
|
width: 'short'
|
|
1597
1476
|
});
|
|
1598
|
-
|
|
1599
1477
|
case 'pp':
|
|
1600
1478
|
return formatLong.time({
|
|
1601
1479
|
width: 'medium'
|
|
1602
1480
|
});
|
|
1603
|
-
|
|
1604
1481
|
case 'ppp':
|
|
1605
1482
|
return formatLong.time({
|
|
1606
1483
|
width: 'long'
|
|
1607
1484
|
});
|
|
1608
|
-
|
|
1609
1485
|
case 'pppp':
|
|
1610
1486
|
default:
|
|
1611
1487
|
return formatLong.time({
|
|
@@ -1613,37 +1489,30 @@ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
|
|
|
1613
1489
|
});
|
|
1614
1490
|
}
|
|
1615
1491
|
};
|
|
1616
|
-
|
|
1617
1492
|
var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
|
|
1618
1493
|
var matchResult = pattern.match(/(P+)(p+)?/) || [];
|
|
1619
1494
|
var datePattern = matchResult[1];
|
|
1620
1495
|
var timePattern = matchResult[2];
|
|
1621
|
-
|
|
1622
1496
|
if (!timePattern) {
|
|
1623
1497
|
return dateLongFormatter(pattern, formatLong);
|
|
1624
1498
|
}
|
|
1625
|
-
|
|
1626
1499
|
var dateTimeFormat;
|
|
1627
|
-
|
|
1628
1500
|
switch (datePattern) {
|
|
1629
1501
|
case 'P':
|
|
1630
1502
|
dateTimeFormat = formatLong.dateTime({
|
|
1631
1503
|
width: 'short'
|
|
1632
1504
|
});
|
|
1633
1505
|
break;
|
|
1634
|
-
|
|
1635
1506
|
case 'PP':
|
|
1636
1507
|
dateTimeFormat = formatLong.dateTime({
|
|
1637
1508
|
width: 'medium'
|
|
1638
1509
|
});
|
|
1639
1510
|
break;
|
|
1640
|
-
|
|
1641
1511
|
case 'PPP':
|
|
1642
1512
|
dateTimeFormat = formatLong.dateTime({
|
|
1643
1513
|
width: 'long'
|
|
1644
1514
|
});
|
|
1645
1515
|
break;
|
|
1646
|
-
|
|
1647
1516
|
case 'PPPP':
|
|
1648
1517
|
default:
|
|
1649
1518
|
dateTimeFormat = formatLong.dateTime({
|
|
@@ -1651,10 +1520,8 @@ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong)
|
|
|
1651
1520
|
});
|
|
1652
1521
|
break;
|
|
1653
1522
|
}
|
|
1654
|
-
|
|
1655
1523
|
return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
|
|
1656
1524
|
};
|
|
1657
|
-
|
|
1658
1525
|
var longFormatters = {
|
|
1659
1526
|
p: timeLongFormatter,
|
|
1660
1527
|
P: dateTimeLongFormatter
|
|
@@ -1743,11 +1610,9 @@ var formatDistanceLocale = {
|
|
|
1743
1610
|
other: 'almost {{count}} years'
|
|
1744
1611
|
}
|
|
1745
1612
|
};
|
|
1746
|
-
|
|
1747
1613
|
var formatDistance = function formatDistance(token, count, options) {
|
|
1748
1614
|
var result;
|
|
1749
1615
|
var tokenValue = formatDistanceLocale[token];
|
|
1750
|
-
|
|
1751
1616
|
if (typeof tokenValue === 'string') {
|
|
1752
1617
|
result = tokenValue;
|
|
1753
1618
|
} else if (count === 1) {
|
|
@@ -1755,7 +1620,6 @@ var formatDistance = function formatDistance(token, count, options) {
|
|
|
1755
1620
|
} else {
|
|
1756
1621
|
result = tokenValue.other.replace('{{count}}', count.toString());
|
|
1757
1622
|
}
|
|
1758
|
-
|
|
1759
1623
|
if (options !== null && options !== void 0 && options.addSuffix) {
|
|
1760
1624
|
if (options.comparison && options.comparison > 0) {
|
|
1761
1625
|
return 'in ' + result;
|
|
@@ -1763,7 +1627,6 @@ var formatDistance = function formatDistance(token, count, options) {
|
|
|
1763
1627
|
return result + ' ago';
|
|
1764
1628
|
}
|
|
1765
1629
|
}
|
|
1766
|
-
|
|
1767
1630
|
return result;
|
|
1768
1631
|
};
|
|
1769
1632
|
|
|
@@ -1818,7 +1681,6 @@ var formatRelativeLocale = {
|
|
|
1818
1681
|
nextWeek: "eeee 'at' p",
|
|
1819
1682
|
other: 'P'
|
|
1820
1683
|
};
|
|
1821
|
-
|
|
1822
1684
|
var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
|
|
1823
1685
|
return formatRelativeLocale[token];
|
|
1824
1686
|
};
|
|
@@ -1827,21 +1689,17 @@ function buildLocalizeFn(args) {
|
|
|
1827
1689
|
return function (dirtyIndex, options) {
|
|
1828
1690
|
var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
|
|
1829
1691
|
var valuesArray;
|
|
1830
|
-
|
|
1831
1692
|
if (context === 'formatting' && args.formattingValues) {
|
|
1832
1693
|
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
1833
1694
|
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
|
|
1834
1695
|
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
1835
1696
|
} else {
|
|
1836
1697
|
var _defaultWidth = args.defaultWidth;
|
|
1837
|
-
|
|
1838
1698
|
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
|
|
1839
|
-
|
|
1840
1699
|
valuesArray = args.values[_width] || args.values[_defaultWidth];
|
|
1841
1700
|
}
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1701
|
+
var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
|
|
1702
|
+
// @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
|
|
1845
1703
|
return valuesArray[index];
|
|
1846
1704
|
};
|
|
1847
1705
|
}
|
|
@@ -1855,11 +1713,12 @@ var quarterValues = {
|
|
|
1855
1713
|
narrow: ['1', '2', '3', '4'],
|
|
1856
1714
|
abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
|
|
1857
1715
|
wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
|
|
1858
|
-
};
|
|
1716
|
+
};
|
|
1717
|
+
|
|
1718
|
+
// Note: in English, the names of days of the week and months are capitalized.
|
|
1859
1719
|
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
|
|
1860
1720
|
// Generally, formatted dates should look like they are in the middle of a sentence,
|
|
1861
1721
|
// e.g. in Spanish language the weekdays and months should be in the lowercase.
|
|
1862
|
-
|
|
1863
1722
|
var monthValues = {
|
|
1864
1723
|
narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
|
|
1865
1724
|
abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
|
@@ -1935,9 +1794,10 @@ var formattingDayPeriodValues = {
|
|
|
1935
1794
|
night: 'at night'
|
|
1936
1795
|
}
|
|
1937
1796
|
};
|
|
1938
|
-
|
|
1939
1797
|
var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
|
|
1940
|
-
var number = Number(dirtyNumber);
|
|
1798
|
+
var number = Number(dirtyNumber);
|
|
1799
|
+
|
|
1800
|
+
// If ordinal numbers depend on context, for example,
|
|
1941
1801
|
// if they are different for different grammatical genders,
|
|
1942
1802
|
// use `options.unit`.
|
|
1943
1803
|
//
|
|
@@ -1945,23 +1805,18 @@ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
|
|
|
1945
1805
|
// 'day', 'hour', 'minute', 'second'.
|
|
1946
1806
|
|
|
1947
1807
|
var rem100 = number % 100;
|
|
1948
|
-
|
|
1949
1808
|
if (rem100 > 20 || rem100 < 10) {
|
|
1950
1809
|
switch (rem100 % 10) {
|
|
1951
1810
|
case 1:
|
|
1952
1811
|
return number + 'st';
|
|
1953
|
-
|
|
1954
1812
|
case 2:
|
|
1955
1813
|
return number + 'nd';
|
|
1956
|
-
|
|
1957
1814
|
case 3:
|
|
1958
1815
|
return number + 'rd';
|
|
1959
1816
|
}
|
|
1960
1817
|
}
|
|
1961
|
-
|
|
1962
1818
|
return number + 'th';
|
|
1963
1819
|
};
|
|
1964
|
-
|
|
1965
1820
|
var localize = {
|
|
1966
1821
|
ordinalNumber: ordinalNumber,
|
|
1967
1822
|
era: buildLocalizeFn({
|
|
@@ -1997,11 +1852,9 @@ function buildMatchFn(args) {
|
|
|
1997
1852
|
var width = options.width;
|
|
1998
1853
|
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
1999
1854
|
var matchResult = string.match(matchPattern);
|
|
2000
|
-
|
|
2001
1855
|
if (!matchResult) {
|
|
2002
1856
|
return null;
|
|
2003
1857
|
}
|
|
2004
|
-
|
|
2005
1858
|
var matchedString = matchResult[0];
|
|
2006
1859
|
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
2007
1860
|
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
|
|
@@ -2019,24 +1872,20 @@ function buildMatchFn(args) {
|
|
|
2019
1872
|
};
|
|
2020
1873
|
};
|
|
2021
1874
|
}
|
|
2022
|
-
|
|
2023
1875
|
function findKey(object, predicate) {
|
|
2024
1876
|
for (var key in object) {
|
|
2025
1877
|
if (object.hasOwnProperty(key) && predicate(object[key])) {
|
|
2026
1878
|
return key;
|
|
2027
1879
|
}
|
|
2028
1880
|
}
|
|
2029
|
-
|
|
2030
1881
|
return undefined;
|
|
2031
1882
|
}
|
|
2032
|
-
|
|
2033
1883
|
function findIndex(array, predicate) {
|
|
2034
1884
|
for (var key = 0; key < array.length; key++) {
|
|
2035
1885
|
if (predicate(array[key])) {
|
|
2036
1886
|
return key;
|
|
2037
1887
|
}
|
|
2038
1888
|
}
|
|
2039
|
-
|
|
2040
1889
|
return undefined;
|
|
2041
1890
|
}
|
|
2042
1891
|
|
|
@@ -2171,9 +2020,7 @@ var locale = {
|
|
|
2171
2020
|
localize: localize,
|
|
2172
2021
|
match: match,
|
|
2173
2022
|
options: {
|
|
2174
|
-
weekStartsOn: 0
|
|
2175
|
-
/* Sunday */
|
|
2176
|
-
,
|
|
2023
|
+
weekStartsOn: 0 /* Sunday */,
|
|
2177
2024
|
firstWeekContainsDate: 1
|
|
2178
2025
|
}
|
|
2179
2026
|
};
|
|
@@ -2188,14 +2035,15 @@ var locale = {
|
|
|
2188
2035
|
// If there is no matching single quote
|
|
2189
2036
|
// then the sequence will continue until the end of the string.
|
|
2190
2037
|
// - . matches any single character unmatched by previous parts of the RegExps
|
|
2038
|
+
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
|
2191
2039
|
|
|
2192
|
-
|
|
2040
|
+
// This RegExp catches symbols escaped by quotes, and also
|
|
2193
2041
|
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
|
|
2194
|
-
|
|
2195
2042
|
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
2196
2043
|
var escapedStringRegExp = /^'([^]*?)'?$/;
|
|
2197
2044
|
var doubleQuoteRegExp = /''/g;
|
|
2198
2045
|
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
2046
|
+
|
|
2199
2047
|
/**
|
|
2200
2048
|
* @name format
|
|
2201
2049
|
* @category Common Helpers
|
|
@@ -2490,40 +2338,36 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
2490
2338
|
|
|
2491
2339
|
function format(dirtyDate, dirtyFormatStr, options) {
|
|
2492
2340
|
var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
|
|
2493
|
-
|
|
2494
2341
|
requiredArgs(2, arguments);
|
|
2495
2342
|
var formatStr = String(dirtyFormatStr);
|
|
2496
2343
|
var defaultOptions = getDefaultOptions();
|
|
2497
2344
|
var locale$1 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : locale;
|
|
2498
|
-
var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
|
|
2345
|
+
var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
|
|
2499
2346
|
|
|
2347
|
+
// Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
|
2500
2348
|
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
2501
2349
|
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
|
2502
2350
|
}
|
|
2351
|
+
var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
|
|
2503
2352
|
|
|
2504
|
-
|
|
2505
|
-
|
|
2353
|
+
// Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
2506
2354
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
2507
2355
|
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
|
2508
2356
|
}
|
|
2509
|
-
|
|
2510
2357
|
if (!locale$1.localize) {
|
|
2511
2358
|
throw new RangeError('locale must contain localize property');
|
|
2512
2359
|
}
|
|
2513
|
-
|
|
2514
2360
|
if (!locale$1.formatLong) {
|
|
2515
2361
|
throw new RangeError('locale must contain formatLong property');
|
|
2516
2362
|
}
|
|
2517
|
-
|
|
2518
2363
|
var originalDate = toDate(dirtyDate);
|
|
2519
|
-
|
|
2520
2364
|
if (!isValid(originalDate)) {
|
|
2521
2365
|
throw new RangeError('Invalid time value');
|
|
2522
|
-
}
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
// Convert the date in system timezone to the same date in UTC+00:00 timezone.
|
|
2523
2369
|
// This ensures that when UTC functions will be implemented, locales will be compatible with them.
|
|
2524
2370
|
// See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
2371
|
var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
|
|
2528
2372
|
var utcDate = subMilliseconds(originalDate, timezoneOffset);
|
|
2529
2373
|
var formatterOptions = {
|
|
@@ -2534,55 +2378,42 @@ function format(dirtyDate, dirtyFormatStr, options) {
|
|
|
2534
2378
|
};
|
|
2535
2379
|
var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
|
|
2536
2380
|
var firstCharacter = substring[0];
|
|
2537
|
-
|
|
2538
2381
|
if (firstCharacter === 'p' || firstCharacter === 'P') {
|
|
2539
2382
|
var longFormatter = longFormatters[firstCharacter];
|
|
2540
2383
|
return longFormatter(substring, locale$1.formatLong);
|
|
2541
2384
|
}
|
|
2542
|
-
|
|
2543
2385
|
return substring;
|
|
2544
2386
|
}).join('').match(formattingTokensRegExp).map(function (substring) {
|
|
2545
2387
|
// Replace two single quote characters with one single quote character
|
|
2546
2388
|
if (substring === "''") {
|
|
2547
2389
|
return "'";
|
|
2548
2390
|
}
|
|
2549
|
-
|
|
2550
2391
|
var firstCharacter = substring[0];
|
|
2551
|
-
|
|
2552
2392
|
if (firstCharacter === "'") {
|
|
2553
2393
|
return cleanEscapedString(substring);
|
|
2554
2394
|
}
|
|
2555
|
-
|
|
2556
2395
|
var formatter = formatters[firstCharacter];
|
|
2557
|
-
|
|
2558
2396
|
if (formatter) {
|
|
2559
2397
|
if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
|
|
2560
2398
|
throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
|
|
2561
2399
|
}
|
|
2562
|
-
|
|
2563
2400
|
if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
|
|
2564
2401
|
throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
|
|
2565
2402
|
}
|
|
2566
|
-
|
|
2567
2403
|
return formatter(utcDate, substring, locale$1.localize, formatterOptions);
|
|
2568
2404
|
}
|
|
2569
|
-
|
|
2570
2405
|
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
|
2571
2406
|
throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
|
|
2572
2407
|
}
|
|
2573
|
-
|
|
2574
2408
|
return substring;
|
|
2575
2409
|
}).join('');
|
|
2576
2410
|
return result;
|
|
2577
2411
|
}
|
|
2578
|
-
|
|
2579
2412
|
function cleanEscapedString(input) {
|
|
2580
2413
|
var matched = input.match(escapedStringRegExp);
|
|
2581
|
-
|
|
2582
2414
|
if (!matched) {
|
|
2583
2415
|
return input;
|
|
2584
2416
|
}
|
|
2585
|
-
|
|
2586
2417
|
return matched[1].replace(doubleQuoteRegExp, "'");
|
|
2587
2418
|
}
|
|
2588
2419
|
|
|
@@ -2603,7 +2434,6 @@ function cleanEscapedString(input) {
|
|
|
2603
2434
|
* const result = getDay(new Date(2012, 1, 29))
|
|
2604
2435
|
* //=> 3
|
|
2605
2436
|
*/
|
|
2606
|
-
|
|
2607
2437
|
function getDay(dirtyDate) {
|
|
2608
2438
|
requiredArgs(1, arguments);
|
|
2609
2439
|
var date = toDate(dirtyDate);
|
|
@@ -2628,7 +2458,6 @@ function getDay(dirtyDate) {
|
|
|
2628
2458
|
* const result = getDaysInMonth(new Date(2000, 1))
|
|
2629
2459
|
* //=> 29
|
|
2630
2460
|
*/
|
|
2631
|
-
|
|
2632
2461
|
function getDaysInMonth(dirtyDate) {
|
|
2633
2462
|
requiredArgs(1, arguments);
|
|
2634
2463
|
var date = toDate(dirtyDate);
|
|
@@ -2657,7 +2486,6 @@ function getDaysInMonth(dirtyDate) {
|
|
|
2657
2486
|
* const result = getYear(new Date(2014, 6, 2))
|
|
2658
2487
|
* //=> 2014
|
|
2659
2488
|
*/
|
|
2660
|
-
|
|
2661
2489
|
function getYear(dirtyDate) {
|
|
2662
2490
|
requiredArgs(1, arguments);
|
|
2663
2491
|
return toDate(dirtyDate).getFullYear();
|
|
@@ -2681,7 +2509,6 @@ function getYear(dirtyDate) {
|
|
|
2681
2509
|
* const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
|
|
2682
2510
|
* //=> true
|
|
2683
2511
|
*/
|
|
2684
|
-
|
|
2685
2512
|
function isAfter(dirtyDate, dirtyDateToCompare) {
|
|
2686
2513
|
requiredArgs(2, arguments);
|
|
2687
2514
|
var date = toDate(dirtyDate);
|
|
@@ -2707,7 +2534,6 @@ function isAfter(dirtyDate, dirtyDateToCompare) {
|
|
|
2707
2534
|
* const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
|
|
2708
2535
|
* //=> false
|
|
2709
2536
|
*/
|
|
2710
|
-
|
|
2711
2537
|
function isBefore(dirtyDate, dirtyDateToCompare) {
|
|
2712
2538
|
requiredArgs(2, arguments);
|
|
2713
2539
|
var date = toDate(dirtyDate);
|
|
@@ -2738,7 +2564,6 @@ function isBefore(dirtyDate, dirtyDateToCompare) {
|
|
|
2738
2564
|
* const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))
|
|
2739
2565
|
* //=> false
|
|
2740
2566
|
*/
|
|
2741
|
-
|
|
2742
2567
|
function isSameMonth(dirtyDateLeft, dirtyDateRight) {
|
|
2743
2568
|
requiredArgs(2, arguments);
|
|
2744
2569
|
var dateLeft = toDate(dirtyDateLeft);
|
|
@@ -2764,7 +2589,6 @@ function isSameMonth(dirtyDateLeft, dirtyDateRight) {
|
|
|
2764
2589
|
* const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))
|
|
2765
2590
|
* //=> true
|
|
2766
2591
|
*/
|
|
2767
|
-
|
|
2768
2592
|
function isSameYear(dirtyDateLeft, dirtyDateRight) {
|
|
2769
2593
|
requiredArgs(2, arguments);
|
|
2770
2594
|
var dateLeft = toDate(dirtyDateLeft);
|
|
@@ -2790,7 +2614,6 @@ function isSameYear(dirtyDateLeft, dirtyDateRight) {
|
|
|
2790
2614
|
* const result = setMonth(new Date(2014, 8, 1), 1)
|
|
2791
2615
|
* //=> Sat Feb 01 2014 00:00:00
|
|
2792
2616
|
*/
|
|
2793
|
-
|
|
2794
2617
|
function setMonth(dirtyDate, dirtyMonth) {
|
|
2795
2618
|
requiredArgs(2, arguments);
|
|
2796
2619
|
var date = toDate(dirtyDate);
|
|
@@ -2800,9 +2623,9 @@ function setMonth(dirtyDate, dirtyMonth) {
|
|
|
2800
2623
|
var dateWithDesiredMonth = new Date(0);
|
|
2801
2624
|
dateWithDesiredMonth.setFullYear(year, month, 15);
|
|
2802
2625
|
dateWithDesiredMonth.setHours(0, 0, 0, 0);
|
|
2803
|
-
var daysInMonth = getDaysInMonth(dateWithDesiredMonth);
|
|
2626
|
+
var daysInMonth = getDaysInMonth(dateWithDesiredMonth);
|
|
2627
|
+
// Set the last day of the new month
|
|
2804
2628
|
// if the original date was the last day of the longer month
|
|
2805
|
-
|
|
2806
2629
|
date.setMonth(month, Math.min(day, daysInMonth));
|
|
2807
2630
|
return date;
|
|
2808
2631
|
}
|
|
@@ -2825,7 +2648,6 @@ function setMonth(dirtyDate, dirtyMonth) {
|
|
|
2825
2648
|
* const result = setDate(new Date(2014, 8, 1), 30)
|
|
2826
2649
|
* //=> Tue Sep 30 2014 00:00:00
|
|
2827
2650
|
*/
|
|
2828
|
-
|
|
2829
2651
|
function setDate(dirtyDate, dirtyDayOfMonth) {
|
|
2830
2652
|
requiredArgs(2, arguments);
|
|
2831
2653
|
var date = toDate(dirtyDate);
|
|
@@ -2852,16 +2674,15 @@ function setDate(dirtyDate, dirtyDayOfMonth) {
|
|
|
2852
2674
|
* const result = setYear(new Date(2014, 8, 1), 2013)
|
|
2853
2675
|
* //=> Sun Sep 01 2013 00:00:00
|
|
2854
2676
|
*/
|
|
2855
|
-
|
|
2856
2677
|
function setYear(dirtyDate, dirtyYear) {
|
|
2857
2678
|
requiredArgs(2, arguments);
|
|
2858
2679
|
var date = toDate(dirtyDate);
|
|
2859
|
-
var year = toInteger(dirtyYear);
|
|
2680
|
+
var year = toInteger(dirtyYear);
|
|
2860
2681
|
|
|
2682
|
+
// Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
|
|
2861
2683
|
if (isNaN(date.getTime())) {
|
|
2862
2684
|
return new Date(NaN);
|
|
2863
2685
|
}
|
|
2864
|
-
|
|
2865
2686
|
date.setFullYear(year);
|
|
2866
2687
|
return date;
|
|
2867
2688
|
}
|
|
@@ -3193,6 +3014,6 @@ function defineCustomElement() {
|
|
|
3193
3014
|
} });
|
|
3194
3015
|
}
|
|
3195
3016
|
|
|
3196
|
-
export { Calendar as C, startOfUTCISOWeek as a, getUTCWeek as b, toInteger as c, defineCustomElement as d, getUTCISOWeek as e, getDefaultOptions as f, getUTCWeekYear as g, subMilliseconds as h, getTimezoneOffsetInMilliseconds as i, locale as j, isProtectedWeekYearToken as k, longFormatters as l, throwProtectedError as m, isProtectedDayOfYearToken as n, format as o, isValid as p, isBefore as q, requiredArgs as r, startOfUTCWeek as s, toDate as t, isAfter as u, startOfDay as v, isSameDay as w };
|
|
3017
|
+
export { Calendar as C, _typeof as _, startOfUTCISOWeek as a, getUTCWeek as b, toInteger as c, defineCustomElement as d, getUTCISOWeek as e, getDefaultOptions as f, getUTCWeekYear as g, subMilliseconds as h, getTimezoneOffsetInMilliseconds as i, locale as j, isProtectedWeekYearToken as k, longFormatters as l, throwProtectedError as m, isProtectedDayOfYearToken as n, format as o, isValid as p, isBefore as q, requiredArgs as r, startOfUTCWeek as s, toDate as t, isAfter as u, startOfDay as v, isSameDay as w };
|
|
3197
3018
|
|
|
3198
3019
|
//# sourceMappingURL=calendar.component.js.map
|