@govbr-ds/webcomponents 2.1.0 → 2.1.1
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/cem/custom-elements.json +63 -63
- package/dist/cjs/app-globals-DcqHuMBv.js +9 -0
- package/dist/cjs/br-avatar.cjs.entry.js +248 -0
- package/dist/cjs/br-breadcrumb-item.cjs.entry.js +45 -0
- package/dist/cjs/br-breadcrumb.cjs.entry.js +443 -0
- package/dist/cjs/br-button_2.cjs.entry.js +280 -0
- package/dist/cjs/br-card.cjs.entry.js +111 -0
- package/dist/cjs/br-carousel-page.cjs.entry.js +80 -0
- package/dist/cjs/br-carousel.cjs.entry.js +565 -0
- package/dist/cjs/br-checkbox-group.cjs.entry.js +118 -0
- package/dist/cjs/br-checkbox.cjs.entry.js +288 -0
- package/dist/cjs/br-checkgroup.cjs.entry.js +20 -0
- package/dist/cjs/br-collapse_2.cjs.entry.js +683 -0
- package/dist/cjs/br-cookiebar-cookie.cjs.entry.js +83 -0
- package/dist/cjs/br-cookiebar-group.cjs.entry.js +309 -0
- package/dist/cjs/br-cookiebar-header.cjs.entry.js +39 -0
- package/dist/cjs/br-cookiebar-link.cjs.entry.js +54 -0
- package/dist/cjs/br-cookiebar-note-group.cjs.entry.js +70 -0
- package/dist/cjs/br-cookiebar-note.cjs.entry.js +25 -0
- package/dist/cjs/br-cookiebar.cjs.entry.js +758 -0
- package/dist/cjs/br-crumb.cjs.entry.js +51 -0
- package/dist/cjs/br-date-picker_3.cjs.entry.js +2446 -0
- package/dist/cjs/br-datetime-picker.cjs.entry.js +1887 -0
- package/dist/cjs/br-divider.cjs.entry.js +225 -0
- package/dist/cjs/br-dropdown_2.cjs.entry.js +1856 -0
- package/dist/cjs/br-footer-category.cjs.entry.js +102 -0
- package/dist/cjs/br-footer-item.cjs.entry.js +52 -0
- package/dist/cjs/br-footer-legal.cjs.entry.js +41 -0
- package/dist/cjs/br-footer-logo.cjs.entry.js +104 -0
- package/dist/cjs/br-footer-social.cjs.entry.js +71 -0
- package/dist/cjs/br-footer.cjs.entry.js +92 -0
- package/dist/cjs/br-header-function.cjs.entry.js +142 -0
- package/dist/cjs/br-header-link.cjs.entry.js +60 -0
- package/dist/cjs/br-header-list.cjs.entry.js +279 -0
- package/dist/cjs/br-header-logo.cjs.entry.js +177 -0
- package/dist/cjs/br-header.cjs.entry.js +642 -0
- package/dist/cjs/br-icon.cjs.entry.js +485 -0
- package/dist/cjs/br-input.cjs.entry.js +599 -0
- package/dist/cjs/br-item.cjs.entry.js +356 -0
- package/dist/cjs/br-link.cjs.entry.js +132 -0
- package/dist/cjs/br-loading.cjs.entry.js +505 -0
- package/dist/cjs/br-magic-button.cjs.entry.js +92 -0
- package/dist/cjs/br-menu-group.cjs.entry.js +23 -0
- package/dist/cjs/br-menu-header.cjs.entry.js +47 -0
- package/dist/cjs/br-menu-info.cjs.entry.js +38 -0
- package/dist/cjs/br-menu-item.cjs.entry.js +79 -0
- package/dist/cjs/br-menu-link.cjs.entry.js +55 -0
- package/dist/cjs/br-menu-list.cjs.entry.js +149 -0
- package/dist/cjs/br-menu-logo.cjs.entry.js +75 -0
- package/dist/cjs/br-menu-social.cjs.entry.js +65 -0
- package/dist/cjs/br-menu.cjs.entry.js +993 -0
- package/dist/cjs/br-modal.cjs.entry.js +496 -0
- package/dist/cjs/br-notification-body.cjs.entry.js +71 -0
- package/dist/cjs/br-notification-header.cjs.entry.js +48 -0
- package/dist/cjs/br-notification-item.cjs.entry.js +110 -0
- package/dist/cjs/br-notification.cjs.entry.js +334 -0
- package/dist/cjs/br-pagination.cjs.entry.js +884 -0
- package/dist/cjs/br-radio-group.cjs.entry.js +428 -0
- package/dist/cjs/br-radio.cjs.entry.js +357 -0
- package/dist/cjs/br-scrim.cjs.entry.js +1336 -0
- package/dist/cjs/br-select-input_3.cjs.entry.js +954 -0
- package/dist/cjs/br-sign-in.cjs.entry.js +125 -0
- package/dist/cjs/br-skip-link-item.cjs.entry.js +20 -0
- package/dist/cjs/br-skip-link.cjs.entry.js +362 -0
- package/dist/cjs/br-skiplink-item.cjs.entry.js +192 -0
- package/dist/cjs/br-slider.cjs.entry.js +688 -0
- package/dist/cjs/br-step_2.cjs.entry.js +628 -0
- package/dist/cjs/br-switch.cjs.entry.js +245 -0
- package/dist/cjs/br-tab-item.cjs.entry.js +185 -0
- package/dist/cjs/br-tab.cjs.entry.js +397 -0
- package/dist/cjs/br-table-body.cjs.entry.js +37 -0
- package/dist/cjs/br-table-cell.cjs.entry.js +184 -0
- package/dist/cjs/br-table-header-cell.cjs.entry.js +173 -0
- package/dist/cjs/br-table-header.cjs.entry.js +37 -0
- package/dist/cjs/br-table-row.cjs.entry.js +81 -0
- package/dist/cjs/br-table.cjs.entry.js +680 -0
- package/dist/cjs/br-tag.cjs.entry.js +494 -0
- package/dist/cjs/br-textarea.cjs.entry.js +306 -0
- package/dist/cjs/br-tooltip.cjs.entry.js +627 -0
- package/dist/cjs/br-upload.cjs.entry.js +582 -0
- package/dist/cjs/br-wizard-panel.cjs.entry.js +54 -0
- package/dist/cjs/br-wizard.cjs.entry.js +708 -0
- package/dist/cjs/breakpoint-observer-P8veqXg7.js +144 -0
- package/dist/cjs/clamp-Co_hWptd.js +25 -0
- package/dist/cjs/cookiebar.utils-CB1gQwZ4.js +18 -0
- package/dist/cjs/datetime-picker-constants-B5pWeOn1.js +3827 -0
- package/dist/cjs/event-CmVdNHxl.js +56 -0
- package/dist/cjs/floating-surface-dismiss-ccdiD0KF.js +63 -0
- package/dist/cjs/floating-ui-MBI1osio.js +136 -0
- package/dist/cjs/floating-ui.dom-BUSTaaxR.js +1715 -0
- package/dist/cjs/focus-DuywwJPR.js +30 -0
- package/dist/cjs/getNextElement-R9l3JtM9.js +31 -0
- package/dist/cjs/iconify-icon-DfODV9bf.js +2307 -0
- package/dist/cjs/id-CjRFMzf6.js +20 -0
- package/dist/cjs/index-C92n55ch.js +678 -0
- package/dist/cjs/index-CRdcutym.js +3287 -0
- package/dist/cjs/index.cjs.js +12 -0
- package/dist/cjs/isNil-DO5zWc3l.js +19 -0
- package/dist/cjs/isValid-Fu3kaWNn.js +3694 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/native-dialog--Ewqm4w0.js +49 -0
- package/dist/cjs/navigation-AbzwcRCU.js +25 -0
- package/dist/cjs/parts-D5K3ae2C.js +19 -0
- package/dist/cjs/props-CScmBvKd.js +24 -0
- package/dist/cjs/raf-batcher-yc87a4dS.js +55 -0
- package/dist/cjs/slot-DAllytTj.js +48 -0
- package/dist/cjs/swipe-BU8_XE9f.js +345 -0
- package/dist/cjs/table-constants-BOPSay0B.js +183 -0
- package/dist/cjs/validator-CTCajtT9.js +123 -0
- package/dist/cjs/webcomponents.cjs.js +50 -0
- package/dist/collection/assets/icon-search.svg +6 -0
- package/dist/collection/assets/logo-negative.svg +1 -0
- package/dist/collection/assets/logo-positive.svg +1 -0
- package/dist/collection/assets/wc.svg +1 -0
- package/dist/collection/collection-manifest.json +113 -0
- package/dist/collection/components/avatar/avatar.css +1 -0
- package/dist/collection/components/avatar/avatar.js +589 -0
- package/dist/collection/components/avatar/avatar.types.js +1 -0
- package/dist/collection/components/breadcrumb/breadcrumb-item/breadcrumb-item.js +166 -0
- package/dist/collection/components/breadcrumb/breadcrumb.css +1 -0
- package/dist/collection/components/breadcrumb/breadcrumb.js +619 -0
- package/dist/collection/components/breadcrumb/breadcrumb.types.js +1 -0
- package/dist/collection/components/breadcrumb/crumb/crumb.js +175 -0
- package/dist/collection/components/button/button.css +1 -0
- package/dist/collection/components/button/button.js +546 -0
- package/dist/collection/components/button/button.types.js +1 -0
- package/dist/collection/components/card/card.css +1 -0
- package/dist/collection/components/card/card.js +225 -0
- package/dist/collection/components/carousel/carousel-page/carousel-page.css +1 -0
- package/dist/collection/components/carousel/carousel-page/carousel-page.js +195 -0
- package/dist/collection/components/carousel/carousel.css +1 -0
- package/dist/collection/components/carousel/carousel.js +1217 -0
- package/dist/collection/components/carousel/carousel.types.js +1 -0
- package/dist/collection/components/checkbox/checkbox.css +1 -0
- package/dist/collection/components/checkbox/checkbox.js +823 -0
- package/dist/collection/components/checkbox/checkbox.types.js +1 -0
- package/dist/collection/components/checkbox-group/checkbox-group.css +1 -0
- package/dist/collection/components/checkbox-group/checkbox-group.js +268 -0
- package/dist/collection/components/checkgroup/checkgroup.js +166 -0
- package/dist/collection/components/collapse/collapse.css +1 -0
- package/dist/collection/components/collapse/collapse.js +642 -0
- package/dist/collection/components/collapse/collapse.types.js +1 -0
- package/dist/collection/components/cookiebar/cookiebar-cookie/cookiebar-cookie.css +1 -0
- package/dist/collection/components/cookiebar/cookiebar-cookie/cookiebar-cookie.js +529 -0
- package/dist/collection/components/cookiebar/cookiebar-group/cookiebar-group.css +1 -0
- package/dist/collection/components/cookiebar/cookiebar-group/cookiebar-group.js +628 -0
- package/dist/collection/components/cookiebar/cookiebar-header/cookiebar-header.css +1 -0
- package/dist/collection/components/cookiebar/cookiebar-header/cookiebar-header.js +165 -0
- package/dist/collection/components/cookiebar/cookiebar-link/cookiebar-link.css +1 -0
- package/dist/collection/components/cookiebar/cookiebar-link/cookiebar-link.js +200 -0
- package/dist/collection/components/cookiebar/cookiebar-note/cookiebar-note.css +1 -0
- package/dist/collection/components/cookiebar/cookiebar-note/cookiebar-note.js +100 -0
- package/dist/collection/components/cookiebar/cookiebar-note-group/cookiebar-note-group.css +1 -0
- package/dist/collection/components/cookiebar/cookiebar-note-group/cookiebar-note-group.js +172 -0
- package/dist/collection/components/cookiebar/cookiebar.css +1 -0
- package/dist/collection/components/cookiebar/cookiebar.js +1419 -0
- package/dist/collection/components/cookiebar/cookiebar.types.js +1 -0
- package/dist/collection/components/cookiebar/cookiebar.utils.js +14 -0
- package/dist/collection/components/datetime-picker/date-picker/date-picker-locale.js +94 -0
- package/dist/collection/components/datetime-picker/date-picker/date-picker-props-validation.js +57 -0
- package/dist/collection/components/datetime-picker/date-picker/date-picker.css +1 -0
- package/dist/collection/components/datetime-picker/date-picker/date-picker.js +913 -0
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input-props-validation.js +65 -0
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input.css +1 -0
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input.js +825 -0
- package/dist/collection/components/datetime-picker/datetime-picker-constants.js +36 -0
- package/dist/collection/components/datetime-picker/datetime-picker-form-associated.js +112 -0
- package/dist/collection/components/datetime-picker/datetime-picker-props-validation.js +202 -0
- package/dist/collection/components/datetime-picker/datetime-picker.css +1 -0
- package/dist/collection/components/datetime-picker/datetime-picker.js +1925 -0
- package/dist/collection/components/datetime-picker/datetime-picker.types.js +1 -0
- package/dist/collection/components/datetime-picker/datetime-picker.utils.js +250 -0
- package/dist/collection/components/datetime-picker/time-picker/time-picker-constants.js +13 -0
- package/dist/collection/components/datetime-picker/time-picker/time-picker.css +1 -0
- package/dist/collection/components/datetime-picker/time-picker/time-picker.js +456 -0
- package/dist/collection/components/divider/divider.css +1 -0
- package/dist/collection/components/divider/divider.js +537 -0
- package/dist/collection/components/divider/divider.types.js +1 -0
- package/dist/collection/components/dropdown/dropdown.css +1 -0
- package/dist/collection/components/dropdown/dropdown.js +939 -0
- package/dist/collection/components/dropdown/dropdown.types.js +1 -0
- package/dist/collection/components/footer/footer-category/footer-category.css +1 -0
- package/dist/collection/components/footer/footer-category/footer-category.js +160 -0
- package/dist/collection/components/footer/footer-item/footer-item.css +1 -0
- package/dist/collection/components/footer/footer-item/footer-item.js +154 -0
- package/dist/collection/components/footer/footer-legal/footer-legal.css +1 -0
- package/dist/collection/components/footer/footer-legal/footer-legal.js +75 -0
- package/dist/collection/components/footer/footer-logo/footer-logo.css +1 -0
- package/dist/collection/components/footer/footer-logo/footer-logo.js +342 -0
- package/dist/collection/components/footer/footer-logo/footer-logo.types.js +1 -0
- package/dist/collection/components/footer/footer-social/footer-social.css +1 -0
- package/dist/collection/components/footer/footer-social/footer-social.js +239 -0
- package/dist/collection/components/footer/footer.css +1 -0
- package/dist/collection/components/footer/footer.js +245 -0
- package/dist/collection/components/footer/footer.types.js +1 -0
- package/dist/collection/components/global.types.js +1 -0
- package/dist/collection/components/header/header-function/header-function.css +1 -0
- package/dist/collection/components/header/header-function/header-function.js +311 -0
- package/dist/collection/components/header/header-link/header-link.css +1 -0
- package/dist/collection/components/header/header-link/header-link.js +189 -0
- package/dist/collection/components/header/header-list/header-list.css +1 -0
- package/dist/collection/components/header/header-list/header-list.js +452 -0
- package/dist/collection/components/header/header-logo/header-logo.css +1 -0
- package/dist/collection/components/header/header-logo/header-logo.js +420 -0
- package/dist/collection/components/header/header.css +1 -0
- package/dist/collection/components/header/header.js +1131 -0
- package/dist/collection/components/header/header.types.js +1 -0
- package/dist/collection/components/icon/default-icons-cache.js +233 -0
- package/dist/collection/components/icon/icon.css +1 -0
- package/dist/collection/components/icon/icon.js +598 -0
- package/dist/collection/components/icon/icon.types.js +1 -0
- package/dist/collection/components/icon/icon.utils.js +33 -0
- package/dist/collection/components/input/input.css +1 -0
- package/dist/collection/components/input/input.js +1642 -0
- package/dist/collection/components/input/input.types.js +1 -0
- package/dist/collection/components/item/item.css +1 -0
- package/dist/collection/components/item/item.js +906 -0
- package/dist/collection/components/item/item.types.js +1 -0
- package/dist/collection/components/link/link.css +1 -0
- package/dist/collection/components/link/link.js +698 -0
- package/dist/collection/components/list/list.css +1 -0
- package/dist/collection/components/list/list.js +728 -0
- package/dist/collection/components/loading/loading.css +1 -0
- package/dist/collection/components/loading/loading.js +1169 -0
- package/dist/collection/components/loading/loading.types.js +1 -0
- package/dist/collection/components/magic-button/magic-button.css +1 -0
- package/dist/collection/components/magic-button/magic-button.js +237 -0
- package/dist/collection/components/menu/menu-group/menu-group.css +1 -0
- package/dist/collection/components/menu/menu-group/menu-group.js +77 -0
- package/dist/collection/components/menu/menu-header/menu-header.css +1 -0
- package/dist/collection/components/menu/menu-header/menu-header.js +161 -0
- package/dist/collection/components/menu/menu-info/menu-info.css +1 -0
- package/dist/collection/components/menu/menu-info/menu-info.js +94 -0
- package/dist/collection/components/menu/menu-item/menu-item.css +1 -0
- package/dist/collection/components/menu/menu-item/menu-item.js +306 -0
- package/dist/collection/components/menu/menu-item/menu-item.types.js +1 -0
- package/dist/collection/components/menu/menu-link/menu-link.css +1 -0
- package/dist/collection/components/menu/menu-link/menu-link.js +259 -0
- package/dist/collection/components/menu/menu-list/menu-list.css +1 -0
- package/dist/collection/components/menu/menu-list/menu-list.js +311 -0
- package/dist/collection/components/menu/menu-logo/menu-logo.css +1 -0
- package/dist/collection/components/menu/menu-logo/menu-logo.js +230 -0
- package/dist/collection/components/menu/menu-social/menu-social.css +1 -0
- package/dist/collection/components/menu/menu-social/menu-social.js +263 -0
- package/dist/collection/components/menu/menu.css +1 -0
- package/dist/collection/components/menu/menu.js +1372 -0
- package/dist/collection/components/menu/menu.types.js +1 -0
- package/dist/collection/components/menu/menu.utils.js +279 -0
- package/dist/collection/components/message/message.css +1 -0
- package/dist/collection/components/message/message.js +508 -0
- package/dist/collection/components/modal/modal.css +1 -0
- package/dist/collection/components/modal/modal.js +842 -0
- package/dist/collection/components/modal/modal.types.js +1 -0
- package/dist/collection/components/notification/notification-body/notification-body.css +1 -0
- package/dist/collection/components/notification/notification-body/notification-body.js +153 -0
- package/dist/collection/components/notification/notification-header/notification-header.css +1 -0
- package/dist/collection/components/notification/notification-header/notification-header.js +181 -0
- package/dist/collection/components/notification/notification-item/notification-item.css +1 -0
- package/dist/collection/components/notification/notification-item/notification-item.js +351 -0
- package/dist/collection/components/notification/notification-item/notification-item.types.js +1 -0
- package/dist/collection/components/notification/notification.css +1 -0
- package/dist/collection/components/notification/notification.js +838 -0
- package/dist/collection/components/notification/notification.types.js +1 -0
- package/dist/collection/components/pagination/pagination.css +1 -0
- package/dist/collection/components/pagination/pagination.js +1470 -0
- package/dist/collection/components/pagination/pagination.types.js +1 -0
- package/dist/collection/components/radio/radio.css +1 -0
- package/dist/collection/components/radio/radio.js +847 -0
- package/dist/collection/components/radio/radio.types.js +1 -0
- package/dist/collection/components/radio-group/radio-group.css +1 -0
- package/dist/collection/components/radio-group/radio-group.js +862 -0
- package/dist/collection/components/radio-group/radio-group.types.js +1 -0
- package/dist/collection/components/scrim/scrim.css +1 -0
- package/dist/collection/components/scrim/scrim.js +1825 -0
- package/dist/collection/components/scrim/scrim.types.js +1 -0
- package/dist/collection/components/scrim/scrim.utils.js +132 -0
- package/dist/collection/components/select/select-input/select-input.css +1 -0
- package/dist/collection/components/select/select-input/select-input.js +585 -0
- package/dist/collection/components/select/select-list/select-list.css +1 -0
- package/dist/collection/components/select/select-list/select-list.js +1147 -0
- package/dist/collection/components/select/select-option/select-option.css +1 -0
- package/dist/collection/components/select/select-option/select-option.js +543 -0
- package/dist/collection/components/select/select.constants.js +6 -0
- package/dist/collection/components/select/select.css +1 -0
- package/dist/collection/components/select/select.js +2575 -0
- package/dist/collection/components/select/select.types.js +1 -0
- package/dist/collection/components/sign-in/sign-in.css +1 -0
- package/dist/collection/components/sign-in/sign-in.js +400 -0
- package/dist/collection/components/sign-in/sign-in.types.js +1 -0
- package/dist/collection/components/skip-link/skip-link-item/skip-link-item-alias.js +103 -0
- package/dist/collection/components/skip-link/skip-link-item/skip-link-item.css +1 -0
- package/dist/collection/components/skip-link/skip-link-item/skip-link-item.js +450 -0
- package/dist/collection/components/skip-link/skip-link.css +1 -0
- package/dist/collection/components/skip-link/skip-link.js +699 -0
- package/dist/collection/components/skip-link/skip-link.types.js +1 -0
- package/dist/collection/components/slider/slider.css +1 -0
- package/dist/collection/components/slider/slider.js +1325 -0
- package/dist/collection/components/slider/slider.types.js +1 -0
- package/dist/collection/components/step/step-item/step-item.css +1 -0
- package/dist/collection/components/step/step-item/step-item.js +604 -0
- package/dist/collection/components/step/step-item/step-item.types.js +1 -0
- package/dist/collection/components/step/step.css +1 -0
- package/dist/collection/components/step/step.js +896 -0
- package/dist/collection/components/step/step.types.js +1 -0
- package/dist/collection/components/switch/switch.css +1 -0
- package/dist/collection/components/switch/switch.js +715 -0
- package/dist/collection/components/switch/switch.types.js +1 -0
- package/dist/collection/components/tab/tab-item/tab-item.css +1 -0
- package/dist/collection/components/tab/tab-item/tab-item.js +425 -0
- package/dist/collection/components/tab/tab.css +1 -0
- package/dist/collection/components/tab/tab.js +724 -0
- package/dist/collection/components/tab/tab.types.js +1 -0
- package/dist/collection/components/table/table-body/table-body.css +1 -0
- package/dist/collection/components/table/table-body/table-body.js +51 -0
- package/dist/collection/components/table/table-cell/table-cell.css +1 -0
- package/dist/collection/components/table/table-cell/table-cell.js +373 -0
- package/dist/collection/components/table/table-constants.js +171 -0
- package/dist/collection/components/table/table-header/table-header.css +1 -0
- package/dist/collection/components/table/table-header/table-header.js +51 -0
- package/dist/collection/components/table/table-header-cell/table-header-cell.css +1 -0
- package/dist/collection/components/table/table-header-cell/table-header-cell.js +402 -0
- package/dist/collection/components/table/table-row/table-row.css +1 -0
- package/dist/collection/components/table/table-row/table-row.js +261 -0
- package/dist/collection/components/table/table-tokens.js +50 -0
- package/dist/collection/components/table/table-types.js +1 -0
- package/dist/collection/components/table/table-utils.js +44 -0
- package/dist/collection/components/table/table.css +1 -0
- package/dist/collection/components/table/table.js +1030 -0
- package/dist/collection/components/tag/tag.css +1 -0
- package/dist/collection/components/tag/tag.js +1153 -0
- package/dist/collection/components/tag/tag.types.js +1 -0
- package/dist/collection/components/textarea/textarea.css +1 -0
- package/dist/collection/components/textarea/textarea.js +985 -0
- package/dist/collection/components/textarea/textarea.types.js +1 -0
- package/dist/collection/components/tooltip/tooltip.css +1 -0
- package/dist/collection/components/tooltip/tooltip.js +1024 -0
- package/dist/collection/components/tooltip/tooltip.types.js +1 -0
- package/dist/collection/components/upload/upload.css +1 -0
- package/dist/collection/components/upload/upload.js +1315 -0
- package/dist/collection/components/upload/upload.types.js +1 -0
- package/dist/collection/components/wizard/wizard-panel/wizard-panel.css +1 -0
- package/dist/collection/components/wizard/wizard-panel/wizard-panel.js +167 -0
- package/dist/collection/components/wizard/wizard.css +1 -0
- package/dist/collection/components/wizard/wizard.js +1228 -0
- package/dist/collection/index.js +14 -0
- package/dist/collection/pages/components/cookiebar/index.js +26 -0
- package/dist/collection/pages/components/link/index.js +29 -0
- package/dist/collection/pages/components/pagination/index.js +12 -0
- package/dist/collection/pages/components/slider/index.js +18 -0
- package/dist/collection/pages/scripts/code-editor.js +101 -0
- package/dist/collection/pages/scripts/component-controls.js +591 -0
- package/dist/collection/pages/scripts/dev-event-console.js +47 -0
- package/dist/collection/pages/scripts/menu.js +183 -0
- package/dist/collection/pages/scripts/pageLoader.js +1420 -0
- package/dist/collection/shared/utils/assetsPath.js +75 -0
- package/dist/collection/shared/utils/breakpoint-observer.js +139 -0
- package/dist/collection/shared/utils/clamp.js +21 -0
- package/dist/collection/shared/utils/css-variables.js +12 -0
- package/dist/collection/shared/utils/cssVariables.js +37 -0
- package/dist/collection/shared/utils/date.js +405 -0
- package/dist/collection/shared/utils/debounce.js +39 -0
- package/dist/collection/shared/utils/event.js +55 -0
- package/dist/collection/shared/utils/floating-surface-dismiss.js +59 -0
- package/dist/collection/shared/utils/floating-ui.js +131 -0
- package/dist/collection/shared/utils/focus.js +24 -0
- package/dist/collection/shared/utils/form.js +82 -0
- package/dist/collection/shared/utils/format-bytes.js +20 -0
- package/dist/collection/shared/utils/getNextElement.js +30 -0
- package/dist/collection/shared/utils/getRandom.js +27 -0
- package/dist/collection/shared/utils/helpers.js +31 -0
- package/dist/collection/shared/utils/id.js +16 -0
- package/dist/collection/shared/utils/index.js +60 -0
- package/dist/collection/shared/utils/interfaces.js +1 -0
- package/dist/collection/shared/utils/isClient.js +14 -0
- package/dist/collection/shared/utils/isDefined.js +19 -0
- package/dist/collection/shared/utils/isEmpty.js +30 -0
- package/dist/collection/shared/utils/isHTMLElement.js +16 -0
- package/dist/collection/shared/utils/isNil.js +15 -0
- package/dist/collection/shared/utils/isString.js +20 -0
- package/dist/collection/shared/utils/native-dialog.js +44 -0
- package/dist/collection/shared/utils/navigation.js +21 -0
- package/dist/collection/shared/utils/parts.js +15 -0
- package/dist/collection/shared/utils/prop-warning.js +7 -0
- package/dist/collection/shared/utils/props.js +37 -0
- package/dist/collection/shared/utils/raf-batcher.js +51 -0
- package/dist/collection/shared/utils/scrollLock.js +141 -0
- package/dist/collection/shared/utils/setRafTimeout.js +38 -0
- package/dist/collection/shared/utils/slot.js +113 -0
- package/dist/collection/shared/utils/ssr-date.js +33 -0
- package/dist/collection/shared/utils/stringToArray.js +29 -0
- package/dist/collection/shared/utils/swipe.js +342 -0
- package/dist/collection/shared/utils/transition.js +127 -0
- package/dist/collection/shared/utils/types.js +1 -0
- package/dist/collection/shared/utils/validator.js +51 -0
- package/dist/collection/value-accessors/angular-value-accessor-config.js +41 -0
- package/dist/collection/value-accessors/index.js +6 -0
- package/dist/collection/value-accessors/vue-model-config.js +43 -0
- package/dist/components/br-avatar.d.ts +11 -0
- package/dist/components/br-avatar.js +5 -0
- package/dist/components/br-breadcrumb-item.d.ts +11 -0
- package/dist/components/br-breadcrumb-item.js +5 -0
- package/dist/components/br-breadcrumb.d.ts +11 -0
- package/dist/components/br-breadcrumb.js +5 -0
- package/dist/components/br-button.d.ts +11 -0
- package/dist/components/br-button.js +5 -0
- package/dist/components/br-card.d.ts +11 -0
- package/dist/components/br-card.js +5 -0
- package/dist/components/br-carousel-page.d.ts +11 -0
- package/dist/components/br-carousel-page.js +5 -0
- package/dist/components/br-carousel.d.ts +11 -0
- package/dist/components/br-carousel.js +5 -0
- package/dist/components/br-checkbox-group.d.ts +11 -0
- package/dist/components/br-checkbox-group.js +5 -0
- package/dist/components/br-checkbox.d.ts +11 -0
- package/dist/components/br-checkbox.js +5 -0
- package/dist/components/br-checkgroup.d.ts +11 -0
- package/dist/components/br-checkgroup.js +5 -0
- package/dist/components/br-collapse.d.ts +11 -0
- package/dist/components/br-collapse.js +5 -0
- package/dist/components/br-cookiebar-cookie.d.ts +11 -0
- package/dist/components/br-cookiebar-cookie.js +5 -0
- package/dist/components/br-cookiebar-group.d.ts +11 -0
- package/dist/components/br-cookiebar-group.js +5 -0
- package/dist/components/br-cookiebar-header.d.ts +11 -0
- package/dist/components/br-cookiebar-header.js +5 -0
- package/dist/components/br-cookiebar-link.d.ts +11 -0
- package/dist/components/br-cookiebar-link.js +5 -0
- package/dist/components/br-cookiebar-note-group.d.ts +11 -0
- package/dist/components/br-cookiebar-note-group.js +5 -0
- package/dist/components/br-cookiebar-note.d.ts +11 -0
- package/dist/components/br-cookiebar-note.js +5 -0
- package/dist/components/br-cookiebar.d.ts +11 -0
- package/dist/components/br-cookiebar.js +5 -0
- package/dist/components/br-crumb.d.ts +11 -0
- package/dist/components/br-crumb.js +5 -0
- package/dist/components/br-date-picker.d.ts +11 -0
- package/dist/components/br-date-picker.js +5 -0
- package/dist/components/br-datetime-input.d.ts +11 -0
- package/dist/components/br-datetime-input.js +5 -0
- package/dist/components/br-datetime-picker.d.ts +11 -0
- package/dist/components/br-datetime-picker.js +5 -0
- package/dist/components/br-divider.d.ts +11 -0
- package/dist/components/br-divider.js +5 -0
- package/dist/components/br-dropdown.d.ts +11 -0
- package/dist/components/br-dropdown.js +5 -0
- package/dist/components/br-footer-category.d.ts +11 -0
- package/dist/components/br-footer-category.js +5 -0
- package/dist/components/br-footer-item.d.ts +11 -0
- package/dist/components/br-footer-item.js +5 -0
- package/dist/components/br-footer-legal.d.ts +11 -0
- package/dist/components/br-footer-legal.js +5 -0
- package/dist/components/br-footer-logo.d.ts +11 -0
- package/dist/components/br-footer-logo.js +5 -0
- package/dist/components/br-footer-social.d.ts +11 -0
- package/dist/components/br-footer-social.js +5 -0
- package/dist/components/br-footer.d.ts +11 -0
- package/dist/components/br-footer.js +5 -0
- package/dist/components/br-header-function.d.ts +11 -0
- package/dist/components/br-header-function.js +5 -0
- package/dist/components/br-header-link.d.ts +11 -0
- package/dist/components/br-header-link.js +5 -0
- package/dist/components/br-header-list.d.ts +11 -0
- package/dist/components/br-header-list.js +5 -0
- package/dist/components/br-header-logo.d.ts +11 -0
- package/dist/components/br-header-logo.js +5 -0
- package/dist/components/br-header.d.ts +11 -0
- package/dist/components/br-header.js +5 -0
- package/dist/components/br-icon.d.ts +11 -0
- package/dist/components/br-icon.js +5 -0
- package/dist/components/br-input.d.ts +11 -0
- package/dist/components/br-input.js +5 -0
- package/dist/components/br-item.d.ts +11 -0
- package/dist/components/br-item.js +5 -0
- package/dist/components/br-link.d.ts +11 -0
- package/dist/components/br-link.js +5 -0
- package/dist/components/br-list.d.ts +11 -0
- package/dist/components/br-list.js +5 -0
- package/dist/components/br-loading.d.ts +11 -0
- package/dist/components/br-loading.js +5 -0
- package/dist/components/br-magic-button.d.ts +11 -0
- package/dist/components/br-magic-button.js +5 -0
- package/dist/components/br-menu-group.d.ts +11 -0
- package/dist/components/br-menu-group.js +5 -0
- package/dist/components/br-menu-header.d.ts +11 -0
- package/dist/components/br-menu-header.js +5 -0
- package/dist/components/br-menu-info.d.ts +11 -0
- package/dist/components/br-menu-info.js +5 -0
- package/dist/components/br-menu-item.d.ts +11 -0
- package/dist/components/br-menu-item.js +5 -0
- package/dist/components/br-menu-link.d.ts +11 -0
- package/dist/components/br-menu-link.js +5 -0
- package/dist/components/br-menu-list.d.ts +11 -0
- package/dist/components/br-menu-list.js +5 -0
- package/dist/components/br-menu-logo.d.ts +11 -0
- package/dist/components/br-menu-logo.js +5 -0
- package/dist/components/br-menu-social.d.ts +11 -0
- package/dist/components/br-menu-social.js +5 -0
- package/dist/components/br-menu.d.ts +11 -0
- package/dist/components/br-menu.js +5 -0
- package/dist/components/br-message.d.ts +11 -0
- package/dist/components/br-message.js +5 -0
- package/dist/components/br-modal.d.ts +11 -0
- package/dist/components/br-modal.js +5 -0
- package/dist/components/br-notification-body.d.ts +11 -0
- package/dist/components/br-notification-body.js +5 -0
- package/dist/components/br-notification-header.d.ts +11 -0
- package/dist/components/br-notification-header.js +5 -0
- package/dist/components/br-notification-item.d.ts +11 -0
- package/dist/components/br-notification-item.js +5 -0
- package/dist/components/br-notification.d.ts +11 -0
- package/dist/components/br-notification.js +5 -0
- package/dist/components/br-pagination.d.ts +11 -0
- package/dist/components/br-pagination.js +5 -0
- package/dist/components/br-radio-group.d.ts +11 -0
- package/dist/components/br-radio-group.js +5 -0
- package/dist/components/br-radio.d.ts +11 -0
- package/dist/components/br-radio.js +5 -0
- package/dist/components/br-scrim.d.ts +11 -0
- package/dist/components/br-scrim.js +5 -0
- package/dist/components/br-select-input.d.ts +11 -0
- package/dist/components/br-select-input.js +5 -0
- package/dist/components/br-select-list.d.ts +11 -0
- package/dist/components/br-select-list.js +5 -0
- package/dist/components/br-select-option.d.ts +11 -0
- package/dist/components/br-select-option.js +5 -0
- package/dist/components/br-select.d.ts +11 -0
- package/dist/components/br-select.js +5 -0
- package/dist/components/br-sign-in.d.ts +11 -0
- package/dist/components/br-sign-in.js +5 -0
- package/dist/components/br-skip-link-item.d.ts +11 -0
- package/dist/components/br-skip-link-item.js +5 -0
- package/dist/components/br-skip-link.d.ts +11 -0
- package/dist/components/br-skip-link.js +5 -0
- package/dist/components/br-skiplink-item.d.ts +11 -0
- package/dist/components/br-skiplink-item.js +5 -0
- package/dist/components/br-slider.d.ts +11 -0
- package/dist/components/br-slider.js +5 -0
- package/dist/components/br-step-item.d.ts +11 -0
- package/dist/components/br-step-item.js +5 -0
- package/dist/components/br-step.d.ts +11 -0
- package/dist/components/br-step.js +5 -0
- package/dist/components/br-switch.d.ts +11 -0
- package/dist/components/br-switch.js +5 -0
- package/dist/components/br-tab-item.d.ts +11 -0
- package/dist/components/br-tab-item.js +5 -0
- package/dist/components/br-tab.d.ts +11 -0
- package/dist/components/br-tab.js +5 -0
- package/dist/components/br-table-body.d.ts +11 -0
- package/dist/components/br-table-body.js +5 -0
- package/dist/components/br-table-cell.d.ts +11 -0
- package/dist/components/br-table-cell.js +5 -0
- package/dist/components/br-table-header-cell.d.ts +11 -0
- package/dist/components/br-table-header-cell.js +5 -0
- package/dist/components/br-table-header.d.ts +11 -0
- package/dist/components/br-table-header.js +5 -0
- package/dist/components/br-table-row.d.ts +11 -0
- package/dist/components/br-table-row.js +5 -0
- package/dist/components/br-table.d.ts +11 -0
- package/dist/components/br-table.js +5 -0
- package/dist/components/br-tag.d.ts +11 -0
- package/dist/components/br-tag.js +5 -0
- package/dist/components/br-textarea.d.ts +11 -0
- package/dist/components/br-textarea.js +5 -0
- package/dist/components/br-time-picker.d.ts +11 -0
- package/dist/components/br-time-picker.js +5 -0
- package/dist/components/br-tooltip.d.ts +11 -0
- package/dist/components/br-tooltip.js +5 -0
- package/dist/components/br-upload.d.ts +11 -0
- package/dist/components/br-upload.js +5 -0
- package/dist/components/br-wizard-panel.d.ts +11 -0
- package/dist/components/br-wizard-panel.js +5 -0
- package/dist/components/br-wizard.d.ts +11 -0
- package/dist/components/br-wizard.js +5 -0
- package/dist/components/index.d.ts +213 -0
- package/dist/components/index.js +5 -0
- package/dist/components/p-0IYmyaTi.js +5 -0
- package/dist/components/p-41XwlWiS.js +5 -0
- package/dist/components/p-5z6jgH1D.js +5 -0
- package/dist/components/p-6OdfnwnK.js +5 -0
- package/dist/components/p-9S9bgUT0.js +5 -0
- package/dist/components/p-B-qLmYZC.js +5 -0
- package/dist/components/p-B-sbd1_h.js +5 -0
- package/dist/components/p-B55qsau4.js +5 -0
- package/dist/components/p-BC7f6MK8.js +5 -0
- package/dist/components/p-BPJpHGOW.js +5 -0
- package/dist/components/p-BW0_ORNA.js +5 -0
- package/dist/components/p-BWXfdbQH.js +5 -0
- package/dist/components/p-Bb-nLtTG.js +5 -0
- package/dist/components/p-BkS6ujyf.js +5 -0
- package/dist/components/p-Bm0ECvfB.js +5 -0
- package/dist/components/p-C1yRmdso.js +5 -0
- package/dist/components/p-C3LQSQpc.js +5 -0
- package/dist/components/p-C98-mHmV.js +5 -0
- package/dist/components/p-CDZFuUlU.js +5 -0
- package/dist/components/p-CRfi23Rd.js +5 -0
- package/dist/components/p-CUI5zWGf.js +5 -0
- package/dist/components/p-CXMwM9m4.js +5 -0
- package/dist/components/p-CdDwqbBv.js +5 -0
- package/dist/components/p-CxviDiCr.js +5 -0
- package/dist/components/p-D3usVJE2.js +16 -0
- package/dist/components/p-D6zroLx5.js +5 -0
- package/dist/components/p-D9SpD3Ay.js +5 -0
- package/dist/components/p-DA5GS53D.js +5 -0
- package/dist/components/p-DBP6K_aq.js +5 -0
- package/dist/components/p-DBmwzG9E.js +5 -0
- package/dist/components/p-DCrVo-8T.js +5 -0
- package/dist/components/p-DIK54tTj.js +5 -0
- package/dist/components/p-DQRSHR-D.js +5 -0
- package/dist/components/p-DRVMm1Py.js +5 -0
- package/dist/components/p-DWPmUV72.js +5 -0
- package/dist/components/p-DYA74R1r.js +5 -0
- package/dist/components/p-DYnkGWii.js +5 -0
- package/dist/components/p-D_CSvOY9.js +5 -0
- package/dist/components/p-DaeGwqw0.js +5 -0
- package/dist/components/p-Dkg2scYZ.js +5 -0
- package/dist/components/p-Dmfk7eEe.js +5 -0
- package/dist/components/p-DoXNfcTT.js +5 -0
- package/dist/components/p-DvrdmqoQ.js +5 -0
- package/dist/components/p-DxZJrIyL.js +5 -0
- package/dist/components/p-LmeJrLxH.js +5 -0
- package/dist/components/p-TFWd_UBV.js +5 -0
- package/dist/components/p-aF8bGN3t.js +5 -0
- package/dist/components/p-bhULC15U.js +5 -0
- package/dist/components/p-cF3ia5e9.js +5 -0
- package/dist/components/p-cfPt-vKA.js +5 -0
- package/dist/components/p-gvnfuTjd.js +5 -0
- package/dist/components/p-nJOJGpyl.js +5 -0
- package/dist/components/p-ttI0nvv_.js +5 -0
- package/dist/esm/app-globals-DVjNHTTs.js +7 -0
- package/dist/esm/br-avatar.entry.js +246 -0
- package/dist/esm/br-breadcrumb-item.entry.js +43 -0
- package/dist/esm/br-breadcrumb.entry.js +441 -0
- package/dist/esm/br-button_2.entry.js +277 -0
- package/dist/esm/br-card.entry.js +109 -0
- package/dist/esm/br-carousel-page.entry.js +78 -0
- package/dist/esm/br-carousel.entry.js +563 -0
- package/dist/esm/br-checkbox-group.entry.js +116 -0
- package/dist/esm/br-checkbox.entry.js +286 -0
- package/dist/esm/br-checkgroup.entry.js +18 -0
- package/dist/esm/br-collapse_2.entry.js +680 -0
- package/dist/esm/br-cookiebar-cookie.entry.js +81 -0
- package/dist/esm/br-cookiebar-group.entry.js +307 -0
- package/dist/esm/br-cookiebar-header.entry.js +37 -0
- package/dist/esm/br-cookiebar-link.entry.js +52 -0
- package/dist/esm/br-cookiebar-note-group.entry.js +68 -0
- package/dist/esm/br-cookiebar-note.entry.js +23 -0
- package/dist/esm/br-cookiebar.entry.js +756 -0
- package/dist/esm/br-crumb.entry.js +49 -0
- package/dist/esm/br-date-picker_3.entry.js +2442 -0
- package/dist/esm/br-datetime-picker.entry.js +1885 -0
- package/dist/esm/br-divider.entry.js +223 -0
- package/dist/esm/br-dropdown_2.entry.js +1853 -0
- package/dist/esm/br-footer-category.entry.js +100 -0
- package/dist/esm/br-footer-item.entry.js +50 -0
- package/dist/esm/br-footer-legal.entry.js +39 -0
- package/dist/esm/br-footer-logo.entry.js +102 -0
- package/dist/esm/br-footer-social.entry.js +69 -0
- package/dist/esm/br-footer.entry.js +90 -0
- package/dist/esm/br-header-function.entry.js +140 -0
- package/dist/esm/br-header-link.entry.js +58 -0
- package/dist/esm/br-header-list.entry.js +277 -0
- package/dist/esm/br-header-logo.entry.js +175 -0
- package/dist/esm/br-header.entry.js +640 -0
- package/dist/esm/br-icon.entry.js +483 -0
- package/dist/esm/br-input.entry.js +597 -0
- package/dist/esm/br-item.entry.js +354 -0
- package/dist/esm/br-link.entry.js +130 -0
- package/dist/esm/br-loading.entry.js +503 -0
- package/dist/esm/br-magic-button.entry.js +90 -0
- package/dist/esm/br-menu-group.entry.js +21 -0
- package/dist/esm/br-menu-header.entry.js +45 -0
- package/dist/esm/br-menu-info.entry.js +36 -0
- package/dist/esm/br-menu-item.entry.js +77 -0
- package/dist/esm/br-menu-link.entry.js +53 -0
- package/dist/esm/br-menu-list.entry.js +147 -0
- package/dist/esm/br-menu-logo.entry.js +73 -0
- package/dist/esm/br-menu-social.entry.js +63 -0
- package/dist/esm/br-menu.entry.js +991 -0
- package/dist/esm/br-modal.entry.js +494 -0
- package/dist/esm/br-notification-body.entry.js +69 -0
- package/dist/esm/br-notification-header.entry.js +46 -0
- package/dist/esm/br-notification-item.entry.js +108 -0
- package/dist/esm/br-notification.entry.js +332 -0
- package/dist/esm/br-pagination.entry.js +882 -0
- package/dist/esm/br-radio-group.entry.js +426 -0
- package/dist/esm/br-radio.entry.js +355 -0
- package/dist/esm/br-scrim.entry.js +1334 -0
- package/dist/esm/br-select-input_3.entry.js +950 -0
- package/dist/esm/br-sign-in.entry.js +123 -0
- package/dist/esm/br-skip-link-item.entry.js +18 -0
- package/dist/esm/br-skip-link.entry.js +360 -0
- package/dist/esm/br-skiplink-item.entry.js +190 -0
- package/dist/esm/br-slider.entry.js +686 -0
- package/dist/esm/br-step_2.entry.js +625 -0
- package/dist/esm/br-switch.entry.js +243 -0
- package/dist/esm/br-tab-item.entry.js +183 -0
- package/dist/esm/br-tab.entry.js +395 -0
- package/dist/esm/br-table-body.entry.js +35 -0
- package/dist/esm/br-table-cell.entry.js +182 -0
- package/dist/esm/br-table-header-cell.entry.js +171 -0
- package/dist/esm/br-table-header.entry.js +35 -0
- package/dist/esm/br-table-row.entry.js +79 -0
- package/dist/esm/br-table.entry.js +678 -0
- package/dist/esm/br-tag.entry.js +492 -0
- package/dist/esm/br-textarea.entry.js +304 -0
- package/dist/esm/br-tooltip.entry.js +625 -0
- package/dist/esm/br-upload.entry.js +580 -0
- package/dist/esm/br-wizard-panel.entry.js +52 -0
- package/dist/esm/br-wizard.entry.js +706 -0
- package/dist/esm/breakpoint-observer-DBmwzG9E.js +141 -0
- package/dist/esm/clamp-gvnfuTjd.js +23 -0
- package/dist/esm/cookiebar.utils-DYA74R1r.js +16 -0
- package/dist/esm/datetime-picker-constants-Bfm58jO6.js +3798 -0
- package/dist/esm/event-DFN_so7I.js +48 -0
- package/dist/esm/floating-surface-dismiss-BWXfdbQH.js +61 -0
- package/dist/esm/floating-ui-BavFwMnx.js +134 -0
- package/dist/esm/floating-ui.dom-DIK54tTj.js +1707 -0
- package/dist/esm/focus-DxZJrIyL.js +26 -0
- package/dist/esm/getNextElement-9S9bgUT0.js +28 -0
- package/dist/esm/iconify-icon-D3usVJE2.js +2303 -0
- package/dist/esm/id-BkS6ujyf.js +18 -0
- package/dist/esm/index-Bo-2igoO.js +671 -0
- package/dist/esm/index-C2RBydfd.js +3258 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/isNil-B-qLmYZC.js +17 -0
- package/dist/esm/isValid-DIUZX1qS.js +3684 -0
- package/dist/esm/loader.js +15 -0
- package/dist/esm/native-dialog-B55qsau4.js +46 -0
- package/dist/esm/navigation-bhULC15U.js +23 -0
- package/dist/esm/parts-Bb5vVlCC.js +17 -0
- package/dist/esm/props-DRVMm1Py.js +22 -0
- package/dist/esm/raf-batcher-cF3ia5e9.js +53 -0
- package/dist/esm/slot-BIG-yees.js +44 -0
- package/dist/esm/swipe-Dmfk7eEe.js +343 -0
- package/dist/esm/table-constants-CXMwM9m4.js +170 -0
- package/dist/esm/validator-D3tVP32U.js +113 -0
- package/dist/esm/webcomponents.js +46 -0
- package/dist/hydrate/index.d.ts +287 -0
- package/dist/hydrate/index.js +67323 -0
- package/dist/hydrate/index.mjs +67313 -0
- package/dist/hydrate/package.json +12 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/loader/cdn.js +5 -0
- package/dist/loader/index.cjs.js +5 -0
- package/dist/loader/index.d.ts +24 -0
- package/dist/loader/index.es2017.js +5 -0
- package/dist/loader/index.js +6 -0
- package/dist/webcomponents/index.esm.js +5 -0
- package/dist/webcomponents/p-0196804a.entry.js +5 -0
- package/dist/webcomponents/p-0410186a.entry.js +5 -0
- package/dist/webcomponents/p-0415ef22.entry.js +5 -0
- package/dist/webcomponents/p-059c3d6c.entry.js +5 -0
- package/dist/webcomponents/p-0b8f39bc.entry.js +5 -0
- package/dist/webcomponents/p-0caa4d12.entry.js +5 -0
- package/dist/webcomponents/p-0d4f718d.entry.js +5 -0
- package/dist/webcomponents/p-0e84c9e8.entry.js +5 -0
- package/dist/webcomponents/p-12286e73.entry.js +5 -0
- package/dist/webcomponents/p-147ac8d3.entry.js +5 -0
- package/dist/webcomponents/p-1580beee.entry.js +5 -0
- package/dist/webcomponents/p-1b138f1c.entry.js +5 -0
- package/dist/webcomponents/p-1bca4499.entry.js +5 -0
- package/dist/webcomponents/p-1d6b0b6f.entry.js +5 -0
- package/dist/webcomponents/p-1d8cb8fd.entry.js +5 -0
- package/dist/webcomponents/p-22443c08.entry.js +5 -0
- package/dist/webcomponents/p-224daaac.entry.js +5 -0
- package/dist/webcomponents/p-28426d2a.entry.js +5 -0
- package/dist/webcomponents/p-2abd2da0.entry.js +5 -0
- package/dist/webcomponents/p-2fdc51ae.entry.js +5 -0
- package/dist/webcomponents/p-30c428b6.entry.js +5 -0
- package/dist/webcomponents/p-36bbea4e.entry.js +5 -0
- package/dist/webcomponents/p-3907ebfa.entry.js +5 -0
- package/dist/webcomponents/p-39a16f9d.entry.js +5 -0
- package/dist/webcomponents/p-3ebbd2f5.entry.js +5 -0
- package/dist/webcomponents/p-3ef7eac8.entry.js +5 -0
- package/dist/webcomponents/p-45356e9a.entry.js +5 -0
- package/dist/webcomponents/p-46513db4.entry.js +5 -0
- package/dist/webcomponents/p-4fe12a72.entry.js +5 -0
- package/dist/webcomponents/p-52df61cb.entry.js +5 -0
- package/dist/webcomponents/p-569134cf.entry.js +5 -0
- package/dist/webcomponents/p-5b257a4b.entry.js +5 -0
- package/dist/webcomponents/p-5ce7db4a.entry.js +5 -0
- package/dist/webcomponents/p-5f373708.entry.js +5 -0
- package/dist/webcomponents/p-5f6afb79.entry.js +5 -0
- package/dist/webcomponents/p-5fc7ba4c.entry.js +5 -0
- package/dist/webcomponents/p-60cc820c.entry.js +5 -0
- package/dist/webcomponents/p-66006312.entry.js +5 -0
- package/dist/webcomponents/p-66b13fd9.entry.js +5 -0
- package/dist/webcomponents/p-6OdfnwnK.js +5 -0
- package/dist/webcomponents/p-6c5f6cb6.entry.js +5 -0
- package/dist/webcomponents/p-6f1c4425.entry.js +5 -0
- package/dist/webcomponents/p-750799b7.entry.js +5 -0
- package/dist/webcomponents/p-756ff2ad.entry.js +5 -0
- package/dist/webcomponents/p-765bfe27.entry.js +5 -0
- package/dist/webcomponents/p-7ab96c11.entry.js +5 -0
- package/dist/webcomponents/p-7c2ff8b4.entry.js +5 -0
- package/dist/webcomponents/p-7cf9f4e5.entry.js +5 -0
- package/dist/webcomponents/p-7e1856e4.entry.js +5 -0
- package/dist/webcomponents/p-7f7506f0.entry.js +5 -0
- package/dist/webcomponents/p-7fb03a49.entry.js +5 -0
- package/dist/webcomponents/p-82200563.entry.js +5 -0
- package/dist/webcomponents/p-85f8063b.entry.js +5 -0
- package/dist/webcomponents/p-8b558233.entry.js +5 -0
- package/dist/webcomponents/p-8e6c2767.entry.js +5 -0
- package/dist/webcomponents/p-966ad32f.entry.js +5 -0
- package/dist/webcomponents/p-9679d230.entry.js +5 -0
- package/dist/webcomponents/p-96dd663b.entry.js +5 -0
- package/dist/webcomponents/p-98843fa3.entry.js +5 -0
- package/dist/webcomponents/p-9S9bgUT0.js +5 -0
- package/dist/webcomponents/p-9a375eff.entry.js +5 -0
- package/dist/webcomponents/p-9b358cff.entry.js +5 -0
- package/dist/webcomponents/p-9f7558c7.entry.js +5 -0
- package/dist/webcomponents/p-B-qLmYZC.js +5 -0
- package/dist/webcomponents/p-B55qsau4.js +5 -0
- package/dist/webcomponents/p-BIG-yees.js +5 -0
- package/dist/webcomponents/p-BWXfdbQH.js +5 -0
- package/dist/webcomponents/p-Bb5vVlCC.js +5 -0
- package/dist/webcomponents/p-Bfm58jO6.js +5 -0
- package/dist/webcomponents/p-BhMVJQ4-.js +5 -0
- package/dist/webcomponents/p-BkS6ujyf.js +5 -0
- package/dist/webcomponents/p-C2RBydfd.js +6 -0
- package/dist/webcomponents/p-CO5cOQQU.js +5 -0
- package/dist/webcomponents/p-CXMwM9m4.js +5 -0
- package/dist/webcomponents/p-D3tVP32U.js +5 -0
- package/dist/webcomponents/p-D3usVJE2.js +16 -0
- package/dist/webcomponents/p-DBmwzG9E.js +5 -0
- package/dist/webcomponents/p-DFN_so7I.js +5 -0
- package/dist/webcomponents/p-DIK54tTj.js +5 -0
- package/dist/webcomponents/p-DRVMm1Py.js +5 -0
- package/dist/webcomponents/p-DVjNHTTs.js +5 -0
- package/dist/webcomponents/p-DYA74R1r.js +5 -0
- package/dist/webcomponents/p-Dmfk7eEe.js +5 -0
- package/dist/webcomponents/p-DxZJrIyL.js +5 -0
- package/dist/webcomponents/p-a382e115.entry.js +5 -0
- package/dist/webcomponents/p-a9ff7c25.entry.js +5 -0
- package/dist/webcomponents/p-bba9fc09.entry.js +5 -0
- package/dist/webcomponents/p-bhULC15U.js +5 -0
- package/dist/webcomponents/p-c0b0f531.entry.js +5 -0
- package/dist/webcomponents/p-c211af17.entry.js +5 -0
- package/dist/webcomponents/p-c492d926.entry.js +5 -0
- package/dist/webcomponents/p-c4cfe599.entry.js +5 -0
- package/dist/webcomponents/p-c846e784.entry.js +5 -0
- package/dist/webcomponents/p-cF3ia5e9.js +5 -0
- package/dist/webcomponents/p-cedb8eea.entry.js +5 -0
- package/dist/webcomponents/p-d1e899cd.entry.js +5 -0
- package/dist/webcomponents/p-d38d82cc.entry.js +5 -0
- package/dist/webcomponents/p-dba376cb.entry.js +5 -0
- package/dist/webcomponents/p-e0ce536a.entry.js +5 -0
- package/dist/webcomponents/p-e1331288.entry.js +5 -0
- package/dist/webcomponents/p-e360a463.entry.js +5 -0
- package/dist/webcomponents/p-e80a1eb0.entry.js +5 -0
- package/dist/webcomponents/p-f078f972.entry.js +5 -0
- package/dist/webcomponents/p-f6318e94.entry.js +5 -0
- package/dist/webcomponents/p-fcd4ae48.entry.js +5 -0
- package/dist/webcomponents/p-gvnfuTjd.js +5 -0
- package/dist/webcomponents/webcomponents.esm.js +5 -0
- package/package.json +1 -1
- package/cem/.gitkeep +0 -0
|
@@ -0,0 +1,3684 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Construído por SERPRO
|
|
3
|
+
* © https://serpro.gov.br/ - MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { g as requireNormalizeDates, a as requireConstructFrom, i as requireStartOfDay, e as requireDefaultOptions, c as requireConstants$1, j as requireGetWeekYear, k as requireStartOfWeek, l as requireStartOfISOWeek, b as requireToDate, m as requireGetWeek, n as requireGetISOWeek, o as requireSetDay, p as requireAddDays, q as requireGetTimezoneOffsetInMilliseconds, s as requireLongFormatters, t as requireDefaultLocale, u as requireProtectedTokens, v as requireSetMonth, r as requireIsValid } from './datetime-picker-constants-Bfm58jO6.js';
|
|
6
|
+
|
|
7
|
+
var eachDayOfInterval = {};
|
|
8
|
+
|
|
9
|
+
var normalizeInterval = {};
|
|
10
|
+
|
|
11
|
+
var hasRequiredNormalizeInterval;
|
|
12
|
+
|
|
13
|
+
function requireNormalizeInterval () {
|
|
14
|
+
if (hasRequiredNormalizeInterval) return normalizeInterval;
|
|
15
|
+
hasRequiredNormalizeInterval = 1;
|
|
16
|
+
normalizeInterval.normalizeInterval = normalizeInterval$1;
|
|
17
|
+
var _index = /*@__PURE__*/ requireNormalizeDates();
|
|
18
|
+
|
|
19
|
+
function normalizeInterval$1(context, interval) {
|
|
20
|
+
const [start, end] = (0, _index.normalizeDates)(
|
|
21
|
+
context,
|
|
22
|
+
interval.start,
|
|
23
|
+
interval.end,
|
|
24
|
+
);
|
|
25
|
+
return { start, end };
|
|
26
|
+
}
|
|
27
|
+
return normalizeInterval;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var hasRequiredEachDayOfInterval;
|
|
31
|
+
|
|
32
|
+
function requireEachDayOfInterval () {
|
|
33
|
+
if (hasRequiredEachDayOfInterval) return eachDayOfInterval;
|
|
34
|
+
hasRequiredEachDayOfInterval = 1;
|
|
35
|
+
eachDayOfInterval.eachDayOfInterval = eachDayOfInterval$1;
|
|
36
|
+
var _index = /*@__PURE__*/ requireNormalizeInterval();
|
|
37
|
+
var _index2 = /*@__PURE__*/ requireConstructFrom();
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The {@link eachDayOfInterval} function options.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The {@link eachDayOfInterval} function result type. It resolves the proper data type.
|
|
45
|
+
* It uses the first argument date object type, starting from the date argument,
|
|
46
|
+
* then the start interval date, and finally the end interval date. If
|
|
47
|
+
* a context function is passed, it uses the context function return type.
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @name eachDayOfInterval
|
|
52
|
+
* @category Interval Helpers
|
|
53
|
+
* @summary Return the array of dates within the specified time interval.
|
|
54
|
+
*
|
|
55
|
+
* @description
|
|
56
|
+
* Return the array of dates within the specified time interval.
|
|
57
|
+
*
|
|
58
|
+
* @typeParam IntervalType - Interval type.
|
|
59
|
+
* @typeParam Options - Options type.
|
|
60
|
+
*
|
|
61
|
+
* @param interval - The interval.
|
|
62
|
+
* @param options - An object with options.
|
|
63
|
+
*
|
|
64
|
+
* @returns The array with starts of days from the day of the interval start to the day of the interval end
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Each day between 6 October 2014 and 10 October 2014:
|
|
68
|
+
* const result = eachDayOfInterval({
|
|
69
|
+
* start: new Date(2014, 9, 6),
|
|
70
|
+
* end: new Date(2014, 9, 10)
|
|
71
|
+
* })
|
|
72
|
+
* //=> [
|
|
73
|
+
* // Mon Oct 06 2014 00:00:00,
|
|
74
|
+
* // Tue Oct 07 2014 00:00:00,
|
|
75
|
+
* // Wed Oct 08 2014 00:00:00,
|
|
76
|
+
* // Thu Oct 09 2014 00:00:00,
|
|
77
|
+
* // Fri Oct 10 2014 00:00:00
|
|
78
|
+
* // ]
|
|
79
|
+
*/
|
|
80
|
+
function eachDayOfInterval$1(interval, options) {
|
|
81
|
+
const { start, end } = (0, _index.normalizeInterval)(options?.in, interval);
|
|
82
|
+
|
|
83
|
+
let reversed = +start > +end;
|
|
84
|
+
const endTime = reversed ? +start : +end;
|
|
85
|
+
const date = reversed ? end : start;
|
|
86
|
+
date.setHours(0, 0, 0, 0);
|
|
87
|
+
|
|
88
|
+
let step = options?.step ?? 1;
|
|
89
|
+
if (!step) return [];
|
|
90
|
+
if (step < 0) {
|
|
91
|
+
step = -step;
|
|
92
|
+
reversed = !reversed;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const dates = [];
|
|
96
|
+
|
|
97
|
+
while (+date <= endTime) {
|
|
98
|
+
dates.push((0, _index2.constructFrom)(start, date));
|
|
99
|
+
date.setDate(date.getDate() + step);
|
|
100
|
+
date.setHours(0, 0, 0, 0);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return reversed ? dates.reverse() : dates;
|
|
104
|
+
}
|
|
105
|
+
return eachDayOfInterval;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var eachDayOfIntervalExports = /*@__PURE__*/ requireEachDayOfInterval();
|
|
109
|
+
|
|
110
|
+
var isSameDay = {};
|
|
111
|
+
|
|
112
|
+
var hasRequiredIsSameDay;
|
|
113
|
+
|
|
114
|
+
function requireIsSameDay () {
|
|
115
|
+
if (hasRequiredIsSameDay) return isSameDay;
|
|
116
|
+
hasRequiredIsSameDay = 1;
|
|
117
|
+
isSameDay.isSameDay = isSameDay$1;
|
|
118
|
+
var _index = /*@__PURE__*/ requireNormalizeDates();
|
|
119
|
+
var _index2 = /*@__PURE__*/ requireStartOfDay();
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* The {@link isSameDay} function options.
|
|
123
|
+
*/
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @name isSameDay
|
|
127
|
+
* @category Day Helpers
|
|
128
|
+
* @summary Are the given dates in the same day (and year and month)?
|
|
129
|
+
*
|
|
130
|
+
* @description
|
|
131
|
+
* Are the given dates in the same day (and year and month)?
|
|
132
|
+
*
|
|
133
|
+
* @param laterDate - The first date to check
|
|
134
|
+
* @param earlierDate - The second date to check
|
|
135
|
+
* @param options - An object with options
|
|
136
|
+
*
|
|
137
|
+
* @returns The dates are in the same day (and year and month)
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
|
|
141
|
+
* const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
|
|
142
|
+
* //=> true
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* // Are 4 September and 4 October in the same day?
|
|
146
|
+
* const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
|
|
147
|
+
* //=> false
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* // Are 4 September, 2014 and 4 September, 2015 in the same day?
|
|
151
|
+
* const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
|
|
152
|
+
* //=> false
|
|
153
|
+
*/
|
|
154
|
+
function isSameDay$1(laterDate, earlierDate, options) {
|
|
155
|
+
const [dateLeft_, dateRight_] = (0, _index.normalizeDates)(
|
|
156
|
+
options?.in,
|
|
157
|
+
laterDate,
|
|
158
|
+
earlierDate,
|
|
159
|
+
);
|
|
160
|
+
return (
|
|
161
|
+
+(0, _index2.startOfDay)(dateLeft_) === +(0, _index2.startOfDay)(dateRight_)
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
return isSameDay;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
var isSameDayExports = /*@__PURE__*/ requireIsSameDay();
|
|
168
|
+
|
|
169
|
+
var parse = {};
|
|
170
|
+
|
|
171
|
+
var getDefaultOptions = {};
|
|
172
|
+
|
|
173
|
+
var hasRequiredGetDefaultOptions;
|
|
174
|
+
|
|
175
|
+
function requireGetDefaultOptions () {
|
|
176
|
+
if (hasRequiredGetDefaultOptions) return getDefaultOptions;
|
|
177
|
+
hasRequiredGetDefaultOptions = 1;
|
|
178
|
+
getDefaultOptions.getDefaultOptions = getDefaultOptions$1;
|
|
179
|
+
var _index = /*@__PURE__*/ requireDefaultOptions();
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @name getDefaultOptions
|
|
183
|
+
* @category Common Helpers
|
|
184
|
+
* @summary Get default options.
|
|
185
|
+
* @pure false
|
|
186
|
+
*
|
|
187
|
+
* @description
|
|
188
|
+
* Returns an object that contains defaults for
|
|
189
|
+
* `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`
|
|
190
|
+
* arguments for all functions.
|
|
191
|
+
*
|
|
192
|
+
* You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).
|
|
193
|
+
*
|
|
194
|
+
* @returns The default options
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* const result = getDefaultOptions()
|
|
198
|
+
* //=> {}
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })
|
|
202
|
+
* const result = getDefaultOptions()
|
|
203
|
+
* //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }
|
|
204
|
+
*/
|
|
205
|
+
function getDefaultOptions$1() {
|
|
206
|
+
return Object.assign({}, (0, _index.getDefaultOptions)());
|
|
207
|
+
}
|
|
208
|
+
return getDefaultOptions;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
var Setter = {};
|
|
212
|
+
|
|
213
|
+
var transpose = {};
|
|
214
|
+
|
|
215
|
+
var hasRequiredTranspose;
|
|
216
|
+
|
|
217
|
+
function requireTranspose () {
|
|
218
|
+
if (hasRequiredTranspose) return transpose;
|
|
219
|
+
hasRequiredTranspose = 1;
|
|
220
|
+
transpose.transpose = transpose$1;
|
|
221
|
+
var _index = /*@__PURE__*/ requireConstructFrom();
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* @name transpose
|
|
225
|
+
* @category Generic Helpers
|
|
226
|
+
* @summary Transpose the date to the given constructor.
|
|
227
|
+
*
|
|
228
|
+
* @description
|
|
229
|
+
* The function transposes the date to the given constructor. It helps you
|
|
230
|
+
* to transpose the date in the system time zone to say `UTCDate` or any other
|
|
231
|
+
* date extension.
|
|
232
|
+
*
|
|
233
|
+
* @typeParam InputDate - The input `Date` type derived from the passed argument.
|
|
234
|
+
* @typeParam ResultDate - The result `Date` type derived from the passed constructor.
|
|
235
|
+
*
|
|
236
|
+
* @param date - The date to use values from
|
|
237
|
+
* @param constructor - The date constructor to use
|
|
238
|
+
*
|
|
239
|
+
* @returns Date transposed to the given constructor
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* // Create July 10, 2022 00:00 in locale time zone
|
|
243
|
+
* const date = new Date(2022, 6, 10)
|
|
244
|
+
* //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* // Transpose the date to July 10, 2022 00:00 in UTC
|
|
248
|
+
* transpose(date, UTCDate)
|
|
249
|
+
* //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'
|
|
250
|
+
*/
|
|
251
|
+
function transpose$1(date, constructor) {
|
|
252
|
+
const date_ = isConstructor(constructor)
|
|
253
|
+
? new constructor(0)
|
|
254
|
+
: (0, _index.constructFrom)(constructor, 0);
|
|
255
|
+
date_.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
|
|
256
|
+
date_.setHours(
|
|
257
|
+
date.getHours(),
|
|
258
|
+
date.getMinutes(),
|
|
259
|
+
date.getSeconds(),
|
|
260
|
+
date.getMilliseconds(),
|
|
261
|
+
);
|
|
262
|
+
return date_;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
function isConstructor(constructor) {
|
|
266
|
+
return (
|
|
267
|
+
typeof constructor === "function" &&
|
|
268
|
+
constructor.prototype?.constructor === constructor
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
return transpose;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
var hasRequiredSetter;
|
|
275
|
+
|
|
276
|
+
function requireSetter () {
|
|
277
|
+
if (hasRequiredSetter) return Setter;
|
|
278
|
+
hasRequiredSetter = 1;
|
|
279
|
+
Setter.ValueSetter = Setter.Setter = Setter.DateTimezoneSetter = void 0;
|
|
280
|
+
var _index = /*@__PURE__*/ requireConstructFrom();
|
|
281
|
+
var _index2 = /*@__PURE__*/ requireTranspose();
|
|
282
|
+
|
|
283
|
+
const TIMEZONE_UNIT_PRIORITY = 10;
|
|
284
|
+
|
|
285
|
+
let Setter$1 = class Setter {
|
|
286
|
+
subPriority = 0;
|
|
287
|
+
|
|
288
|
+
validate(_utcDate, _options) {
|
|
289
|
+
return true;
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
Setter.Setter = Setter$1;
|
|
293
|
+
|
|
294
|
+
class ValueSetter extends Setter$1 {
|
|
295
|
+
constructor(
|
|
296
|
+
value,
|
|
297
|
+
validateValue,
|
|
298
|
+
|
|
299
|
+
setValue,
|
|
300
|
+
|
|
301
|
+
priority,
|
|
302
|
+
subPriority,
|
|
303
|
+
) {
|
|
304
|
+
super();
|
|
305
|
+
this.value = value;
|
|
306
|
+
this.validateValue = validateValue;
|
|
307
|
+
this.setValue = setValue;
|
|
308
|
+
this.priority = priority;
|
|
309
|
+
if (subPriority) {
|
|
310
|
+
this.subPriority = subPriority;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
validate(date, options) {
|
|
315
|
+
return this.validateValue(date, this.value, options);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
set(date, flags, options) {
|
|
319
|
+
return this.setValue(date, flags, this.value, options);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
Setter.ValueSetter = ValueSetter;
|
|
323
|
+
|
|
324
|
+
class DateTimezoneSetter extends Setter$1 {
|
|
325
|
+
priority = TIMEZONE_UNIT_PRIORITY;
|
|
326
|
+
subPriority = -1;
|
|
327
|
+
|
|
328
|
+
constructor(context, reference) {
|
|
329
|
+
super();
|
|
330
|
+
this.context =
|
|
331
|
+
context || ((date) => (0, _index.constructFrom)(reference, date));
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
set(date, flags) {
|
|
335
|
+
if (flags.timestampIsSet) return date;
|
|
336
|
+
return (0, _index.constructFrom)(
|
|
337
|
+
date,
|
|
338
|
+
(0, _index2.transpose)(date, this.context),
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
Setter.DateTimezoneSetter = DateTimezoneSetter;
|
|
343
|
+
return Setter;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
var parsers = {};
|
|
347
|
+
|
|
348
|
+
var EraParser = {};
|
|
349
|
+
|
|
350
|
+
var Parser = {};
|
|
351
|
+
|
|
352
|
+
var hasRequiredParser;
|
|
353
|
+
|
|
354
|
+
function requireParser () {
|
|
355
|
+
if (hasRequiredParser) return Parser;
|
|
356
|
+
hasRequiredParser = 1;
|
|
357
|
+
Parser.Parser = void 0;
|
|
358
|
+
var _Setter = /*@__PURE__*/ requireSetter();
|
|
359
|
+
|
|
360
|
+
let Parser$1 = class Parser {
|
|
361
|
+
run(dateString, token, match, options) {
|
|
362
|
+
const result = this.parse(dateString, token, match, options);
|
|
363
|
+
if (!result) {
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
return {
|
|
368
|
+
setter: new _Setter.ValueSetter(
|
|
369
|
+
result.value,
|
|
370
|
+
this.validate,
|
|
371
|
+
this.set,
|
|
372
|
+
this.priority,
|
|
373
|
+
this.subPriority,
|
|
374
|
+
),
|
|
375
|
+
rest: result.rest,
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
validate(_utcDate, _value, _options) {
|
|
380
|
+
return true;
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
Parser.Parser = Parser$1;
|
|
384
|
+
return Parser;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
var hasRequiredEraParser;
|
|
388
|
+
|
|
389
|
+
function requireEraParser () {
|
|
390
|
+
if (hasRequiredEraParser) return EraParser;
|
|
391
|
+
hasRequiredEraParser = 1;
|
|
392
|
+
EraParser.EraParser = void 0;
|
|
393
|
+
|
|
394
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
395
|
+
|
|
396
|
+
let EraParser$1 = class EraParser extends _Parser.Parser {
|
|
397
|
+
priority = 140;
|
|
398
|
+
|
|
399
|
+
parse(dateString, token, match) {
|
|
400
|
+
switch (token) {
|
|
401
|
+
// AD, BC
|
|
402
|
+
case "G":
|
|
403
|
+
case "GG":
|
|
404
|
+
case "GGG":
|
|
405
|
+
return (
|
|
406
|
+
match.era(dateString, { width: "abbreviated" }) ||
|
|
407
|
+
match.era(dateString, { width: "narrow" })
|
|
408
|
+
);
|
|
409
|
+
|
|
410
|
+
// A, B
|
|
411
|
+
case "GGGGG":
|
|
412
|
+
return match.era(dateString, { width: "narrow" });
|
|
413
|
+
// Anno Domini, Before Christ
|
|
414
|
+
case "GGGG":
|
|
415
|
+
default:
|
|
416
|
+
return (
|
|
417
|
+
match.era(dateString, { width: "wide" }) ||
|
|
418
|
+
match.era(dateString, { width: "abbreviated" }) ||
|
|
419
|
+
match.era(dateString, { width: "narrow" })
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
set(date, flags, value) {
|
|
425
|
+
flags.era = value;
|
|
426
|
+
date.setFullYear(value, 0, 1);
|
|
427
|
+
date.setHours(0, 0, 0, 0);
|
|
428
|
+
return date;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
incompatibleTokens = ["R", "u", "t", "T"];
|
|
432
|
+
};
|
|
433
|
+
EraParser.EraParser = EraParser$1;
|
|
434
|
+
return EraParser;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
var YearParser = {};
|
|
438
|
+
|
|
439
|
+
var utils = {};
|
|
440
|
+
|
|
441
|
+
var constants = {};
|
|
442
|
+
|
|
443
|
+
var hasRequiredConstants;
|
|
444
|
+
|
|
445
|
+
function requireConstants () {
|
|
446
|
+
if (hasRequiredConstants) return constants;
|
|
447
|
+
hasRequiredConstants = 1;
|
|
448
|
+
constants.timezonePatterns = constants.numericPatterns = void 0;
|
|
449
|
+
(constants.numericPatterns = {
|
|
450
|
+
month: /^(1[0-2]|0?\d)/, // 0 to 12
|
|
451
|
+
date: /^(3[0-1]|[0-2]?\d)/, // 0 to 31
|
|
452
|
+
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, // 0 to 366
|
|
453
|
+
week: /^(5[0-3]|[0-4]?\d)/, // 0 to 53
|
|
454
|
+
hour23h: /^(2[0-3]|[0-1]?\d)/, // 0 to 23
|
|
455
|
+
hour24h: /^(2[0-4]|[0-1]?\d)/, // 0 to 24
|
|
456
|
+
hour11h: /^(1[0-1]|0?\d)/, // 0 to 11
|
|
457
|
+
hour12h: /^(1[0-2]|0?\d)/, // 0 to 12
|
|
458
|
+
minute: /^[0-5]?\d/, // 0 to 59
|
|
459
|
+
second: /^[0-5]?\d/, // 0 to 59
|
|
460
|
+
|
|
461
|
+
singleDigit: /^\d/, // 0 to 9
|
|
462
|
+
twoDigits: /^\d{1,2}/, // 0 to 99
|
|
463
|
+
threeDigits: /^\d{1,3}/, // 0 to 999
|
|
464
|
+
fourDigits: /^\d{1,4}/, // 0 to 9999
|
|
465
|
+
|
|
466
|
+
anyDigitsSigned: /^-?\d+/,
|
|
467
|
+
singleDigitSigned: /^-?\d/, // 0 to 9, -0 to -9
|
|
468
|
+
twoDigitsSigned: /^-?\d{1,2}/, // 0 to 99, -0 to -99
|
|
469
|
+
threeDigitsSigned: /^-?\d{1,3}/, // 0 to 999, -0 to -999
|
|
470
|
+
fourDigitsSigned: /^-?\d{1,4}/, // 0 to 9999, -0 to -9999
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
(constants.timezonePatterns = {
|
|
474
|
+
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
475
|
+
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
476
|
+
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
477
|
+
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
478
|
+
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/,
|
|
479
|
+
});
|
|
480
|
+
return constants;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
var hasRequiredUtils;
|
|
484
|
+
|
|
485
|
+
function requireUtils () {
|
|
486
|
+
if (hasRequiredUtils) return utils;
|
|
487
|
+
hasRequiredUtils = 1;
|
|
488
|
+
utils.dayPeriodEnumToHours = dayPeriodEnumToHours;
|
|
489
|
+
utils.isLeapYearIndex = isLeapYearIndex;
|
|
490
|
+
utils.mapValue = mapValue;
|
|
491
|
+
utils.normalizeTwoDigitYear = normalizeTwoDigitYear;
|
|
492
|
+
utils.parseAnyDigitsSigned = parseAnyDigitsSigned;
|
|
493
|
+
utils.parseNDigits = parseNDigits;
|
|
494
|
+
utils.parseNDigitsSigned = parseNDigitsSigned;
|
|
495
|
+
utils.parseNumericPattern = parseNumericPattern;
|
|
496
|
+
utils.parseTimezonePattern = parseTimezonePattern;
|
|
497
|
+
var _index = /*@__PURE__*/ requireConstants$1();
|
|
498
|
+
|
|
499
|
+
var _constants = /*@__PURE__*/ requireConstants();
|
|
500
|
+
|
|
501
|
+
function mapValue(parseFnResult, mapFn) {
|
|
502
|
+
if (!parseFnResult) {
|
|
503
|
+
return parseFnResult;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
return {
|
|
507
|
+
value: mapFn(parseFnResult.value),
|
|
508
|
+
rest: parseFnResult.rest,
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
function parseNumericPattern(pattern, dateString) {
|
|
513
|
+
const matchResult = dateString.match(pattern);
|
|
514
|
+
|
|
515
|
+
if (!matchResult) {
|
|
516
|
+
return null;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
return {
|
|
520
|
+
value: parseInt(matchResult[0], 10),
|
|
521
|
+
rest: dateString.slice(matchResult[0].length),
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
function parseTimezonePattern(pattern, dateString) {
|
|
526
|
+
const matchResult = dateString.match(pattern);
|
|
527
|
+
|
|
528
|
+
if (!matchResult) {
|
|
529
|
+
return null;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// Input is 'Z'
|
|
533
|
+
if (matchResult[0] === "Z") {
|
|
534
|
+
return {
|
|
535
|
+
value: 0,
|
|
536
|
+
rest: dateString.slice(1),
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
const sign = matchResult[1] === "+" ? 1 : -1;
|
|
541
|
+
const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
|
|
542
|
+
const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
|
|
543
|
+
const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
|
|
544
|
+
|
|
545
|
+
return {
|
|
546
|
+
value:
|
|
547
|
+
sign *
|
|
548
|
+
(hours * _index.millisecondsInHour +
|
|
549
|
+
minutes * _index.millisecondsInMinute +
|
|
550
|
+
seconds * _index.millisecondsInSecond),
|
|
551
|
+
rest: dateString.slice(matchResult[0].length),
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
function parseAnyDigitsSigned(dateString) {
|
|
556
|
+
return parseNumericPattern(
|
|
557
|
+
_constants.numericPatterns.anyDigitsSigned,
|
|
558
|
+
dateString,
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
function parseNDigits(n, dateString) {
|
|
563
|
+
switch (n) {
|
|
564
|
+
case 1:
|
|
565
|
+
return parseNumericPattern(
|
|
566
|
+
_constants.numericPatterns.singleDigit,
|
|
567
|
+
dateString,
|
|
568
|
+
);
|
|
569
|
+
case 2:
|
|
570
|
+
return parseNumericPattern(
|
|
571
|
+
_constants.numericPatterns.twoDigits,
|
|
572
|
+
dateString,
|
|
573
|
+
);
|
|
574
|
+
case 3:
|
|
575
|
+
return parseNumericPattern(
|
|
576
|
+
_constants.numericPatterns.threeDigits,
|
|
577
|
+
dateString,
|
|
578
|
+
);
|
|
579
|
+
case 4:
|
|
580
|
+
return parseNumericPattern(
|
|
581
|
+
_constants.numericPatterns.fourDigits,
|
|
582
|
+
dateString,
|
|
583
|
+
);
|
|
584
|
+
default:
|
|
585
|
+
return parseNumericPattern(new RegExp("^\\d{1," + n + "}"), dateString);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
function parseNDigitsSigned(n, dateString) {
|
|
590
|
+
switch (n) {
|
|
591
|
+
case 1:
|
|
592
|
+
return parseNumericPattern(
|
|
593
|
+
_constants.numericPatterns.singleDigitSigned,
|
|
594
|
+
dateString,
|
|
595
|
+
);
|
|
596
|
+
case 2:
|
|
597
|
+
return parseNumericPattern(
|
|
598
|
+
_constants.numericPatterns.twoDigitsSigned,
|
|
599
|
+
dateString,
|
|
600
|
+
);
|
|
601
|
+
case 3:
|
|
602
|
+
return parseNumericPattern(
|
|
603
|
+
_constants.numericPatterns.threeDigitsSigned,
|
|
604
|
+
dateString,
|
|
605
|
+
);
|
|
606
|
+
case 4:
|
|
607
|
+
return parseNumericPattern(
|
|
608
|
+
_constants.numericPatterns.fourDigitsSigned,
|
|
609
|
+
dateString,
|
|
610
|
+
);
|
|
611
|
+
default:
|
|
612
|
+
return parseNumericPattern(new RegExp("^-?\\d{1," + n + "}"), dateString);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
function dayPeriodEnumToHours(dayPeriod) {
|
|
617
|
+
switch (dayPeriod) {
|
|
618
|
+
case "morning":
|
|
619
|
+
return 4;
|
|
620
|
+
case "evening":
|
|
621
|
+
return 17;
|
|
622
|
+
case "pm":
|
|
623
|
+
case "noon":
|
|
624
|
+
case "afternoon":
|
|
625
|
+
return 12;
|
|
626
|
+
case "am":
|
|
627
|
+
case "midnight":
|
|
628
|
+
case "night":
|
|
629
|
+
default:
|
|
630
|
+
return 0;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
function normalizeTwoDigitYear(twoDigitYear, currentYear) {
|
|
635
|
+
const isCommonEra = currentYear > 0;
|
|
636
|
+
// Absolute number of the current year:
|
|
637
|
+
// 1 -> 1 AC
|
|
638
|
+
// 0 -> 1 BC
|
|
639
|
+
// -1 -> 2 BC
|
|
640
|
+
const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
|
|
641
|
+
|
|
642
|
+
let result;
|
|
643
|
+
if (absCurrentYear <= 50) {
|
|
644
|
+
result = twoDigitYear || 100;
|
|
645
|
+
} else {
|
|
646
|
+
const rangeEnd = absCurrentYear + 50;
|
|
647
|
+
const rangeEndCentury = Math.trunc(rangeEnd / 100) * 100;
|
|
648
|
+
const isPreviousCentury = twoDigitYear >= rangeEnd % 100;
|
|
649
|
+
result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
return isCommonEra ? result : 1 - result;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
function isLeapYearIndex(year) {
|
|
656
|
+
return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);
|
|
657
|
+
}
|
|
658
|
+
return utils;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
var hasRequiredYearParser;
|
|
662
|
+
|
|
663
|
+
function requireYearParser () {
|
|
664
|
+
if (hasRequiredYearParser) return YearParser;
|
|
665
|
+
hasRequiredYearParser = 1;
|
|
666
|
+
YearParser.YearParser = void 0;
|
|
667
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
668
|
+
|
|
669
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
670
|
+
|
|
671
|
+
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns
|
|
672
|
+
// | Year | y | yy | yyy | yyyy | yyyyy |
|
|
673
|
+
// |----------|-------|----|-------|-------|-------|
|
|
674
|
+
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
|
|
675
|
+
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
|
|
676
|
+
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
|
677
|
+
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
|
678
|
+
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
|
679
|
+
let YearParser$1 = class YearParser extends _Parser.Parser {
|
|
680
|
+
priority = 130;
|
|
681
|
+
incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"];
|
|
682
|
+
|
|
683
|
+
parse(dateString, token, match) {
|
|
684
|
+
const valueCallback = (year) => ({
|
|
685
|
+
year,
|
|
686
|
+
isTwoDigitYear: token === "yy",
|
|
687
|
+
});
|
|
688
|
+
|
|
689
|
+
switch (token) {
|
|
690
|
+
case "y":
|
|
691
|
+
return (0, _utils.mapValue)(
|
|
692
|
+
(0, _utils.parseNDigits)(4, dateString),
|
|
693
|
+
valueCallback,
|
|
694
|
+
);
|
|
695
|
+
case "yo":
|
|
696
|
+
return (0, _utils.mapValue)(
|
|
697
|
+
match.ordinalNumber(dateString, {
|
|
698
|
+
unit: "year",
|
|
699
|
+
}),
|
|
700
|
+
valueCallback,
|
|
701
|
+
);
|
|
702
|
+
default:
|
|
703
|
+
return (0, _utils.mapValue)(
|
|
704
|
+
(0, _utils.parseNDigits)(token.length, dateString),
|
|
705
|
+
valueCallback,
|
|
706
|
+
);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
validate(_date, value) {
|
|
711
|
+
return value.isTwoDigitYear || value.year > 0;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
set(date, flags, value) {
|
|
715
|
+
const currentYear = date.getFullYear();
|
|
716
|
+
|
|
717
|
+
if (value.isTwoDigitYear) {
|
|
718
|
+
const normalizedTwoDigitYear = (0, _utils.normalizeTwoDigitYear)(
|
|
719
|
+
value.year,
|
|
720
|
+
currentYear,
|
|
721
|
+
);
|
|
722
|
+
date.setFullYear(normalizedTwoDigitYear, 0, 1);
|
|
723
|
+
date.setHours(0, 0, 0, 0);
|
|
724
|
+
return date;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
const year =
|
|
728
|
+
!("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
|
729
|
+
date.setFullYear(year, 0, 1);
|
|
730
|
+
date.setHours(0, 0, 0, 0);
|
|
731
|
+
return date;
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
YearParser.YearParser = YearParser$1;
|
|
735
|
+
return YearParser;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
var LocalWeekYearParser = {};
|
|
739
|
+
|
|
740
|
+
var hasRequiredLocalWeekYearParser;
|
|
741
|
+
|
|
742
|
+
function requireLocalWeekYearParser () {
|
|
743
|
+
if (hasRequiredLocalWeekYearParser) return LocalWeekYearParser;
|
|
744
|
+
hasRequiredLocalWeekYearParser = 1;
|
|
745
|
+
LocalWeekYearParser.LocalWeekYearParser = void 0;
|
|
746
|
+
var _index = /*@__PURE__*/ requireGetWeekYear();
|
|
747
|
+
|
|
748
|
+
var _index2 = /*@__PURE__*/ requireStartOfWeek();
|
|
749
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
750
|
+
|
|
751
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
752
|
+
|
|
753
|
+
// Local week-numbering year
|
|
754
|
+
let LocalWeekYearParser$1 = class LocalWeekYearParser extends _Parser.Parser {
|
|
755
|
+
priority = 130;
|
|
756
|
+
|
|
757
|
+
parse(dateString, token, match) {
|
|
758
|
+
const valueCallback = (year) => ({
|
|
759
|
+
year,
|
|
760
|
+
isTwoDigitYear: token === "YY",
|
|
761
|
+
});
|
|
762
|
+
|
|
763
|
+
switch (token) {
|
|
764
|
+
case "Y":
|
|
765
|
+
return (0, _utils.mapValue)(
|
|
766
|
+
(0, _utils.parseNDigits)(4, dateString),
|
|
767
|
+
valueCallback,
|
|
768
|
+
);
|
|
769
|
+
case "Yo":
|
|
770
|
+
return (0, _utils.mapValue)(
|
|
771
|
+
match.ordinalNumber(dateString, {
|
|
772
|
+
unit: "year",
|
|
773
|
+
}),
|
|
774
|
+
valueCallback,
|
|
775
|
+
);
|
|
776
|
+
default:
|
|
777
|
+
return (0, _utils.mapValue)(
|
|
778
|
+
(0, _utils.parseNDigits)(token.length, dateString),
|
|
779
|
+
valueCallback,
|
|
780
|
+
);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
validate(_date, value) {
|
|
785
|
+
return value.isTwoDigitYear || value.year > 0;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
set(date, flags, value, options) {
|
|
789
|
+
const currentYear = (0, _index.getWeekYear)(date, options);
|
|
790
|
+
|
|
791
|
+
if (value.isTwoDigitYear) {
|
|
792
|
+
const normalizedTwoDigitYear = (0, _utils.normalizeTwoDigitYear)(
|
|
793
|
+
value.year,
|
|
794
|
+
currentYear,
|
|
795
|
+
);
|
|
796
|
+
date.setFullYear(
|
|
797
|
+
normalizedTwoDigitYear,
|
|
798
|
+
0,
|
|
799
|
+
options.firstWeekContainsDate,
|
|
800
|
+
);
|
|
801
|
+
date.setHours(0, 0, 0, 0);
|
|
802
|
+
return (0, _index2.startOfWeek)(date, options);
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
const year =
|
|
806
|
+
!("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
|
807
|
+
date.setFullYear(year, 0, options.firstWeekContainsDate);
|
|
808
|
+
date.setHours(0, 0, 0, 0);
|
|
809
|
+
return (0, _index2.startOfWeek)(date, options);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
incompatibleTokens = [
|
|
813
|
+
"y",
|
|
814
|
+
"R",
|
|
815
|
+
"u",
|
|
816
|
+
"Q",
|
|
817
|
+
"q",
|
|
818
|
+
"M",
|
|
819
|
+
"L",
|
|
820
|
+
"I",
|
|
821
|
+
"d",
|
|
822
|
+
"D",
|
|
823
|
+
"i",
|
|
824
|
+
"t",
|
|
825
|
+
"T",
|
|
826
|
+
];
|
|
827
|
+
};
|
|
828
|
+
LocalWeekYearParser.LocalWeekYearParser = LocalWeekYearParser$1;
|
|
829
|
+
return LocalWeekYearParser;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
var ISOWeekYearParser = {};
|
|
833
|
+
|
|
834
|
+
var hasRequiredISOWeekYearParser;
|
|
835
|
+
|
|
836
|
+
function requireISOWeekYearParser () {
|
|
837
|
+
if (hasRequiredISOWeekYearParser) return ISOWeekYearParser;
|
|
838
|
+
hasRequiredISOWeekYearParser = 1;
|
|
839
|
+
ISOWeekYearParser.ISOWeekYearParser = void 0;
|
|
840
|
+
var _index = /*@__PURE__*/ requireStartOfISOWeek();
|
|
841
|
+
var _index2 = /*@__PURE__*/ requireConstructFrom();
|
|
842
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
843
|
+
|
|
844
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
845
|
+
|
|
846
|
+
// ISO week-numbering year
|
|
847
|
+
let ISOWeekYearParser$1 = class ISOWeekYearParser extends _Parser.Parser {
|
|
848
|
+
priority = 130;
|
|
849
|
+
|
|
850
|
+
parse(dateString, token) {
|
|
851
|
+
if (token === "R") {
|
|
852
|
+
return (0, _utils.parseNDigitsSigned)(4, dateString);
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
return (0, _utils.parseNDigitsSigned)(token.length, dateString);
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
set(date, _flags, value) {
|
|
859
|
+
const firstWeekOfYear = (0, _index2.constructFrom)(date, 0);
|
|
860
|
+
firstWeekOfYear.setFullYear(value, 0, 4);
|
|
861
|
+
firstWeekOfYear.setHours(0, 0, 0, 0);
|
|
862
|
+
return (0, _index.startOfISOWeek)(firstWeekOfYear);
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
incompatibleTokens = [
|
|
866
|
+
"G",
|
|
867
|
+
"y",
|
|
868
|
+
"Y",
|
|
869
|
+
"u",
|
|
870
|
+
"Q",
|
|
871
|
+
"q",
|
|
872
|
+
"M",
|
|
873
|
+
"L",
|
|
874
|
+
"w",
|
|
875
|
+
"d",
|
|
876
|
+
"D",
|
|
877
|
+
"e",
|
|
878
|
+
"c",
|
|
879
|
+
"t",
|
|
880
|
+
"T",
|
|
881
|
+
];
|
|
882
|
+
};
|
|
883
|
+
ISOWeekYearParser.ISOWeekYearParser = ISOWeekYearParser$1;
|
|
884
|
+
return ISOWeekYearParser;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
var ExtendedYearParser = {};
|
|
888
|
+
|
|
889
|
+
var hasRequiredExtendedYearParser;
|
|
890
|
+
|
|
891
|
+
function requireExtendedYearParser () {
|
|
892
|
+
if (hasRequiredExtendedYearParser) return ExtendedYearParser;
|
|
893
|
+
hasRequiredExtendedYearParser = 1;
|
|
894
|
+
ExtendedYearParser.ExtendedYearParser = void 0;
|
|
895
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
896
|
+
|
|
897
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
898
|
+
|
|
899
|
+
let ExtendedYearParser$1 = class ExtendedYearParser extends _Parser.Parser {
|
|
900
|
+
priority = 130;
|
|
901
|
+
|
|
902
|
+
parse(dateString, token) {
|
|
903
|
+
if (token === "u") {
|
|
904
|
+
return (0, _utils.parseNDigitsSigned)(4, dateString);
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
return (0, _utils.parseNDigitsSigned)(token.length, dateString);
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
set(date, _flags, value) {
|
|
911
|
+
date.setFullYear(value, 0, 1);
|
|
912
|
+
date.setHours(0, 0, 0, 0);
|
|
913
|
+
return date;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
incompatibleTokens = ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"];
|
|
917
|
+
};
|
|
918
|
+
ExtendedYearParser.ExtendedYearParser = ExtendedYearParser$1;
|
|
919
|
+
return ExtendedYearParser;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
var QuarterParser = {};
|
|
923
|
+
|
|
924
|
+
var hasRequiredQuarterParser;
|
|
925
|
+
|
|
926
|
+
function requireQuarterParser () {
|
|
927
|
+
if (hasRequiredQuarterParser) return QuarterParser;
|
|
928
|
+
hasRequiredQuarterParser = 1;
|
|
929
|
+
QuarterParser.QuarterParser = void 0;
|
|
930
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
931
|
+
|
|
932
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
933
|
+
|
|
934
|
+
let QuarterParser$1 = class QuarterParser extends _Parser.Parser {
|
|
935
|
+
priority = 120;
|
|
936
|
+
|
|
937
|
+
parse(dateString, token, match) {
|
|
938
|
+
switch (token) {
|
|
939
|
+
// 1, 2, 3, 4
|
|
940
|
+
case "Q":
|
|
941
|
+
case "QQ": // 01, 02, 03, 04
|
|
942
|
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
943
|
+
// 1st, 2nd, 3rd, 4th
|
|
944
|
+
case "Qo":
|
|
945
|
+
return match.ordinalNumber(dateString, { unit: "quarter" });
|
|
946
|
+
// Q1, Q2, Q3, Q4
|
|
947
|
+
case "QQQ":
|
|
948
|
+
return (
|
|
949
|
+
match.quarter(dateString, {
|
|
950
|
+
width: "abbreviated",
|
|
951
|
+
context: "formatting",
|
|
952
|
+
}) ||
|
|
953
|
+
match.quarter(dateString, {
|
|
954
|
+
width: "narrow",
|
|
955
|
+
context: "formatting",
|
|
956
|
+
})
|
|
957
|
+
);
|
|
958
|
+
|
|
959
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
960
|
+
case "QQQQQ":
|
|
961
|
+
return match.quarter(dateString, {
|
|
962
|
+
width: "narrow",
|
|
963
|
+
context: "formatting",
|
|
964
|
+
});
|
|
965
|
+
// 1st quarter, 2nd quarter, ...
|
|
966
|
+
case "QQQQ":
|
|
967
|
+
default:
|
|
968
|
+
return (
|
|
969
|
+
match.quarter(dateString, {
|
|
970
|
+
width: "wide",
|
|
971
|
+
context: "formatting",
|
|
972
|
+
}) ||
|
|
973
|
+
match.quarter(dateString, {
|
|
974
|
+
width: "abbreviated",
|
|
975
|
+
context: "formatting",
|
|
976
|
+
}) ||
|
|
977
|
+
match.quarter(dateString, {
|
|
978
|
+
width: "narrow",
|
|
979
|
+
context: "formatting",
|
|
980
|
+
})
|
|
981
|
+
);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
validate(_date, value) {
|
|
986
|
+
return value >= 1 && value <= 4;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
set(date, _flags, value) {
|
|
990
|
+
date.setMonth((value - 1) * 3, 1);
|
|
991
|
+
date.setHours(0, 0, 0, 0);
|
|
992
|
+
return date;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
incompatibleTokens = [
|
|
996
|
+
"Y",
|
|
997
|
+
"R",
|
|
998
|
+
"q",
|
|
999
|
+
"M",
|
|
1000
|
+
"L",
|
|
1001
|
+
"w",
|
|
1002
|
+
"I",
|
|
1003
|
+
"d",
|
|
1004
|
+
"D",
|
|
1005
|
+
"i",
|
|
1006
|
+
"e",
|
|
1007
|
+
"c",
|
|
1008
|
+
"t",
|
|
1009
|
+
"T",
|
|
1010
|
+
];
|
|
1011
|
+
};
|
|
1012
|
+
QuarterParser.QuarterParser = QuarterParser$1;
|
|
1013
|
+
return QuarterParser;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
var StandAloneQuarterParser = {};
|
|
1017
|
+
|
|
1018
|
+
var hasRequiredStandAloneQuarterParser;
|
|
1019
|
+
|
|
1020
|
+
function requireStandAloneQuarterParser () {
|
|
1021
|
+
if (hasRequiredStandAloneQuarterParser) return StandAloneQuarterParser;
|
|
1022
|
+
hasRequiredStandAloneQuarterParser = 1;
|
|
1023
|
+
StandAloneQuarterParser.StandAloneQuarterParser = void 0;
|
|
1024
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
1025
|
+
|
|
1026
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
1027
|
+
|
|
1028
|
+
let StandAloneQuarterParser$1 = class StandAloneQuarterParser extends _Parser.Parser {
|
|
1029
|
+
priority = 120;
|
|
1030
|
+
|
|
1031
|
+
parse(dateString, token, match) {
|
|
1032
|
+
switch (token) {
|
|
1033
|
+
// 1, 2, 3, 4
|
|
1034
|
+
case "q":
|
|
1035
|
+
case "qq": // 01, 02, 03, 04
|
|
1036
|
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
1037
|
+
// 1st, 2nd, 3rd, 4th
|
|
1038
|
+
case "qo":
|
|
1039
|
+
return match.ordinalNumber(dateString, { unit: "quarter" });
|
|
1040
|
+
// Q1, Q2, Q3, Q4
|
|
1041
|
+
case "qqq":
|
|
1042
|
+
return (
|
|
1043
|
+
match.quarter(dateString, {
|
|
1044
|
+
width: "abbreviated",
|
|
1045
|
+
context: "standalone",
|
|
1046
|
+
}) ||
|
|
1047
|
+
match.quarter(dateString, {
|
|
1048
|
+
width: "narrow",
|
|
1049
|
+
context: "standalone",
|
|
1050
|
+
})
|
|
1051
|
+
);
|
|
1052
|
+
|
|
1053
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1054
|
+
case "qqqqq":
|
|
1055
|
+
return match.quarter(dateString, {
|
|
1056
|
+
width: "narrow",
|
|
1057
|
+
context: "standalone",
|
|
1058
|
+
});
|
|
1059
|
+
// 1st quarter, 2nd quarter, ...
|
|
1060
|
+
case "qqqq":
|
|
1061
|
+
default:
|
|
1062
|
+
return (
|
|
1063
|
+
match.quarter(dateString, {
|
|
1064
|
+
width: "wide",
|
|
1065
|
+
context: "standalone",
|
|
1066
|
+
}) ||
|
|
1067
|
+
match.quarter(dateString, {
|
|
1068
|
+
width: "abbreviated",
|
|
1069
|
+
context: "standalone",
|
|
1070
|
+
}) ||
|
|
1071
|
+
match.quarter(dateString, {
|
|
1072
|
+
width: "narrow",
|
|
1073
|
+
context: "standalone",
|
|
1074
|
+
})
|
|
1075
|
+
);
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
validate(_date, value) {
|
|
1080
|
+
return value >= 1 && value <= 4;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
set(date, _flags, value) {
|
|
1084
|
+
date.setMonth((value - 1) * 3, 1);
|
|
1085
|
+
date.setHours(0, 0, 0, 0);
|
|
1086
|
+
return date;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
incompatibleTokens = [
|
|
1090
|
+
"Y",
|
|
1091
|
+
"R",
|
|
1092
|
+
"Q",
|
|
1093
|
+
"M",
|
|
1094
|
+
"L",
|
|
1095
|
+
"w",
|
|
1096
|
+
"I",
|
|
1097
|
+
"d",
|
|
1098
|
+
"D",
|
|
1099
|
+
"i",
|
|
1100
|
+
"e",
|
|
1101
|
+
"c",
|
|
1102
|
+
"t",
|
|
1103
|
+
"T",
|
|
1104
|
+
];
|
|
1105
|
+
};
|
|
1106
|
+
StandAloneQuarterParser.StandAloneQuarterParser = StandAloneQuarterParser$1;
|
|
1107
|
+
return StandAloneQuarterParser;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
var MonthParser = {};
|
|
1111
|
+
|
|
1112
|
+
var hasRequiredMonthParser;
|
|
1113
|
+
|
|
1114
|
+
function requireMonthParser () {
|
|
1115
|
+
if (hasRequiredMonthParser) return MonthParser;
|
|
1116
|
+
hasRequiredMonthParser = 1;
|
|
1117
|
+
MonthParser.MonthParser = void 0;
|
|
1118
|
+
var _constants = /*@__PURE__*/ requireConstants();
|
|
1119
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
1120
|
+
|
|
1121
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
1122
|
+
|
|
1123
|
+
let MonthParser$1 = class MonthParser extends _Parser.Parser {
|
|
1124
|
+
incompatibleTokens = [
|
|
1125
|
+
"Y",
|
|
1126
|
+
"R",
|
|
1127
|
+
"q",
|
|
1128
|
+
"Q",
|
|
1129
|
+
"L",
|
|
1130
|
+
"w",
|
|
1131
|
+
"I",
|
|
1132
|
+
"D",
|
|
1133
|
+
"i",
|
|
1134
|
+
"e",
|
|
1135
|
+
"c",
|
|
1136
|
+
"t",
|
|
1137
|
+
"T",
|
|
1138
|
+
];
|
|
1139
|
+
|
|
1140
|
+
priority = 110;
|
|
1141
|
+
|
|
1142
|
+
parse(dateString, token, match) {
|
|
1143
|
+
const valueCallback = (value) => value - 1;
|
|
1144
|
+
|
|
1145
|
+
switch (token) {
|
|
1146
|
+
// 1, 2, ..., 12
|
|
1147
|
+
case "M":
|
|
1148
|
+
return (0, _utils.mapValue)(
|
|
1149
|
+
(0, _utils.parseNumericPattern)(
|
|
1150
|
+
_constants.numericPatterns.month,
|
|
1151
|
+
dateString,
|
|
1152
|
+
),
|
|
1153
|
+
valueCallback,
|
|
1154
|
+
);
|
|
1155
|
+
// 01, 02, ..., 12
|
|
1156
|
+
case "MM":
|
|
1157
|
+
return (0, _utils.mapValue)(
|
|
1158
|
+
(0, _utils.parseNDigits)(2, dateString),
|
|
1159
|
+
valueCallback,
|
|
1160
|
+
);
|
|
1161
|
+
// 1st, 2nd, ..., 12th
|
|
1162
|
+
case "Mo":
|
|
1163
|
+
return (0, _utils.mapValue)(
|
|
1164
|
+
match.ordinalNumber(dateString, {
|
|
1165
|
+
unit: "month",
|
|
1166
|
+
}),
|
|
1167
|
+
valueCallback,
|
|
1168
|
+
);
|
|
1169
|
+
// Jan, Feb, ..., Dec
|
|
1170
|
+
case "MMM":
|
|
1171
|
+
return (
|
|
1172
|
+
match.month(dateString, {
|
|
1173
|
+
width: "abbreviated",
|
|
1174
|
+
context: "formatting",
|
|
1175
|
+
}) ||
|
|
1176
|
+
match.month(dateString, { width: "narrow", context: "formatting" })
|
|
1177
|
+
);
|
|
1178
|
+
|
|
1179
|
+
// J, F, ..., D
|
|
1180
|
+
case "MMMMM":
|
|
1181
|
+
return match.month(dateString, {
|
|
1182
|
+
width: "narrow",
|
|
1183
|
+
context: "formatting",
|
|
1184
|
+
});
|
|
1185
|
+
// January, February, ..., December
|
|
1186
|
+
case "MMMM":
|
|
1187
|
+
default:
|
|
1188
|
+
return (
|
|
1189
|
+
match.month(dateString, { width: "wide", context: "formatting" }) ||
|
|
1190
|
+
match.month(dateString, {
|
|
1191
|
+
width: "abbreviated",
|
|
1192
|
+
context: "formatting",
|
|
1193
|
+
}) ||
|
|
1194
|
+
match.month(dateString, { width: "narrow", context: "formatting" })
|
|
1195
|
+
);
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
validate(_date, value) {
|
|
1200
|
+
return value >= 0 && value <= 11;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
set(date, _flags, value) {
|
|
1204
|
+
date.setMonth(value, 1);
|
|
1205
|
+
date.setHours(0, 0, 0, 0);
|
|
1206
|
+
return date;
|
|
1207
|
+
}
|
|
1208
|
+
};
|
|
1209
|
+
MonthParser.MonthParser = MonthParser$1;
|
|
1210
|
+
return MonthParser;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
var StandAloneMonthParser = {};
|
|
1214
|
+
|
|
1215
|
+
var hasRequiredStandAloneMonthParser;
|
|
1216
|
+
|
|
1217
|
+
function requireStandAloneMonthParser () {
|
|
1218
|
+
if (hasRequiredStandAloneMonthParser) return StandAloneMonthParser;
|
|
1219
|
+
hasRequiredStandAloneMonthParser = 1;
|
|
1220
|
+
StandAloneMonthParser.StandAloneMonthParser = void 0;
|
|
1221
|
+
var _constants = /*@__PURE__*/ requireConstants();
|
|
1222
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
1223
|
+
|
|
1224
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
1225
|
+
|
|
1226
|
+
let StandAloneMonthParser$1 = class StandAloneMonthParser extends _Parser.Parser {
|
|
1227
|
+
priority = 110;
|
|
1228
|
+
|
|
1229
|
+
parse(dateString, token, match) {
|
|
1230
|
+
const valueCallback = (value) => value - 1;
|
|
1231
|
+
|
|
1232
|
+
switch (token) {
|
|
1233
|
+
// 1, 2, ..., 12
|
|
1234
|
+
case "L":
|
|
1235
|
+
return (0, _utils.mapValue)(
|
|
1236
|
+
(0, _utils.parseNumericPattern)(
|
|
1237
|
+
_constants.numericPatterns.month,
|
|
1238
|
+
dateString,
|
|
1239
|
+
),
|
|
1240
|
+
valueCallback,
|
|
1241
|
+
);
|
|
1242
|
+
// 01, 02, ..., 12
|
|
1243
|
+
case "LL":
|
|
1244
|
+
return (0, _utils.mapValue)(
|
|
1245
|
+
(0, _utils.parseNDigits)(2, dateString),
|
|
1246
|
+
valueCallback,
|
|
1247
|
+
);
|
|
1248
|
+
// 1st, 2nd, ..., 12th
|
|
1249
|
+
case "Lo":
|
|
1250
|
+
return (0, _utils.mapValue)(
|
|
1251
|
+
match.ordinalNumber(dateString, {
|
|
1252
|
+
unit: "month",
|
|
1253
|
+
}),
|
|
1254
|
+
valueCallback,
|
|
1255
|
+
);
|
|
1256
|
+
// Jan, Feb, ..., Dec
|
|
1257
|
+
case "LLL":
|
|
1258
|
+
return (
|
|
1259
|
+
match.month(dateString, {
|
|
1260
|
+
width: "abbreviated",
|
|
1261
|
+
context: "standalone",
|
|
1262
|
+
}) ||
|
|
1263
|
+
match.month(dateString, { width: "narrow", context: "standalone" })
|
|
1264
|
+
);
|
|
1265
|
+
|
|
1266
|
+
// J, F, ..., D
|
|
1267
|
+
case "LLLLL":
|
|
1268
|
+
return match.month(dateString, {
|
|
1269
|
+
width: "narrow",
|
|
1270
|
+
context: "standalone",
|
|
1271
|
+
});
|
|
1272
|
+
// January, February, ..., December
|
|
1273
|
+
case "LLLL":
|
|
1274
|
+
default:
|
|
1275
|
+
return (
|
|
1276
|
+
match.month(dateString, { width: "wide", context: "standalone" }) ||
|
|
1277
|
+
match.month(dateString, {
|
|
1278
|
+
width: "abbreviated",
|
|
1279
|
+
context: "standalone",
|
|
1280
|
+
}) ||
|
|
1281
|
+
match.month(dateString, { width: "narrow", context: "standalone" })
|
|
1282
|
+
);
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
validate(_date, value) {
|
|
1287
|
+
return value >= 0 && value <= 11;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
set(date, _flags, value) {
|
|
1291
|
+
date.setMonth(value, 1);
|
|
1292
|
+
date.setHours(0, 0, 0, 0);
|
|
1293
|
+
return date;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
incompatibleTokens = [
|
|
1297
|
+
"Y",
|
|
1298
|
+
"R",
|
|
1299
|
+
"q",
|
|
1300
|
+
"Q",
|
|
1301
|
+
"M",
|
|
1302
|
+
"w",
|
|
1303
|
+
"I",
|
|
1304
|
+
"D",
|
|
1305
|
+
"i",
|
|
1306
|
+
"e",
|
|
1307
|
+
"c",
|
|
1308
|
+
"t",
|
|
1309
|
+
"T",
|
|
1310
|
+
];
|
|
1311
|
+
};
|
|
1312
|
+
StandAloneMonthParser.StandAloneMonthParser = StandAloneMonthParser$1;
|
|
1313
|
+
return StandAloneMonthParser;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
var LocalWeekParser = {};
|
|
1317
|
+
|
|
1318
|
+
var setWeek = {};
|
|
1319
|
+
|
|
1320
|
+
var hasRequiredSetWeek;
|
|
1321
|
+
|
|
1322
|
+
function requireSetWeek () {
|
|
1323
|
+
if (hasRequiredSetWeek) return setWeek;
|
|
1324
|
+
hasRequiredSetWeek = 1;
|
|
1325
|
+
setWeek.setWeek = setWeek$1;
|
|
1326
|
+
var _index = /*@__PURE__*/ requireGetWeek();
|
|
1327
|
+
var _index2 = /*@__PURE__*/ requireToDate();
|
|
1328
|
+
|
|
1329
|
+
/**
|
|
1330
|
+
* The {@link setWeek} function options.
|
|
1331
|
+
*/
|
|
1332
|
+
|
|
1333
|
+
/**
|
|
1334
|
+
* @name setWeek
|
|
1335
|
+
* @category Week Helpers
|
|
1336
|
+
* @summary Set the local week to the given date.
|
|
1337
|
+
*
|
|
1338
|
+
* @description
|
|
1339
|
+
* Set the local week to the given date, saving the weekday number.
|
|
1340
|
+
* The exact calculation depends on the values of
|
|
1341
|
+
* `options.weekStartsOn` (which is the index of the first day of the week)
|
|
1342
|
+
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
|
|
1343
|
+
* the first week of the week-numbering year)
|
|
1344
|
+
*
|
|
1345
|
+
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
|
|
1346
|
+
*
|
|
1347
|
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
1348
|
+
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
1349
|
+
*
|
|
1350
|
+
* @param date - The date to be changed
|
|
1351
|
+
* @param week - The week of the new date
|
|
1352
|
+
* @param options - An object with options
|
|
1353
|
+
*
|
|
1354
|
+
* @returns The new date with the local week set
|
|
1355
|
+
*
|
|
1356
|
+
* @example
|
|
1357
|
+
* // Set the 1st week to 2 January 2005 with default options:
|
|
1358
|
+
* const result = setWeek(new Date(2005, 0, 2), 1)
|
|
1359
|
+
* //=> Sun Dec 26 2004 00:00:00
|
|
1360
|
+
*
|
|
1361
|
+
* @example
|
|
1362
|
+
* // Set the 1st week to 2 January 2005,
|
|
1363
|
+
* // if Monday is the first day of the week,
|
|
1364
|
+
* // and the first week of the year always contains 4 January:
|
|
1365
|
+
* const result = setWeek(new Date(2005, 0, 2), 1, {
|
|
1366
|
+
* weekStartsOn: 1,
|
|
1367
|
+
* firstWeekContainsDate: 4
|
|
1368
|
+
* })
|
|
1369
|
+
* //=> Sun Jan 4 2004 00:00:00
|
|
1370
|
+
*/
|
|
1371
|
+
function setWeek$1(date, week, options) {
|
|
1372
|
+
const date_ = (0, _index2.toDate)(date, options?.in);
|
|
1373
|
+
const diff = (0, _index.getWeek)(date_, options) - week;
|
|
1374
|
+
date_.setDate(date_.getDate() - diff * 7);
|
|
1375
|
+
return (0, _index2.toDate)(date_, options?.in);
|
|
1376
|
+
}
|
|
1377
|
+
return setWeek;
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
var hasRequiredLocalWeekParser;
|
|
1381
|
+
|
|
1382
|
+
function requireLocalWeekParser () {
|
|
1383
|
+
if (hasRequiredLocalWeekParser) return LocalWeekParser;
|
|
1384
|
+
hasRequiredLocalWeekParser = 1;
|
|
1385
|
+
LocalWeekParser.LocalWeekParser = void 0;
|
|
1386
|
+
var _index = /*@__PURE__*/ requireSetWeek();
|
|
1387
|
+
var _index2 = /*@__PURE__*/ requireStartOfWeek();
|
|
1388
|
+
var _constants = /*@__PURE__*/ requireConstants();
|
|
1389
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
1390
|
+
|
|
1391
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
1392
|
+
|
|
1393
|
+
// Local week of year
|
|
1394
|
+
let LocalWeekParser$1 = class LocalWeekParser extends _Parser.Parser {
|
|
1395
|
+
priority = 100;
|
|
1396
|
+
|
|
1397
|
+
parse(dateString, token, match) {
|
|
1398
|
+
switch (token) {
|
|
1399
|
+
case "w":
|
|
1400
|
+
return (0, _utils.parseNumericPattern)(
|
|
1401
|
+
_constants.numericPatterns.week,
|
|
1402
|
+
dateString,
|
|
1403
|
+
);
|
|
1404
|
+
case "wo":
|
|
1405
|
+
return match.ordinalNumber(dateString, { unit: "week" });
|
|
1406
|
+
default:
|
|
1407
|
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
validate(_date, value) {
|
|
1412
|
+
return value >= 1 && value <= 53;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
set(date, _flags, value, options) {
|
|
1416
|
+
return (0, _index2.startOfWeek)(
|
|
1417
|
+
(0, _index.setWeek)(date, value, options),
|
|
1418
|
+
options,
|
|
1419
|
+
);
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
incompatibleTokens = [
|
|
1423
|
+
"y",
|
|
1424
|
+
"R",
|
|
1425
|
+
"u",
|
|
1426
|
+
"q",
|
|
1427
|
+
"Q",
|
|
1428
|
+
"M",
|
|
1429
|
+
"L",
|
|
1430
|
+
"I",
|
|
1431
|
+
"d",
|
|
1432
|
+
"D",
|
|
1433
|
+
"i",
|
|
1434
|
+
"t",
|
|
1435
|
+
"T",
|
|
1436
|
+
];
|
|
1437
|
+
};
|
|
1438
|
+
LocalWeekParser.LocalWeekParser = LocalWeekParser$1;
|
|
1439
|
+
return LocalWeekParser;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
var ISOWeekParser = {};
|
|
1443
|
+
|
|
1444
|
+
var setISOWeek = {};
|
|
1445
|
+
|
|
1446
|
+
var hasRequiredSetISOWeek;
|
|
1447
|
+
|
|
1448
|
+
function requireSetISOWeek () {
|
|
1449
|
+
if (hasRequiredSetISOWeek) return setISOWeek;
|
|
1450
|
+
hasRequiredSetISOWeek = 1;
|
|
1451
|
+
setISOWeek.setISOWeek = setISOWeek$1;
|
|
1452
|
+
var _index = /*@__PURE__*/ requireGetISOWeek();
|
|
1453
|
+
var _index2 = /*@__PURE__*/ requireToDate();
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* The {@link setISOWeek} function options.
|
|
1457
|
+
*/
|
|
1458
|
+
|
|
1459
|
+
/**
|
|
1460
|
+
* @name setISOWeek
|
|
1461
|
+
* @category ISO Week Helpers
|
|
1462
|
+
* @summary Set the ISO week to the given date.
|
|
1463
|
+
*
|
|
1464
|
+
* @description
|
|
1465
|
+
* Set the ISO week to the given date, saving the weekday number.
|
|
1466
|
+
*
|
|
1467
|
+
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
|
1468
|
+
*
|
|
1469
|
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
1470
|
+
* @typeParam ResultDate - The `Date` type of the context function.
|
|
1471
|
+
*
|
|
1472
|
+
* @param date - The date to be changed
|
|
1473
|
+
* @param week - The ISO week of the new date
|
|
1474
|
+
* @param options - An object with options
|
|
1475
|
+
*
|
|
1476
|
+
* @returns The new date with the ISO week set
|
|
1477
|
+
*
|
|
1478
|
+
* @example
|
|
1479
|
+
* // Set the 53rd ISO week to 7 August 2004:
|
|
1480
|
+
* const result = setISOWeek(new Date(2004, 7, 7), 53)
|
|
1481
|
+
* //=> Sat Jan 01 2005 00:00:00
|
|
1482
|
+
*/
|
|
1483
|
+
function setISOWeek$1(date, week, options) {
|
|
1484
|
+
const _date = (0, _index2.toDate)(date, options?.in);
|
|
1485
|
+
const diff = (0, _index.getISOWeek)(_date, options) - week;
|
|
1486
|
+
_date.setDate(_date.getDate() - diff * 7);
|
|
1487
|
+
return _date;
|
|
1488
|
+
}
|
|
1489
|
+
return setISOWeek;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
var hasRequiredISOWeekParser;
|
|
1493
|
+
|
|
1494
|
+
function requireISOWeekParser () {
|
|
1495
|
+
if (hasRequiredISOWeekParser) return ISOWeekParser;
|
|
1496
|
+
hasRequiredISOWeekParser = 1;
|
|
1497
|
+
ISOWeekParser.ISOWeekParser = void 0;
|
|
1498
|
+
var _index = /*@__PURE__*/ requireSetISOWeek();
|
|
1499
|
+
var _index2 = /*@__PURE__*/ requireStartOfISOWeek();
|
|
1500
|
+
var _constants = /*@__PURE__*/ requireConstants();
|
|
1501
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
1502
|
+
|
|
1503
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
1504
|
+
|
|
1505
|
+
// ISO week of year
|
|
1506
|
+
let ISOWeekParser$1 = class ISOWeekParser extends _Parser.Parser {
|
|
1507
|
+
priority = 100;
|
|
1508
|
+
|
|
1509
|
+
parse(dateString, token, match) {
|
|
1510
|
+
switch (token) {
|
|
1511
|
+
case "I":
|
|
1512
|
+
return (0, _utils.parseNumericPattern)(
|
|
1513
|
+
_constants.numericPatterns.week,
|
|
1514
|
+
dateString,
|
|
1515
|
+
);
|
|
1516
|
+
case "Io":
|
|
1517
|
+
return match.ordinalNumber(dateString, { unit: "week" });
|
|
1518
|
+
default:
|
|
1519
|
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
validate(_date, value) {
|
|
1524
|
+
return value >= 1 && value <= 53;
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
set(date, _flags, value) {
|
|
1528
|
+
return (0, _index2.startOfISOWeek)((0, _index.setISOWeek)(date, value));
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
incompatibleTokens = [
|
|
1532
|
+
"y",
|
|
1533
|
+
"Y",
|
|
1534
|
+
"u",
|
|
1535
|
+
"q",
|
|
1536
|
+
"Q",
|
|
1537
|
+
"M",
|
|
1538
|
+
"L",
|
|
1539
|
+
"w",
|
|
1540
|
+
"d",
|
|
1541
|
+
"D",
|
|
1542
|
+
"e",
|
|
1543
|
+
"c",
|
|
1544
|
+
"t",
|
|
1545
|
+
"T",
|
|
1546
|
+
];
|
|
1547
|
+
};
|
|
1548
|
+
ISOWeekParser.ISOWeekParser = ISOWeekParser$1;
|
|
1549
|
+
return ISOWeekParser;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
var DateParser = {};
|
|
1553
|
+
|
|
1554
|
+
var hasRequiredDateParser;
|
|
1555
|
+
|
|
1556
|
+
function requireDateParser () {
|
|
1557
|
+
if (hasRequiredDateParser) return DateParser;
|
|
1558
|
+
hasRequiredDateParser = 1;
|
|
1559
|
+
DateParser.DateParser = void 0;
|
|
1560
|
+
var _constants = /*@__PURE__*/ requireConstants();
|
|
1561
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
1562
|
+
|
|
1563
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
1564
|
+
|
|
1565
|
+
const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
1566
|
+
const DAYS_IN_MONTH_LEAP_YEAR = [
|
|
1567
|
+
31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
|
|
1568
|
+
];
|
|
1569
|
+
|
|
1570
|
+
// Day of the month
|
|
1571
|
+
let DateParser$1 = class DateParser extends _Parser.Parser {
|
|
1572
|
+
priority = 90;
|
|
1573
|
+
subPriority = 1;
|
|
1574
|
+
|
|
1575
|
+
parse(dateString, token, match) {
|
|
1576
|
+
switch (token) {
|
|
1577
|
+
case "d":
|
|
1578
|
+
return (0, _utils.parseNumericPattern)(
|
|
1579
|
+
_constants.numericPatterns.date,
|
|
1580
|
+
dateString,
|
|
1581
|
+
);
|
|
1582
|
+
case "do":
|
|
1583
|
+
return match.ordinalNumber(dateString, { unit: "date" });
|
|
1584
|
+
default:
|
|
1585
|
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
validate(date, value) {
|
|
1590
|
+
const year = date.getFullYear();
|
|
1591
|
+
const isLeapYear = (0, _utils.isLeapYearIndex)(year);
|
|
1592
|
+
const month = date.getMonth();
|
|
1593
|
+
if (isLeapYear) {
|
|
1594
|
+
return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
|
|
1595
|
+
} else {
|
|
1596
|
+
return value >= 1 && value <= DAYS_IN_MONTH[month];
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
set(date, _flags, value) {
|
|
1601
|
+
date.setDate(value);
|
|
1602
|
+
date.setHours(0, 0, 0, 0);
|
|
1603
|
+
return date;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
incompatibleTokens = [
|
|
1607
|
+
"Y",
|
|
1608
|
+
"R",
|
|
1609
|
+
"q",
|
|
1610
|
+
"Q",
|
|
1611
|
+
"w",
|
|
1612
|
+
"I",
|
|
1613
|
+
"D",
|
|
1614
|
+
"i",
|
|
1615
|
+
"e",
|
|
1616
|
+
"c",
|
|
1617
|
+
"t",
|
|
1618
|
+
"T",
|
|
1619
|
+
];
|
|
1620
|
+
};
|
|
1621
|
+
DateParser.DateParser = DateParser$1;
|
|
1622
|
+
return DateParser;
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
var DayOfYearParser = {};
|
|
1626
|
+
|
|
1627
|
+
var hasRequiredDayOfYearParser;
|
|
1628
|
+
|
|
1629
|
+
function requireDayOfYearParser () {
|
|
1630
|
+
if (hasRequiredDayOfYearParser) return DayOfYearParser;
|
|
1631
|
+
hasRequiredDayOfYearParser = 1;
|
|
1632
|
+
DayOfYearParser.DayOfYearParser = void 0;
|
|
1633
|
+
var _constants = /*@__PURE__*/ requireConstants();
|
|
1634
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
1635
|
+
|
|
1636
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
1637
|
+
|
|
1638
|
+
let DayOfYearParser$1 = class DayOfYearParser extends _Parser.Parser {
|
|
1639
|
+
priority = 90;
|
|
1640
|
+
|
|
1641
|
+
subpriority = 1;
|
|
1642
|
+
|
|
1643
|
+
parse(dateString, token, match) {
|
|
1644
|
+
switch (token) {
|
|
1645
|
+
case "D":
|
|
1646
|
+
case "DD":
|
|
1647
|
+
return (0, _utils.parseNumericPattern)(
|
|
1648
|
+
_constants.numericPatterns.dayOfYear,
|
|
1649
|
+
dateString,
|
|
1650
|
+
);
|
|
1651
|
+
case "Do":
|
|
1652
|
+
return match.ordinalNumber(dateString, { unit: "date" });
|
|
1653
|
+
default:
|
|
1654
|
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
validate(date, value) {
|
|
1659
|
+
const year = date.getFullYear();
|
|
1660
|
+
const isLeapYear = (0, _utils.isLeapYearIndex)(year);
|
|
1661
|
+
if (isLeapYear) {
|
|
1662
|
+
return value >= 1 && value <= 366;
|
|
1663
|
+
} else {
|
|
1664
|
+
return value >= 1 && value <= 365;
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
set(date, _flags, value) {
|
|
1669
|
+
date.setMonth(0, value);
|
|
1670
|
+
date.setHours(0, 0, 0, 0);
|
|
1671
|
+
return date;
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
incompatibleTokens = [
|
|
1675
|
+
"Y",
|
|
1676
|
+
"R",
|
|
1677
|
+
"q",
|
|
1678
|
+
"Q",
|
|
1679
|
+
"M",
|
|
1680
|
+
"L",
|
|
1681
|
+
"w",
|
|
1682
|
+
"I",
|
|
1683
|
+
"d",
|
|
1684
|
+
"E",
|
|
1685
|
+
"i",
|
|
1686
|
+
"e",
|
|
1687
|
+
"c",
|
|
1688
|
+
"t",
|
|
1689
|
+
"T",
|
|
1690
|
+
];
|
|
1691
|
+
};
|
|
1692
|
+
DayOfYearParser.DayOfYearParser = DayOfYearParser$1;
|
|
1693
|
+
return DayOfYearParser;
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
var DayParser = {};
|
|
1697
|
+
|
|
1698
|
+
var hasRequiredDayParser;
|
|
1699
|
+
|
|
1700
|
+
function requireDayParser () {
|
|
1701
|
+
if (hasRequiredDayParser) return DayParser;
|
|
1702
|
+
hasRequiredDayParser = 1;
|
|
1703
|
+
DayParser.DayParser = void 0;
|
|
1704
|
+
var _index = /*@__PURE__*/ requireSetDay();
|
|
1705
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
1706
|
+
|
|
1707
|
+
// Day of week
|
|
1708
|
+
let DayParser$1 = class DayParser extends _Parser.Parser {
|
|
1709
|
+
priority = 90;
|
|
1710
|
+
|
|
1711
|
+
parse(dateString, token, match) {
|
|
1712
|
+
switch (token) {
|
|
1713
|
+
// Tue
|
|
1714
|
+
case "E":
|
|
1715
|
+
case "EE":
|
|
1716
|
+
case "EEE":
|
|
1717
|
+
return (
|
|
1718
|
+
match.day(dateString, {
|
|
1719
|
+
width: "abbreviated",
|
|
1720
|
+
context: "formatting",
|
|
1721
|
+
}) ||
|
|
1722
|
+
match.day(dateString, { width: "short", context: "formatting" }) ||
|
|
1723
|
+
match.day(dateString, { width: "narrow", context: "formatting" })
|
|
1724
|
+
);
|
|
1725
|
+
|
|
1726
|
+
// T
|
|
1727
|
+
case "EEEEE":
|
|
1728
|
+
return match.day(dateString, {
|
|
1729
|
+
width: "narrow",
|
|
1730
|
+
context: "formatting",
|
|
1731
|
+
});
|
|
1732
|
+
// Tu
|
|
1733
|
+
case "EEEEEE":
|
|
1734
|
+
return (
|
|
1735
|
+
match.day(dateString, { width: "short", context: "formatting" }) ||
|
|
1736
|
+
match.day(dateString, { width: "narrow", context: "formatting" })
|
|
1737
|
+
);
|
|
1738
|
+
|
|
1739
|
+
// Tuesday
|
|
1740
|
+
case "EEEE":
|
|
1741
|
+
default:
|
|
1742
|
+
return (
|
|
1743
|
+
match.day(dateString, { width: "wide", context: "formatting" }) ||
|
|
1744
|
+
match.day(dateString, {
|
|
1745
|
+
width: "abbreviated",
|
|
1746
|
+
context: "formatting",
|
|
1747
|
+
}) ||
|
|
1748
|
+
match.day(dateString, { width: "short", context: "formatting" }) ||
|
|
1749
|
+
match.day(dateString, { width: "narrow", context: "formatting" })
|
|
1750
|
+
);
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
validate(_date, value) {
|
|
1755
|
+
return value >= 0 && value <= 6;
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
set(date, _flags, value, options) {
|
|
1759
|
+
date = (0, _index.setDay)(date, value, options);
|
|
1760
|
+
date.setHours(0, 0, 0, 0);
|
|
1761
|
+
return date;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
incompatibleTokens = ["D", "i", "e", "c", "t", "T"];
|
|
1765
|
+
};
|
|
1766
|
+
DayParser.DayParser = DayParser$1;
|
|
1767
|
+
return DayParser;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
var LocalDayParser = {};
|
|
1771
|
+
|
|
1772
|
+
var hasRequiredLocalDayParser;
|
|
1773
|
+
|
|
1774
|
+
function requireLocalDayParser () {
|
|
1775
|
+
if (hasRequiredLocalDayParser) return LocalDayParser;
|
|
1776
|
+
hasRequiredLocalDayParser = 1;
|
|
1777
|
+
LocalDayParser.LocalDayParser = void 0;
|
|
1778
|
+
var _index = /*@__PURE__*/ requireSetDay();
|
|
1779
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
1780
|
+
|
|
1781
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
1782
|
+
|
|
1783
|
+
// Local day of week
|
|
1784
|
+
let LocalDayParser$1 = class LocalDayParser extends _Parser.Parser {
|
|
1785
|
+
priority = 90;
|
|
1786
|
+
parse(dateString, token, match, options) {
|
|
1787
|
+
const valueCallback = (value) => {
|
|
1788
|
+
// We want here floor instead of trunc, so we get -7 for value 0 instead of 0
|
|
1789
|
+
const wholeWeekDays = Math.floor((value - 1) / 7) * 7;
|
|
1790
|
+
return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;
|
|
1791
|
+
};
|
|
1792
|
+
|
|
1793
|
+
switch (token) {
|
|
1794
|
+
// 3
|
|
1795
|
+
case "e":
|
|
1796
|
+
case "ee": // 03
|
|
1797
|
+
return (0, _utils.mapValue)(
|
|
1798
|
+
(0, _utils.parseNDigits)(token.length, dateString),
|
|
1799
|
+
valueCallback,
|
|
1800
|
+
);
|
|
1801
|
+
// 3rd
|
|
1802
|
+
case "eo":
|
|
1803
|
+
return (0, _utils.mapValue)(
|
|
1804
|
+
match.ordinalNumber(dateString, {
|
|
1805
|
+
unit: "day",
|
|
1806
|
+
}),
|
|
1807
|
+
valueCallback,
|
|
1808
|
+
);
|
|
1809
|
+
// Tue
|
|
1810
|
+
case "eee":
|
|
1811
|
+
return (
|
|
1812
|
+
match.day(dateString, {
|
|
1813
|
+
width: "abbreviated",
|
|
1814
|
+
context: "formatting",
|
|
1815
|
+
}) ||
|
|
1816
|
+
match.day(dateString, { width: "short", context: "formatting" }) ||
|
|
1817
|
+
match.day(dateString, { width: "narrow", context: "formatting" })
|
|
1818
|
+
);
|
|
1819
|
+
|
|
1820
|
+
// T
|
|
1821
|
+
case "eeeee":
|
|
1822
|
+
return match.day(dateString, {
|
|
1823
|
+
width: "narrow",
|
|
1824
|
+
context: "formatting",
|
|
1825
|
+
});
|
|
1826
|
+
// Tu
|
|
1827
|
+
case "eeeeee":
|
|
1828
|
+
return (
|
|
1829
|
+
match.day(dateString, { width: "short", context: "formatting" }) ||
|
|
1830
|
+
match.day(dateString, { width: "narrow", context: "formatting" })
|
|
1831
|
+
);
|
|
1832
|
+
|
|
1833
|
+
// Tuesday
|
|
1834
|
+
case "eeee":
|
|
1835
|
+
default:
|
|
1836
|
+
return (
|
|
1837
|
+
match.day(dateString, { width: "wide", context: "formatting" }) ||
|
|
1838
|
+
match.day(dateString, {
|
|
1839
|
+
width: "abbreviated",
|
|
1840
|
+
context: "formatting",
|
|
1841
|
+
}) ||
|
|
1842
|
+
match.day(dateString, { width: "short", context: "formatting" }) ||
|
|
1843
|
+
match.day(dateString, { width: "narrow", context: "formatting" })
|
|
1844
|
+
);
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
validate(_date, value) {
|
|
1849
|
+
return value >= 0 && value <= 6;
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
set(date, _flags, value, options) {
|
|
1853
|
+
date = (0, _index.setDay)(date, value, options);
|
|
1854
|
+
date.setHours(0, 0, 0, 0);
|
|
1855
|
+
return date;
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
incompatibleTokens = [
|
|
1859
|
+
"y",
|
|
1860
|
+
"R",
|
|
1861
|
+
"u",
|
|
1862
|
+
"q",
|
|
1863
|
+
"Q",
|
|
1864
|
+
"M",
|
|
1865
|
+
"L",
|
|
1866
|
+
"I",
|
|
1867
|
+
"d",
|
|
1868
|
+
"D",
|
|
1869
|
+
"E",
|
|
1870
|
+
"i",
|
|
1871
|
+
"c",
|
|
1872
|
+
"t",
|
|
1873
|
+
"T",
|
|
1874
|
+
];
|
|
1875
|
+
};
|
|
1876
|
+
LocalDayParser.LocalDayParser = LocalDayParser$1;
|
|
1877
|
+
return LocalDayParser;
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
var StandAloneLocalDayParser = {};
|
|
1881
|
+
|
|
1882
|
+
var hasRequiredStandAloneLocalDayParser;
|
|
1883
|
+
|
|
1884
|
+
function requireStandAloneLocalDayParser () {
|
|
1885
|
+
if (hasRequiredStandAloneLocalDayParser) return StandAloneLocalDayParser;
|
|
1886
|
+
hasRequiredStandAloneLocalDayParser = 1;
|
|
1887
|
+
StandAloneLocalDayParser.StandAloneLocalDayParser = void 0;
|
|
1888
|
+
var _index = /*@__PURE__*/ requireSetDay();
|
|
1889
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
1890
|
+
|
|
1891
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
1892
|
+
|
|
1893
|
+
// Stand-alone local day of week
|
|
1894
|
+
let StandAloneLocalDayParser$1 = class StandAloneLocalDayParser extends _Parser.Parser {
|
|
1895
|
+
priority = 90;
|
|
1896
|
+
|
|
1897
|
+
parse(dateString, token, match, options) {
|
|
1898
|
+
const valueCallback = (value) => {
|
|
1899
|
+
// We want here floor instead of trunc, so we get -7 for value 0 instead of 0
|
|
1900
|
+
const wholeWeekDays = Math.floor((value - 1) / 7) * 7;
|
|
1901
|
+
return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;
|
|
1902
|
+
};
|
|
1903
|
+
|
|
1904
|
+
switch (token) {
|
|
1905
|
+
// 3
|
|
1906
|
+
case "c":
|
|
1907
|
+
case "cc": // 03
|
|
1908
|
+
return (0, _utils.mapValue)(
|
|
1909
|
+
(0, _utils.parseNDigits)(token.length, dateString),
|
|
1910
|
+
valueCallback,
|
|
1911
|
+
);
|
|
1912
|
+
// 3rd
|
|
1913
|
+
case "co":
|
|
1914
|
+
return (0, _utils.mapValue)(
|
|
1915
|
+
match.ordinalNumber(dateString, {
|
|
1916
|
+
unit: "day",
|
|
1917
|
+
}),
|
|
1918
|
+
valueCallback,
|
|
1919
|
+
);
|
|
1920
|
+
// Tue
|
|
1921
|
+
case "ccc":
|
|
1922
|
+
return (
|
|
1923
|
+
match.day(dateString, {
|
|
1924
|
+
width: "abbreviated",
|
|
1925
|
+
context: "standalone",
|
|
1926
|
+
}) ||
|
|
1927
|
+
match.day(dateString, { width: "short", context: "standalone" }) ||
|
|
1928
|
+
match.day(dateString, { width: "narrow", context: "standalone" })
|
|
1929
|
+
);
|
|
1930
|
+
|
|
1931
|
+
// T
|
|
1932
|
+
case "ccccc":
|
|
1933
|
+
return match.day(dateString, {
|
|
1934
|
+
width: "narrow",
|
|
1935
|
+
context: "standalone",
|
|
1936
|
+
});
|
|
1937
|
+
// Tu
|
|
1938
|
+
case "cccccc":
|
|
1939
|
+
return (
|
|
1940
|
+
match.day(dateString, { width: "short", context: "standalone" }) ||
|
|
1941
|
+
match.day(dateString, { width: "narrow", context: "standalone" })
|
|
1942
|
+
);
|
|
1943
|
+
|
|
1944
|
+
// Tuesday
|
|
1945
|
+
case "cccc":
|
|
1946
|
+
default:
|
|
1947
|
+
return (
|
|
1948
|
+
match.day(dateString, { width: "wide", context: "standalone" }) ||
|
|
1949
|
+
match.day(dateString, {
|
|
1950
|
+
width: "abbreviated",
|
|
1951
|
+
context: "standalone",
|
|
1952
|
+
}) ||
|
|
1953
|
+
match.day(dateString, { width: "short", context: "standalone" }) ||
|
|
1954
|
+
match.day(dateString, { width: "narrow", context: "standalone" })
|
|
1955
|
+
);
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
validate(_date, value) {
|
|
1960
|
+
return value >= 0 && value <= 6;
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
set(date, _flags, value, options) {
|
|
1964
|
+
date = (0, _index.setDay)(date, value, options);
|
|
1965
|
+
date.setHours(0, 0, 0, 0);
|
|
1966
|
+
return date;
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
incompatibleTokens = [
|
|
1970
|
+
"y",
|
|
1971
|
+
"R",
|
|
1972
|
+
"u",
|
|
1973
|
+
"q",
|
|
1974
|
+
"Q",
|
|
1975
|
+
"M",
|
|
1976
|
+
"L",
|
|
1977
|
+
"I",
|
|
1978
|
+
"d",
|
|
1979
|
+
"D",
|
|
1980
|
+
"E",
|
|
1981
|
+
"i",
|
|
1982
|
+
"e",
|
|
1983
|
+
"t",
|
|
1984
|
+
"T",
|
|
1985
|
+
];
|
|
1986
|
+
};
|
|
1987
|
+
StandAloneLocalDayParser.StandAloneLocalDayParser = StandAloneLocalDayParser$1;
|
|
1988
|
+
return StandAloneLocalDayParser;
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
var ISODayParser = {};
|
|
1992
|
+
|
|
1993
|
+
var setISODay = {};
|
|
1994
|
+
|
|
1995
|
+
var getISODay = {};
|
|
1996
|
+
|
|
1997
|
+
var hasRequiredGetISODay;
|
|
1998
|
+
|
|
1999
|
+
function requireGetISODay () {
|
|
2000
|
+
if (hasRequiredGetISODay) return getISODay;
|
|
2001
|
+
hasRequiredGetISODay = 1;
|
|
2002
|
+
getISODay.getISODay = getISODay$1;
|
|
2003
|
+
var _index = /*@__PURE__*/ requireToDate();
|
|
2004
|
+
|
|
2005
|
+
/**
|
|
2006
|
+
* The {@link getISODay} function options.
|
|
2007
|
+
*/
|
|
2008
|
+
|
|
2009
|
+
/**
|
|
2010
|
+
* @name getISODay
|
|
2011
|
+
* @category Weekday Helpers
|
|
2012
|
+
* @summary Get the day of the ISO week of the given date.
|
|
2013
|
+
*
|
|
2014
|
+
* @description
|
|
2015
|
+
* Get the day of the ISO week of the given date,
|
|
2016
|
+
* which is 7 for Sunday, 1 for Monday etc.
|
|
2017
|
+
*
|
|
2018
|
+
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
|
2019
|
+
*
|
|
2020
|
+
* @param date - The given date
|
|
2021
|
+
* @param options - An object with options
|
|
2022
|
+
*
|
|
2023
|
+
* @returns The day of ISO week
|
|
2024
|
+
*
|
|
2025
|
+
* @example
|
|
2026
|
+
* // Which day of the ISO week is 26 February 2012?
|
|
2027
|
+
* const result = getISODay(new Date(2012, 1, 26))
|
|
2028
|
+
* //=> 7
|
|
2029
|
+
*/
|
|
2030
|
+
function getISODay$1(date, options) {
|
|
2031
|
+
const day = (0, _index.toDate)(date, options?.in).getDay();
|
|
2032
|
+
return day === 0 ? 7 : day;
|
|
2033
|
+
}
|
|
2034
|
+
return getISODay;
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
var hasRequiredSetISODay;
|
|
2038
|
+
|
|
2039
|
+
function requireSetISODay () {
|
|
2040
|
+
if (hasRequiredSetISODay) return setISODay;
|
|
2041
|
+
hasRequiredSetISODay = 1;
|
|
2042
|
+
setISODay.setISODay = setISODay$1;
|
|
2043
|
+
var _index = /*@__PURE__*/ requireAddDays();
|
|
2044
|
+
var _index2 = /*@__PURE__*/ requireGetISODay();
|
|
2045
|
+
var _index3 = /*@__PURE__*/ requireToDate();
|
|
2046
|
+
|
|
2047
|
+
/**
|
|
2048
|
+
* The {@link setISODay} function options.
|
|
2049
|
+
*/
|
|
2050
|
+
|
|
2051
|
+
/**
|
|
2052
|
+
* @name setISODay
|
|
2053
|
+
* @category Weekday Helpers
|
|
2054
|
+
* @summary Set the day of the ISO week to the given date.
|
|
2055
|
+
*
|
|
2056
|
+
* @description
|
|
2057
|
+
* Set the day of the ISO week to the given date.
|
|
2058
|
+
* ISO week starts with Monday.
|
|
2059
|
+
* 7 is the index of Sunday, 1 is the index of Monday, etc.
|
|
2060
|
+
*
|
|
2061
|
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
2062
|
+
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
2063
|
+
*
|
|
2064
|
+
* @param date - The date to be changed
|
|
2065
|
+
* @param day - The day of the ISO week of the new date
|
|
2066
|
+
* @param options - An object with options
|
|
2067
|
+
*
|
|
2068
|
+
* @returns The new date with the day of the ISO week set
|
|
2069
|
+
*
|
|
2070
|
+
* @example
|
|
2071
|
+
* // Set Sunday to 1 September 2014:
|
|
2072
|
+
* const result = setISODay(new Date(2014, 8, 1), 7)
|
|
2073
|
+
* //=> Sun Sep 07 2014 00:00:00
|
|
2074
|
+
*/
|
|
2075
|
+
function setISODay$1(date, day, options) {
|
|
2076
|
+
const date_ = (0, _index3.toDate)(date, options?.in);
|
|
2077
|
+
const currentDay = (0, _index2.getISODay)(date_, options);
|
|
2078
|
+
const diff = day - currentDay;
|
|
2079
|
+
return (0, _index.addDays)(date_, diff, options);
|
|
2080
|
+
}
|
|
2081
|
+
return setISODay;
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
var hasRequiredISODayParser;
|
|
2085
|
+
|
|
2086
|
+
function requireISODayParser () {
|
|
2087
|
+
if (hasRequiredISODayParser) return ISODayParser;
|
|
2088
|
+
hasRequiredISODayParser = 1;
|
|
2089
|
+
ISODayParser.ISODayParser = void 0;
|
|
2090
|
+
var _index = /*@__PURE__*/ requireSetISODay();
|
|
2091
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
2092
|
+
|
|
2093
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
2094
|
+
|
|
2095
|
+
// ISO day of week
|
|
2096
|
+
let ISODayParser$1 = class ISODayParser extends _Parser.Parser {
|
|
2097
|
+
priority = 90;
|
|
2098
|
+
|
|
2099
|
+
parse(dateString, token, match) {
|
|
2100
|
+
const valueCallback = (value) => {
|
|
2101
|
+
if (value === 0) {
|
|
2102
|
+
return 7;
|
|
2103
|
+
}
|
|
2104
|
+
return value;
|
|
2105
|
+
};
|
|
2106
|
+
|
|
2107
|
+
switch (token) {
|
|
2108
|
+
// 2
|
|
2109
|
+
case "i":
|
|
2110
|
+
case "ii": // 02
|
|
2111
|
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
2112
|
+
// 2nd
|
|
2113
|
+
case "io":
|
|
2114
|
+
return match.ordinalNumber(dateString, { unit: "day" });
|
|
2115
|
+
// Tue
|
|
2116
|
+
case "iii":
|
|
2117
|
+
return (0, _utils.mapValue)(
|
|
2118
|
+
match.day(dateString, {
|
|
2119
|
+
width: "abbreviated",
|
|
2120
|
+
context: "formatting",
|
|
2121
|
+
}) ||
|
|
2122
|
+
match.day(dateString, {
|
|
2123
|
+
width: "short",
|
|
2124
|
+
context: "formatting",
|
|
2125
|
+
}) ||
|
|
2126
|
+
match.day(dateString, {
|
|
2127
|
+
width: "narrow",
|
|
2128
|
+
context: "formatting",
|
|
2129
|
+
}),
|
|
2130
|
+
valueCallback,
|
|
2131
|
+
);
|
|
2132
|
+
// T
|
|
2133
|
+
case "iiiii":
|
|
2134
|
+
return (0, _utils.mapValue)(
|
|
2135
|
+
match.day(dateString, {
|
|
2136
|
+
width: "narrow",
|
|
2137
|
+
context: "formatting",
|
|
2138
|
+
}),
|
|
2139
|
+
valueCallback,
|
|
2140
|
+
);
|
|
2141
|
+
// Tu
|
|
2142
|
+
case "iiiiii":
|
|
2143
|
+
return (0, _utils.mapValue)(
|
|
2144
|
+
match.day(dateString, {
|
|
2145
|
+
width: "short",
|
|
2146
|
+
context: "formatting",
|
|
2147
|
+
}) ||
|
|
2148
|
+
match.day(dateString, {
|
|
2149
|
+
width: "narrow",
|
|
2150
|
+
context: "formatting",
|
|
2151
|
+
}),
|
|
2152
|
+
valueCallback,
|
|
2153
|
+
);
|
|
2154
|
+
// Tuesday
|
|
2155
|
+
case "iiii":
|
|
2156
|
+
default:
|
|
2157
|
+
return (0, _utils.mapValue)(
|
|
2158
|
+
match.day(dateString, {
|
|
2159
|
+
width: "wide",
|
|
2160
|
+
context: "formatting",
|
|
2161
|
+
}) ||
|
|
2162
|
+
match.day(dateString, {
|
|
2163
|
+
width: "abbreviated",
|
|
2164
|
+
context: "formatting",
|
|
2165
|
+
}) ||
|
|
2166
|
+
match.day(dateString, {
|
|
2167
|
+
width: "short",
|
|
2168
|
+
context: "formatting",
|
|
2169
|
+
}) ||
|
|
2170
|
+
match.day(dateString, {
|
|
2171
|
+
width: "narrow",
|
|
2172
|
+
context: "formatting",
|
|
2173
|
+
}),
|
|
2174
|
+
valueCallback,
|
|
2175
|
+
);
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2179
|
+
validate(_date, value) {
|
|
2180
|
+
return value >= 1 && value <= 7;
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
set(date, _flags, value) {
|
|
2184
|
+
date = (0, _index.setISODay)(date, value);
|
|
2185
|
+
date.setHours(0, 0, 0, 0);
|
|
2186
|
+
return date;
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
incompatibleTokens = [
|
|
2190
|
+
"y",
|
|
2191
|
+
"Y",
|
|
2192
|
+
"u",
|
|
2193
|
+
"q",
|
|
2194
|
+
"Q",
|
|
2195
|
+
"M",
|
|
2196
|
+
"L",
|
|
2197
|
+
"w",
|
|
2198
|
+
"d",
|
|
2199
|
+
"D",
|
|
2200
|
+
"E",
|
|
2201
|
+
"e",
|
|
2202
|
+
"c",
|
|
2203
|
+
"t",
|
|
2204
|
+
"T",
|
|
2205
|
+
];
|
|
2206
|
+
};
|
|
2207
|
+
ISODayParser.ISODayParser = ISODayParser$1;
|
|
2208
|
+
return ISODayParser;
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
var AMPMParser = {};
|
|
2212
|
+
|
|
2213
|
+
var hasRequiredAMPMParser;
|
|
2214
|
+
|
|
2215
|
+
function requireAMPMParser () {
|
|
2216
|
+
if (hasRequiredAMPMParser) return AMPMParser;
|
|
2217
|
+
hasRequiredAMPMParser = 1;
|
|
2218
|
+
AMPMParser.AMPMParser = void 0;
|
|
2219
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
2220
|
+
|
|
2221
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
2222
|
+
|
|
2223
|
+
let AMPMParser$1 = class AMPMParser extends _Parser.Parser {
|
|
2224
|
+
priority = 80;
|
|
2225
|
+
|
|
2226
|
+
parse(dateString, token, match) {
|
|
2227
|
+
switch (token) {
|
|
2228
|
+
case "a":
|
|
2229
|
+
case "aa":
|
|
2230
|
+
case "aaa":
|
|
2231
|
+
return (
|
|
2232
|
+
match.dayPeriod(dateString, {
|
|
2233
|
+
width: "abbreviated",
|
|
2234
|
+
context: "formatting",
|
|
2235
|
+
}) ||
|
|
2236
|
+
match.dayPeriod(dateString, {
|
|
2237
|
+
width: "narrow",
|
|
2238
|
+
context: "formatting",
|
|
2239
|
+
})
|
|
2240
|
+
);
|
|
2241
|
+
|
|
2242
|
+
case "aaaaa":
|
|
2243
|
+
return match.dayPeriod(dateString, {
|
|
2244
|
+
width: "narrow",
|
|
2245
|
+
context: "formatting",
|
|
2246
|
+
});
|
|
2247
|
+
case "aaaa":
|
|
2248
|
+
default:
|
|
2249
|
+
return (
|
|
2250
|
+
match.dayPeriod(dateString, {
|
|
2251
|
+
width: "wide",
|
|
2252
|
+
context: "formatting",
|
|
2253
|
+
}) ||
|
|
2254
|
+
match.dayPeriod(dateString, {
|
|
2255
|
+
width: "abbreviated",
|
|
2256
|
+
context: "formatting",
|
|
2257
|
+
}) ||
|
|
2258
|
+
match.dayPeriod(dateString, {
|
|
2259
|
+
width: "narrow",
|
|
2260
|
+
context: "formatting",
|
|
2261
|
+
})
|
|
2262
|
+
);
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
set(date, _flags, value) {
|
|
2267
|
+
date.setHours((0, _utils.dayPeriodEnumToHours)(value), 0, 0, 0);
|
|
2268
|
+
return date;
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
incompatibleTokens = ["b", "B", "H", "k", "t", "T"];
|
|
2272
|
+
};
|
|
2273
|
+
AMPMParser.AMPMParser = AMPMParser$1;
|
|
2274
|
+
return AMPMParser;
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
var AMPMMidnightParser = {};
|
|
2278
|
+
|
|
2279
|
+
var hasRequiredAMPMMidnightParser;
|
|
2280
|
+
|
|
2281
|
+
function requireAMPMMidnightParser () {
|
|
2282
|
+
if (hasRequiredAMPMMidnightParser) return AMPMMidnightParser;
|
|
2283
|
+
hasRequiredAMPMMidnightParser = 1;
|
|
2284
|
+
AMPMMidnightParser.AMPMMidnightParser = void 0;
|
|
2285
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
2286
|
+
|
|
2287
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
2288
|
+
|
|
2289
|
+
let AMPMMidnightParser$1 = class AMPMMidnightParser extends _Parser.Parser {
|
|
2290
|
+
priority = 80;
|
|
2291
|
+
|
|
2292
|
+
parse(dateString, token, match) {
|
|
2293
|
+
switch (token) {
|
|
2294
|
+
case "b":
|
|
2295
|
+
case "bb":
|
|
2296
|
+
case "bbb":
|
|
2297
|
+
return (
|
|
2298
|
+
match.dayPeriod(dateString, {
|
|
2299
|
+
width: "abbreviated",
|
|
2300
|
+
context: "formatting",
|
|
2301
|
+
}) ||
|
|
2302
|
+
match.dayPeriod(dateString, {
|
|
2303
|
+
width: "narrow",
|
|
2304
|
+
context: "formatting",
|
|
2305
|
+
})
|
|
2306
|
+
);
|
|
2307
|
+
|
|
2308
|
+
case "bbbbb":
|
|
2309
|
+
return match.dayPeriod(dateString, {
|
|
2310
|
+
width: "narrow",
|
|
2311
|
+
context: "formatting",
|
|
2312
|
+
});
|
|
2313
|
+
case "bbbb":
|
|
2314
|
+
default:
|
|
2315
|
+
return (
|
|
2316
|
+
match.dayPeriod(dateString, {
|
|
2317
|
+
width: "wide",
|
|
2318
|
+
context: "formatting",
|
|
2319
|
+
}) ||
|
|
2320
|
+
match.dayPeriod(dateString, {
|
|
2321
|
+
width: "abbreviated",
|
|
2322
|
+
context: "formatting",
|
|
2323
|
+
}) ||
|
|
2324
|
+
match.dayPeriod(dateString, {
|
|
2325
|
+
width: "narrow",
|
|
2326
|
+
context: "formatting",
|
|
2327
|
+
})
|
|
2328
|
+
);
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2332
|
+
set(date, _flags, value) {
|
|
2333
|
+
date.setHours((0, _utils.dayPeriodEnumToHours)(value), 0, 0, 0);
|
|
2334
|
+
return date;
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
incompatibleTokens = ["a", "B", "H", "k", "t", "T"];
|
|
2338
|
+
};
|
|
2339
|
+
AMPMMidnightParser.AMPMMidnightParser = AMPMMidnightParser$1;
|
|
2340
|
+
return AMPMMidnightParser;
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
var DayPeriodParser = {};
|
|
2344
|
+
|
|
2345
|
+
var hasRequiredDayPeriodParser;
|
|
2346
|
+
|
|
2347
|
+
function requireDayPeriodParser () {
|
|
2348
|
+
if (hasRequiredDayPeriodParser) return DayPeriodParser;
|
|
2349
|
+
hasRequiredDayPeriodParser = 1;
|
|
2350
|
+
DayPeriodParser.DayPeriodParser = void 0;
|
|
2351
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
2352
|
+
|
|
2353
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
2354
|
+
|
|
2355
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
2356
|
+
let DayPeriodParser$1 = class DayPeriodParser extends _Parser.Parser {
|
|
2357
|
+
priority = 80;
|
|
2358
|
+
|
|
2359
|
+
parse(dateString, token, match) {
|
|
2360
|
+
switch (token) {
|
|
2361
|
+
case "B":
|
|
2362
|
+
case "BB":
|
|
2363
|
+
case "BBB":
|
|
2364
|
+
return (
|
|
2365
|
+
match.dayPeriod(dateString, {
|
|
2366
|
+
width: "abbreviated",
|
|
2367
|
+
context: "formatting",
|
|
2368
|
+
}) ||
|
|
2369
|
+
match.dayPeriod(dateString, {
|
|
2370
|
+
width: "narrow",
|
|
2371
|
+
context: "formatting",
|
|
2372
|
+
})
|
|
2373
|
+
);
|
|
2374
|
+
|
|
2375
|
+
case "BBBBB":
|
|
2376
|
+
return match.dayPeriod(dateString, {
|
|
2377
|
+
width: "narrow",
|
|
2378
|
+
context: "formatting",
|
|
2379
|
+
});
|
|
2380
|
+
case "BBBB":
|
|
2381
|
+
default:
|
|
2382
|
+
return (
|
|
2383
|
+
match.dayPeriod(dateString, {
|
|
2384
|
+
width: "wide",
|
|
2385
|
+
context: "formatting",
|
|
2386
|
+
}) ||
|
|
2387
|
+
match.dayPeriod(dateString, {
|
|
2388
|
+
width: "abbreviated",
|
|
2389
|
+
context: "formatting",
|
|
2390
|
+
}) ||
|
|
2391
|
+
match.dayPeriod(dateString, {
|
|
2392
|
+
width: "narrow",
|
|
2393
|
+
context: "formatting",
|
|
2394
|
+
})
|
|
2395
|
+
);
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2399
|
+
set(date, _flags, value) {
|
|
2400
|
+
date.setHours((0, _utils.dayPeriodEnumToHours)(value), 0, 0, 0);
|
|
2401
|
+
return date;
|
|
2402
|
+
}
|
|
2403
|
+
|
|
2404
|
+
incompatibleTokens = ["a", "b", "t", "T"];
|
|
2405
|
+
};
|
|
2406
|
+
DayPeriodParser.DayPeriodParser = DayPeriodParser$1;
|
|
2407
|
+
return DayPeriodParser;
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
var Hour1to12Parser = {};
|
|
2411
|
+
|
|
2412
|
+
var hasRequiredHour1to12Parser;
|
|
2413
|
+
|
|
2414
|
+
function requireHour1to12Parser () {
|
|
2415
|
+
if (hasRequiredHour1to12Parser) return Hour1to12Parser;
|
|
2416
|
+
hasRequiredHour1to12Parser = 1;
|
|
2417
|
+
Hour1to12Parser.Hour1to12Parser = void 0;
|
|
2418
|
+
var _constants = /*@__PURE__*/ requireConstants();
|
|
2419
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
2420
|
+
|
|
2421
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
2422
|
+
|
|
2423
|
+
let Hour1to12Parser$1 = class Hour1to12Parser extends _Parser.Parser {
|
|
2424
|
+
priority = 70;
|
|
2425
|
+
|
|
2426
|
+
parse(dateString, token, match) {
|
|
2427
|
+
switch (token) {
|
|
2428
|
+
case "h":
|
|
2429
|
+
return (0, _utils.parseNumericPattern)(
|
|
2430
|
+
_constants.numericPatterns.hour12h,
|
|
2431
|
+
dateString,
|
|
2432
|
+
);
|
|
2433
|
+
case "ho":
|
|
2434
|
+
return match.ordinalNumber(dateString, { unit: "hour" });
|
|
2435
|
+
default:
|
|
2436
|
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2439
|
+
|
|
2440
|
+
validate(_date, value) {
|
|
2441
|
+
return value >= 1 && value <= 12;
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
set(date, _flags, value) {
|
|
2445
|
+
const isPM = date.getHours() >= 12;
|
|
2446
|
+
if (isPM && value < 12) {
|
|
2447
|
+
date.setHours(value + 12, 0, 0, 0);
|
|
2448
|
+
} else if (!isPM && value === 12) {
|
|
2449
|
+
date.setHours(0, 0, 0, 0);
|
|
2450
|
+
} else {
|
|
2451
|
+
date.setHours(value, 0, 0, 0);
|
|
2452
|
+
}
|
|
2453
|
+
return date;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
incompatibleTokens = ["H", "K", "k", "t", "T"];
|
|
2457
|
+
};
|
|
2458
|
+
Hour1to12Parser.Hour1to12Parser = Hour1to12Parser$1;
|
|
2459
|
+
return Hour1to12Parser;
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
var Hour0to23Parser = {};
|
|
2463
|
+
|
|
2464
|
+
var hasRequiredHour0to23Parser;
|
|
2465
|
+
|
|
2466
|
+
function requireHour0to23Parser () {
|
|
2467
|
+
if (hasRequiredHour0to23Parser) return Hour0to23Parser;
|
|
2468
|
+
hasRequiredHour0to23Parser = 1;
|
|
2469
|
+
Hour0to23Parser.Hour0to23Parser = void 0;
|
|
2470
|
+
var _constants = /*@__PURE__*/ requireConstants();
|
|
2471
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
2472
|
+
|
|
2473
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
2474
|
+
|
|
2475
|
+
let Hour0to23Parser$1 = class Hour0to23Parser extends _Parser.Parser {
|
|
2476
|
+
priority = 70;
|
|
2477
|
+
|
|
2478
|
+
parse(dateString, token, match) {
|
|
2479
|
+
switch (token) {
|
|
2480
|
+
case "H":
|
|
2481
|
+
return (0, _utils.parseNumericPattern)(
|
|
2482
|
+
_constants.numericPatterns.hour23h,
|
|
2483
|
+
dateString,
|
|
2484
|
+
);
|
|
2485
|
+
case "Ho":
|
|
2486
|
+
return match.ordinalNumber(dateString, { unit: "hour" });
|
|
2487
|
+
default:
|
|
2488
|
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
validate(_date, value) {
|
|
2493
|
+
return value >= 0 && value <= 23;
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
set(date, _flags, value) {
|
|
2497
|
+
date.setHours(value, 0, 0, 0);
|
|
2498
|
+
return date;
|
|
2499
|
+
}
|
|
2500
|
+
|
|
2501
|
+
incompatibleTokens = ["a", "b", "h", "K", "k", "t", "T"];
|
|
2502
|
+
};
|
|
2503
|
+
Hour0to23Parser.Hour0to23Parser = Hour0to23Parser$1;
|
|
2504
|
+
return Hour0to23Parser;
|
|
2505
|
+
}
|
|
2506
|
+
|
|
2507
|
+
var Hour0To11Parser = {};
|
|
2508
|
+
|
|
2509
|
+
var hasRequiredHour0To11Parser;
|
|
2510
|
+
|
|
2511
|
+
function requireHour0To11Parser () {
|
|
2512
|
+
if (hasRequiredHour0To11Parser) return Hour0To11Parser;
|
|
2513
|
+
hasRequiredHour0To11Parser = 1;
|
|
2514
|
+
Hour0To11Parser.Hour0To11Parser = void 0;
|
|
2515
|
+
var _constants = /*@__PURE__*/ requireConstants();
|
|
2516
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
2517
|
+
|
|
2518
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
2519
|
+
|
|
2520
|
+
let Hour0To11Parser$1 = class Hour0To11Parser extends _Parser.Parser {
|
|
2521
|
+
priority = 70;
|
|
2522
|
+
|
|
2523
|
+
parse(dateString, token, match) {
|
|
2524
|
+
switch (token) {
|
|
2525
|
+
case "K":
|
|
2526
|
+
return (0, _utils.parseNumericPattern)(
|
|
2527
|
+
_constants.numericPatterns.hour11h,
|
|
2528
|
+
dateString,
|
|
2529
|
+
);
|
|
2530
|
+
case "Ko":
|
|
2531
|
+
return match.ordinalNumber(dateString, { unit: "hour" });
|
|
2532
|
+
default:
|
|
2533
|
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
|
|
2537
|
+
validate(_date, value) {
|
|
2538
|
+
return value >= 0 && value <= 11;
|
|
2539
|
+
}
|
|
2540
|
+
|
|
2541
|
+
set(date, _flags, value) {
|
|
2542
|
+
const isPM = date.getHours() >= 12;
|
|
2543
|
+
if (isPM && value < 12) {
|
|
2544
|
+
date.setHours(value + 12, 0, 0, 0);
|
|
2545
|
+
} else {
|
|
2546
|
+
date.setHours(value, 0, 0, 0);
|
|
2547
|
+
}
|
|
2548
|
+
return date;
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
incompatibleTokens = ["h", "H", "k", "t", "T"];
|
|
2552
|
+
};
|
|
2553
|
+
Hour0To11Parser.Hour0To11Parser = Hour0To11Parser$1;
|
|
2554
|
+
return Hour0To11Parser;
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
var Hour1To24Parser = {};
|
|
2558
|
+
|
|
2559
|
+
var hasRequiredHour1To24Parser;
|
|
2560
|
+
|
|
2561
|
+
function requireHour1To24Parser () {
|
|
2562
|
+
if (hasRequiredHour1To24Parser) return Hour1To24Parser;
|
|
2563
|
+
hasRequiredHour1To24Parser = 1;
|
|
2564
|
+
Hour1To24Parser.Hour1To24Parser = void 0;
|
|
2565
|
+
var _constants = /*@__PURE__*/ requireConstants();
|
|
2566
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
2567
|
+
|
|
2568
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
2569
|
+
|
|
2570
|
+
let Hour1To24Parser$1 = class Hour1To24Parser extends _Parser.Parser {
|
|
2571
|
+
priority = 70;
|
|
2572
|
+
|
|
2573
|
+
parse(dateString, token, match) {
|
|
2574
|
+
switch (token) {
|
|
2575
|
+
case "k":
|
|
2576
|
+
return (0, _utils.parseNumericPattern)(
|
|
2577
|
+
_constants.numericPatterns.hour24h,
|
|
2578
|
+
dateString,
|
|
2579
|
+
);
|
|
2580
|
+
case "ko":
|
|
2581
|
+
return match.ordinalNumber(dateString, { unit: "hour" });
|
|
2582
|
+
default:
|
|
2583
|
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2587
|
+
validate(_date, value) {
|
|
2588
|
+
return value >= 1 && value <= 24;
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
set(date, _flags, value) {
|
|
2592
|
+
const hours = value <= 24 ? value % 24 : value;
|
|
2593
|
+
date.setHours(hours, 0, 0, 0);
|
|
2594
|
+
return date;
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
incompatibleTokens = ["a", "b", "h", "H", "K", "t", "T"];
|
|
2598
|
+
};
|
|
2599
|
+
Hour1To24Parser.Hour1To24Parser = Hour1To24Parser$1;
|
|
2600
|
+
return Hour1To24Parser;
|
|
2601
|
+
}
|
|
2602
|
+
|
|
2603
|
+
var MinuteParser = {};
|
|
2604
|
+
|
|
2605
|
+
var hasRequiredMinuteParser;
|
|
2606
|
+
|
|
2607
|
+
function requireMinuteParser () {
|
|
2608
|
+
if (hasRequiredMinuteParser) return MinuteParser;
|
|
2609
|
+
hasRequiredMinuteParser = 1;
|
|
2610
|
+
MinuteParser.MinuteParser = void 0;
|
|
2611
|
+
var _constants = /*@__PURE__*/ requireConstants();
|
|
2612
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
2613
|
+
|
|
2614
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
2615
|
+
|
|
2616
|
+
let MinuteParser$1 = class MinuteParser extends _Parser.Parser {
|
|
2617
|
+
priority = 60;
|
|
2618
|
+
|
|
2619
|
+
parse(dateString, token, match) {
|
|
2620
|
+
switch (token) {
|
|
2621
|
+
case "m":
|
|
2622
|
+
return (0, _utils.parseNumericPattern)(
|
|
2623
|
+
_constants.numericPatterns.minute,
|
|
2624
|
+
dateString,
|
|
2625
|
+
);
|
|
2626
|
+
case "mo":
|
|
2627
|
+
return match.ordinalNumber(dateString, { unit: "minute" });
|
|
2628
|
+
default:
|
|
2629
|
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
validate(_date, value) {
|
|
2634
|
+
return value >= 0 && value <= 59;
|
|
2635
|
+
}
|
|
2636
|
+
|
|
2637
|
+
set(date, _flags, value) {
|
|
2638
|
+
date.setMinutes(value, 0, 0);
|
|
2639
|
+
return date;
|
|
2640
|
+
}
|
|
2641
|
+
|
|
2642
|
+
incompatibleTokens = ["t", "T"];
|
|
2643
|
+
};
|
|
2644
|
+
MinuteParser.MinuteParser = MinuteParser$1;
|
|
2645
|
+
return MinuteParser;
|
|
2646
|
+
}
|
|
2647
|
+
|
|
2648
|
+
var SecondParser = {};
|
|
2649
|
+
|
|
2650
|
+
var hasRequiredSecondParser;
|
|
2651
|
+
|
|
2652
|
+
function requireSecondParser () {
|
|
2653
|
+
if (hasRequiredSecondParser) return SecondParser;
|
|
2654
|
+
hasRequiredSecondParser = 1;
|
|
2655
|
+
SecondParser.SecondParser = void 0;
|
|
2656
|
+
var _constants = /*@__PURE__*/ requireConstants();
|
|
2657
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
2658
|
+
|
|
2659
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
2660
|
+
|
|
2661
|
+
let SecondParser$1 = class SecondParser extends _Parser.Parser {
|
|
2662
|
+
priority = 50;
|
|
2663
|
+
|
|
2664
|
+
parse(dateString, token, match) {
|
|
2665
|
+
switch (token) {
|
|
2666
|
+
case "s":
|
|
2667
|
+
return (0, _utils.parseNumericPattern)(
|
|
2668
|
+
_constants.numericPatterns.second,
|
|
2669
|
+
dateString,
|
|
2670
|
+
);
|
|
2671
|
+
case "so":
|
|
2672
|
+
return match.ordinalNumber(dateString, { unit: "second" });
|
|
2673
|
+
default:
|
|
2674
|
+
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
|
|
2678
|
+
validate(_date, value) {
|
|
2679
|
+
return value >= 0 && value <= 59;
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
set(date, _flags, value) {
|
|
2683
|
+
date.setSeconds(value, 0);
|
|
2684
|
+
return date;
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2687
|
+
incompatibleTokens = ["t", "T"];
|
|
2688
|
+
};
|
|
2689
|
+
SecondParser.SecondParser = SecondParser$1;
|
|
2690
|
+
return SecondParser;
|
|
2691
|
+
}
|
|
2692
|
+
|
|
2693
|
+
var FractionOfSecondParser = {};
|
|
2694
|
+
|
|
2695
|
+
var hasRequiredFractionOfSecondParser;
|
|
2696
|
+
|
|
2697
|
+
function requireFractionOfSecondParser () {
|
|
2698
|
+
if (hasRequiredFractionOfSecondParser) return FractionOfSecondParser;
|
|
2699
|
+
hasRequiredFractionOfSecondParser = 1;
|
|
2700
|
+
FractionOfSecondParser.FractionOfSecondParser = void 0;
|
|
2701
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
2702
|
+
|
|
2703
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
2704
|
+
|
|
2705
|
+
let FractionOfSecondParser$1 = class FractionOfSecondParser extends _Parser.Parser {
|
|
2706
|
+
priority = 30;
|
|
2707
|
+
|
|
2708
|
+
parse(dateString, token) {
|
|
2709
|
+
const valueCallback = (value) =>
|
|
2710
|
+
Math.trunc(value * Math.pow(10, -token.length + 3));
|
|
2711
|
+
return (0, _utils.mapValue)(
|
|
2712
|
+
(0, _utils.parseNDigits)(token.length, dateString),
|
|
2713
|
+
valueCallback,
|
|
2714
|
+
);
|
|
2715
|
+
}
|
|
2716
|
+
|
|
2717
|
+
set(date, _flags, value) {
|
|
2718
|
+
date.setMilliseconds(value);
|
|
2719
|
+
return date;
|
|
2720
|
+
}
|
|
2721
|
+
|
|
2722
|
+
incompatibleTokens = ["t", "T"];
|
|
2723
|
+
};
|
|
2724
|
+
FractionOfSecondParser.FractionOfSecondParser = FractionOfSecondParser$1;
|
|
2725
|
+
return FractionOfSecondParser;
|
|
2726
|
+
}
|
|
2727
|
+
|
|
2728
|
+
var ISOTimezoneWithZParser = {};
|
|
2729
|
+
|
|
2730
|
+
var hasRequiredISOTimezoneWithZParser;
|
|
2731
|
+
|
|
2732
|
+
function requireISOTimezoneWithZParser () {
|
|
2733
|
+
if (hasRequiredISOTimezoneWithZParser) return ISOTimezoneWithZParser;
|
|
2734
|
+
hasRequiredISOTimezoneWithZParser = 1;
|
|
2735
|
+
ISOTimezoneWithZParser.ISOTimezoneWithZParser = void 0;
|
|
2736
|
+
var _index = /*@__PURE__*/ requireConstructFrom();
|
|
2737
|
+
var _index2 = /*@__PURE__*/ requireGetTimezoneOffsetInMilliseconds();
|
|
2738
|
+
var _constants = /*@__PURE__*/ requireConstants();
|
|
2739
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
2740
|
+
|
|
2741
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
2742
|
+
|
|
2743
|
+
// Timezone (ISO-8601. +00:00 is `'Z'`)
|
|
2744
|
+
let ISOTimezoneWithZParser$1 = class ISOTimezoneWithZParser extends _Parser.Parser {
|
|
2745
|
+
priority = 10;
|
|
2746
|
+
|
|
2747
|
+
parse(dateString, token) {
|
|
2748
|
+
switch (token) {
|
|
2749
|
+
case "X":
|
|
2750
|
+
return (0, _utils.parseTimezonePattern)(
|
|
2751
|
+
_constants.timezonePatterns.basicOptionalMinutes,
|
|
2752
|
+
dateString,
|
|
2753
|
+
);
|
|
2754
|
+
case "XX":
|
|
2755
|
+
return (0, _utils.parseTimezonePattern)(
|
|
2756
|
+
_constants.timezonePatterns.basic,
|
|
2757
|
+
dateString,
|
|
2758
|
+
);
|
|
2759
|
+
case "XXXX":
|
|
2760
|
+
return (0, _utils.parseTimezonePattern)(
|
|
2761
|
+
_constants.timezonePatterns.basicOptionalSeconds,
|
|
2762
|
+
dateString,
|
|
2763
|
+
);
|
|
2764
|
+
case "XXXXX":
|
|
2765
|
+
return (0, _utils.parseTimezonePattern)(
|
|
2766
|
+
_constants.timezonePatterns.extendedOptionalSeconds,
|
|
2767
|
+
dateString,
|
|
2768
|
+
);
|
|
2769
|
+
case "XXX":
|
|
2770
|
+
default:
|
|
2771
|
+
return (0, _utils.parseTimezonePattern)(
|
|
2772
|
+
_constants.timezonePatterns.extended,
|
|
2773
|
+
dateString,
|
|
2774
|
+
);
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
|
|
2778
|
+
set(date, flags, value) {
|
|
2779
|
+
if (flags.timestampIsSet) return date;
|
|
2780
|
+
return (0, _index.constructFrom)(
|
|
2781
|
+
date,
|
|
2782
|
+
date.getTime() -
|
|
2783
|
+
(0, _index2.getTimezoneOffsetInMilliseconds)(date) -
|
|
2784
|
+
value,
|
|
2785
|
+
);
|
|
2786
|
+
}
|
|
2787
|
+
|
|
2788
|
+
incompatibleTokens = ["t", "T", "x"];
|
|
2789
|
+
};
|
|
2790
|
+
ISOTimezoneWithZParser.ISOTimezoneWithZParser = ISOTimezoneWithZParser$1;
|
|
2791
|
+
return ISOTimezoneWithZParser;
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2794
|
+
var ISOTimezoneParser = {};
|
|
2795
|
+
|
|
2796
|
+
var hasRequiredISOTimezoneParser;
|
|
2797
|
+
|
|
2798
|
+
function requireISOTimezoneParser () {
|
|
2799
|
+
if (hasRequiredISOTimezoneParser) return ISOTimezoneParser;
|
|
2800
|
+
hasRequiredISOTimezoneParser = 1;
|
|
2801
|
+
ISOTimezoneParser.ISOTimezoneParser = void 0;
|
|
2802
|
+
var _index = /*@__PURE__*/ requireConstructFrom();
|
|
2803
|
+
var _index2 = /*@__PURE__*/ requireGetTimezoneOffsetInMilliseconds();
|
|
2804
|
+
var _constants = /*@__PURE__*/ requireConstants();
|
|
2805
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
2806
|
+
|
|
2807
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
2808
|
+
|
|
2809
|
+
// Timezone (ISO-8601)
|
|
2810
|
+
let ISOTimezoneParser$1 = class ISOTimezoneParser extends _Parser.Parser {
|
|
2811
|
+
priority = 10;
|
|
2812
|
+
|
|
2813
|
+
parse(dateString, token) {
|
|
2814
|
+
switch (token) {
|
|
2815
|
+
case "x":
|
|
2816
|
+
return (0, _utils.parseTimezonePattern)(
|
|
2817
|
+
_constants.timezonePatterns.basicOptionalMinutes,
|
|
2818
|
+
dateString,
|
|
2819
|
+
);
|
|
2820
|
+
case "xx":
|
|
2821
|
+
return (0, _utils.parseTimezonePattern)(
|
|
2822
|
+
_constants.timezonePatterns.basic,
|
|
2823
|
+
dateString,
|
|
2824
|
+
);
|
|
2825
|
+
case "xxxx":
|
|
2826
|
+
return (0, _utils.parseTimezonePattern)(
|
|
2827
|
+
_constants.timezonePatterns.basicOptionalSeconds,
|
|
2828
|
+
dateString,
|
|
2829
|
+
);
|
|
2830
|
+
case "xxxxx":
|
|
2831
|
+
return (0, _utils.parseTimezonePattern)(
|
|
2832
|
+
_constants.timezonePatterns.extendedOptionalSeconds,
|
|
2833
|
+
dateString,
|
|
2834
|
+
);
|
|
2835
|
+
case "xxx":
|
|
2836
|
+
default:
|
|
2837
|
+
return (0, _utils.parseTimezonePattern)(
|
|
2838
|
+
_constants.timezonePatterns.extended,
|
|
2839
|
+
dateString,
|
|
2840
|
+
);
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
|
|
2844
|
+
set(date, flags, value) {
|
|
2845
|
+
if (flags.timestampIsSet) return date;
|
|
2846
|
+
return (0, _index.constructFrom)(
|
|
2847
|
+
date,
|
|
2848
|
+
date.getTime() -
|
|
2849
|
+
(0, _index2.getTimezoneOffsetInMilliseconds)(date) -
|
|
2850
|
+
value,
|
|
2851
|
+
);
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2854
|
+
incompatibleTokens = ["t", "T", "X"];
|
|
2855
|
+
};
|
|
2856
|
+
ISOTimezoneParser.ISOTimezoneParser = ISOTimezoneParser$1;
|
|
2857
|
+
return ISOTimezoneParser;
|
|
2858
|
+
}
|
|
2859
|
+
|
|
2860
|
+
var TimestampSecondsParser = {};
|
|
2861
|
+
|
|
2862
|
+
var hasRequiredTimestampSecondsParser;
|
|
2863
|
+
|
|
2864
|
+
function requireTimestampSecondsParser () {
|
|
2865
|
+
if (hasRequiredTimestampSecondsParser) return TimestampSecondsParser;
|
|
2866
|
+
hasRequiredTimestampSecondsParser = 1;
|
|
2867
|
+
TimestampSecondsParser.TimestampSecondsParser = void 0;
|
|
2868
|
+
var _index = /*@__PURE__*/ requireConstructFrom();
|
|
2869
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
2870
|
+
|
|
2871
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
2872
|
+
|
|
2873
|
+
let TimestampSecondsParser$1 = class TimestampSecondsParser extends _Parser.Parser {
|
|
2874
|
+
priority = 40;
|
|
2875
|
+
|
|
2876
|
+
parse(dateString) {
|
|
2877
|
+
return (0, _utils.parseAnyDigitsSigned)(dateString);
|
|
2878
|
+
}
|
|
2879
|
+
|
|
2880
|
+
set(date, _flags, value) {
|
|
2881
|
+
return [
|
|
2882
|
+
(0, _index.constructFrom)(date, value * 1000),
|
|
2883
|
+
{ timestampIsSet: true },
|
|
2884
|
+
];
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2887
|
+
incompatibleTokens = "*";
|
|
2888
|
+
};
|
|
2889
|
+
TimestampSecondsParser.TimestampSecondsParser = TimestampSecondsParser$1;
|
|
2890
|
+
return TimestampSecondsParser;
|
|
2891
|
+
}
|
|
2892
|
+
|
|
2893
|
+
var TimestampMillisecondsParser = {};
|
|
2894
|
+
|
|
2895
|
+
var hasRequiredTimestampMillisecondsParser;
|
|
2896
|
+
|
|
2897
|
+
function requireTimestampMillisecondsParser () {
|
|
2898
|
+
if (hasRequiredTimestampMillisecondsParser) return TimestampMillisecondsParser;
|
|
2899
|
+
hasRequiredTimestampMillisecondsParser = 1;
|
|
2900
|
+
TimestampMillisecondsParser.TimestampMillisecondsParser = void 0;
|
|
2901
|
+
var _index = /*@__PURE__*/ requireConstructFrom();
|
|
2902
|
+
var _Parser = /*@__PURE__*/ requireParser();
|
|
2903
|
+
|
|
2904
|
+
var _utils = /*@__PURE__*/ requireUtils();
|
|
2905
|
+
|
|
2906
|
+
let TimestampMillisecondsParser$1 = class TimestampMillisecondsParser extends _Parser.Parser {
|
|
2907
|
+
priority = 20;
|
|
2908
|
+
|
|
2909
|
+
parse(dateString) {
|
|
2910
|
+
return (0, _utils.parseAnyDigitsSigned)(dateString);
|
|
2911
|
+
}
|
|
2912
|
+
|
|
2913
|
+
set(date, _flags, value) {
|
|
2914
|
+
return [(0, _index.constructFrom)(date, value), { timestampIsSet: true }];
|
|
2915
|
+
}
|
|
2916
|
+
|
|
2917
|
+
incompatibleTokens = "*";
|
|
2918
|
+
};
|
|
2919
|
+
TimestampMillisecondsParser.TimestampMillisecondsParser = TimestampMillisecondsParser$1;
|
|
2920
|
+
return TimestampMillisecondsParser;
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
var hasRequiredParsers;
|
|
2924
|
+
|
|
2925
|
+
function requireParsers () {
|
|
2926
|
+
if (hasRequiredParsers) return parsers;
|
|
2927
|
+
hasRequiredParsers = 1;
|
|
2928
|
+
parsers.parsers = void 0;
|
|
2929
|
+
var _EraParser = /*@__PURE__*/ requireEraParser();
|
|
2930
|
+
var _YearParser = /*@__PURE__*/ requireYearParser();
|
|
2931
|
+
var _LocalWeekYearParser = /*@__PURE__*/ requireLocalWeekYearParser();
|
|
2932
|
+
var _ISOWeekYearParser = /*@__PURE__*/ requireISOWeekYearParser();
|
|
2933
|
+
var _ExtendedYearParser = /*@__PURE__*/ requireExtendedYearParser();
|
|
2934
|
+
var _QuarterParser = /*@__PURE__*/ requireQuarterParser();
|
|
2935
|
+
var _StandAloneQuarterParser = /*@__PURE__*/ requireStandAloneQuarterParser();
|
|
2936
|
+
var _MonthParser = /*@__PURE__*/ requireMonthParser();
|
|
2937
|
+
var _StandAloneMonthParser = /*@__PURE__*/ requireStandAloneMonthParser();
|
|
2938
|
+
var _LocalWeekParser = /*@__PURE__*/ requireLocalWeekParser();
|
|
2939
|
+
var _ISOWeekParser = /*@__PURE__*/ requireISOWeekParser();
|
|
2940
|
+
var _DateParser = /*@__PURE__*/ requireDateParser();
|
|
2941
|
+
var _DayOfYearParser = /*@__PURE__*/ requireDayOfYearParser();
|
|
2942
|
+
var _DayParser = /*@__PURE__*/ requireDayParser();
|
|
2943
|
+
var _LocalDayParser = /*@__PURE__*/ requireLocalDayParser();
|
|
2944
|
+
var _StandAloneLocalDayParser = /*@__PURE__*/ requireStandAloneLocalDayParser();
|
|
2945
|
+
var _ISODayParser = /*@__PURE__*/ requireISODayParser();
|
|
2946
|
+
var _AMPMParser = /*@__PURE__*/ requireAMPMParser();
|
|
2947
|
+
var _AMPMMidnightParser = /*@__PURE__*/ requireAMPMMidnightParser();
|
|
2948
|
+
var _DayPeriodParser = /*@__PURE__*/ requireDayPeriodParser();
|
|
2949
|
+
var _Hour1to12Parser = /*@__PURE__*/ requireHour1to12Parser();
|
|
2950
|
+
var _Hour0to23Parser = /*@__PURE__*/ requireHour0to23Parser();
|
|
2951
|
+
var _Hour0To11Parser = /*@__PURE__*/ requireHour0To11Parser();
|
|
2952
|
+
var _Hour1To24Parser = /*@__PURE__*/ requireHour1To24Parser();
|
|
2953
|
+
var _MinuteParser = /*@__PURE__*/ requireMinuteParser();
|
|
2954
|
+
var _SecondParser = /*@__PURE__*/ requireSecondParser();
|
|
2955
|
+
var _FractionOfSecondParser = /*@__PURE__*/ requireFractionOfSecondParser();
|
|
2956
|
+
var _ISOTimezoneWithZParser = /*@__PURE__*/ requireISOTimezoneWithZParser();
|
|
2957
|
+
var _ISOTimezoneParser = /*@__PURE__*/ requireISOTimezoneParser();
|
|
2958
|
+
var _TimestampSecondsParser = /*@__PURE__*/ requireTimestampSecondsParser();
|
|
2959
|
+
var _TimestampMillisecondsParser = /*@__PURE__*/ requireTimestampMillisecondsParser();
|
|
2960
|
+
|
|
2961
|
+
/*
|
|
2962
|
+
* | | Unit | | Unit |
|
|
2963
|
+
* |-----|--------------------------------|-----|--------------------------------|
|
|
2964
|
+
* | a | AM, PM | A* | Milliseconds in day |
|
|
2965
|
+
* | b | AM, PM, noon, midnight | B | Flexible day period |
|
|
2966
|
+
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
|
|
2967
|
+
* | d | Day of month | D | Day of year |
|
|
2968
|
+
* | e | Local day of week | E | Day of week |
|
|
2969
|
+
* | f | | F* | Day of week in month |
|
|
2970
|
+
* | g* | Modified Julian day | G | Era |
|
|
2971
|
+
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
2972
|
+
* | i! | ISO day of week | I! | ISO week of year |
|
|
2973
|
+
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
|
|
2974
|
+
* | k | Hour [1-24] | K | Hour [0-11] |
|
|
2975
|
+
* | l* | (deprecated) | L | Stand-alone month |
|
|
2976
|
+
* | m | Minute | M | Month |
|
|
2977
|
+
* | n | | N | |
|
|
2978
|
+
* | o! | Ordinal number modifier | O* | Timezone (GMT) |
|
|
2979
|
+
* | p | | P | |
|
|
2980
|
+
* | q | Stand-alone quarter | Q | Quarter |
|
|
2981
|
+
* | r* | Related Gregorian year | R! | ISO week-numbering year |
|
|
2982
|
+
* | s | Second | S | Fraction of second |
|
|
2983
|
+
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
|
|
2984
|
+
* | u | Extended year | U* | Cyclic year |
|
|
2985
|
+
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
|
|
2986
|
+
* | w | Local week of year | W* | Week of month |
|
|
2987
|
+
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
|
|
2988
|
+
* | y | Year (abs) | Y | Local week-numbering year |
|
|
2989
|
+
* | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
|
|
2990
|
+
*
|
|
2991
|
+
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
2992
|
+
*
|
|
2993
|
+
* Letters marked by ! are non-standard, but implemented by date-fns:
|
|
2994
|
+
* - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)
|
|
2995
|
+
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
|
|
2996
|
+
* i.e. 7 for Sunday, 1 for Monday, etc.
|
|
2997
|
+
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
|
|
2998
|
+
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
|
|
2999
|
+
* `R` is supposed to be used in conjunction with `I` and `i`
|
|
3000
|
+
* for universal ISO week-numbering date, whereas
|
|
3001
|
+
* `Y` is supposed to be used in conjunction with `w` and `e`
|
|
3002
|
+
* for week-numbering date specific to the locale.
|
|
3003
|
+
*/
|
|
3004
|
+
(parsers.parsers = {
|
|
3005
|
+
G: new _EraParser.EraParser(),
|
|
3006
|
+
y: new _YearParser.YearParser(),
|
|
3007
|
+
Y: new _LocalWeekYearParser.LocalWeekYearParser(),
|
|
3008
|
+
R: new _ISOWeekYearParser.ISOWeekYearParser(),
|
|
3009
|
+
u: new _ExtendedYearParser.ExtendedYearParser(),
|
|
3010
|
+
Q: new _QuarterParser.QuarterParser(),
|
|
3011
|
+
q: new _StandAloneQuarterParser.StandAloneQuarterParser(),
|
|
3012
|
+
M: new _MonthParser.MonthParser(),
|
|
3013
|
+
L: new _StandAloneMonthParser.StandAloneMonthParser(),
|
|
3014
|
+
w: new _LocalWeekParser.LocalWeekParser(),
|
|
3015
|
+
I: new _ISOWeekParser.ISOWeekParser(),
|
|
3016
|
+
d: new _DateParser.DateParser(),
|
|
3017
|
+
D: new _DayOfYearParser.DayOfYearParser(),
|
|
3018
|
+
E: new _DayParser.DayParser(),
|
|
3019
|
+
e: new _LocalDayParser.LocalDayParser(),
|
|
3020
|
+
c: new _StandAloneLocalDayParser.StandAloneLocalDayParser(),
|
|
3021
|
+
i: new _ISODayParser.ISODayParser(),
|
|
3022
|
+
a: new _AMPMParser.AMPMParser(),
|
|
3023
|
+
b: new _AMPMMidnightParser.AMPMMidnightParser(),
|
|
3024
|
+
B: new _DayPeriodParser.DayPeriodParser(),
|
|
3025
|
+
h: new _Hour1to12Parser.Hour1to12Parser(),
|
|
3026
|
+
H: new _Hour0to23Parser.Hour0to23Parser(),
|
|
3027
|
+
K: new _Hour0To11Parser.Hour0To11Parser(),
|
|
3028
|
+
k: new _Hour1To24Parser.Hour1To24Parser(),
|
|
3029
|
+
m: new _MinuteParser.MinuteParser(),
|
|
3030
|
+
s: new _SecondParser.SecondParser(),
|
|
3031
|
+
S: new _FractionOfSecondParser.FractionOfSecondParser(),
|
|
3032
|
+
X: new _ISOTimezoneWithZParser.ISOTimezoneWithZParser(),
|
|
3033
|
+
x: new _ISOTimezoneParser.ISOTimezoneParser(),
|
|
3034
|
+
t: new _TimestampSecondsParser.TimestampSecondsParser(),
|
|
3035
|
+
T: new _TimestampMillisecondsParser.TimestampMillisecondsParser(),
|
|
3036
|
+
});
|
|
3037
|
+
return parsers;
|
|
3038
|
+
}
|
|
3039
|
+
|
|
3040
|
+
var hasRequiredParse;
|
|
3041
|
+
|
|
3042
|
+
function requireParse () {
|
|
3043
|
+
if (hasRequiredParse) return parse;
|
|
3044
|
+
hasRequiredParse = 1;
|
|
3045
|
+
(function (exports) {
|
|
3046
|
+
Object.defineProperty(exports, "longFormatters", {
|
|
3047
|
+
enumerable: true,
|
|
3048
|
+
get: function () {
|
|
3049
|
+
return _index2.longFormatters;
|
|
3050
|
+
},
|
|
3051
|
+
});
|
|
3052
|
+
exports.parse = parse;
|
|
3053
|
+
Object.defineProperty(exports, "parsers", {
|
|
3054
|
+
enumerable: true,
|
|
3055
|
+
get: function () {
|
|
3056
|
+
return _index7.parsers;
|
|
3057
|
+
},
|
|
3058
|
+
});
|
|
3059
|
+
var _index = /*@__PURE__*/ requireDefaultLocale();
|
|
3060
|
+
var _index2 = /*@__PURE__*/ requireLongFormatters();
|
|
3061
|
+
var _index3 = /*@__PURE__*/ requireProtectedTokens();
|
|
3062
|
+
|
|
3063
|
+
var _index4 = /*@__PURE__*/ requireConstructFrom();
|
|
3064
|
+
var _index5 = /*@__PURE__*/ requireGetDefaultOptions();
|
|
3065
|
+
var _index6 = /*@__PURE__*/ requireToDate();
|
|
3066
|
+
|
|
3067
|
+
var _Setter = /*@__PURE__*/ requireSetter();
|
|
3068
|
+
var _index7 = /*@__PURE__*/ requireParsers();
|
|
3069
|
+
|
|
3070
|
+
// Rexports of internal for libraries to use.
|
|
3071
|
+
// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874
|
|
3072
|
+
|
|
3073
|
+
/**
|
|
3074
|
+
* The {@link parse} function options.
|
|
3075
|
+
*/
|
|
3076
|
+
|
|
3077
|
+
// This RegExp consists of three parts separated by `|`:
|
|
3078
|
+
// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
|
|
3079
|
+
// (one of the certain letters followed by `o`)
|
|
3080
|
+
// - (\w)\1* matches any sequences of the same letter
|
|
3081
|
+
// - '' matches two quote characters in a row
|
|
3082
|
+
// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
|
|
3083
|
+
// except a single quote symbol, which ends the sequence.
|
|
3084
|
+
// Two quote characters do not end the sequence.
|
|
3085
|
+
// If there is no matching single quote
|
|
3086
|
+
// then the sequence will continue until the end of the string.
|
|
3087
|
+
// - . matches any single character unmatched by previous parts of the RegExps
|
|
3088
|
+
const formattingTokensRegExp =
|
|
3089
|
+
/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
|
3090
|
+
|
|
3091
|
+
// This RegExp catches symbols escaped by quotes, and also
|
|
3092
|
+
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
|
|
3093
|
+
const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
3094
|
+
|
|
3095
|
+
const escapedStringRegExp = /^'([^]*?)'?$/;
|
|
3096
|
+
const doubleQuoteRegExp = /''/g;
|
|
3097
|
+
|
|
3098
|
+
const notWhitespaceRegExp = /\S/;
|
|
3099
|
+
const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
3100
|
+
|
|
3101
|
+
/**
|
|
3102
|
+
* @name parse
|
|
3103
|
+
* @category Common Helpers
|
|
3104
|
+
* @summary Parse the date.
|
|
3105
|
+
*
|
|
3106
|
+
* @description
|
|
3107
|
+
* Return the date parsed from string using the given format string.
|
|
3108
|
+
*
|
|
3109
|
+
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
|
|
3110
|
+
* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
3111
|
+
*
|
|
3112
|
+
* The characters in the format string wrapped between two single quotes characters (') are escaped.
|
|
3113
|
+
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
|
|
3114
|
+
*
|
|
3115
|
+
* Format of the format string is based on Unicode Technical Standard #35:
|
|
3116
|
+
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
3117
|
+
* with a few additions (see note 5 below the table).
|
|
3118
|
+
*
|
|
3119
|
+
* Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited
|
|
3120
|
+
* and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:
|
|
3121
|
+
*
|
|
3122
|
+
* ```javascript
|
|
3123
|
+
* parse('23 AM', 'HH a', new Date())
|
|
3124
|
+
* //=> RangeError: The format string mustn't contain `HH` and `a` at the same time
|
|
3125
|
+
* ```
|
|
3126
|
+
*
|
|
3127
|
+
* See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true
|
|
3128
|
+
*
|
|
3129
|
+
* Accepted format string patterns:
|
|
3130
|
+
* | Unit |Prior| Pattern | Result examples | Notes |
|
|
3131
|
+
* |---------------------------------|-----|---------|-----------------------------------|-------|
|
|
3132
|
+
* | Era | 140 | G..GGG | AD, BC | |
|
|
3133
|
+
* | | | GGGG | Anno Domini, Before Christ | 2 |
|
|
3134
|
+
* | | | GGGGG | A, B | |
|
|
3135
|
+
* | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |
|
|
3136
|
+
* | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |
|
|
3137
|
+
* | | | yy | 44, 01, 00, 17 | 4 |
|
|
3138
|
+
* | | | yyy | 044, 001, 123, 999 | 4 |
|
|
3139
|
+
* | | | yyyy | 0044, 0001, 1900, 2017 | 4 |
|
|
3140
|
+
* | | | yyyyy | ... | 2,4 |
|
|
3141
|
+
* | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |
|
|
3142
|
+
* | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |
|
|
3143
|
+
* | | | YY | 44, 01, 00, 17 | 4,6 |
|
|
3144
|
+
* | | | YYY | 044, 001, 123, 999 | 4 |
|
|
3145
|
+
* | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |
|
|
3146
|
+
* | | | YYYYY | ... | 2,4 |
|
|
3147
|
+
* | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |
|
|
3148
|
+
* | | | RR | -43, 01, 00, 17 | 4,5 |
|
|
3149
|
+
* | | | RRR | -043, 001, 123, 999, -999 | 4,5 |
|
|
3150
|
+
* | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |
|
|
3151
|
+
* | | | RRRRR | ... | 2,4,5 |
|
|
3152
|
+
* | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |
|
|
3153
|
+
* | | | uu | -43, 01, 99, -99 | 4 |
|
|
3154
|
+
* | | | uuu | -043, 001, 123, 999, -999 | 4 |
|
|
3155
|
+
* | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |
|
|
3156
|
+
* | | | uuuuu | ... | 2,4 |
|
|
3157
|
+
* | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |
|
|
3158
|
+
* | | | Qo | 1st, 2nd, 3rd, 4th | 5 |
|
|
3159
|
+
* | | | QQ | 01, 02, 03, 04 | |
|
|
3160
|
+
* | | | QQQ | Q1, Q2, Q3, Q4 | |
|
|
3161
|
+
* | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
|
|
3162
|
+
* | | | QQQQQ | 1, 2, 3, 4 | 4 |
|
|
3163
|
+
* | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |
|
|
3164
|
+
* | | | qo | 1st, 2nd, 3rd, 4th | 5 |
|
|
3165
|
+
* | | | qq | 01, 02, 03, 04 | |
|
|
3166
|
+
* | | | qqq | Q1, Q2, Q3, Q4 | |
|
|
3167
|
+
* | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
|
|
3168
|
+
* | | | qqqqq | 1, 2, 3, 4 | 3 |
|
|
3169
|
+
* | Month (formatting) | 110 | M | 1, 2, ..., 12 | |
|
|
3170
|
+
* | | | Mo | 1st, 2nd, ..., 12th | 5 |
|
|
3171
|
+
* | | | MM | 01, 02, ..., 12 | |
|
|
3172
|
+
* | | | MMM | Jan, Feb, ..., Dec | |
|
|
3173
|
+
* | | | MMMM | January, February, ..., December | 2 |
|
|
3174
|
+
* | | | MMMMM | J, F, ..., D | |
|
|
3175
|
+
* | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |
|
|
3176
|
+
* | | | Lo | 1st, 2nd, ..., 12th | 5 |
|
|
3177
|
+
* | | | LL | 01, 02, ..., 12 | |
|
|
3178
|
+
* | | | LLL | Jan, Feb, ..., Dec | |
|
|
3179
|
+
* | | | LLLL | January, February, ..., December | 2 |
|
|
3180
|
+
* | | | LLLLL | J, F, ..., D | |
|
|
3181
|
+
* | Local week of year | 100 | w | 1, 2, ..., 53 | |
|
|
3182
|
+
* | | | wo | 1st, 2nd, ..., 53th | 5 |
|
|
3183
|
+
* | | | ww | 01, 02, ..., 53 | |
|
|
3184
|
+
* | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |
|
|
3185
|
+
* | | | Io | 1st, 2nd, ..., 53th | 5 |
|
|
3186
|
+
* | | | II | 01, 02, ..., 53 | 5 |
|
|
3187
|
+
* | Day of month | 90 | d | 1, 2, ..., 31 | |
|
|
3188
|
+
* | | | do | 1st, 2nd, ..., 31st | 5 |
|
|
3189
|
+
* | | | dd | 01, 02, ..., 31 | |
|
|
3190
|
+
* | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |
|
|
3191
|
+
* | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |
|
|
3192
|
+
* | | | DD | 01, 02, ..., 365, 366 | 7 |
|
|
3193
|
+
* | | | DDD | 001, 002, ..., 365, 366 | |
|
|
3194
|
+
* | | | DDDD | ... | 2 |
|
|
3195
|
+
* | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |
|
|
3196
|
+
* | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
|
|
3197
|
+
* | | | EEEEE | M, T, W, T, F, S, S | |
|
|
3198
|
+
* | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
3199
|
+
* | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |
|
|
3200
|
+
* | | | io | 1st, 2nd, ..., 7th | 5 |
|
|
3201
|
+
* | | | ii | 01, 02, ..., 07 | 5 |
|
|
3202
|
+
* | | | iii | Mon, Tue, Wed, ..., Sun | 5 |
|
|
3203
|
+
* | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |
|
|
3204
|
+
* | | | iiiii | M, T, W, T, F, S, S | 5 |
|
|
3205
|
+
* | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |
|
|
3206
|
+
* | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |
|
|
3207
|
+
* | | | eo | 2nd, 3rd, ..., 1st | 5 |
|
|
3208
|
+
* | | | ee | 02, 03, ..., 01 | |
|
|
3209
|
+
* | | | eee | Mon, Tue, Wed, ..., Sun | |
|
|
3210
|
+
* | | | eeee | Monday, Tuesday, ..., Sunday | 2 |
|
|
3211
|
+
* | | | eeeee | M, T, W, T, F, S, S | |
|
|
3212
|
+
* | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
3213
|
+
* | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |
|
|
3214
|
+
* | | | co | 2nd, 3rd, ..., 1st | 5 |
|
|
3215
|
+
* | | | cc | 02, 03, ..., 01 | |
|
|
3216
|
+
* | | | ccc | Mon, Tue, Wed, ..., Sun | |
|
|
3217
|
+
* | | | cccc | Monday, Tuesday, ..., Sunday | 2 |
|
|
3218
|
+
* | | | ccccc | M, T, W, T, F, S, S | |
|
|
3219
|
+
* | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
3220
|
+
* | AM, PM | 80 | a..aaa | AM, PM | |
|
|
3221
|
+
* | | | aaaa | a.m., p.m. | 2 |
|
|
3222
|
+
* | | | aaaaa | a, p | |
|
|
3223
|
+
* | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |
|
|
3224
|
+
* | | | bbbb | a.m., p.m., noon, midnight | 2 |
|
|
3225
|
+
* | | | bbbbb | a, p, n, mi | |
|
|
3226
|
+
* | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |
|
|
3227
|
+
* | | | BBBB | at night, in the morning, ... | 2 |
|
|
3228
|
+
* | | | BBBBB | at night, in the morning, ... | |
|
|
3229
|
+
* | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |
|
|
3230
|
+
* | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |
|
|
3231
|
+
* | | | hh | 01, 02, ..., 11, 12 | |
|
|
3232
|
+
* | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |
|
|
3233
|
+
* | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |
|
|
3234
|
+
* | | | HH | 00, 01, 02, ..., 23 | |
|
|
3235
|
+
* | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |
|
|
3236
|
+
* | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |
|
|
3237
|
+
* | | | KK | 01, 02, ..., 11, 00 | |
|
|
3238
|
+
* | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |
|
|
3239
|
+
* | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |
|
|
3240
|
+
* | | | kk | 24, 01, 02, ..., 23 | |
|
|
3241
|
+
* | Minute | 60 | m | 0, 1, ..., 59 | |
|
|
3242
|
+
* | | | mo | 0th, 1st, ..., 59th | 5 |
|
|
3243
|
+
* | | | mm | 00, 01, ..., 59 | |
|
|
3244
|
+
* | Second | 50 | s | 0, 1, ..., 59 | |
|
|
3245
|
+
* | | | so | 0th, 1st, ..., 59th | 5 |
|
|
3246
|
+
* | | | ss | 00, 01, ..., 59 | |
|
|
3247
|
+
* | Seconds timestamp | 40 | t | 512969520 | |
|
|
3248
|
+
* | | | tt | ... | 2 |
|
|
3249
|
+
* | Fraction of second | 30 | S | 0, 1, ..., 9 | |
|
|
3250
|
+
* | | | SS | 00, 01, ..., 99 | |
|
|
3251
|
+
* | | | SSS | 000, 001, ..., 999 | |
|
|
3252
|
+
* | | | SSSS | ... | 2 |
|
|
3253
|
+
* | Milliseconds timestamp | 20 | T | 512969520900 | |
|
|
3254
|
+
* | | | TT | ... | 2 |
|
|
3255
|
+
* | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |
|
|
3256
|
+
* | | | XX | -0800, +0530, Z | |
|
|
3257
|
+
* | | | XXX | -08:00, +05:30, Z | |
|
|
3258
|
+
* | | | XXXX | -0800, +0530, Z, +123456 | 2 |
|
|
3259
|
+
* | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
|
|
3260
|
+
* | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |
|
|
3261
|
+
* | | | xx | -0800, +0530, +0000 | |
|
|
3262
|
+
* | | | xxx | -08:00, +05:30, +00:00 | 2 |
|
|
3263
|
+
* | | | xxxx | -0800, +0530, +0000, +123456 | |
|
|
3264
|
+
* | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
|
|
3265
|
+
* | Long localized date | NA | P | 05/29/1453 | 5,8 |
|
|
3266
|
+
* | | | PP | May 29, 1453 | |
|
|
3267
|
+
* | | | PPP | May 29th, 1453 | |
|
|
3268
|
+
* | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |
|
|
3269
|
+
* | Long localized time | NA | p | 12:00 AM | 5,8 |
|
|
3270
|
+
* | | | pp | 12:00:00 AM | |
|
|
3271
|
+
* | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |
|
|
3272
|
+
* | | | PPpp | May 29, 1453, 12:00:00 AM | |
|
|
3273
|
+
* | | | PPPpp | May 29th, 1453 at ... | |
|
|
3274
|
+
* | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |
|
|
3275
|
+
* Notes:
|
|
3276
|
+
* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
|
|
3277
|
+
* are the same as "stand-alone" units, but are different in some languages.
|
|
3278
|
+
* "Formatting" units are declined according to the rules of the language
|
|
3279
|
+
* in the context of a date. "Stand-alone" units are always nominative singular.
|
|
3280
|
+
* In `format` function, they will produce different result:
|
|
3281
|
+
*
|
|
3282
|
+
* `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
|
|
3283
|
+
*
|
|
3284
|
+
* `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
|
|
3285
|
+
*
|
|
3286
|
+
* `parse` will try to match both formatting and stand-alone units interchangeably.
|
|
3287
|
+
*
|
|
3288
|
+
* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
|
|
3289
|
+
* the single quote characters (see below).
|
|
3290
|
+
* If the sequence is longer than listed in table:
|
|
3291
|
+
* - for numerical units (`yyyyyyyy`) `parse` will try to match a number
|
|
3292
|
+
* as wide as the sequence
|
|
3293
|
+
* - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.
|
|
3294
|
+
* These variations are marked with "2" in the last column of the table.
|
|
3295
|
+
*
|
|
3296
|
+
* 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
|
|
3297
|
+
* These tokens represent the shortest form of the quarter.
|
|
3298
|
+
*
|
|
3299
|
+
* 4. The main difference between `y` and `u` patterns are B.C. years:
|
|
3300
|
+
*
|
|
3301
|
+
* | Year | `y` | `u` |
|
|
3302
|
+
* |------|-----|-----|
|
|
3303
|
+
* | AC 1 | 1 | 1 |
|
|
3304
|
+
* | BC 1 | 1 | 0 |
|
|
3305
|
+
* | BC 2 | 2 | -1 |
|
|
3306
|
+
*
|
|
3307
|
+
* Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:
|
|
3308
|
+
*
|
|
3309
|
+
* `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`
|
|
3310
|
+
*
|
|
3311
|
+
* `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`
|
|
3312
|
+
*
|
|
3313
|
+
* while `uu` will just assign the year as is:
|
|
3314
|
+
*
|
|
3315
|
+
* `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`
|
|
3316
|
+
*
|
|
3317
|
+
* `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`
|
|
3318
|
+
*
|
|
3319
|
+
* The same difference is true for local and ISO week-numbering years (`Y` and `R`),
|
|
3320
|
+
* except local week-numbering years are dependent on `options.weekStartsOn`
|
|
3321
|
+
* and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)
|
|
3322
|
+
* and [setWeekYear](https://date-fns.org/docs/setWeekYear)).
|
|
3323
|
+
*
|
|
3324
|
+
* 5. These patterns are not in the Unicode Technical Standard #35:
|
|
3325
|
+
* - `i`: ISO day of week
|
|
3326
|
+
* - `I`: ISO week of year
|
|
3327
|
+
* - `R`: ISO week-numbering year
|
|
3328
|
+
* - `o`: ordinal number modifier
|
|
3329
|
+
* - `P`: long localized date
|
|
3330
|
+
* - `p`: long localized time
|
|
3331
|
+
*
|
|
3332
|
+
* 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
|
|
3333
|
+
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
3334
|
+
*
|
|
3335
|
+
* 7. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
|
|
3336
|
+
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
3337
|
+
*
|
|
3338
|
+
* 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based
|
|
3339
|
+
* on the given locale.
|
|
3340
|
+
*
|
|
3341
|
+
* using `en-US` locale: `P` => `MM/dd/yyyy`
|
|
3342
|
+
* using `en-US` locale: `p` => `hh:mm a`
|
|
3343
|
+
* using `pt-BR` locale: `P` => `dd/MM/yyyy`
|
|
3344
|
+
* using `pt-BR` locale: `p` => `HH:mm`
|
|
3345
|
+
*
|
|
3346
|
+
* Values will be assigned to the date in the descending order of its unit's priority.
|
|
3347
|
+
* Units of an equal priority overwrite each other in the order of appearance.
|
|
3348
|
+
*
|
|
3349
|
+
* If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),
|
|
3350
|
+
* the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.
|
|
3351
|
+
*
|
|
3352
|
+
* `referenceDate` must be passed for correct work of the function.
|
|
3353
|
+
* If you're not sure which `referenceDate` to supply, create a new instance of Date:
|
|
3354
|
+
* `parse('02/11/2014', 'MM/dd/yyyy', new Date())`
|
|
3355
|
+
* In this case parsing will be done in the context of the current date.
|
|
3356
|
+
* If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,
|
|
3357
|
+
* then `Invalid Date` will be returned.
|
|
3358
|
+
*
|
|
3359
|
+
* The result may vary by locale.
|
|
3360
|
+
*
|
|
3361
|
+
* If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.
|
|
3362
|
+
*
|
|
3363
|
+
* If parsing failed, `Invalid Date` will be returned.
|
|
3364
|
+
* Invalid Date is a Date, whose time value is NaN.
|
|
3365
|
+
* Time value of Date: http://es5.github.io/#x15.9.1.1
|
|
3366
|
+
*
|
|
3367
|
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
3368
|
+
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
3369
|
+
*
|
|
3370
|
+
* @param dateStr - The string to parse
|
|
3371
|
+
* @param formatStr - The string of tokens
|
|
3372
|
+
* @param referenceDate - defines values missing from the parsed dateString
|
|
3373
|
+
* @param options - An object with options.
|
|
3374
|
+
* see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
3375
|
+
* see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
3376
|
+
*
|
|
3377
|
+
* @returns The parsed date
|
|
3378
|
+
*
|
|
3379
|
+
* @throws `options.locale` must contain `match` property
|
|
3380
|
+
* @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
3381
|
+
* @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
3382
|
+
* @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
3383
|
+
* @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
3384
|
+
* @throws format string contains an unescaped latin alphabet character
|
|
3385
|
+
*
|
|
3386
|
+
* @example
|
|
3387
|
+
* // Parse 11 February 2014 from middle-endian format:
|
|
3388
|
+
* var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())
|
|
3389
|
+
* //=> Tue Feb 11 2014 00:00:00
|
|
3390
|
+
*
|
|
3391
|
+
* @example
|
|
3392
|
+
* // Parse 28th of February in Esperanto locale in the context of 2010 year:
|
|
3393
|
+
* import eo from 'date-fns/locale/eo'
|
|
3394
|
+
* var result = parse('28-a de februaro', "do 'de' MMMM", new Date(2010, 0, 1), {
|
|
3395
|
+
* locale: eo
|
|
3396
|
+
* })
|
|
3397
|
+
* //=> Sun Feb 28 2010 00:00:00
|
|
3398
|
+
*/
|
|
3399
|
+
function parse(dateStr, formatStr, referenceDate, options) {
|
|
3400
|
+
const invalidDate = () =>
|
|
3401
|
+
(0, _index4.constructFrom)(options?.in || referenceDate, NaN);
|
|
3402
|
+
const defaultOptions = (0, _index5.getDefaultOptions)();
|
|
3403
|
+
const locale =
|
|
3404
|
+
options?.locale ?? defaultOptions.locale ?? _index.defaultLocale;
|
|
3405
|
+
|
|
3406
|
+
const firstWeekContainsDate =
|
|
3407
|
+
options?.firstWeekContainsDate ??
|
|
3408
|
+
options?.locale?.options?.firstWeekContainsDate ??
|
|
3409
|
+
defaultOptions.firstWeekContainsDate ??
|
|
3410
|
+
defaultOptions.locale?.options?.firstWeekContainsDate ??
|
|
3411
|
+
1;
|
|
3412
|
+
|
|
3413
|
+
const weekStartsOn =
|
|
3414
|
+
options?.weekStartsOn ??
|
|
3415
|
+
options?.locale?.options?.weekStartsOn ??
|
|
3416
|
+
defaultOptions.weekStartsOn ??
|
|
3417
|
+
defaultOptions.locale?.options?.weekStartsOn ??
|
|
3418
|
+
0;
|
|
3419
|
+
|
|
3420
|
+
if (!formatStr)
|
|
3421
|
+
return dateStr
|
|
3422
|
+
? invalidDate()
|
|
3423
|
+
: (0, _index6.toDate)(referenceDate, options?.in);
|
|
3424
|
+
|
|
3425
|
+
const subFnOptions = {
|
|
3426
|
+
firstWeekContainsDate,
|
|
3427
|
+
weekStartsOn,
|
|
3428
|
+
locale,
|
|
3429
|
+
};
|
|
3430
|
+
|
|
3431
|
+
// If timezone isn't specified, it will try to use the context or
|
|
3432
|
+
// the reference date and fallback to the system time zone.
|
|
3433
|
+
const setters = [new _Setter.DateTimezoneSetter(options?.in, referenceDate)];
|
|
3434
|
+
|
|
3435
|
+
const tokens = formatStr
|
|
3436
|
+
.match(longFormattingTokensRegExp)
|
|
3437
|
+
.map((substring) => {
|
|
3438
|
+
const firstCharacter = substring[0];
|
|
3439
|
+
if (firstCharacter in _index2.longFormatters) {
|
|
3440
|
+
const longFormatter = _index2.longFormatters[firstCharacter];
|
|
3441
|
+
return longFormatter(substring, locale.formatLong);
|
|
3442
|
+
}
|
|
3443
|
+
return substring;
|
|
3444
|
+
})
|
|
3445
|
+
.join("")
|
|
3446
|
+
.match(formattingTokensRegExp);
|
|
3447
|
+
|
|
3448
|
+
const usedTokens = [];
|
|
3449
|
+
|
|
3450
|
+
for (let token of tokens) {
|
|
3451
|
+
if (
|
|
3452
|
+
!options?.useAdditionalWeekYearTokens &&
|
|
3453
|
+
(0, _index3.isProtectedWeekYearToken)(token)
|
|
3454
|
+
) {
|
|
3455
|
+
(0, _index3.warnOrThrowProtectedError)(token, formatStr, dateStr);
|
|
3456
|
+
}
|
|
3457
|
+
if (
|
|
3458
|
+
!options?.useAdditionalDayOfYearTokens &&
|
|
3459
|
+
(0, _index3.isProtectedDayOfYearToken)(token)
|
|
3460
|
+
) {
|
|
3461
|
+
(0, _index3.warnOrThrowProtectedError)(token, formatStr, dateStr);
|
|
3462
|
+
}
|
|
3463
|
+
|
|
3464
|
+
const firstCharacter = token[0];
|
|
3465
|
+
const parser = _index7.parsers[firstCharacter];
|
|
3466
|
+
if (parser) {
|
|
3467
|
+
const { incompatibleTokens } = parser;
|
|
3468
|
+
if (Array.isArray(incompatibleTokens)) {
|
|
3469
|
+
const incompatibleToken = usedTokens.find(
|
|
3470
|
+
(usedToken) =>
|
|
3471
|
+
incompatibleTokens.includes(usedToken.token) ||
|
|
3472
|
+
usedToken.token === firstCharacter,
|
|
3473
|
+
);
|
|
3474
|
+
if (incompatibleToken) {
|
|
3475
|
+
throw new RangeError(
|
|
3476
|
+
`The format string mustn't contain \`${incompatibleToken.fullToken}\` and \`${token}\` at the same time`,
|
|
3477
|
+
);
|
|
3478
|
+
}
|
|
3479
|
+
} else if (parser.incompatibleTokens === "*" && usedTokens.length > 0) {
|
|
3480
|
+
throw new RangeError(
|
|
3481
|
+
`The format string mustn't contain \`${token}\` and any other token at the same time`,
|
|
3482
|
+
);
|
|
3483
|
+
}
|
|
3484
|
+
|
|
3485
|
+
usedTokens.push({ token: firstCharacter, fullToken: token });
|
|
3486
|
+
|
|
3487
|
+
const parseResult = parser.run(
|
|
3488
|
+
dateStr,
|
|
3489
|
+
token,
|
|
3490
|
+
locale.match,
|
|
3491
|
+
subFnOptions,
|
|
3492
|
+
);
|
|
3493
|
+
|
|
3494
|
+
if (!parseResult) {
|
|
3495
|
+
return invalidDate();
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
setters.push(parseResult.setter);
|
|
3499
|
+
|
|
3500
|
+
dateStr = parseResult.rest;
|
|
3501
|
+
} else {
|
|
3502
|
+
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
|
3503
|
+
throw new RangeError(
|
|
3504
|
+
"Format string contains an unescaped latin alphabet character `" +
|
|
3505
|
+
firstCharacter +
|
|
3506
|
+
"`",
|
|
3507
|
+
);
|
|
3508
|
+
}
|
|
3509
|
+
|
|
3510
|
+
// Replace two single quote characters with one single quote character
|
|
3511
|
+
if (token === "''") {
|
|
3512
|
+
token = "'";
|
|
3513
|
+
} else if (firstCharacter === "'") {
|
|
3514
|
+
token = cleanEscapedString(token);
|
|
3515
|
+
}
|
|
3516
|
+
|
|
3517
|
+
// Cut token from string, or, if string doesn't match the token, return Invalid Date
|
|
3518
|
+
if (dateStr.indexOf(token) === 0) {
|
|
3519
|
+
dateStr = dateStr.slice(token.length);
|
|
3520
|
+
} else {
|
|
3521
|
+
return invalidDate();
|
|
3522
|
+
}
|
|
3523
|
+
}
|
|
3524
|
+
}
|
|
3525
|
+
|
|
3526
|
+
// Check if the remaining input contains something other than whitespace
|
|
3527
|
+
if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {
|
|
3528
|
+
return invalidDate();
|
|
3529
|
+
}
|
|
3530
|
+
|
|
3531
|
+
const uniquePrioritySetters = setters
|
|
3532
|
+
.map((setter) => setter.priority)
|
|
3533
|
+
.sort((a, b) => b - a)
|
|
3534
|
+
.filter((priority, index, array) => array.indexOf(priority) === index)
|
|
3535
|
+
.map((priority) =>
|
|
3536
|
+
setters
|
|
3537
|
+
.filter((setter) => setter.priority === priority)
|
|
3538
|
+
.sort((a, b) => b.subPriority - a.subPriority),
|
|
3539
|
+
)
|
|
3540
|
+
.map((setterArray) => setterArray[0]);
|
|
3541
|
+
|
|
3542
|
+
let date = (0, _index6.toDate)(referenceDate, options?.in);
|
|
3543
|
+
|
|
3544
|
+
if (isNaN(+date)) return invalidDate();
|
|
3545
|
+
|
|
3546
|
+
const flags = {};
|
|
3547
|
+
for (const setter of uniquePrioritySetters) {
|
|
3548
|
+
if (!setter.validate(date, subFnOptions)) {
|
|
3549
|
+
return invalidDate();
|
|
3550
|
+
}
|
|
3551
|
+
|
|
3552
|
+
const result = setter.set(date, flags, subFnOptions);
|
|
3553
|
+
// Result is tuple (date, flags)
|
|
3554
|
+
if (Array.isArray(result)) {
|
|
3555
|
+
date = result[0];
|
|
3556
|
+
Object.assign(flags, result[1]);
|
|
3557
|
+
// Result is date
|
|
3558
|
+
} else {
|
|
3559
|
+
date = result;
|
|
3560
|
+
}
|
|
3561
|
+
}
|
|
3562
|
+
|
|
3563
|
+
return date;
|
|
3564
|
+
}
|
|
3565
|
+
|
|
3566
|
+
function cleanEscapedString(input) {
|
|
3567
|
+
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
|
|
3568
|
+
}
|
|
3569
|
+
} (parse));
|
|
3570
|
+
return parse;
|
|
3571
|
+
}
|
|
3572
|
+
|
|
3573
|
+
var parseExports = /*@__PURE__*/ requireParse();
|
|
3574
|
+
|
|
3575
|
+
var set = {};
|
|
3576
|
+
|
|
3577
|
+
var hasRequiredSet;
|
|
3578
|
+
|
|
3579
|
+
function requireSet () {
|
|
3580
|
+
if (hasRequiredSet) return set;
|
|
3581
|
+
hasRequiredSet = 1;
|
|
3582
|
+
set.set = set$1;
|
|
3583
|
+
var _index = /*@__PURE__*/ requireConstructFrom();
|
|
3584
|
+
var _index2 = /*@__PURE__*/ requireSetMonth();
|
|
3585
|
+
var _index3 = /*@__PURE__*/ requireToDate();
|
|
3586
|
+
|
|
3587
|
+
/**
|
|
3588
|
+
* The {@link set} function options.
|
|
3589
|
+
*/
|
|
3590
|
+
|
|
3591
|
+
/**
|
|
3592
|
+
* @name set
|
|
3593
|
+
* @category Common Helpers
|
|
3594
|
+
* @summary Set date values to a given date.
|
|
3595
|
+
*
|
|
3596
|
+
* @description
|
|
3597
|
+
* Set date values to a given date.
|
|
3598
|
+
*
|
|
3599
|
+
* Sets time values to date from object `values`.
|
|
3600
|
+
* A value is not set if it is undefined or null or doesn't exist in `values`.
|
|
3601
|
+
*
|
|
3602
|
+
* Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts
|
|
3603
|
+
* to use native `Date#setX` methods. If you use this function, you may not want to include the
|
|
3604
|
+
* other `setX` functions that date-fns provides if you are concerned about the bundle size.
|
|
3605
|
+
*
|
|
3606
|
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
3607
|
+
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
3608
|
+
*
|
|
3609
|
+
* @param date - The date to be changed
|
|
3610
|
+
* @param values - The date values to be set
|
|
3611
|
+
* @param options - The options
|
|
3612
|
+
*
|
|
3613
|
+
* @returns The new date with options set
|
|
3614
|
+
*
|
|
3615
|
+
* @example
|
|
3616
|
+
* // Transform 1 September 2014 into 20 October 2015 in a single line:
|
|
3617
|
+
* const result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 })
|
|
3618
|
+
* //=> Tue Oct 20 2015 00:00:00
|
|
3619
|
+
*
|
|
3620
|
+
* @example
|
|
3621
|
+
* // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00:
|
|
3622
|
+
* const result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 })
|
|
3623
|
+
* //=> Mon Sep 01 2014 12:23:45
|
|
3624
|
+
*/
|
|
3625
|
+
function set$1(date, values, options) {
|
|
3626
|
+
let _date = (0, _index3.toDate)(date, options?.in);
|
|
3627
|
+
|
|
3628
|
+
// Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
|
|
3629
|
+
if (isNaN(+_date)) return (0, _index.constructFrom)(options?.in || date, NaN);
|
|
3630
|
+
|
|
3631
|
+
if (values.year != null) _date.setFullYear(values.year);
|
|
3632
|
+
if (values.month != null) _date = (0, _index2.setMonth)(_date, values.month);
|
|
3633
|
+
if (values.date != null) _date.setDate(values.date);
|
|
3634
|
+
if (values.hours != null) _date.setHours(values.hours);
|
|
3635
|
+
if (values.minutes != null) _date.setMinutes(values.minutes);
|
|
3636
|
+
if (values.seconds != null) _date.setSeconds(values.seconds);
|
|
3637
|
+
if (values.milliseconds != null) _date.setMilliseconds(values.milliseconds);
|
|
3638
|
+
|
|
3639
|
+
return _date;
|
|
3640
|
+
}
|
|
3641
|
+
return set;
|
|
3642
|
+
}
|
|
3643
|
+
|
|
3644
|
+
var setExports = /*@__PURE__*/ requireSet();
|
|
3645
|
+
|
|
3646
|
+
var toDateExports = /*@__PURE__*/ requireToDate();
|
|
3647
|
+
|
|
3648
|
+
const SSR_MOMENT_ATTRIBUTE = 'data-br-ssr-moment';
|
|
3649
|
+
function serializeLocalDate(date) {
|
|
3650
|
+
return [
|
|
3651
|
+
date.getFullYear(),
|
|
3652
|
+
date.getMonth(),
|
|
3653
|
+
date.getDate(),
|
|
3654
|
+
date.getHours(),
|
|
3655
|
+
date.getMinutes(),
|
|
3656
|
+
date.getSeconds(),
|
|
3657
|
+
date.getMilliseconds(),
|
|
3658
|
+
].join('-');
|
|
3659
|
+
}
|
|
3660
|
+
function parseLocalDate(value) {
|
|
3661
|
+
const parts = value.split('-').map(Number);
|
|
3662
|
+
if (parts.length !== 7 || parts.some((part) => !Number.isFinite(part)))
|
|
3663
|
+
return null;
|
|
3664
|
+
const [year, month, day, hours, minutes, seconds, milliseconds] = parts;
|
|
3665
|
+
const date = new Date(year, month, day, hours, minutes, seconds, milliseconds);
|
|
3666
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
3667
|
+
}
|
|
3668
|
+
/** Mantém defaults baseados no relógio idênticos entre SSR e hidratação. */
|
|
3669
|
+
function resolveSsrLocalDate(host, fallback) {
|
|
3670
|
+
const hydrated = parseLocalDate(host.getAttribute(SSR_MOMENT_ATTRIBUTE) ?? '');
|
|
3671
|
+
if (hydrated)
|
|
3672
|
+
return hydrated;
|
|
3673
|
+
if (!Number.isNaN(fallback.getTime()))
|
|
3674
|
+
host.setAttribute(SSR_MOMENT_ATTRIBUTE, serializeLocalDate(fallback));
|
|
3675
|
+
return fallback;
|
|
3676
|
+
}
|
|
3677
|
+
|
|
3678
|
+
function warnInvalidPropValue(componentTag, propName, receivedValue, defaultValue) {
|
|
3679
|
+
console.warn(`[${componentTag}]: valor invalido para "${propName}": "${String(receivedValue)}". Usando valor padrao "${defaultValue}".`);
|
|
3680
|
+
}
|
|
3681
|
+
|
|
3682
|
+
var isValidExports = /*@__PURE__*/ requireIsValid();
|
|
3683
|
+
|
|
3684
|
+
export { resolveSsrLocalDate as a, isSameDayExports as b, eachDayOfIntervalExports as e, isValidExports as i, parseExports as p, requireParse as r, setExports as s, toDateExports as t, warnInvalidPropValue as w };
|