@paperless/core 0.1.0-alpha.437 → 0.1.0-alpha.439
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 +19 -0
- package/dist/{paperless/p-e3f29ba8.entry.js → build/p-0410ec1e.entry.js} +2 -2
- 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/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-a3fcf8b6.entry.js → p-3d458d5a.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-a2bd1a79.entry.js → build/p-4939be3e.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-ea824ef3.entry.js → p-688264c9.entry.js} +2 -2
- package/dist/build/{p-d012d066.entry.js → p-6a7584cc.entry.js} +2 -2
- 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/{paperless/p-ef2eee59.entry.js → build/p-7b16e066.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/{paperless/p-6f82a1e7.entry.js → build/p-8569fa3c.entry.js} +2 -2
- package/dist/{paperless/p-c87da93e.entry.js → build/p-86b47461.entry.js} +2 -2
- package/dist/build/p-89f5e9c9.entry.js +2 -0
- package/dist/build/p-89f5e9c9.entry.js.map +1 -0
- package/dist/build/{p-1b5292a3.entry.js → p-8f453ef2.entry.js} +2 -2
- package/dist/{paperless/p-57411b2b.entry.js → build/p-a0790d7b.entry.js} +2 -2
- package/dist/build/{p-31afbb45.entry.js → p-a233bac3.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-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-7b94bc6a.entry.js → p-b5b591c7.entry.js} +2 -2
- package/dist/{paperless/p-78948e08.entry.js → build/p-b62e6ab2.entry.js} +2 -2
- package/dist/{paperless/p-5236b565.entry.js → build/p-c6d9e720.entry.js} +2 -2
- package/dist/{paperless/p-f34ed23f.entry.js → build/p-c942022f.entry.js} +2 -2
- package/dist/build/p-c942022f.entry.js.map +1 -0
- package/dist/build/{p-ebd4ba56.entry.js → p-ca2abe98.entry.js} +2 -2
- package/dist/build/{p-b0eeab26.entry.js → p-cfd0a2bb.entry.js} +2 -2
- package/dist/build/{p-10ad607e.entry.js → p-e8a815d7.entry.js} +2 -2
- package/dist/build/{p-036a82fc.entry.js → p-e9dc7598.entry.js} +2 -2
- package/dist/build/p-e9dc7598.entry.js.map +1 -0
- package/dist/build/{p-e0d7a4ee.entry.js → p-efdeae92.entry.js} +2 -2
- package/dist/{paperless/p-8fb43cc7.entry.js → build/p-f215bf8c.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 +2 -2
- 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 +1 -1
- package/dist/cjs/p-button_3.cjs.entry.js +1 -1
- package/dist/cjs/p-calendar.cjs.entry.js +9 -28
- 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 +435 -1476
- package/dist/cjs/p-datepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/p-divider.cjs.entry.js +1 -1
- 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_2.cjs.entry.js +3 -3
- package/dist/cjs/p-helper_3.cjs.entry.js +3 -3
- package/dist/cjs/p-illustration_6.cjs.entry.js +1 -1
- package/dist/cjs/p-info-panel.cjs.entry.js +1 -1
- package/dist/cjs/p-label_3.cjs.entry.js +1 -1
- package/dist/cjs/p-layout.cjs.entry.js +1 -1
- package/dist/cjs/p-modal-body_4.cjs.entry.js +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 +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.cjs.entry.js +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/drawer-body/drawer-body.component.css +1 -1
- package/dist/collection/components/atoms/drawer-container/drawer-container.component.css +1 -1
- package/dist/collection/components/atoms/drawer-header/drawer-header.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/molecules/attachment/attachment.component.css +1 -1
- package/dist/collection/components/molecules/calendar/calendar.component.css +1 -1
- package/dist/collection/components/molecules/datepicker/datepicker.component.css +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/profile/profile.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/drawer/drawer.component.css +1 -1
- package/dist/collection/components/organisms/table/table.component.css +1 -1
- package/dist/components/calendar.component.js +71 -250
- package/dist/components/calendar.component.js.map +1 -1
- package/dist/components/dropdown-menu-container.component.js +1 -1
- package/dist/components/dropdown.component.js +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/input-group.component.js +1 -1
- package/dist/components/p-attachment.js +1 -1
- package/dist/components/p-datepicker.js +433 -1474
- package/dist/components/p-datepicker.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 +2 -2
- 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 +1 -1
- package/dist/esm/p-button_3.entry.js +1 -1
- package/dist/esm/p-calendar.entry.js +9 -28
- 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 +434 -1475
- package/dist/esm/p-datepicker.entry.js.map +1 -1
- package/dist/esm/p-divider.entry.js +1 -1
- 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_2.entry.js +3 -3
- package/dist/esm/p-helper_3.entry.js +3 -3
- package/dist/esm/p-illustration_6.entry.js +1 -1
- package/dist/esm/p-info-panel.entry.js +1 -1
- package/dist/esm/p-label_3.entry.js +1 -1
- package/dist/esm/p-layout.entry.js +1 -1
- package/dist/esm/p-modal-body_4.entry.js +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 +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.entry.js +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/{build/p-e3f29ba8.entry.js → paperless/p-0410ec1e.entry.js} +2 -2
- 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/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-a3fcf8b6.entry.js → p-3d458d5a.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-a2bd1a79.entry.js → paperless/p-4939be3e.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-ea824ef3.entry.js → p-688264c9.entry.js} +2 -2
- package/dist/paperless/{p-d012d066.entry.js → p-6a7584cc.entry.js} +2 -2
- 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/{build/p-ef2eee59.entry.js → paperless/p-7b16e066.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/{build/p-6f82a1e7.entry.js → paperless/p-8569fa3c.entry.js} +2 -2
- package/dist/{build/p-c87da93e.entry.js → paperless/p-86b47461.entry.js} +2 -2
- package/dist/paperless/p-89f5e9c9.entry.js +2 -0
- package/dist/paperless/p-89f5e9c9.entry.js.map +1 -0
- package/dist/paperless/{p-1b5292a3.entry.js → p-8f453ef2.entry.js} +2 -2
- package/dist/{build/p-57411b2b.entry.js → paperless/p-a0790d7b.entry.js} +2 -2
- package/dist/paperless/{p-31afbb45.entry.js → p-a233bac3.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-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-7b94bc6a.entry.js → p-b5b591c7.entry.js} +2 -2
- package/dist/{build/p-78948e08.entry.js → paperless/p-b62e6ab2.entry.js} +2 -2
- package/dist/{build/p-5236b565.entry.js → paperless/p-c6d9e720.entry.js} +2 -2
- package/dist/{build/p-f34ed23f.entry.js → paperless/p-c942022f.entry.js} +2 -2
- package/dist/paperless/p-c942022f.entry.js.map +1 -0
- package/dist/paperless/{p-ebd4ba56.entry.js → p-ca2abe98.entry.js} +2 -2
- package/dist/paperless/{p-b0eeab26.entry.js → p-cfd0a2bb.entry.js} +2 -2
- package/dist/paperless/{p-10ad607e.entry.js → p-e8a815d7.entry.js} +2 -2
- package/dist/paperless/{p-036a82fc.entry.js → p-e9dc7598.entry.js} +2 -2
- package/dist/paperless/p-e9dc7598.entry.js.map +1 -0
- package/dist/paperless/{p-e0d7a4ee.entry.js → p-efdeae92.entry.js} +2 -2
- package/dist/{build/p-8fb43cc7.entry.js → paperless/p-f215bf8c.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/stencil-public-runtime.d.ts +1 -0
- 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-ac1af618.js +0 -3
- package/dist/build/p-ac1af618.js.map +0 -1
- package/dist/build/p-b273ac6d.js +0 -2
- package/dist/build/p-b273ac6d.js.map +0 -1
- package/dist/build/p-e621e34c.js +0 -2
- package/dist/build/p-e621e34c.js.map +0 -1
- 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-ac1af618.js +0 -3
- package/dist/paperless/p-ac1af618.js.map +0 -1
- package/dist/paperless/p-b273ac6d.js +0 -2
- package/dist/paperless/p-b273ac6d.js.map +0 -1
- package/dist/paperless/p-e621e34c.js +0 -2
- package/dist/paperless/p-e621e34c.js.map +0 -1
- package/dist/paperless/p-f34ed23f.entry.js.map +0 -1
- /package/dist/build/{p-e3f29ba8.entry.js.map → p-0410ec1e.entry.js.map} +0 -0
- /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-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-a3fcf8b6.entry.js.map → p-3d458d5a.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-a2bd1a79.entry.js.map → p-4939be3e.entry.js.map} +0 -0
- /package/dist/build/{p-ac7b48ff.entry.js.map → p-4b99a4fe.entry.js.map} +0 -0
- /package/dist/build/{p-464569dc.entry.js.map → p-5e5f3eaa.entry.js.map} +0 -0
- /package/dist/build/{p-ea824ef3.entry.js.map → p-688264c9.entry.js.map} +0 -0
- /package/dist/build/{p-d012d066.entry.js.map → p-6a7584cc.entry.js.map} +0 -0
- /package/dist/build/{p-ebc2ae62.entry.js.map → p-733a0d79.entry.js.map} +0 -0
- /package/dist/build/{p-ef2eee59.entry.js.map → p-7b16e066.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-c87da93e.entry.js.map → p-86b47461.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-31afbb45.entry.js.map → p-a233bac3.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-78948e08.entry.js.map → p-b62e6ab2.entry.js.map} +0 -0
- /package/dist/build/{p-5236b565.entry.js.map → p-c6d9e720.entry.js.map} +0 -0
- /package/dist/build/{p-ebd4ba56.entry.js.map → p-ca2abe98.entry.js.map} +0 -0
- /package/dist/build/{p-b0eeab26.entry.js.map → p-cfd0a2bb.entry.js.map} +0 -0
- /package/dist/build/{p-10ad607e.entry.js.map → p-e8a815d7.entry.js.map} +0 -0
- /package/dist/build/{p-e0d7a4ee.entry.js.map → p-efdeae92.entry.js.map} +0 -0
- /package/dist/build/{p-8fb43cc7.entry.js.map → p-f215bf8c.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-e3f29ba8.entry.js.map → p-0410ec1e.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-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-a3fcf8b6.entry.js.map → p-3d458d5a.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-a2bd1a79.entry.js.map → p-4939be3e.entry.js.map} +0 -0
- /package/dist/paperless/{p-ac7b48ff.entry.js.map → p-4b99a4fe.entry.js.map} +0 -0
- /package/dist/paperless/{p-464569dc.entry.js.map → p-5e5f3eaa.entry.js.map} +0 -0
- /package/dist/paperless/{p-ea824ef3.entry.js.map → p-688264c9.entry.js.map} +0 -0
- /package/dist/paperless/{p-d012d066.entry.js.map → p-6a7584cc.entry.js.map} +0 -0
- /package/dist/paperless/{p-ebc2ae62.entry.js.map → p-733a0d79.entry.js.map} +0 -0
- /package/dist/paperless/{p-ef2eee59.entry.js.map → p-7b16e066.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-c87da93e.entry.js.map → p-86b47461.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-31afbb45.entry.js.map → p-a233bac3.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-78948e08.entry.js.map → p-b62e6ab2.entry.js.map} +0 -0
- /package/dist/paperless/{p-5236b565.entry.js.map → p-c6d9e720.entry.js.map} +0 -0
- /package/dist/paperless/{p-ebd4ba56.entry.js.map → p-ca2abe98.entry.js.map} +0 -0
- /package/dist/paperless/{p-b0eeab26.entry.js.map → p-cfd0a2bb.entry.js.map} +0 -0
- /package/dist/paperless/{p-10ad607e.entry.js.map → p-e8a815d7.entry.js.map} +0 -0
- /package/dist/paperless/{p-e0d7a4ee.entry.js.map → p-efdeae92.entry.js.map} +0 -0
- /package/dist/paperless/{p-8fb43cc7.entry.js.map → p-f215bf8c.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,14 +1,21 @@
|
|
|
1
|
+
function _typeof(obj) {
|
|
2
|
+
"@babel/helpers - typeof";
|
|
3
|
+
|
|
4
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
5
|
+
return typeof obj;
|
|
6
|
+
} : function (obj) {
|
|
7
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
8
|
+
}, _typeof(obj);
|
|
9
|
+
}
|
|
10
|
+
|
|
1
11
|
function toInteger(dirtyNumber) {
|
|
2
12
|
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
3
13
|
return NaN;
|
|
4
14
|
}
|
|
5
|
-
|
|
6
15
|
var number = Number(dirtyNumber);
|
|
7
|
-
|
|
8
16
|
if (isNaN(number)) {
|
|
9
17
|
return number;
|
|
10
18
|
}
|
|
11
|
-
|
|
12
19
|
return number < 0 ? Math.ceil(number) : Math.floor(number);
|
|
13
20
|
}
|
|
14
21
|
|
|
@@ -18,7 +25,6 @@ function requiredArgs(required, args) {
|
|
|
18
25
|
}
|
|
19
26
|
}
|
|
20
27
|
|
|
21
|
-
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); }
|
|
22
28
|
/**
|
|
23
29
|
* @name toDate
|
|
24
30
|
* @category Common Helpers
|
|
@@ -49,12 +55,12 @@ function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "func
|
|
|
49
55
|
* const result = toDate(1392098430000)
|
|
50
56
|
* //=> Tue Feb 11 2014 11:30:30
|
|
51
57
|
*/
|
|
52
|
-
|
|
53
58
|
function toDate(argument) {
|
|
54
59
|
requiredArgs(1, arguments);
|
|
55
|
-
var argStr = Object.prototype.toString.call(argument);
|
|
60
|
+
var argStr = Object.prototype.toString.call(argument);
|
|
56
61
|
|
|
57
|
-
|
|
62
|
+
// Clone the date
|
|
63
|
+
if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
|
|
58
64
|
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
|
59
65
|
return new Date(argument.getTime());
|
|
60
66
|
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
|
@@ -62,11 +68,10 @@ function toDate(argument) {
|
|
|
62
68
|
} else {
|
|
63
69
|
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
|
64
70
|
// eslint-disable-next-line no-console
|
|
65
|
-
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");
|
|
66
|
-
|
|
71
|
+
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");
|
|
72
|
+
// eslint-disable-next-line no-console
|
|
67
73
|
console.warn(new Error().stack);
|
|
68
74
|
}
|
|
69
|
-
|
|
70
75
|
return new Date(NaN);
|
|
71
76
|
}
|
|
72
77
|
}
|
|
@@ -89,7 +94,6 @@ function toDate(argument) {
|
|
|
89
94
|
* const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
|
|
90
95
|
* //=> Thu Jul 10 2014 12:45:30.750
|
|
91
96
|
*/
|
|
92
|
-
|
|
93
97
|
function addMilliseconds(dirtyDate, dirtyAmount) {
|
|
94
98
|
requiredArgs(2, arguments);
|
|
95
99
|
var timestamp = toDate(dirtyDate).getTime();
|
|
@@ -137,7 +141,6 @@ function getTimezoneOffsetInMilliseconds(date) {
|
|
|
137
141
|
* const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
|
|
138
142
|
* //=> Tue Sep 02 2014 00:00:00
|
|
139
143
|
*/
|
|
140
|
-
|
|
141
144
|
function startOfDay(dirtyDate) {
|
|
142
145
|
requiredArgs(1, arguments);
|
|
143
146
|
var date = toDate(dirtyDate);
|
|
@@ -173,7 +176,6 @@ function startOfDay(dirtyDate) {
|
|
|
173
176
|
* const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
|
|
174
177
|
* //=> false
|
|
175
178
|
*/
|
|
176
|
-
|
|
177
179
|
function isSameDay(dirtyDateLeft, dirtyDateRight) {
|
|
178
180
|
requiredArgs(2, arguments);
|
|
179
181
|
var dateLeftStartOfDay = startOfDay(dirtyDateLeft);
|
|
@@ -181,7 +183,6 @@ function isSameDay(dirtyDateLeft, dirtyDateRight) {
|
|
|
181
183
|
return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();
|
|
182
184
|
}
|
|
183
185
|
|
|
184
|
-
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); }
|
|
185
186
|
/**
|
|
186
187
|
* @name isDate
|
|
187
188
|
* @category Common Helpers
|
|
@@ -214,7 +215,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
214
215
|
* const result = isDate({})
|
|
215
216
|
* //=> false
|
|
216
217
|
*/
|
|
217
|
-
|
|
218
218
|
function isDate(value) {
|
|
219
219
|
requiredArgs(1, arguments);
|
|
220
220
|
return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
|
|
@@ -251,14 +251,11 @@ function isDate(value) {
|
|
|
251
251
|
* const result = isValid(new Date(''))
|
|
252
252
|
* //=> false
|
|
253
253
|
*/
|
|
254
|
-
|
|
255
254
|
function isValid(dirtyDate) {
|
|
256
255
|
requiredArgs(1, arguments);
|
|
257
|
-
|
|
258
256
|
if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
|
|
259
257
|
return false;
|
|
260
258
|
}
|
|
261
|
-
|
|
262
259
|
var date = toDate(dirtyDate);
|
|
263
260
|
return !isNaN(Number(date));
|
|
264
261
|
}
|
|
@@ -281,7 +278,6 @@ function isValid(dirtyDate) {
|
|
|
281
278
|
* const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
|
|
282
279
|
* //=> Thu Jul 10 2014 12:45:29.250
|
|
283
280
|
*/
|
|
284
|
-
|
|
285
281
|
function subMilliseconds(dirtyDate, dirtyAmount) {
|
|
286
282
|
requiredArgs(2, arguments);
|
|
287
283
|
var amount = toInteger(dirtyAmount);
|
|
@@ -323,7 +319,6 @@ function getUTCISOWeekYear(dirtyDate) {
|
|
|
323
319
|
fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
|
|
324
320
|
fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
|
|
325
321
|
var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
|
|
326
|
-
|
|
327
322
|
if (date.getTime() >= startOfNextYear.getTime()) {
|
|
328
323
|
return year + 1;
|
|
329
324
|
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
|
@@ -347,24 +342,24 @@ var MILLISECONDS_IN_WEEK$1 = 604800000;
|
|
|
347
342
|
function getUTCISOWeek(dirtyDate) {
|
|
348
343
|
requiredArgs(1, arguments);
|
|
349
344
|
var date = toDate(dirtyDate);
|
|
350
|
-
var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
|
|
345
|
+
var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
|
|
346
|
+
|
|
347
|
+
// Round the number of days to the nearest integer
|
|
351
348
|
// because the number of milliseconds in a week is not constant
|
|
352
349
|
// (e.g. it's different in the week of the daylight saving time clock shift)
|
|
353
|
-
|
|
354
350
|
return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
|
|
355
351
|
}
|
|
356
352
|
|
|
357
353
|
function startOfUTCWeek(dirtyDate, options) {
|
|
358
354
|
var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
359
|
-
|
|
360
355
|
requiredArgs(1, arguments);
|
|
361
356
|
var defaultOptions = getDefaultOptions();
|
|
362
|
-
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);
|
|
357
|
+
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);
|
|
363
358
|
|
|
359
|
+
// Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
364
360
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
365
361
|
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
|
366
362
|
}
|
|
367
|
-
|
|
368
363
|
var date = toDate(dirtyDate);
|
|
369
364
|
var day = date.getUTCDay();
|
|
370
365
|
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
@@ -375,17 +370,16 @@ function startOfUTCWeek(dirtyDate, options) {
|
|
|
375
370
|
|
|
376
371
|
function getUTCWeekYear(dirtyDate, options) {
|
|
377
372
|
var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
378
|
-
|
|
379
373
|
requiredArgs(1, arguments);
|
|
380
374
|
var date = toDate(dirtyDate);
|
|
381
375
|
var year = date.getUTCFullYear();
|
|
382
376
|
var defaultOptions = getDefaultOptions();
|
|
383
|
-
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);
|
|
377
|
+
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);
|
|
384
378
|
|
|
379
|
+
// Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
|
385
380
|
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
386
381
|
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
|
387
382
|
}
|
|
388
|
-
|
|
389
383
|
var firstWeekOfNextYear = new Date(0);
|
|
390
384
|
firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
|
|
391
385
|
firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
|
|
@@ -394,7 +388,6 @@ function getUTCWeekYear(dirtyDate, options) {
|
|
|
394
388
|
firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
|
|
395
389
|
firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
|
|
396
390
|
var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
|
|
397
|
-
|
|
398
391
|
if (date.getTime() >= startOfNextYear.getTime()) {
|
|
399
392
|
return year + 1;
|
|
400
393
|
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
|
@@ -406,7 +399,6 @@ function getUTCWeekYear(dirtyDate, options) {
|
|
|
406
399
|
|
|
407
400
|
function startOfUTCWeekYear(dirtyDate, options) {
|
|
408
401
|
var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
409
|
-
|
|
410
402
|
requiredArgs(1, arguments);
|
|
411
403
|
var defaultOptions = getDefaultOptions();
|
|
412
404
|
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);
|
|
@@ -422,21 +414,20 @@ var MILLISECONDS_IN_WEEK = 604800000;
|
|
|
422
414
|
function getUTCWeek(dirtyDate, options) {
|
|
423
415
|
requiredArgs(1, arguments);
|
|
424
416
|
var date = toDate(dirtyDate);
|
|
425
|
-
var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
|
|
417
|
+
var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
|
|
418
|
+
|
|
419
|
+
// Round the number of days to the nearest integer
|
|
426
420
|
// because the number of milliseconds in a week is not constant
|
|
427
421
|
// (e.g. it's different in the week of the daylight saving time clock shift)
|
|
428
|
-
|
|
429
422
|
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
|
|
430
423
|
}
|
|
431
424
|
|
|
432
425
|
function addLeadingZeros(number, targetLength) {
|
|
433
426
|
var sign = number < 0 ? '-' : '';
|
|
434
427
|
var output = Math.abs(number).toString();
|
|
435
|
-
|
|
436
428
|
while (output.length < targetLength) {
|
|
437
429
|
output = '0' + output;
|
|
438
430
|
}
|
|
439
|
-
|
|
440
431
|
return sign + output;
|
|
441
432
|
}
|
|
442
433
|
|
|
@@ -452,7 +443,6 @@ function addLeadingZeros(number, targetLength) {
|
|
|
452
443
|
*
|
|
453
444
|
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
454
445
|
*/
|
|
455
|
-
|
|
456
446
|
var formatters$1 = {
|
|
457
447
|
// Year
|
|
458
448
|
y: function y(date, token) {
|
|
@@ -464,8 +454,9 @@ var formatters$1 = {
|
|
|
464
454
|
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
|
465
455
|
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
|
466
456
|
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
|
467
|
-
var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
468
457
|
|
|
458
|
+
var signedYear = date.getUTCFullYear();
|
|
459
|
+
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
469
460
|
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
470
461
|
return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
|
|
471
462
|
},
|
|
@@ -481,18 +472,14 @@ var formatters$1 = {
|
|
|
481
472
|
// AM or PM
|
|
482
473
|
a: function a(date, token) {
|
|
483
474
|
var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
|
|
484
|
-
|
|
485
475
|
switch (token) {
|
|
486
476
|
case 'a':
|
|
487
477
|
case 'aa':
|
|
488
478
|
return dayPeriodEnumValue.toUpperCase();
|
|
489
|
-
|
|
490
479
|
case 'aaa':
|
|
491
480
|
return dayPeriodEnumValue;
|
|
492
|
-
|
|
493
481
|
case 'aaaaa':
|
|
494
482
|
return dayPeriodEnumValue[0];
|
|
495
|
-
|
|
496
483
|
case 'aaaa':
|
|
497
484
|
default:
|
|
498
485
|
return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
|
|
@@ -533,7 +520,6 @@ var dayPeriodEnum = {
|
|
|
533
520
|
evening: 'evening',
|
|
534
521
|
night: 'night'
|
|
535
522
|
};
|
|
536
|
-
|
|
537
523
|
/*
|
|
538
524
|
* | | Unit | | Unit |
|
|
539
525
|
* |-----|--------------------------------|-----|--------------------------------|
|
|
@@ -579,11 +565,11 @@ var dayPeriodEnum = {
|
|
|
579
565
|
* - `P` is long localized date format
|
|
580
566
|
* - `p` is long localized time format
|
|
581
567
|
*/
|
|
568
|
+
|
|
582
569
|
var formatters = {
|
|
583
570
|
// Era
|
|
584
571
|
G: function G(date, token, localize) {
|
|
585
572
|
var era = date.getUTCFullYear() > 0 ? 1 : 0;
|
|
586
|
-
|
|
587
573
|
switch (token) {
|
|
588
574
|
// AD, BC
|
|
589
575
|
case 'G':
|
|
@@ -593,13 +579,11 @@ var formatters = {
|
|
|
593
579
|
width: 'abbreviated'
|
|
594
580
|
});
|
|
595
581
|
// A, B
|
|
596
|
-
|
|
597
582
|
case 'GGGGG':
|
|
598
583
|
return localize.era(era, {
|
|
599
584
|
width: 'narrow'
|
|
600
585
|
});
|
|
601
586
|
// Anno Domini, Before Christ
|
|
602
|
-
|
|
603
587
|
case 'GGGG':
|
|
604
588
|
default:
|
|
605
589
|
return localize.era(era, {
|
|
@@ -611,41 +595,42 @@ var formatters = {
|
|
|
611
595
|
y: function y(date, token, localize) {
|
|
612
596
|
// Ordinal number
|
|
613
597
|
if (token === 'yo') {
|
|
614
|
-
var signedYear = date.getUTCFullYear();
|
|
615
|
-
|
|
598
|
+
var signedYear = date.getUTCFullYear();
|
|
599
|
+
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
616
600
|
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
617
601
|
return localize.ordinalNumber(year, {
|
|
618
602
|
unit: 'year'
|
|
619
603
|
});
|
|
620
604
|
}
|
|
621
|
-
|
|
622
605
|
return formatters$1.y(date, token);
|
|
623
606
|
},
|
|
624
607
|
// Local week-numbering year
|
|
625
608
|
Y: function Y(date, token, localize, options) {
|
|
626
|
-
var signedWeekYear = getUTCWeekYear(date, options);
|
|
627
|
-
|
|
628
|
-
var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
|
609
|
+
var signedWeekYear = getUTCWeekYear(date, options);
|
|
610
|
+
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
611
|
+
var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
|
629
612
|
|
|
613
|
+
// Two digit year
|
|
630
614
|
if (token === 'YY') {
|
|
631
615
|
var twoDigitYear = weekYear % 100;
|
|
632
616
|
return addLeadingZeros(twoDigitYear, 2);
|
|
633
|
-
}
|
|
634
|
-
|
|
617
|
+
}
|
|
635
618
|
|
|
619
|
+
// Ordinal number
|
|
636
620
|
if (token === 'Yo') {
|
|
637
621
|
return localize.ordinalNumber(weekYear, {
|
|
638
622
|
unit: 'year'
|
|
639
623
|
});
|
|
640
|
-
}
|
|
641
|
-
|
|
624
|
+
}
|
|
642
625
|
|
|
626
|
+
// Padding
|
|
643
627
|
return addLeadingZeros(weekYear, token.length);
|
|
644
628
|
},
|
|
645
629
|
// ISO week-numbering year
|
|
646
630
|
R: function R(date, token) {
|
|
647
|
-
var isoWeekYear = getUTCISOWeekYear(date);
|
|
631
|
+
var isoWeekYear = getUTCISOWeekYear(date);
|
|
648
632
|
|
|
633
|
+
// Padding
|
|
649
634
|
return addLeadingZeros(isoWeekYear, token.length);
|
|
650
635
|
},
|
|
651
636
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
@@ -664,37 +649,31 @@ var formatters = {
|
|
|
664
649
|
// Quarter
|
|
665
650
|
Q: function Q(date, token, localize) {
|
|
666
651
|
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
667
|
-
|
|
668
652
|
switch (token) {
|
|
669
653
|
// 1, 2, 3, 4
|
|
670
654
|
case 'Q':
|
|
671
655
|
return String(quarter);
|
|
672
656
|
// 01, 02, 03, 04
|
|
673
|
-
|
|
674
657
|
case 'QQ':
|
|
675
658
|
return addLeadingZeros(quarter, 2);
|
|
676
659
|
// 1st, 2nd, 3rd, 4th
|
|
677
|
-
|
|
678
660
|
case 'Qo':
|
|
679
661
|
return localize.ordinalNumber(quarter, {
|
|
680
662
|
unit: 'quarter'
|
|
681
663
|
});
|
|
682
664
|
// Q1, Q2, Q3, Q4
|
|
683
|
-
|
|
684
665
|
case 'QQQ':
|
|
685
666
|
return localize.quarter(quarter, {
|
|
686
667
|
width: 'abbreviated',
|
|
687
668
|
context: 'formatting'
|
|
688
669
|
});
|
|
689
670
|
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
690
|
-
|
|
691
671
|
case 'QQQQQ':
|
|
692
672
|
return localize.quarter(quarter, {
|
|
693
673
|
width: 'narrow',
|
|
694
674
|
context: 'formatting'
|
|
695
675
|
});
|
|
696
676
|
// 1st quarter, 2nd quarter, ...
|
|
697
|
-
|
|
698
677
|
case 'QQQQ':
|
|
699
678
|
default:
|
|
700
679
|
return localize.quarter(quarter, {
|
|
@@ -706,37 +685,31 @@ var formatters = {
|
|
|
706
685
|
// Stand-alone quarter
|
|
707
686
|
q: function q(date, token, localize) {
|
|
708
687
|
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
709
|
-
|
|
710
688
|
switch (token) {
|
|
711
689
|
// 1, 2, 3, 4
|
|
712
690
|
case 'q':
|
|
713
691
|
return String(quarter);
|
|
714
692
|
// 01, 02, 03, 04
|
|
715
|
-
|
|
716
693
|
case 'qq':
|
|
717
694
|
return addLeadingZeros(quarter, 2);
|
|
718
695
|
// 1st, 2nd, 3rd, 4th
|
|
719
|
-
|
|
720
696
|
case 'qo':
|
|
721
697
|
return localize.ordinalNumber(quarter, {
|
|
722
698
|
unit: 'quarter'
|
|
723
699
|
});
|
|
724
700
|
// Q1, Q2, Q3, Q4
|
|
725
|
-
|
|
726
701
|
case 'qqq':
|
|
727
702
|
return localize.quarter(quarter, {
|
|
728
703
|
width: 'abbreviated',
|
|
729
704
|
context: 'standalone'
|
|
730
705
|
});
|
|
731
706
|
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
732
|
-
|
|
733
707
|
case 'qqqqq':
|
|
734
708
|
return localize.quarter(quarter, {
|
|
735
709
|
width: 'narrow',
|
|
736
710
|
context: 'standalone'
|
|
737
711
|
});
|
|
738
712
|
// 1st quarter, 2nd quarter, ...
|
|
739
|
-
|
|
740
713
|
case 'qqqq':
|
|
741
714
|
default:
|
|
742
715
|
return localize.quarter(quarter, {
|
|
@@ -748,33 +721,28 @@ var formatters = {
|
|
|
748
721
|
// Month
|
|
749
722
|
M: function M(date, token, localize) {
|
|
750
723
|
var month = date.getUTCMonth();
|
|
751
|
-
|
|
752
724
|
switch (token) {
|
|
753
725
|
case 'M':
|
|
754
726
|
case 'MM':
|
|
755
727
|
return formatters$1.M(date, token);
|
|
756
728
|
// 1st, 2nd, ..., 12th
|
|
757
|
-
|
|
758
729
|
case 'Mo':
|
|
759
730
|
return localize.ordinalNumber(month + 1, {
|
|
760
731
|
unit: 'month'
|
|
761
732
|
});
|
|
762
733
|
// Jan, Feb, ..., Dec
|
|
763
|
-
|
|
764
734
|
case 'MMM':
|
|
765
735
|
return localize.month(month, {
|
|
766
736
|
width: 'abbreviated',
|
|
767
737
|
context: 'formatting'
|
|
768
738
|
});
|
|
769
739
|
// J, F, ..., D
|
|
770
|
-
|
|
771
740
|
case 'MMMMM':
|
|
772
741
|
return localize.month(month, {
|
|
773
742
|
width: 'narrow',
|
|
774
743
|
context: 'formatting'
|
|
775
744
|
});
|
|
776
745
|
// January, February, ..., December
|
|
777
|
-
|
|
778
746
|
case 'MMMM':
|
|
779
747
|
default:
|
|
780
748
|
return localize.month(month, {
|
|
@@ -786,37 +754,31 @@ var formatters = {
|
|
|
786
754
|
// Stand-alone month
|
|
787
755
|
L: function L(date, token, localize) {
|
|
788
756
|
var month = date.getUTCMonth();
|
|
789
|
-
|
|
790
757
|
switch (token) {
|
|
791
758
|
// 1, 2, ..., 12
|
|
792
759
|
case 'L':
|
|
793
760
|
return String(month + 1);
|
|
794
761
|
// 01, 02, ..., 12
|
|
795
|
-
|
|
796
762
|
case 'LL':
|
|
797
763
|
return addLeadingZeros(month + 1, 2);
|
|
798
764
|
// 1st, 2nd, ..., 12th
|
|
799
|
-
|
|
800
765
|
case 'Lo':
|
|
801
766
|
return localize.ordinalNumber(month + 1, {
|
|
802
767
|
unit: 'month'
|
|
803
768
|
});
|
|
804
769
|
// Jan, Feb, ..., Dec
|
|
805
|
-
|
|
806
770
|
case 'LLL':
|
|
807
771
|
return localize.month(month, {
|
|
808
772
|
width: 'abbreviated',
|
|
809
773
|
context: 'standalone'
|
|
810
774
|
});
|
|
811
775
|
// J, F, ..., D
|
|
812
|
-
|
|
813
776
|
case 'LLLLL':
|
|
814
777
|
return localize.month(month, {
|
|
815
778
|
width: 'narrow',
|
|
816
779
|
context: 'standalone'
|
|
817
780
|
});
|
|
818
781
|
// January, February, ..., December
|
|
819
|
-
|
|
820
782
|
case 'LLLL':
|
|
821
783
|
default:
|
|
822
784
|
return localize.month(month, {
|
|
@@ -828,25 +790,21 @@ var formatters = {
|
|
|
828
790
|
// Local week of year
|
|
829
791
|
w: function w(date, token, localize, options) {
|
|
830
792
|
var week = getUTCWeek(date, options);
|
|
831
|
-
|
|
832
793
|
if (token === 'wo') {
|
|
833
794
|
return localize.ordinalNumber(week, {
|
|
834
795
|
unit: 'week'
|
|
835
796
|
});
|
|
836
797
|
}
|
|
837
|
-
|
|
838
798
|
return addLeadingZeros(week, token.length);
|
|
839
799
|
},
|
|
840
800
|
// ISO week of year
|
|
841
801
|
I: function I(date, token, localize) {
|
|
842
802
|
var isoWeek = getUTCISOWeek(date);
|
|
843
|
-
|
|
844
803
|
if (token === 'Io') {
|
|
845
804
|
return localize.ordinalNumber(isoWeek, {
|
|
846
805
|
unit: 'week'
|
|
847
806
|
});
|
|
848
807
|
}
|
|
849
|
-
|
|
850
808
|
return addLeadingZeros(isoWeek, token.length);
|
|
851
809
|
},
|
|
852
810
|
// Day of the month
|
|
@@ -856,25 +814,21 @@ var formatters = {
|
|
|
856
814
|
unit: 'date'
|
|
857
815
|
});
|
|
858
816
|
}
|
|
859
|
-
|
|
860
817
|
return formatters$1.d(date, token);
|
|
861
818
|
},
|
|
862
819
|
// Day of year
|
|
863
820
|
D: function D(date, token, localize) {
|
|
864
821
|
var dayOfYear = getUTCDayOfYear(date);
|
|
865
|
-
|
|
866
822
|
if (token === 'Do') {
|
|
867
823
|
return localize.ordinalNumber(dayOfYear, {
|
|
868
824
|
unit: 'dayOfYear'
|
|
869
825
|
});
|
|
870
826
|
}
|
|
871
|
-
|
|
872
827
|
return addLeadingZeros(dayOfYear, token.length);
|
|
873
828
|
},
|
|
874
829
|
// Day of week
|
|
875
830
|
E: function E(date, token, localize) {
|
|
876
831
|
var dayOfWeek = date.getUTCDay();
|
|
877
|
-
|
|
878
832
|
switch (token) {
|
|
879
833
|
// Tue
|
|
880
834
|
case 'E':
|
|
@@ -885,21 +839,18 @@ var formatters = {
|
|
|
885
839
|
context: 'formatting'
|
|
886
840
|
});
|
|
887
841
|
// T
|
|
888
|
-
|
|
889
842
|
case 'EEEEE':
|
|
890
843
|
return localize.day(dayOfWeek, {
|
|
891
844
|
width: 'narrow',
|
|
892
845
|
context: 'formatting'
|
|
893
846
|
});
|
|
894
847
|
// Tu
|
|
895
|
-
|
|
896
848
|
case 'EEEEEE':
|
|
897
849
|
return localize.day(dayOfWeek, {
|
|
898
850
|
width: 'short',
|
|
899
851
|
context: 'formatting'
|
|
900
852
|
});
|
|
901
853
|
// Tuesday
|
|
902
|
-
|
|
903
854
|
case 'EEEE':
|
|
904
855
|
default:
|
|
905
856
|
return localize.day(dayOfWeek, {
|
|
@@ -912,43 +863,36 @@ var formatters = {
|
|
|
912
863
|
e: function e(date, token, localize, options) {
|
|
913
864
|
var dayOfWeek = date.getUTCDay();
|
|
914
865
|
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
915
|
-
|
|
916
866
|
switch (token) {
|
|
917
867
|
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
918
868
|
case 'e':
|
|
919
869
|
return String(localDayOfWeek);
|
|
920
870
|
// Padded numerical value
|
|
921
|
-
|
|
922
871
|
case 'ee':
|
|
923
872
|
return addLeadingZeros(localDayOfWeek, 2);
|
|
924
873
|
// 1st, 2nd, ..., 7th
|
|
925
|
-
|
|
926
874
|
case 'eo':
|
|
927
875
|
return localize.ordinalNumber(localDayOfWeek, {
|
|
928
876
|
unit: 'day'
|
|
929
877
|
});
|
|
930
|
-
|
|
931
878
|
case 'eee':
|
|
932
879
|
return localize.day(dayOfWeek, {
|
|
933
880
|
width: 'abbreviated',
|
|
934
881
|
context: 'formatting'
|
|
935
882
|
});
|
|
936
883
|
// T
|
|
937
|
-
|
|
938
884
|
case 'eeeee':
|
|
939
885
|
return localize.day(dayOfWeek, {
|
|
940
886
|
width: 'narrow',
|
|
941
887
|
context: 'formatting'
|
|
942
888
|
});
|
|
943
889
|
// Tu
|
|
944
|
-
|
|
945
890
|
case 'eeeeee':
|
|
946
891
|
return localize.day(dayOfWeek, {
|
|
947
892
|
width: 'short',
|
|
948
893
|
context: 'formatting'
|
|
949
894
|
});
|
|
950
895
|
// Tuesday
|
|
951
|
-
|
|
952
896
|
case 'eeee':
|
|
953
897
|
default:
|
|
954
898
|
return localize.day(dayOfWeek, {
|
|
@@ -961,43 +905,36 @@ var formatters = {
|
|
|
961
905
|
c: function c(date, token, localize, options) {
|
|
962
906
|
var dayOfWeek = date.getUTCDay();
|
|
963
907
|
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
964
|
-
|
|
965
908
|
switch (token) {
|
|
966
909
|
// Numerical value (same as in `e`)
|
|
967
910
|
case 'c':
|
|
968
911
|
return String(localDayOfWeek);
|
|
969
912
|
// Padded numerical value
|
|
970
|
-
|
|
971
913
|
case 'cc':
|
|
972
914
|
return addLeadingZeros(localDayOfWeek, token.length);
|
|
973
915
|
// 1st, 2nd, ..., 7th
|
|
974
|
-
|
|
975
916
|
case 'co':
|
|
976
917
|
return localize.ordinalNumber(localDayOfWeek, {
|
|
977
918
|
unit: 'day'
|
|
978
919
|
});
|
|
979
|
-
|
|
980
920
|
case 'ccc':
|
|
981
921
|
return localize.day(dayOfWeek, {
|
|
982
922
|
width: 'abbreviated',
|
|
983
923
|
context: 'standalone'
|
|
984
924
|
});
|
|
985
925
|
// T
|
|
986
|
-
|
|
987
926
|
case 'ccccc':
|
|
988
927
|
return localize.day(dayOfWeek, {
|
|
989
928
|
width: 'narrow',
|
|
990
929
|
context: 'standalone'
|
|
991
930
|
});
|
|
992
931
|
// Tu
|
|
993
|
-
|
|
994
932
|
case 'cccccc':
|
|
995
933
|
return localize.day(dayOfWeek, {
|
|
996
934
|
width: 'short',
|
|
997
935
|
context: 'standalone'
|
|
998
936
|
});
|
|
999
937
|
// Tuesday
|
|
1000
|
-
|
|
1001
938
|
case 'cccc':
|
|
1002
939
|
default:
|
|
1003
940
|
return localize.day(dayOfWeek, {
|
|
@@ -1010,44 +947,37 @@ var formatters = {
|
|
|
1010
947
|
i: function i(date, token, localize) {
|
|
1011
948
|
var dayOfWeek = date.getUTCDay();
|
|
1012
949
|
var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
|
1013
|
-
|
|
1014
950
|
switch (token) {
|
|
1015
951
|
// 2
|
|
1016
952
|
case 'i':
|
|
1017
953
|
return String(isoDayOfWeek);
|
|
1018
954
|
// 02
|
|
1019
|
-
|
|
1020
955
|
case 'ii':
|
|
1021
956
|
return addLeadingZeros(isoDayOfWeek, token.length);
|
|
1022
957
|
// 2nd
|
|
1023
|
-
|
|
1024
958
|
case 'io':
|
|
1025
959
|
return localize.ordinalNumber(isoDayOfWeek, {
|
|
1026
960
|
unit: 'day'
|
|
1027
961
|
});
|
|
1028
962
|
// Tue
|
|
1029
|
-
|
|
1030
963
|
case 'iii':
|
|
1031
964
|
return localize.day(dayOfWeek, {
|
|
1032
965
|
width: 'abbreviated',
|
|
1033
966
|
context: 'formatting'
|
|
1034
967
|
});
|
|
1035
968
|
// T
|
|
1036
|
-
|
|
1037
969
|
case 'iiiii':
|
|
1038
970
|
return localize.day(dayOfWeek, {
|
|
1039
971
|
width: 'narrow',
|
|
1040
972
|
context: 'formatting'
|
|
1041
973
|
});
|
|
1042
974
|
// Tu
|
|
1043
|
-
|
|
1044
975
|
case 'iiiiii':
|
|
1045
976
|
return localize.day(dayOfWeek, {
|
|
1046
977
|
width: 'short',
|
|
1047
978
|
context: 'formatting'
|
|
1048
979
|
});
|
|
1049
980
|
// Tuesday
|
|
1050
|
-
|
|
1051
981
|
case 'iiii':
|
|
1052
982
|
default:
|
|
1053
983
|
return localize.day(dayOfWeek, {
|
|
@@ -1060,7 +990,6 @@ var formatters = {
|
|
|
1060
990
|
a: function a(date, token, localize) {
|
|
1061
991
|
var hours = date.getUTCHours();
|
|
1062
992
|
var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
|
|
1063
|
-
|
|
1064
993
|
switch (token) {
|
|
1065
994
|
case 'a':
|
|
1066
995
|
case 'aa':
|
|
@@ -1068,19 +997,16 @@ var formatters = {
|
|
|
1068
997
|
width: 'abbreviated',
|
|
1069
998
|
context: 'formatting'
|
|
1070
999
|
});
|
|
1071
|
-
|
|
1072
1000
|
case 'aaa':
|
|
1073
1001
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
1074
1002
|
width: 'abbreviated',
|
|
1075
1003
|
context: 'formatting'
|
|
1076
1004
|
}).toLowerCase();
|
|
1077
|
-
|
|
1078
1005
|
case 'aaaaa':
|
|
1079
1006
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
1080
1007
|
width: 'narrow',
|
|
1081
1008
|
context: 'formatting'
|
|
1082
1009
|
});
|
|
1083
|
-
|
|
1084
1010
|
case 'aaaa':
|
|
1085
1011
|
default:
|
|
1086
1012
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
@@ -1093,7 +1019,6 @@ var formatters = {
|
|
|
1093
1019
|
b: function b(date, token, localize) {
|
|
1094
1020
|
var hours = date.getUTCHours();
|
|
1095
1021
|
var dayPeriodEnumValue;
|
|
1096
|
-
|
|
1097
1022
|
if (hours === 12) {
|
|
1098
1023
|
dayPeriodEnumValue = dayPeriodEnum.noon;
|
|
1099
1024
|
} else if (hours === 0) {
|
|
@@ -1101,7 +1026,6 @@ var formatters = {
|
|
|
1101
1026
|
} else {
|
|
1102
1027
|
dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
|
|
1103
1028
|
}
|
|
1104
|
-
|
|
1105
1029
|
switch (token) {
|
|
1106
1030
|
case 'b':
|
|
1107
1031
|
case 'bb':
|
|
@@ -1109,19 +1033,16 @@ var formatters = {
|
|
|
1109
1033
|
width: 'abbreviated',
|
|
1110
1034
|
context: 'formatting'
|
|
1111
1035
|
});
|
|
1112
|
-
|
|
1113
1036
|
case 'bbb':
|
|
1114
1037
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
1115
1038
|
width: 'abbreviated',
|
|
1116
1039
|
context: 'formatting'
|
|
1117
1040
|
}).toLowerCase();
|
|
1118
|
-
|
|
1119
1041
|
case 'bbbbb':
|
|
1120
1042
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
1121
1043
|
width: 'narrow',
|
|
1122
1044
|
context: 'formatting'
|
|
1123
1045
|
});
|
|
1124
|
-
|
|
1125
1046
|
case 'bbbb':
|
|
1126
1047
|
default:
|
|
1127
1048
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
@@ -1134,7 +1055,6 @@ var formatters = {
|
|
|
1134
1055
|
B: function B(date, token, localize) {
|
|
1135
1056
|
var hours = date.getUTCHours();
|
|
1136
1057
|
var dayPeriodEnumValue;
|
|
1137
|
-
|
|
1138
1058
|
if (hours >= 17) {
|
|
1139
1059
|
dayPeriodEnumValue = dayPeriodEnum.evening;
|
|
1140
1060
|
} else if (hours >= 12) {
|
|
@@ -1144,7 +1064,6 @@ var formatters = {
|
|
|
1144
1064
|
} else {
|
|
1145
1065
|
dayPeriodEnumValue = dayPeriodEnum.night;
|
|
1146
1066
|
}
|
|
1147
|
-
|
|
1148
1067
|
switch (token) {
|
|
1149
1068
|
case 'B':
|
|
1150
1069
|
case 'BB':
|
|
@@ -1153,13 +1072,11 @@ var formatters = {
|
|
|
1153
1072
|
width: 'abbreviated',
|
|
1154
1073
|
context: 'formatting'
|
|
1155
1074
|
});
|
|
1156
|
-
|
|
1157
1075
|
case 'BBBBB':
|
|
1158
1076
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
1159
1077
|
width: 'narrow',
|
|
1160
1078
|
context: 'formatting'
|
|
1161
1079
|
});
|
|
1162
|
-
|
|
1163
1080
|
case 'BBBB':
|
|
1164
1081
|
default:
|
|
1165
1082
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
@@ -1177,7 +1094,6 @@ var formatters = {
|
|
|
1177
1094
|
unit: 'hour'
|
|
1178
1095
|
});
|
|
1179
1096
|
}
|
|
1180
|
-
|
|
1181
1097
|
return formatters$1.h(date, token);
|
|
1182
1098
|
},
|
|
1183
1099
|
// Hour [0-23]
|
|
@@ -1187,32 +1103,27 @@ var formatters = {
|
|
|
1187
1103
|
unit: 'hour'
|
|
1188
1104
|
});
|
|
1189
1105
|
}
|
|
1190
|
-
|
|
1191
1106
|
return formatters$1.H(date, token);
|
|
1192
1107
|
},
|
|
1193
1108
|
// Hour [0-11]
|
|
1194
1109
|
K: function K(date, token, localize) {
|
|
1195
1110
|
var hours = date.getUTCHours() % 12;
|
|
1196
|
-
|
|
1197
1111
|
if (token === 'Ko') {
|
|
1198
1112
|
return localize.ordinalNumber(hours, {
|
|
1199
1113
|
unit: 'hour'
|
|
1200
1114
|
});
|
|
1201
1115
|
}
|
|
1202
|
-
|
|
1203
1116
|
return addLeadingZeros(hours, token.length);
|
|
1204
1117
|
},
|
|
1205
1118
|
// Hour [1-24]
|
|
1206
1119
|
k: function k(date, token, localize) {
|
|
1207
1120
|
var hours = date.getUTCHours();
|
|
1208
1121
|
if (hours === 0) hours = 24;
|
|
1209
|
-
|
|
1210
1122
|
if (token === 'ko') {
|
|
1211
1123
|
return localize.ordinalNumber(hours, {
|
|
1212
1124
|
unit: 'hour'
|
|
1213
1125
|
});
|
|
1214
1126
|
}
|
|
1215
|
-
|
|
1216
1127
|
return addLeadingZeros(hours, token.length);
|
|
1217
1128
|
},
|
|
1218
1129
|
// Minute
|
|
@@ -1222,7 +1133,6 @@ var formatters = {
|
|
|
1222
1133
|
unit: 'minute'
|
|
1223
1134
|
});
|
|
1224
1135
|
}
|
|
1225
|
-
|
|
1226
1136
|
return formatters$1.m(date, token);
|
|
1227
1137
|
},
|
|
1228
1138
|
// Second
|
|
@@ -1232,7 +1142,6 @@ var formatters = {
|
|
|
1232
1142
|
unit: 'second'
|
|
1233
1143
|
});
|
|
1234
1144
|
}
|
|
1235
|
-
|
|
1236
1145
|
return formatters$1.s(date, token);
|
|
1237
1146
|
},
|
|
1238
1147
|
// Fraction of second
|
|
@@ -1243,30 +1152,27 @@ var formatters = {
|
|
|
1243
1152
|
X: function X(date, token, _localize, options) {
|
|
1244
1153
|
var originalDate = options._originalDate || date;
|
|
1245
1154
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1246
|
-
|
|
1247
1155
|
if (timezoneOffset === 0) {
|
|
1248
1156
|
return 'Z';
|
|
1249
1157
|
}
|
|
1250
|
-
|
|
1251
1158
|
switch (token) {
|
|
1252
1159
|
// Hours and optional minutes
|
|
1253
1160
|
case 'X':
|
|
1254
1161
|
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
1162
|
+
|
|
1255
1163
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1256
1164
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1257
1165
|
// so this token always has the same output as `XX`
|
|
1258
|
-
|
|
1259
1166
|
case 'XXXX':
|
|
1260
1167
|
case 'XX':
|
|
1261
1168
|
// Hours and minutes without `:` delimiter
|
|
1262
1169
|
return formatTimezone(timezoneOffset);
|
|
1170
|
+
|
|
1263
1171
|
// Hours, minutes and optional seconds with `:` delimiter
|
|
1264
1172
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1265
1173
|
// so this token always has the same output as `XXX`
|
|
1266
|
-
|
|
1267
1174
|
case 'XXXXX':
|
|
1268
1175
|
case 'XXX': // Hours and minutes with `:` delimiter
|
|
1269
|
-
|
|
1270
1176
|
default:
|
|
1271
1177
|
return formatTimezone(timezoneOffset, ':');
|
|
1272
1178
|
}
|
|
@@ -1275,26 +1181,24 @@ var formatters = {
|
|
|
1275
1181
|
x: function x(date, token, _localize, options) {
|
|
1276
1182
|
var originalDate = options._originalDate || date;
|
|
1277
1183
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1278
|
-
|
|
1279
1184
|
switch (token) {
|
|
1280
1185
|
// Hours and optional minutes
|
|
1281
1186
|
case 'x':
|
|
1282
1187
|
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
1188
|
+
|
|
1283
1189
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1284
1190
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1285
1191
|
// so this token always has the same output as `xx`
|
|
1286
|
-
|
|
1287
1192
|
case 'xxxx':
|
|
1288
1193
|
case 'xx':
|
|
1289
1194
|
// Hours and minutes without `:` delimiter
|
|
1290
1195
|
return formatTimezone(timezoneOffset);
|
|
1196
|
+
|
|
1291
1197
|
// Hours, minutes and optional seconds with `:` delimiter
|
|
1292
1198
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1293
1199
|
// so this token always has the same output as `xxx`
|
|
1294
|
-
|
|
1295
1200
|
case 'xxxxx':
|
|
1296
1201
|
case 'xxx': // Hours and minutes with `:` delimiter
|
|
1297
|
-
|
|
1298
1202
|
default:
|
|
1299
1203
|
return formatTimezone(timezoneOffset, ':');
|
|
1300
1204
|
}
|
|
@@ -1303,7 +1207,6 @@ var formatters = {
|
|
|
1303
1207
|
O: function O(date, token, _localize, options) {
|
|
1304
1208
|
var originalDate = options._originalDate || date;
|
|
1305
1209
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1306
|
-
|
|
1307
1210
|
switch (token) {
|
|
1308
1211
|
// Short
|
|
1309
1212
|
case 'O':
|
|
@@ -1311,7 +1214,6 @@ var formatters = {
|
|
|
1311
1214
|
case 'OOO':
|
|
1312
1215
|
return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
|
|
1313
1216
|
// Long
|
|
1314
|
-
|
|
1315
1217
|
case 'OOOO':
|
|
1316
1218
|
default:
|
|
1317
1219
|
return 'GMT' + formatTimezone(timezoneOffset, ':');
|
|
@@ -1321,7 +1223,6 @@ var formatters = {
|
|
|
1321
1223
|
z: function z(date, token, _localize, options) {
|
|
1322
1224
|
var originalDate = options._originalDate || date;
|
|
1323
1225
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1324
|
-
|
|
1325
1226
|
switch (token) {
|
|
1326
1227
|
// Short
|
|
1327
1228
|
case 'z':
|
|
@@ -1329,7 +1230,6 @@ var formatters = {
|
|
|
1329
1230
|
case 'zzz':
|
|
1330
1231
|
return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
|
|
1331
1232
|
// Long
|
|
1332
|
-
|
|
1333
1233
|
case 'zzzz':
|
|
1334
1234
|
default:
|
|
1335
1235
|
return 'GMT' + formatTimezone(timezoneOffset, ':');
|
|
@@ -1348,30 +1248,24 @@ var formatters = {
|
|
|
1348
1248
|
return addLeadingZeros(timestamp, token.length);
|
|
1349
1249
|
}
|
|
1350
1250
|
};
|
|
1351
|
-
|
|
1352
1251
|
function formatTimezoneShort(offset, dirtyDelimiter) {
|
|
1353
1252
|
var sign = offset > 0 ? '-' : '+';
|
|
1354
1253
|
var absOffset = Math.abs(offset);
|
|
1355
1254
|
var hours = Math.floor(absOffset / 60);
|
|
1356
1255
|
var minutes = absOffset % 60;
|
|
1357
|
-
|
|
1358
1256
|
if (minutes === 0) {
|
|
1359
1257
|
return sign + String(hours);
|
|
1360
1258
|
}
|
|
1361
|
-
|
|
1362
1259
|
var delimiter = dirtyDelimiter || '';
|
|
1363
1260
|
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
|
|
1364
1261
|
}
|
|
1365
|
-
|
|
1366
1262
|
function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
|
|
1367
1263
|
if (offset % 60 === 0) {
|
|
1368
1264
|
var sign = offset > 0 ? '-' : '+';
|
|
1369
1265
|
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
|
|
1370
1266
|
}
|
|
1371
|
-
|
|
1372
1267
|
return formatTimezone(offset, dirtyDelimiter);
|
|
1373
1268
|
}
|
|
1374
|
-
|
|
1375
1269
|
function formatTimezone(offset, dirtyDelimiter) {
|
|
1376
1270
|
var delimiter = dirtyDelimiter || '';
|
|
1377
1271
|
var sign = offset > 0 ? '-' : '+';
|
|
@@ -1387,17 +1281,14 @@ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
|
|
|
1387
1281
|
return formatLong.date({
|
|
1388
1282
|
width: 'short'
|
|
1389
1283
|
});
|
|
1390
|
-
|
|
1391
1284
|
case 'PP':
|
|
1392
1285
|
return formatLong.date({
|
|
1393
1286
|
width: 'medium'
|
|
1394
1287
|
});
|
|
1395
|
-
|
|
1396
1288
|
case 'PPP':
|
|
1397
1289
|
return formatLong.date({
|
|
1398
1290
|
width: 'long'
|
|
1399
1291
|
});
|
|
1400
|
-
|
|
1401
1292
|
case 'PPPP':
|
|
1402
1293
|
default:
|
|
1403
1294
|
return formatLong.date({
|
|
@@ -1405,24 +1296,20 @@ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
|
|
|
1405
1296
|
});
|
|
1406
1297
|
}
|
|
1407
1298
|
};
|
|
1408
|
-
|
|
1409
1299
|
var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
|
|
1410
1300
|
switch (pattern) {
|
|
1411
1301
|
case 'p':
|
|
1412
1302
|
return formatLong.time({
|
|
1413
1303
|
width: 'short'
|
|
1414
1304
|
});
|
|
1415
|
-
|
|
1416
1305
|
case 'pp':
|
|
1417
1306
|
return formatLong.time({
|
|
1418
1307
|
width: 'medium'
|
|
1419
1308
|
});
|
|
1420
|
-
|
|
1421
1309
|
case 'ppp':
|
|
1422
1310
|
return formatLong.time({
|
|
1423
1311
|
width: 'long'
|
|
1424
1312
|
});
|
|
1425
|
-
|
|
1426
1313
|
case 'pppp':
|
|
1427
1314
|
default:
|
|
1428
1315
|
return formatLong.time({
|
|
@@ -1430,37 +1317,30 @@ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
|
|
|
1430
1317
|
});
|
|
1431
1318
|
}
|
|
1432
1319
|
};
|
|
1433
|
-
|
|
1434
1320
|
var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
|
|
1435
1321
|
var matchResult = pattern.match(/(P+)(p+)?/) || [];
|
|
1436
1322
|
var datePattern = matchResult[1];
|
|
1437
1323
|
var timePattern = matchResult[2];
|
|
1438
|
-
|
|
1439
1324
|
if (!timePattern) {
|
|
1440
1325
|
return dateLongFormatter(pattern, formatLong);
|
|
1441
1326
|
}
|
|
1442
|
-
|
|
1443
1327
|
var dateTimeFormat;
|
|
1444
|
-
|
|
1445
1328
|
switch (datePattern) {
|
|
1446
1329
|
case 'P':
|
|
1447
1330
|
dateTimeFormat = formatLong.dateTime({
|
|
1448
1331
|
width: 'short'
|
|
1449
1332
|
});
|
|
1450
1333
|
break;
|
|
1451
|
-
|
|
1452
1334
|
case 'PP':
|
|
1453
1335
|
dateTimeFormat = formatLong.dateTime({
|
|
1454
1336
|
width: 'medium'
|
|
1455
1337
|
});
|
|
1456
1338
|
break;
|
|
1457
|
-
|
|
1458
1339
|
case 'PPP':
|
|
1459
1340
|
dateTimeFormat = formatLong.dateTime({
|
|
1460
1341
|
width: 'long'
|
|
1461
1342
|
});
|
|
1462
1343
|
break;
|
|
1463
|
-
|
|
1464
1344
|
case 'PPPP':
|
|
1465
1345
|
default:
|
|
1466
1346
|
dateTimeFormat = formatLong.dateTime({
|
|
@@ -1468,10 +1348,8 @@ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong)
|
|
|
1468
1348
|
});
|
|
1469
1349
|
break;
|
|
1470
1350
|
}
|
|
1471
|
-
|
|
1472
1351
|
return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
|
|
1473
1352
|
};
|
|
1474
|
-
|
|
1475
1353
|
var longFormatters = {
|
|
1476
1354
|
p: timeLongFormatter,
|
|
1477
1355
|
P: dateTimeLongFormatter
|
|
@@ -1560,11 +1438,9 @@ var formatDistanceLocale = {
|
|
|
1560
1438
|
other: 'almost {{count}} years'
|
|
1561
1439
|
}
|
|
1562
1440
|
};
|
|
1563
|
-
|
|
1564
1441
|
var formatDistance = function formatDistance(token, count, options) {
|
|
1565
1442
|
var result;
|
|
1566
1443
|
var tokenValue = formatDistanceLocale[token];
|
|
1567
|
-
|
|
1568
1444
|
if (typeof tokenValue === 'string') {
|
|
1569
1445
|
result = tokenValue;
|
|
1570
1446
|
} else if (count === 1) {
|
|
@@ -1572,7 +1448,6 @@ var formatDistance = function formatDistance(token, count, options) {
|
|
|
1572
1448
|
} else {
|
|
1573
1449
|
result = tokenValue.other.replace('{{count}}', count.toString());
|
|
1574
1450
|
}
|
|
1575
|
-
|
|
1576
1451
|
if (options !== null && options !== void 0 && options.addSuffix) {
|
|
1577
1452
|
if (options.comparison && options.comparison > 0) {
|
|
1578
1453
|
return 'in ' + result;
|
|
@@ -1580,7 +1455,6 @@ var formatDistance = function formatDistance(token, count, options) {
|
|
|
1580
1455
|
return result + ' ago';
|
|
1581
1456
|
}
|
|
1582
1457
|
}
|
|
1583
|
-
|
|
1584
1458
|
return result;
|
|
1585
1459
|
};
|
|
1586
1460
|
|
|
@@ -1635,7 +1509,6 @@ var formatRelativeLocale = {
|
|
|
1635
1509
|
nextWeek: "eeee 'at' p",
|
|
1636
1510
|
other: 'P'
|
|
1637
1511
|
};
|
|
1638
|
-
|
|
1639
1512
|
var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
|
|
1640
1513
|
return formatRelativeLocale[token];
|
|
1641
1514
|
};
|
|
@@ -1644,21 +1517,17 @@ function buildLocalizeFn(args) {
|
|
|
1644
1517
|
return function (dirtyIndex, options) {
|
|
1645
1518
|
var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
|
|
1646
1519
|
var valuesArray;
|
|
1647
|
-
|
|
1648
1520
|
if (context === 'formatting' && args.formattingValues) {
|
|
1649
1521
|
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
1650
1522
|
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
|
|
1651
1523
|
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
1652
1524
|
} else {
|
|
1653
1525
|
var _defaultWidth = args.defaultWidth;
|
|
1654
|
-
|
|
1655
1526
|
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
|
|
1656
|
-
|
|
1657
1527
|
valuesArray = args.values[_width] || args.values[_defaultWidth];
|
|
1658
1528
|
}
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1529
|
+
var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
|
|
1530
|
+
// @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!
|
|
1662
1531
|
return valuesArray[index];
|
|
1663
1532
|
};
|
|
1664
1533
|
}
|
|
@@ -1672,11 +1541,12 @@ var quarterValues = {
|
|
|
1672
1541
|
narrow: ['1', '2', '3', '4'],
|
|
1673
1542
|
abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
|
|
1674
1543
|
wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
|
|
1675
|
-
};
|
|
1544
|
+
};
|
|
1545
|
+
|
|
1546
|
+
// Note: in English, the names of days of the week and months are capitalized.
|
|
1676
1547
|
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
|
|
1677
1548
|
// Generally, formatted dates should look like they are in the middle of a sentence,
|
|
1678
1549
|
// e.g. in Spanish language the weekdays and months should be in the lowercase.
|
|
1679
|
-
|
|
1680
1550
|
var monthValues = {
|
|
1681
1551
|
narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
|
|
1682
1552
|
abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
|
@@ -1752,9 +1622,10 @@ var formattingDayPeriodValues = {
|
|
|
1752
1622
|
night: 'at night'
|
|
1753
1623
|
}
|
|
1754
1624
|
};
|
|
1755
|
-
|
|
1756
1625
|
var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
|
|
1757
|
-
var number = Number(dirtyNumber);
|
|
1626
|
+
var number = Number(dirtyNumber);
|
|
1627
|
+
|
|
1628
|
+
// If ordinal numbers depend on context, for example,
|
|
1758
1629
|
// if they are different for different grammatical genders,
|
|
1759
1630
|
// use `options.unit`.
|
|
1760
1631
|
//
|
|
@@ -1762,23 +1633,18 @@ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
|
|
|
1762
1633
|
// 'day', 'hour', 'minute', 'second'.
|
|
1763
1634
|
|
|
1764
1635
|
var rem100 = number % 100;
|
|
1765
|
-
|
|
1766
1636
|
if (rem100 > 20 || rem100 < 10) {
|
|
1767
1637
|
switch (rem100 % 10) {
|
|
1768
1638
|
case 1:
|
|
1769
1639
|
return number + 'st';
|
|
1770
|
-
|
|
1771
1640
|
case 2:
|
|
1772
1641
|
return number + 'nd';
|
|
1773
|
-
|
|
1774
1642
|
case 3:
|
|
1775
1643
|
return number + 'rd';
|
|
1776
1644
|
}
|
|
1777
1645
|
}
|
|
1778
|
-
|
|
1779
1646
|
return number + 'th';
|
|
1780
1647
|
};
|
|
1781
|
-
|
|
1782
1648
|
var localize = {
|
|
1783
1649
|
ordinalNumber: ordinalNumber,
|
|
1784
1650
|
era: buildLocalizeFn({
|
|
@@ -1814,11 +1680,9 @@ function buildMatchFn(args) {
|
|
|
1814
1680
|
var width = options.width;
|
|
1815
1681
|
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
1816
1682
|
var matchResult = string.match(matchPattern);
|
|
1817
|
-
|
|
1818
1683
|
if (!matchResult) {
|
|
1819
1684
|
return null;
|
|
1820
1685
|
}
|
|
1821
|
-
|
|
1822
1686
|
var matchedString = matchResult[0];
|
|
1823
1687
|
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
1824
1688
|
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
|
|
@@ -1836,24 +1700,20 @@ function buildMatchFn(args) {
|
|
|
1836
1700
|
};
|
|
1837
1701
|
};
|
|
1838
1702
|
}
|
|
1839
|
-
|
|
1840
1703
|
function findKey(object, predicate) {
|
|
1841
1704
|
for (var key in object) {
|
|
1842
1705
|
if (object.hasOwnProperty(key) && predicate(object[key])) {
|
|
1843
1706
|
return key;
|
|
1844
1707
|
}
|
|
1845
1708
|
}
|
|
1846
|
-
|
|
1847
1709
|
return undefined;
|
|
1848
1710
|
}
|
|
1849
|
-
|
|
1850
1711
|
function findIndex(array, predicate) {
|
|
1851
1712
|
for (var key = 0; key < array.length; key++) {
|
|
1852
1713
|
if (predicate(array[key])) {
|
|
1853
1714
|
return key;
|
|
1854
1715
|
}
|
|
1855
1716
|
}
|
|
1856
|
-
|
|
1857
1717
|
return undefined;
|
|
1858
1718
|
}
|
|
1859
1719
|
|
|
@@ -1988,9 +1848,7 @@ var locale = {
|
|
|
1988
1848
|
localize: localize,
|
|
1989
1849
|
match: match,
|
|
1990
1850
|
options: {
|
|
1991
|
-
weekStartsOn: 0
|
|
1992
|
-
/* Sunday */
|
|
1993
|
-
,
|
|
1851
|
+
weekStartsOn: 0 /* Sunday */,
|
|
1994
1852
|
firstWeekContainsDate: 1
|
|
1995
1853
|
}
|
|
1996
1854
|
};
|
|
@@ -2005,14 +1863,15 @@ var locale = {
|
|
|
2005
1863
|
// If there is no matching single quote
|
|
2006
1864
|
// then the sequence will continue until the end of the string.
|
|
2007
1865
|
// - . matches any single character unmatched by previous parts of the RegExps
|
|
1866
|
+
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
|
2008
1867
|
|
|
2009
|
-
|
|
1868
|
+
// This RegExp catches symbols escaped by quotes, and also
|
|
2010
1869
|
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
|
|
2011
|
-
|
|
2012
1870
|
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
2013
1871
|
var escapedStringRegExp = /^'([^]*?)'?$/;
|
|
2014
1872
|
var doubleQuoteRegExp = /''/g;
|
|
2015
1873
|
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
1874
|
+
|
|
2016
1875
|
/**
|
|
2017
1876
|
* @name format
|
|
2018
1877
|
* @category Common Helpers
|
|
@@ -2307,40 +2166,36 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
2307
2166
|
|
|
2308
2167
|
function format(dirtyDate, dirtyFormatStr, options) {
|
|
2309
2168
|
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;
|
|
2310
|
-
|
|
2311
2169
|
requiredArgs(2, arguments);
|
|
2312
2170
|
var formatStr = String(dirtyFormatStr);
|
|
2313
2171
|
var defaultOptions = getDefaultOptions();
|
|
2314
2172
|
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;
|
|
2315
|
-
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);
|
|
2173
|
+
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);
|
|
2316
2174
|
|
|
2175
|
+
// Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
|
2317
2176
|
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
2318
2177
|
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
|
2319
2178
|
}
|
|
2179
|
+
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);
|
|
2320
2180
|
|
|
2321
|
-
|
|
2322
|
-
|
|
2181
|
+
// Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
2323
2182
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
2324
2183
|
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
|
2325
2184
|
}
|
|
2326
|
-
|
|
2327
2185
|
if (!locale$1.localize) {
|
|
2328
2186
|
throw new RangeError('locale must contain localize property');
|
|
2329
2187
|
}
|
|
2330
|
-
|
|
2331
2188
|
if (!locale$1.formatLong) {
|
|
2332
2189
|
throw new RangeError('locale must contain formatLong property');
|
|
2333
2190
|
}
|
|
2334
|
-
|
|
2335
2191
|
var originalDate = toDate(dirtyDate);
|
|
2336
|
-
|
|
2337
2192
|
if (!isValid(originalDate)) {
|
|
2338
2193
|
throw new RangeError('Invalid time value');
|
|
2339
|
-
}
|
|
2194
|
+
}
|
|
2195
|
+
|
|
2196
|
+
// Convert the date in system timezone to the same date in UTC+00:00 timezone.
|
|
2340
2197
|
// This ensures that when UTC functions will be implemented, locales will be compatible with them.
|
|
2341
2198
|
// See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
2199
|
var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
|
|
2345
2200
|
var utcDate = subMilliseconds(originalDate, timezoneOffset);
|
|
2346
2201
|
var formatterOptions = {
|
|
@@ -2351,55 +2206,42 @@ function format(dirtyDate, dirtyFormatStr, options) {
|
|
|
2351
2206
|
};
|
|
2352
2207
|
var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
|
|
2353
2208
|
var firstCharacter = substring[0];
|
|
2354
|
-
|
|
2355
2209
|
if (firstCharacter === 'p' || firstCharacter === 'P') {
|
|
2356
2210
|
var longFormatter = longFormatters[firstCharacter];
|
|
2357
2211
|
return longFormatter(substring, locale$1.formatLong);
|
|
2358
2212
|
}
|
|
2359
|
-
|
|
2360
2213
|
return substring;
|
|
2361
2214
|
}).join('').match(formattingTokensRegExp).map(function (substring) {
|
|
2362
2215
|
// Replace two single quote characters with one single quote character
|
|
2363
2216
|
if (substring === "''") {
|
|
2364
2217
|
return "'";
|
|
2365
2218
|
}
|
|
2366
|
-
|
|
2367
2219
|
var firstCharacter = substring[0];
|
|
2368
|
-
|
|
2369
2220
|
if (firstCharacter === "'") {
|
|
2370
2221
|
return cleanEscapedString(substring);
|
|
2371
2222
|
}
|
|
2372
|
-
|
|
2373
2223
|
var formatter = formatters[firstCharacter];
|
|
2374
|
-
|
|
2375
2224
|
if (formatter) {
|
|
2376
2225
|
if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
|
|
2377
2226
|
throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
|
|
2378
2227
|
}
|
|
2379
|
-
|
|
2380
2228
|
if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
|
|
2381
2229
|
throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
|
|
2382
2230
|
}
|
|
2383
|
-
|
|
2384
2231
|
return formatter(utcDate, substring, locale$1.localize, formatterOptions);
|
|
2385
2232
|
}
|
|
2386
|
-
|
|
2387
2233
|
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
|
2388
2234
|
throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
|
|
2389
2235
|
}
|
|
2390
|
-
|
|
2391
2236
|
return substring;
|
|
2392
2237
|
}).join('');
|
|
2393
2238
|
return result;
|
|
2394
2239
|
}
|
|
2395
|
-
|
|
2396
2240
|
function cleanEscapedString(input) {
|
|
2397
2241
|
var matched = input.match(escapedStringRegExp);
|
|
2398
|
-
|
|
2399
2242
|
if (!matched) {
|
|
2400
2243
|
return input;
|
|
2401
2244
|
}
|
|
2402
|
-
|
|
2403
2245
|
return matched[1].replace(doubleQuoteRegExp, "'");
|
|
2404
2246
|
}
|
|
2405
2247
|
|
|
@@ -2421,7 +2263,6 @@ function cleanEscapedString(input) {
|
|
|
2421
2263
|
* const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
|
|
2422
2264
|
* //=> true
|
|
2423
2265
|
*/
|
|
2424
|
-
|
|
2425
2266
|
function isAfter(dirtyDate, dirtyDateToCompare) {
|
|
2426
2267
|
requiredArgs(2, arguments);
|
|
2427
2268
|
var date = toDate(dirtyDate);
|
|
@@ -2447,7 +2288,6 @@ function isAfter(dirtyDate, dirtyDateToCompare) {
|
|
|
2447
2288
|
* const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
|
|
2448
2289
|
* //=> false
|
|
2449
2290
|
*/
|
|
2450
|
-
|
|
2451
2291
|
function isBefore(dirtyDate, dirtyDateToCompare) {
|
|
2452
2292
|
requiredArgs(2, arguments);
|
|
2453
2293
|
var date = toDate(dirtyDate);
|
|
@@ -2455,6 +2295,6 @@ function isBefore(dirtyDate, dirtyDateToCompare) {
|
|
|
2455
2295
|
return date.getTime() < dateToCompare.getTime();
|
|
2456
2296
|
}
|
|
2457
2297
|
|
|
2458
|
-
export { startOfUTCISOWeek as a, getUTCWeek as b, toInteger as c, getUTCISOWeek as d, getDefaultOptions as e, subMilliseconds as f, getUTCWeekYear as g, getTimezoneOffsetInMilliseconds as h, locale as i, isProtectedWeekYearToken as j, throwProtectedError as k, longFormatters as l, isProtectedDayOfYearToken as m, format as n, isValid as o, isBefore as p, isAfter as q, requiredArgs as r, startOfUTCWeek as s, toDate as t, startOfDay as u, isSameDay as v };
|
|
2298
|
+
export { _typeof as _, startOfUTCISOWeek as a, getUTCWeek as b, toInteger as c, getUTCISOWeek as d, getDefaultOptions as e, subMilliseconds as f, getUTCWeekYear as g, getTimezoneOffsetInMilliseconds as h, locale as i, isProtectedWeekYearToken as j, throwProtectedError as k, longFormatters as l, isProtectedDayOfYearToken as m, format as n, isValid as o, isBefore as p, isAfter as q, requiredArgs as r, startOfUTCWeek as s, toDate as t, startOfDay as u, isSameDay as v };
|
|
2459
2299
|
|
|
2460
|
-
//# sourceMappingURL=index-
|
|
2300
|
+
//# sourceMappingURL=index-934ac6da.js.map
|