@nextcloud/vue 9.8.2 → 9.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +95 -60
- package/README.md +21 -0
- package/dist/assets/{NcActionButton-DLer-aUY.css → NcActionButton.css} +1 -0
- package/dist/assets/{NcActionCheckbox-wD8m_a8-.css → NcActionCheckbox.css} +1 -0
- package/dist/assets/{NcActionInput-t9WvlgV0.css → NcActionInput.css} +70 -66
- package/dist/assets/{NcActionLink-b4Ph5q10.css → NcActionLink.css} +1 -0
- package/dist/assets/{NcActionRadio-D2rLM1ci.css → NcActionRadio.css} +1 -0
- package/dist/assets/{NcActionRouter-BWXfCfxM.css → NcActionRouter.css} +1 -0
- package/dist/assets/{NcActionText-Dzegj6AY.css → NcActionText.css} +1 -0
- package/dist/assets/{NcActionTextEditable-BlZeHZ7J.css → NcActionTextEditable.css} +67 -65
- package/dist/assets/{NcActions-DOI7rRa0.css → NcActions.css} +14 -11
- package/dist/assets/{NcAppContent-BC7DBer3.css → NcAppContent.css} +20 -20
- package/dist/assets/{NcAppNavigation-2b1jxOXM.css → NcAppNavigation.css} +17 -17
- package/dist/assets/{NcAppNavigationItem-BsuZoJAq.css → NcAppNavigationItem.css} +53 -49
- package/dist/assets/NcAppNavigationList.css +52 -0
- package/dist/assets/{NcAppNavigationNewItem-MaYQVcKF.css → NcAppNavigationNewItem.css} +4 -0
- package/dist/assets/{NcAppNavigationSettings-B4ZZe32B.css → NcAppNavigationSettings.css} +6 -6
- package/dist/assets/{NcAppSettingsDialog-BPOsEn6K.css → NcAppSettingsDialog.css} +31 -31
- package/dist/assets/{NcAppSettingsShortcutsSection-ABRbmy1I.css → NcAppSettingsShortcutsSection.css} +1 -1
- package/dist/assets/{NcAppSidebar-TcyGhk0L.css → NcAppSidebar.css} +67 -67
- package/dist/assets/{NcAssistantButton-CeNrbdrG.css → NcAssistantButton.css} +9 -9
- package/dist/assets/{NcAssistantContent-DI-vub5j.css → NcAssistantContent.css} +3 -3
- package/dist/assets/{NcAssistantIcon-DyenP95c.css → NcAssistantIcon.css} +4 -4
- package/dist/assets/{NcAvatar-Bs7qEhkA.css → NcAvatar.css} +39 -24
- package/dist/assets/{NcBlurHash-CloqLmG2.css → NcBlurHash.css} +2 -2
- package/dist/assets/{NcBreadcrumbs-5gl8Syfa.css → NcBreadcrumbs.css} +6 -6
- package/dist/assets/{NcButton-Bf9wuDV-.css → NcButton.css} +52 -50
- package/dist/assets/{NcCheckboxRadioSwitch-BlQSZVW0.css → NcCheckboxRadioSwitch.css} +36 -36
- package/dist/assets/{NcDateTimePicker-HT1ZTE-Z.css → NcDateTimePicker.css} +235 -235
- package/dist/assets/NcDateTimePickerNative.css +38 -0
- package/dist/assets/{NcEllipsisedOption-CPWbbgBy.css → NcEllipsisedOption.css} +10 -5
- package/dist/assets/{NcFilePicker-CGYCxNdK.css → NcFilePicker.css} +1 -1
- package/dist/assets/{NcFormBox-D_5h4Op_.css → NcFormBox.css} +11 -11
- package/dist/assets/{NcFormBoxButton-DZ9GqF8V.css → NcFormBoxButton.css} +2 -2
- package/dist/assets/{NcFormBoxItem-syU6X_5H.css → NcFormBoxItem.css} +19 -15
- package/dist/assets/{NcFormBoxSwitch-D-GBFFaK.css → NcFormBoxSwitch.css} +2 -2
- package/dist/assets/{NcFormGroup-C9rXaPCl.css → NcFormGroup.css} +7 -7
- package/dist/assets/{NcGuestContent-j8ai4O1K.css → NcGuestContent.css} +3 -3
- package/dist/assets/{NcHeaderMenu-Hy0UKyUu.css → NcHeaderMenu.css} +22 -24
- package/dist/assets/{NcHotkey-0gFtnVYv.css → NcHotkey.css} +8 -8
- package/dist/assets/{NcHotkeyList-DqyUQBw6.css → NcHotkeyList.css} +2 -2
- package/dist/assets/{NcIconToggleSwitch-BrjPjGQL.css → NcIconToggleSwitch.css} +4 -4
- package/dist/assets/{NcInputConfirmCancel-BEmwC87z.css → NcInputConfirmCancel.css} +8 -8
- package/dist/assets/{NcInputField-DpyFJ1xw.css → NcInputField.css} +43 -43
- package/dist/assets/{NcKbd-B2M-oGN9.css → NcKbd.css} +3 -3
- package/dist/assets/{NcListItem-1uR7AJIf.css → NcListItem.css} +58 -58
- package/dist/assets/{NcMentionBubble-ptHUq68a.css → NcMentionBubble.css} +9 -9
- package/dist/assets/NcPopover.css +108 -0
- package/dist/assets/NcProfileHoverCard.css +340 -0
- package/dist/assets/{NcProgressBar-B6wveIA1.css → NcProgressBar.css} +14 -14
- package/dist/assets/{NcRadioGroup-CqQ5ahHP.css → NcRadioGroup.css} +2 -2
- package/dist/assets/{NcRadioGroupButton-B1d2yRTk.css → NcRadioGroupButton.css} +19 -14
- package/dist/assets/NcReferenceWidget.css +150 -0
- package/dist/assets/{NcRelatedResourcesPanel-CiG_Ixb6.css → NcRelatedResourcesPanel.css} +24 -24
- package/dist/assets/{NcRichContenteditable-BggdwT5n.css → NcRichContenteditable.css} +37 -37
- package/dist/assets/{NcRichText-BTu-LT3p.css → NcRichText.css} +93 -93
- package/dist/assets/NcSelect.css +372 -0
- package/dist/assets/NcSelectUsers.css +12 -0
- package/dist/assets/{autolink-DH5K5u8D.css → autolink.css} +3 -3
- package/dist/assets/{referencePickerModal-Dod7nzta.css → referencePickerModal.css} +37 -151
- package/dist/chunks/{ArrowRight-B1ncAhus.mjs → ArrowRight.mjs} +2 -2
- package/dist/chunks/ArrowRight.mjs.map +1 -0
- package/dist/chunks/{ChevronDown-C6gc637b.mjs → ChevronDown.mjs} +2 -2
- package/dist/chunks/ChevronDown.mjs.map +1 -0
- package/dist/chunks/{ChevronUp-ChH8oB7p.mjs → ChevronUp.mjs} +2 -2
- package/dist/chunks/ChevronUp.mjs.map +1 -0
- package/dist/chunks/{Close-CuhcJnX2.mjs → Close.mjs} +2 -2
- package/dist/chunks/Close.mjs.map +1 -0
- package/dist/chunks/{NcActionButton-BO5T5ePT.mjs → NcActionButton.mjs} +7 -7
- package/dist/chunks/NcActionButton.mjs.map +1 -0
- package/dist/chunks/{NcActionButtonGroup-B9LfyE-G.mjs → NcActionButtonGroup.mjs} +6 -6
- package/dist/chunks/NcActionButtonGroup.mjs.map +1 -0
- package/dist/chunks/{NcActionCaption-f7L9gBlT.mjs → NcActionCaption.mjs} +4 -4
- package/dist/chunks/NcActionCaption.mjs.map +1 -0
- package/dist/chunks/{NcActionCheckbox-DBqiK-AZ.mjs → NcActionCheckbox.mjs} +8 -8
- package/dist/chunks/NcActionCheckbox.mjs.map +1 -0
- package/dist/chunks/{NcActionInput-BO0lB4VP.mjs → NcActionInput.mjs} +13 -12
- package/dist/chunks/NcActionInput.mjs.map +1 -0
- package/dist/chunks/{NcActionLink-BFiaYt9A.mjs → NcActionLink.mjs} +5 -5
- package/dist/chunks/NcActionLink.mjs.map +1 -0
- package/dist/chunks/{NcActionRadio-BA08CAtA.mjs → NcActionRadio.mjs} +8 -8
- package/dist/chunks/NcActionRadio.mjs.map +1 -0
- package/dist/chunks/{NcActionRouter-vYFtIOzD.mjs → NcActionRouter.mjs} +5 -5
- package/dist/chunks/NcActionRouter.mjs.map +1 -0
- package/dist/chunks/{NcActionSeparator-B9pNQaji.mjs → NcActionSeparator.mjs} +3 -3
- package/dist/chunks/NcActionSeparator.mjs.map +1 -0
- package/dist/chunks/{NcActionText-CQ9qwJ0p.mjs → NcActionText.mjs} +5 -5
- package/dist/chunks/NcActionText.mjs.map +1 -0
- package/dist/chunks/{NcActionTextEditable-B8y_GEre.mjs → NcActionTextEditable.mjs} +8 -8
- package/dist/chunks/NcActionTextEditable.mjs.map +1 -0
- package/dist/chunks/{NcActions-DY4GGONi.mjs → NcActions.mjs} +28 -13
- package/dist/chunks/NcActions.mjs.map +1 -0
- package/dist/chunks/{NcAppContent--92JdjRr.mjs → NcAppContent.mjs} +12 -12
- package/dist/chunks/NcAppContent.mjs.map +1 -0
- package/dist/chunks/{NcAppContentDetails.vue_vue_type_script_setup_true_lang-BWl5Pw5g.mjs → NcAppContentDetails.vue_vue_type_script_setup_true_lang.mjs} +1 -1
- package/dist/chunks/NcAppContentDetails.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/chunks/{NcAppContentList-Copx3Ver.mjs → NcAppContentList.mjs} +2 -2
- package/dist/chunks/NcAppContentList.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigation-Bb9-C2eO.mjs → NcAppNavigation.mjs} +20 -18
- package/dist/chunks/NcAppNavigation.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationCaption-BptTnvQU.mjs → NcAppNavigationCaption.mjs} +4 -4
- package/dist/chunks/NcAppNavigationCaption.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationIconBullet-BmU-dPcY.mjs → NcAppNavigationIconBullet.mjs} +3 -3
- package/dist/chunks/NcAppNavigationIconBullet.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationItem-B0-60shw.mjs → NcAppNavigationItem.mjs} +58 -29
- package/dist/chunks/NcAppNavigationItem.mjs.map +1 -0
- package/dist/chunks/NcAppNavigationList.mjs +147 -0
- package/dist/chunks/NcAppNavigationList.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationNew-Dspn3-4i.mjs → NcAppNavigationNew.mjs} +4 -4
- package/dist/chunks/NcAppNavigationNew.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationNewItem-Cg8IJ6ZV.mjs → NcAppNavigationNewItem.mjs} +5 -5
- package/dist/chunks/NcAppNavigationNewItem.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationSearch-CiOKjV3M.mjs → NcAppNavigationSearch.mjs} +7 -7
- package/dist/chunks/NcAppNavigationSearch.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationSettings-1BzAhIDg.mjs → NcAppNavigationSettings.mjs} +16 -16
- package/dist/chunks/NcAppNavigationSettings.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationSpacer-CIRC4ZEj.mjs → NcAppNavigationSpacer.mjs} +3 -3
- package/dist/chunks/NcAppNavigationSpacer.mjs.map +1 -0
- package/dist/chunks/{NcAppSettingsDialog-BgZCuMK0.mjs → NcAppSettingsDialog.mjs} +14 -14
- package/dist/chunks/NcAppSettingsDialog.mjs.map +1 -0
- package/dist/chunks/{NcAppSettingsSection-BosSmisT.mjs → NcAppSettingsSection.mjs} +5 -5
- package/dist/chunks/NcAppSettingsSection.mjs.map +1 -0
- package/dist/chunks/{NcAppSettingsShortcutsSection-og6gyYxr.mjs → NcAppSettingsShortcutsSection.mjs} +7 -7
- package/dist/chunks/NcAppSettingsShortcutsSection.mjs.map +1 -0
- package/dist/chunks/{NcAppSidebar-DX26aRNB.mjs → NcAppSidebar.mjs} +26 -26
- package/dist/chunks/NcAppSidebar.mjs.map +1 -0
- package/dist/chunks/{NcAppSidebarHeader.vue_vue_type_script_setup_true_lang-C-QhdyiN.mjs → NcAppSidebarHeader.vue_vue_type_script_setup_true_lang.mjs} +1 -1
- package/dist/chunks/NcAppSidebarHeader.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/chunks/{NcAppSidebarTab-DOSDDbGA.mjs → NcAppSidebarTab.mjs} +3 -3
- package/dist/chunks/NcAppSidebarTab.mjs.map +1 -0
- package/dist/chunks/{NcAssistantButton-BMuKy6Mh.mjs → NcAssistantButton.mjs} +14 -14
- package/dist/chunks/NcAssistantButton.mjs.map +1 -0
- package/dist/chunks/{NcAssistantContent-D24YPWRc.mjs → NcAssistantContent.mjs} +6 -6
- package/dist/chunks/NcAssistantContent.mjs.map +1 -0
- package/dist/chunks/{NcAssistantIcon-DW-HrfQg.mjs → NcAssistantIcon.mjs} +9 -9
- package/dist/chunks/NcAssistantIcon.mjs.map +1 -0
- package/dist/chunks/{NcAvatar-DX-Nk9Es.mjs → NcAvatar.mjs} +218 -83
- package/dist/chunks/NcAvatar.mjs.map +1 -0
- package/dist/chunks/{NcBlurHash-BGaeAt4-.mjs → NcBlurHash.mjs} +6 -6
- package/dist/chunks/NcBlurHash.mjs.map +1 -0
- package/dist/chunks/{NcBreadcrumb-DHvm77Vw.mjs → NcBreadcrumb.mjs} +6 -6
- package/dist/chunks/NcBreadcrumb.mjs.map +1 -0
- package/dist/chunks/{NcBreadcrumbs-B_uysWv6.mjs → NcBreadcrumbs.mjs} +9 -10
- package/dist/chunks/NcBreadcrumbs.mjs.map +1 -0
- package/dist/chunks/{NcButton-QbPBynlU.mjs → NcButton.mjs} +6 -6
- package/dist/chunks/NcButton.mjs.map +1 -0
- package/dist/chunks/{NcCheckboxRadioSwitch-BVTMQSAg.mjs → NcCheckboxRadioSwitch.mjs} +22 -12
- package/dist/chunks/NcCheckboxRadioSwitch.mjs.map +1 -0
- package/dist/chunks/{NcChip-BCtDxh7v.mjs → NcChip.mjs} +9 -9
- package/dist/chunks/NcChip.mjs.map +1 -0
- package/dist/chunks/{NcCollectionList-DNfWulkK.mjs → NcCollectionList.mjs} +12 -12
- package/dist/chunks/NcCollectionList.mjs.map +1 -0
- package/dist/chunks/{NcColorPicker-CGE4Kei4.mjs → NcColorPicker.mjs} +12 -12
- package/dist/chunks/NcColorPicker.mjs.map +1 -0
- package/dist/chunks/{NcContent-BhMoPROW.mjs → NcContent.mjs} +9 -9
- package/dist/chunks/NcContent.mjs.map +1 -0
- package/dist/chunks/{NcCounterBubble-CV0YMrXW.mjs → NcCounterBubble.mjs} +3 -3
- package/dist/chunks/NcCounterBubble.mjs.map +1 -0
- package/dist/chunks/{NcDashboardWidget-DKZ8Mgt0.mjs → NcDashboardWidget.mjs} +8 -8
- package/dist/chunks/NcDashboardWidget.mjs.map +1 -0
- package/dist/chunks/{NcDashboardWidgetItem-DxA6-V0R.mjs → NcDashboardWidgetItem.mjs} +6 -6
- package/dist/chunks/NcDashboardWidgetItem.mjs.map +1 -0
- package/dist/chunks/{NcDateTime.vue_vue_type_script_setup_true_lang-BJuPH7S7.mjs → NcDateTime.vue_vue_type_script_setup_true_lang.mjs} +1 -1
- package/dist/chunks/NcDateTime.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/chunks/NcDateTimePicker.mjs +2979 -0
- package/dist/chunks/NcDateTimePicker.mjs.map +1 -0
- package/dist/chunks/{NcDateTimePickerNative-BeM4WOA4.mjs → NcDateTimePickerNative.mjs} +21 -26
- package/dist/chunks/NcDateTimePickerNative.mjs.map +1 -0
- package/dist/chunks/{NcDialog-D1u-qo74.mjs → NcDialog.mjs} +6 -6
- package/dist/chunks/NcDialog.mjs.map +1 -0
- package/dist/chunks/{NcDialogButton.vue_vue_type_script_setup_true_lang-Cn-8O9iZ.mjs → NcDialogButton.vue_vue_type_script_setup_true_lang.mjs} +6 -6
- package/dist/chunks/NcDialogButton.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/chunks/{NcEllipsisedOption-D6Amb91K.mjs → NcEllipsisedOption.mjs} +5 -5
- package/dist/chunks/NcEllipsisedOption.mjs.map +1 -0
- package/dist/chunks/{NcEmojiPicker-R2GSAiCW.mjs → NcEmojiPicker.mjs} +12 -12
- package/dist/chunks/NcEmojiPicker.mjs.map +1 -0
- package/dist/chunks/{NcEmptyContent-CGAPqk4S.mjs → NcEmptyContent.mjs} +4 -4
- package/dist/chunks/NcEmptyContent.mjs.map +1 -0
- package/dist/chunks/{NcFilePicker-C7Xs8E2Q.mjs → NcFilePicker.mjs} +9 -9
- package/dist/chunks/NcFilePicker.mjs.map +1 -0
- package/dist/chunks/{NcFormBox-3Ql2JSK8.mjs → NcFormBox.mjs} +9 -9
- package/dist/chunks/NcFormBox.mjs.map +1 -0
- package/dist/chunks/{NcFormBoxButton-DIKZK9kp.mjs → NcFormBoxButton.mjs} +8 -8
- package/dist/chunks/NcFormBoxButton.mjs.map +1 -0
- package/dist/chunks/{NcFormBoxCopyButton.vue_vue_type_script_setup_true_lang-BVCoU7LB.mjs → NcFormBoxCopyButton.vue_vue_type_script_setup_true_lang.mjs} +4 -4
- package/dist/chunks/NcFormBoxCopyButton.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/chunks/{NcFormBoxItem-CV8UrJib.mjs → NcFormBoxItem.mjs} +14 -14
- package/dist/chunks/NcFormBoxItem.mjs.map +1 -0
- package/dist/chunks/{NcFormBoxSwitch-C0hMaYEj.mjs → NcFormBoxSwitch.mjs} +8 -8
- package/dist/chunks/NcFormBoxSwitch.mjs.map +1 -0
- package/dist/chunks/{NcFormGroup-W-Wgps0q.mjs → NcFormGroup.mjs} +11 -11
- package/dist/chunks/NcFormGroup.mjs.map +1 -0
- package/dist/chunks/NcGuestContent.mjs +19 -0
- package/dist/chunks/NcGuestContent.mjs.map +1 -0
- package/dist/chunks/{NcHeaderButton-m4oAOSTa.mjs → NcHeaderButton.mjs} +5 -5
- package/dist/chunks/NcHeaderButton.mjs.map +1 -0
- package/dist/chunks/{NcHeaderMenu-DRxcyWNX.mjs → NcHeaderMenu.mjs} +14 -20
- package/dist/chunks/NcHeaderMenu.mjs.map +1 -0
- package/dist/chunks/{NcHighlight.vue_vue_type_script_lang-DnWQDM_2.mjs → NcHighlight.vue_vue_type_script_lang.mjs} +1 -1
- package/dist/chunks/NcHighlight.vue_vue_type_script_lang.mjs.map +1 -0
- package/dist/chunks/{NcHotkey-9HBkzRAt.mjs → NcHotkey.mjs} +8 -8
- package/dist/chunks/NcHotkey.mjs.map +1 -0
- package/dist/chunks/{NcHotkeyList-BWerT8qH.mjs → NcHotkeyList.mjs} +8 -8
- package/dist/chunks/NcHotkeyList.mjs.map +1 -0
- package/dist/chunks/{NcIconSvgWrapper-g8ubWhoz.mjs → NcIconSvgWrapper.mjs} +3 -3
- package/dist/chunks/NcIconSvgWrapper.mjs.map +1 -0
- package/dist/chunks/{NcIconToggleSwitch-CWzIC2ar.mjs → NcIconToggleSwitch.mjs} +6 -6
- package/dist/chunks/NcIconToggleSwitch.mjs.map +1 -0
- package/dist/chunks/{NcInputConfirmCancel-B6qC3s63.mjs → NcInputConfirmCancel.mjs} +13 -13
- package/dist/chunks/NcInputConfirmCancel.mjs.map +1 -0
- package/dist/chunks/{NcInputField-B1bGxYHt.mjs → NcInputField.mjs} +9 -9
- package/dist/chunks/NcInputField.mjs.map +1 -0
- package/dist/chunks/{NcKbd-DCsSL73F.mjs → NcKbd.mjs} +8 -8
- package/dist/chunks/NcKbd.mjs.map +1 -0
- package/dist/chunks/{NcListItem-DItks2Sq.mjs → NcListItem.mjs} +12 -12
- package/dist/chunks/NcListItem.mjs.map +1 -0
- package/dist/chunks/{NcListItemIcon-BKbbR_Vf.mjs → NcListItemIcon.mjs} +7 -7
- package/dist/chunks/NcListItemIcon.mjs.map +1 -0
- package/dist/chunks/{NcLoadingIcon-BOVpFVQz.mjs → NcLoadingIcon.mjs} +3 -3
- package/dist/chunks/NcLoadingIcon.mjs.map +1 -0
- package/dist/chunks/{NcMentionBubble.vue_vue_type_style_index_0_scoped_45238efd_lang-BX_KxRP-.mjs → NcMentionBubble.vue_vue_type_style_index_0_scoped_3c4a673d_lang.mjs} +2 -2
- package/dist/chunks/NcMentionBubble.vue_vue_type_style_index_0_scoped_3c4a673d_lang.mjs.map +1 -0
- package/dist/chunks/{NcModal-B-YLND3e.mjs → NcModal.mjs} +12 -12
- package/dist/chunks/NcModal.mjs.map +1 -0
- package/dist/chunks/{NcNoteCard-mI7qVZ9j.mjs → NcNoteCard.mjs} +6 -6
- package/dist/chunks/NcNoteCard.mjs.map +1 -0
- package/dist/chunks/{NcPasswordField-Be5_qcfm.mjs → NcPasswordField.mjs} +9 -9
- package/dist/chunks/NcPasswordField.mjs.map +1 -0
- package/dist/chunks/{NcPopover-CObDh89q.mjs → NcPopover.mjs} +9 -10
- package/dist/chunks/NcPopover.mjs.map +1 -0
- package/dist/chunks/NcProfileHoverCard.mjs +777 -0
- package/dist/chunks/NcProfileHoverCard.mjs.map +1 -0
- package/dist/chunks/{NcProgressBar-C-ane-Ni.mjs → NcProgressBar.mjs} +20 -10
- package/dist/chunks/NcProgressBar.mjs.map +1 -0
- package/dist/chunks/{NcRadioGroup-DYwRkXaY.mjs → NcRadioGroup.mjs} +8 -8
- package/dist/chunks/NcRadioGroup.mjs.map +1 -0
- package/dist/chunks/{NcRadioGroupButton-WKdAdfUy.mjs → NcRadioGroupButton.mjs} +12 -12
- package/dist/chunks/NcRadioGroupButton.mjs.map +1 -0
- package/dist/chunks/NcReferenceWidget.mjs +292 -0
- package/dist/chunks/NcReferenceWidget.mjs.map +1 -0
- package/dist/chunks/{NcRelatedResourcesPanel-Bk9l-BN3.mjs → NcRelatedResourcesPanel.mjs} +35 -19
- package/dist/chunks/NcRelatedResourcesPanel.mjs.map +1 -0
- package/dist/chunks/{NcRichContenteditable-BwGkxhDF.mjs → NcRichContenteditable.mjs} +50 -39
- package/dist/chunks/NcRichContenteditable.mjs.map +1 -0
- package/dist/chunks/{NcRichText-Dkk6iX8F.mjs → NcRichText.mjs} +44 -15
- package/dist/chunks/NcRichText.mjs.map +1 -0
- package/dist/chunks/{NcSavingIndicatorIcon.vue_vue_type_script_setup_true_lang-DbQnMYZm.mjs → NcSavingIndicatorIcon.vue_vue_type_script_setup_true_lang.mjs} +1 -1
- package/dist/chunks/NcSavingIndicatorIcon.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/chunks/{NcSelect-BOFzoCwK.mjs → NcSelect.mjs} +55 -29
- package/dist/chunks/NcSelect.mjs.map +1 -0
- package/dist/chunks/{NcSelectTags-D7qWNjXa.mjs → NcSelectTags.mjs} +6 -6
- package/dist/chunks/NcSelectTags.mjs.map +1 -0
- package/dist/chunks/{NcSelectUsers-0AajBWY6.mjs → NcSelectUsers.mjs} +6 -6
- package/dist/chunks/NcSelectUsers.mjs.map +1 -0
- package/dist/chunks/{NcSettingsSection-DmfxX2se.mjs → NcSettingsSection.mjs} +5 -5
- package/dist/chunks/NcSettingsSection.mjs.map +1 -0
- package/dist/chunks/{NcSettingsSelectGroup-TN64yH4k.mjs → NcSettingsSelectGroup.mjs} +7 -7
- package/dist/chunks/NcSettingsSelectGroup.mjs.map +1 -0
- package/dist/chunks/{NcTextArea-Dxzj4zdb.mjs → NcTextArea.mjs} +8 -8
- package/dist/chunks/NcTextArea.mjs.map +1 -0
- package/dist/chunks/{NcTextField.vue_vue_type_script_setup_true_lang-BQHjkK8r.mjs → NcTextField.vue_vue_type_script_setup_true_lang.mjs} +7 -7
- package/dist/chunks/NcTextField.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/chunks/{NcThemeProvider.vue_vue_type_script_setup_true_lang-wie70gn4.mjs → NcThemeProvider.vue_vue_type_script_setup_true_lang.mjs} +2 -2
- package/dist/chunks/NcThemeProvider.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/chunks/{NcTimezonePicker.vue_vue_type_script_setup_true_lang-Csd1JQe6.mjs → NcTimezonePicker.vue_vue_type_script_setup_true_lang.mjs} +5 -5
- package/dist/chunks/NcTimezonePicker.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/chunks/{NcUserBubble-BXBgGflZ.mjs → NcUserBubble.mjs} +5 -5
- package/dist/chunks/NcUserBubble.mjs.map +1 -0
- package/dist/chunks/{NcUserStatusIcon-DsviB2Cr.mjs → NcUserStatusIcon.mjs} +7 -7
- package/dist/chunks/NcUserStatusIcon.mjs.map +1 -0
- package/dist/chunks/{NcVNodes.vue_vue_type_script_lang-BqUHinRZ.mjs → NcVNodes.vue_vue_type_script_lang.mjs} +1 -1
- package/dist/chunks/NcVNodes.vue_vue_type_script_lang.mjs.map +1 -0
- package/dist/chunks/{_l10n-CG4CuN3H.mjs → _l10n.mjs} +106 -104
- package/dist/chunks/_l10n.mjs.map +1 -0
- package/dist/chunks/{_plugin-vue_export-helper-1tPrXgE0.mjs → _plugin-vue_export-helper.mjs} +1 -1
- package/dist/chunks/_plugin-vue_export-helper.mjs.map +1 -0
- package/dist/chunks/{actionGlobal-BZFdtdJL.mjs → actionGlobal.mjs} +1 -1
- package/dist/chunks/actionGlobal.mjs.map +1 -0
- package/dist/chunks/{actionText-BXR0sWNu.mjs → actionText.mjs} +3 -3
- package/dist/chunks/actionText.mjs.map +1 -0
- package/dist/chunks/{appName-DyNMVZpX.mjs → appName.mjs} +2 -2
- package/dist/chunks/appName.mjs.map +1 -0
- package/dist/chunks/{autolink-B2azbG18.mjs → autolink.mjs} +7 -7
- package/dist/chunks/autolink.mjs.map +1 -0
- package/dist/chunks/{colors-BDeMBgfq.mjs → colors.mjs} +3 -3
- package/dist/chunks/colors.mjs.map +1 -0
- package/dist/chunks/{constants-wIEKSp2G.mjs → constants.mjs} +1 -1
- package/dist/chunks/constants.mjs.map +1 -0
- package/dist/chunks/{constants-Ciwvl5xb.mjs → constants2.mjs} +1 -1
- package/dist/chunks/constants2.mjs.map +1 -0
- package/dist/chunks/{createElementId-DhjFt1I9.mjs → createElementId.mjs} +1 -1
- package/dist/chunks/createElementId.mjs.map +1 -0
- package/dist/chunks/{customPickerElements-Cu7bLbap.mjs → customPickerElements.mjs} +3 -60
- package/dist/chunks/customPickerElements.mjs.map +1 -0
- package/dist/chunks/{emoji-C8k9NUlo.mjs → emoji.mjs} +1 -1
- package/dist/chunks/emoji.mjs.map +1 -0
- package/dist/chunks/{focusTrap-HJQ4pqHV.mjs → focusTrap.mjs} +1 -1
- package/dist/chunks/focusTrap.mjs.map +1 -0
- package/dist/chunks/highlight.mjs +5 -0
- package/dist/chunks/highlight.mjs.map +1 -0
- package/dist/chunks/{legacy-BoqDmOCa.mjs → legacy.mjs} +4 -2
- package/dist/chunks/legacy.mjs.map +1 -0
- package/dist/chunks/{logger-D3RVzcfQ.mjs → logger.mjs} +1 -1
- package/dist/chunks/logger.mjs.map +1 -0
- package/dist/chunks/{mdi-CpchYUUV.mjs → mdi.mjs} +12 -14
- package/dist/chunks/mdi.mjs.map +1 -0
- package/dist/chunks/{platform-CC2ecGvV.mjs → platform.mjs} +1 -1
- package/dist/chunks/platform.mjs.map +1 -0
- package/dist/chunks/{referencePickerModal-CD1BjLPe.mjs → referencePickerModal.mjs} +140 -258
- package/dist/chunks/referencePickerModal.mjs.map +1 -0
- package/dist/chunks/{rtl-v0UOPAM7.mjs → rtl.mjs} +1 -1
- package/dist/chunks/rtl.mjs.map +1 -0
- package/dist/chunks/{useAppSettingsDialog-C73Wx6iQ.mjs → useAppSettingsDialog.mjs} +1 -1
- package/dist/chunks/useAppSettingsDialog.mjs.map +1 -0
- package/dist/chunks/{useCopy-PckLYUAU.mjs → useCopy.mjs} +4 -4
- package/dist/chunks/useCopy.mjs.map +1 -0
- package/dist/chunks/{useNcActions-BzPO2c4h.mjs → useNcActions.mjs} +1 -1
- package/dist/chunks/useNcActions.mjs.map +1 -0
- package/dist/chunks/{useNcFormBox-Djlh582y.mjs → useNcFormBox.mjs} +1 -1
- package/dist/chunks/useNcFormBox.mjs.map +1 -0
- package/dist/chunks/{useNcRadioGroup-D6llQmAl.mjs → useNcRadioGroup.mjs} +1 -1
- package/dist/chunks/useNcRadioGroup.mjs.map +1 -0
- package/dist/chunks/{useTrapStackControl-B6cEicto.mjs → useTrapStackControl.mjs} +2 -2
- package/dist/chunks/useTrapStackControl.mjs.map +1 -0
- package/dist/chunks/widgets.mjs +66 -0
- package/dist/chunks/widgets.mjs.map +1 -0
- package/dist/components/NcActionButton/index.mjs +1 -1
- package/dist/components/NcActionButtonGroup/index.mjs +1 -1
- package/dist/components/NcActionCaption/index.mjs +1 -1
- package/dist/components/NcActionCheckbox/index.mjs +1 -1
- package/dist/components/NcActionInput/NcActionInput.vue.d.ts +270 -99
- package/dist/components/NcActionInput/index.mjs +1 -1
- package/dist/components/NcActionLink/index.mjs +1 -1
- package/dist/components/NcActionRadio/index.mjs +1 -1
- package/dist/components/NcActionRouter/index.mjs +1 -1
- package/dist/components/NcActionSeparator/index.mjs +1 -1
- package/dist/components/NcActionText/index.mjs +1 -1
- package/dist/components/NcActionTextEditable/index.mjs +1 -1
- package/dist/components/NcActions/NcActions.vue.d.ts +17 -2
- package/dist/components/NcActions/index.mjs +1 -1
- package/dist/components/NcAppContent/index.mjs +1 -1
- package/dist/components/NcAppContentDetails/index.mjs +1 -1
- package/dist/components/NcAppContentList/index.mjs +1 -1
- package/dist/components/NcAppNavigation/index.mjs +1 -1
- package/dist/components/NcAppNavigationCaption/NcAppNavigationCaption.vue.d.ts +11 -2
- package/dist/components/NcAppNavigationCaption/index.mjs +1 -1
- package/dist/components/NcAppNavigationIconBullet/index.mjs +1 -1
- package/dist/components/NcAppNavigationItem/NcAppNavigationItem.vue.d.ts +20 -7
- package/dist/components/NcAppNavigationItem/NcInputConfirmCancel.vue.d.ts +1 -1
- package/dist/components/NcAppNavigationItem/index.mjs +1 -1
- package/dist/components/NcAppNavigationList/NcAppNavigationList.vue.d.ts +57 -1
- package/dist/components/NcAppNavigationList/highlight.d.ts +12 -0
- package/dist/components/NcAppNavigationList/index.mjs +1 -1
- package/dist/components/NcAppNavigationNew/index.mjs +1 -1
- package/dist/components/NcAppNavigationNewItem/NcAppNavigationNewItem.vue.d.ts +1 -1
- package/dist/components/NcAppNavigationNewItem/index.mjs +1 -1
- package/dist/components/NcAppNavigationSearch/NcAppNavigationSearch.vue.d.ts +16 -16
- package/dist/components/NcAppNavigationSearch/index.mjs +1 -1
- package/dist/components/NcAppNavigationSettings/index.mjs +1 -1
- package/dist/components/NcAppNavigationSpacer/index.mjs +1 -1
- package/dist/components/NcAppSettingsDialog/index.mjs +1 -1
- package/dist/components/NcAppSettingsSection/index.mjs +1 -1
- package/dist/components/NcAppSettingsSectionShortcuts/index.mjs +1 -1
- package/dist/components/NcAppSettingsShortcutsSection/index.mjs +1 -1
- package/dist/components/NcAppSidebar/NcAppSidebar.vue.d.ts +12 -3
- package/dist/components/NcAppSidebar/index.mjs +1 -1
- package/dist/components/NcAppSidebarHeader/index.mjs +1 -1
- package/dist/components/NcAppSidebarTab/index.mjs +1 -1
- package/dist/components/NcAssistantButton/index.mjs +1 -1
- package/dist/components/NcAssistantContent/index.mjs +1 -1
- package/dist/components/NcAssistantIcon/index.mjs +1 -1
- package/dist/components/NcAvatar/NcAvatar.vue.d.ts +62 -138
- package/dist/components/NcAvatar/index.mjs +1 -1
- package/dist/components/NcBlurHash/index.mjs +1 -1
- package/dist/components/NcBreadcrumb/NcBreadcrumb.vue.d.ts +12 -3
- package/dist/components/NcBreadcrumb/index.mjs +1 -1
- package/dist/components/NcBreadcrumbs/NcBreadcrumbs.vue.d.ts +23 -5
- package/dist/components/NcBreadcrumbs/index.mjs +1 -1
- package/dist/components/NcButton/index.mjs +1 -1
- package/dist/components/NcCheckboxRadioSwitch/index.mjs +1 -1
- package/dist/components/NcChip/index.mjs +1 -1
- package/dist/components/NcCollectionList/NcCollectionList.vue.d.ts +273 -278
- package/dist/components/NcCollectionList/NcCollectionListItem.vue.d.ts +55 -139
- package/dist/components/NcCollectionList/index.mjs +1 -1
- package/dist/components/NcCollectionList/useCollections.d.ts +5 -1
- package/dist/components/NcColorPicker/index.mjs +1 -1
- package/dist/components/NcContent/index.mjs +1 -1
- package/dist/components/NcCounterBubble/index.mjs +1 -1
- package/dist/components/NcDashboardWidget/NcDashboardWidget.vue.d.ts +99 -276
- package/dist/components/NcDashboardWidget/index.mjs +1 -1
- package/dist/components/NcDashboardWidgetItem/NcDashboardWidgetItem.vue.d.ts +55 -139
- package/dist/components/NcDashboardWidgetItem/index.mjs +1 -1
- package/dist/components/NcDateTime/index.mjs +1 -1
- package/dist/components/NcDateTimePicker/NcDateTimePicker.vue.d.ts +83 -79
- package/dist/components/NcDateTimePicker/dateFnsLocaleLoader.d.ts +3 -0
- package/dist/components/NcDateTimePicker/format.d.ts +35 -0
- package/dist/components/NcDateTimePicker/index.mjs +1 -1
- package/dist/components/NcDateTimePicker/useDateFnsLocale.d.ts +16 -0
- package/dist/components/NcDateTimePickerNative/index.mjs +1 -1
- package/dist/components/NcDialog/NcDialog.vue.d.ts +1 -1
- package/dist/components/NcDialog/index.mjs +1 -1
- package/dist/components/NcDialogButton/index.mjs +1 -1
- package/dist/components/NcEllipsisedOption/index.mjs +1 -1
- package/dist/components/NcEmojiPicker/NcEmojiPicker.vue.d.ts +14 -11
- package/dist/components/NcEmojiPicker/index.mjs +1 -1
- package/dist/components/NcEmptyContent/index.mjs +1 -1
- package/dist/components/NcFilePicker/index.mjs +1 -1
- package/dist/components/NcFormBox/index.mjs +1 -1
- package/dist/components/NcFormBoxButton/index.mjs +1 -1
- package/dist/components/NcFormBoxCopyButton/index.mjs +1 -1
- package/dist/components/NcFormBoxSwitch/index.mjs +1 -1
- package/dist/components/NcFormGroup/index.mjs +1 -1
- package/dist/components/NcGuestContent/index.mjs +1 -1
- package/dist/components/NcHeaderButton/index.mjs +1 -1
- package/dist/components/NcHeaderMenu/index.mjs +1 -1
- package/dist/components/NcHighlight/index.mjs +1 -1
- package/dist/components/NcHotkey/index.mjs +1 -1
- package/dist/components/NcHotkeyList/index.mjs +1 -1
- package/dist/components/NcIconSvgWrapper/index.mjs +1 -1
- package/dist/components/NcInputField/NcInputField.vue.d.ts +8 -5
- package/dist/components/NcInputField/index.mjs +1 -1
- package/dist/components/NcKbd/index.mjs +1 -1
- package/dist/components/NcListItem/NcListItem.vue.d.ts +13 -4
- package/dist/components/NcListItem/index.mjs +1 -1
- package/dist/components/NcListItemIcon/NcListItemIcon.vue.d.ts +46 -139
- package/dist/components/NcListItemIcon/index.mjs +1 -1
- package/dist/components/NcLoadingIcon/index.mjs +1 -1
- package/dist/components/NcModal/index.mjs +1 -1
- package/dist/components/NcNoteCard/index.mjs +1 -1
- package/dist/components/NcPasswordField/NcPasswordField.vue.d.ts +16 -16
- package/dist/components/NcPasswordField/index.mjs +1 -1
- package/dist/components/NcPopover/index.mjs +1 -1
- package/dist/components/NcProfileHoverCard/NcProfileHoverCard.vue.d.ts +80 -0
- package/dist/components/NcProfileHoverCard/index.d.ts +5 -0
- package/dist/components/NcProfileHoverCard/index.mjs +5 -0
- package/dist/components/NcProfileHoverCard/index.mjs.map +1 -0
- package/dist/components/NcProfileHoverCard/profileCache.d.ts +31 -0
- package/dist/components/NcProgressBar/NcProgressBar.vue.d.ts +27 -0
- package/dist/components/NcProgressBar/index.mjs +1 -1
- package/dist/components/NcRadioGroup/index.mjs +1 -1
- package/dist/components/NcRadioGroupButton/index.mjs +1 -1
- package/dist/components/NcRelatedResourcesPanel/NcRelatedResourcesPanel.vue.d.ts +9 -3
- package/dist/components/NcRelatedResourcesPanel/NcResource.vue.d.ts +18 -0
- package/dist/components/NcRelatedResourcesPanel/NcTeamResources.vue.d.ts +12 -0
- package/dist/components/NcRelatedResourcesPanel/index.mjs +1 -1
- package/dist/components/NcRichContenteditable/NcAutoCompleteResult.vue.d.ts +12 -0
- package/dist/components/NcRichContenteditable/NcMentionBubble.vue.d.ts +6 -0
- package/dist/components/NcRichContenteditable/NcRichContenteditable.vue.d.ts +2 -2
- package/dist/components/NcRichContenteditable/index.mjs +1 -1
- package/dist/components/NcRichText/NcReferenceList.vue.d.ts +37 -0
- package/dist/components/NcRichText/NcReferencePicker/NcCustomPickerElement.vue.d.ts +3 -1
- package/dist/components/NcRichText/NcReferencePicker/NcProviderList.vue.d.ts +171 -2
- package/dist/components/NcRichText/NcReferencePicker/NcRawLinkInput.vue.d.ts +17 -12
- package/dist/components/NcRichText/NcReferencePicker/NcReferencePicker.vue.d.ts +365 -18
- package/dist/components/NcRichText/NcReferencePicker/NcReferencePickerModal.vue.d.ts +368 -19
- package/dist/components/NcRichText/NcReferencePicker/NcSearch.vue.d.ts +177 -2
- package/dist/components/NcRichText/NcReferenceWidget.vue.d.ts +1 -0
- package/dist/components/NcRichText/NcRichText.vue.d.ts +25 -0
- package/dist/components/NcRichText/autolink.d.ts +7 -5
- package/dist/components/NcRichText/index.d.ts +2 -2
- package/dist/components/NcRichText/index.mjs +15 -12
- package/dist/components/NcRichText/index.mjs.map +1 -1
- package/dist/components/NcSavingIndicatorIcon/index.mjs +1 -1
- package/dist/components/NcSelect/NcSelect.vue.d.ts +169 -1
- package/dist/components/NcSelect/index.mjs +1 -1
- package/dist/components/NcSelectTags/NcSelectTags.vue.d.ts +171 -3
- package/dist/components/NcSelectTags/index.mjs +1 -1
- package/dist/components/NcSelectUsers/index.mjs +1 -1
- package/dist/components/NcSettingsSection/index.mjs +1 -1
- package/dist/components/NcSettingsSelectGroup/NcSettingsSelectGroup.vue.d.ts +169 -1
- package/dist/components/NcSettingsSelectGroup/index.mjs +1 -1
- package/dist/components/NcTextArea/index.mjs +1 -1
- package/dist/components/NcTextField/NcTextField.vue.d.ts +23 -17
- package/dist/components/NcTextField/index.mjs +1 -1
- package/dist/components/NcThemeProvider/index.mjs +1 -1
- package/dist/components/NcTimezonePicker/index.mjs +1 -1
- package/dist/components/NcUserBubble/index.mjs +1 -1
- package/dist/components/NcUserStatusIcon/index.mjs +1 -1
- package/dist/components/NcVNodes/index.mjs +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/composables/useFormatDateTime/index.mjs +11 -5
- package/dist/composables/useFormatDateTime/index.mjs.map +1 -1
- package/dist/composables/useHotKey/index.mjs +1 -1
- package/dist/composables/useIsDarkTheme/index.mjs +1 -1
- package/dist/functions/contactsMenu/index.mjs +1 -1
- package/dist/functions/emoji/index.mjs +1 -1
- package/dist/functions/reference/index.d.ts +7 -4
- package/dist/functions/reference/index.mjs +14 -12
- package/dist/functions/reference/index.mjs.map +1 -1
- package/dist/functions/reference/referencePickerModal.d.ts +16 -1
- package/dist/functions/reference/widgets.d.ts +11 -1
- package/dist/functions/registerReference/index.mjs +10 -9
- package/dist/functions/registerReference/index.mjs.map +1 -1
- package/dist/functions/usernameToColor/index.mjs +1 -1
- package/dist/index.mjs +121 -115
- package/dist/index.mjs.map +1 -1
- package/dist/mixins/userStatus.d.ts +5 -4
- package/dist/utils/legacy.d.ts +2 -0
- package/package.json +24 -23
- package/dist/assets/NcAppNavigationList--36j6Acm.css +0 -28
- package/dist/assets/NcDateTimePickerNative-BP6eg8aU.css +0 -60
- package/dist/assets/NcPopover-C7YEE_vn.css +0 -123
- package/dist/assets/NcSelect-CvDEQAjD.css +0 -245
- package/dist/assets/NcSelectUsers-YF5729PJ.css +0 -4
- package/dist/chunks/ArrowRight-B1ncAhus.mjs.map +0 -1
- package/dist/chunks/ChevronDown-C6gc637b.mjs.map +0 -1
- package/dist/chunks/ChevronUp-ChH8oB7p.mjs.map +0 -1
- package/dist/chunks/Close-CuhcJnX2.mjs.map +0 -1
- package/dist/chunks/NcActionButton-BO5T5ePT.mjs.map +0 -1
- package/dist/chunks/NcActionButtonGroup-B9LfyE-G.mjs.map +0 -1
- package/dist/chunks/NcActionCaption-f7L9gBlT.mjs.map +0 -1
- package/dist/chunks/NcActionCheckbox-DBqiK-AZ.mjs.map +0 -1
- package/dist/chunks/NcActionInput-BO0lB4VP.mjs.map +0 -1
- package/dist/chunks/NcActionLink-BFiaYt9A.mjs.map +0 -1
- package/dist/chunks/NcActionRadio-BA08CAtA.mjs.map +0 -1
- package/dist/chunks/NcActionRouter-vYFtIOzD.mjs.map +0 -1
- package/dist/chunks/NcActionSeparator-B9pNQaji.mjs.map +0 -1
- package/dist/chunks/NcActionText-CQ9qwJ0p.mjs.map +0 -1
- package/dist/chunks/NcActionTextEditable-B8y_GEre.mjs.map +0 -1
- package/dist/chunks/NcActions-DY4GGONi.mjs.map +0 -1
- package/dist/chunks/NcAppContent--92JdjRr.mjs.map +0 -1
- package/dist/chunks/NcAppContentDetails.vue_vue_type_script_setup_true_lang-BWl5Pw5g.mjs.map +0 -1
- package/dist/chunks/NcAppContentList-Copx3Ver.mjs.map +0 -1
- package/dist/chunks/NcAppNavigation-Bb9-C2eO.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationCaption-BptTnvQU.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationIconBullet-BmU-dPcY.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationItem-B0-60shw.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationList-CGSWabRB.mjs +0 -17
- package/dist/chunks/NcAppNavigationList-CGSWabRB.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationNew-Dspn3-4i.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationNewItem-Cg8IJ6ZV.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationSearch-CiOKjV3M.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationSettings-1BzAhIDg.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationSpacer-CIRC4ZEj.mjs.map +0 -1
- package/dist/chunks/NcAppSettingsDialog-BgZCuMK0.mjs.map +0 -1
- package/dist/chunks/NcAppSettingsSection-BosSmisT.mjs.map +0 -1
- package/dist/chunks/NcAppSettingsShortcutsSection-og6gyYxr.mjs.map +0 -1
- package/dist/chunks/NcAppSidebar-DX26aRNB.mjs.map +0 -1
- package/dist/chunks/NcAppSidebarHeader.vue_vue_type_script_setup_true_lang-C-QhdyiN.mjs.map +0 -1
- package/dist/chunks/NcAppSidebarTab-DOSDDbGA.mjs.map +0 -1
- package/dist/chunks/NcAssistantButton-BMuKy6Mh.mjs.map +0 -1
- package/dist/chunks/NcAssistantContent-D24YPWRc.mjs.map +0 -1
- package/dist/chunks/NcAssistantIcon-DW-HrfQg.mjs.map +0 -1
- package/dist/chunks/NcAvatar-DX-Nk9Es.mjs.map +0 -1
- package/dist/chunks/NcBlurHash-BGaeAt4-.mjs.map +0 -1
- package/dist/chunks/NcBreadcrumb-DHvm77Vw.mjs.map +0 -1
- package/dist/chunks/NcBreadcrumbs-B_uysWv6.mjs.map +0 -1
- package/dist/chunks/NcButton-QbPBynlU.mjs.map +0 -1
- package/dist/chunks/NcCheckboxRadioSwitch-BVTMQSAg.mjs.map +0 -1
- package/dist/chunks/NcChip-BCtDxh7v.mjs.map +0 -1
- package/dist/chunks/NcCollectionList-DNfWulkK.mjs.map +0 -1
- package/dist/chunks/NcColorPicker-CGE4Kei4.mjs.map +0 -1
- package/dist/chunks/NcContent-BhMoPROW.mjs.map +0 -1
- package/dist/chunks/NcCounterBubble-CV0YMrXW.mjs.map +0 -1
- package/dist/chunks/NcDashboardWidget-DKZ8Mgt0.mjs.map +0 -1
- package/dist/chunks/NcDashboardWidgetItem-DxA6-V0R.mjs.map +0 -1
- package/dist/chunks/NcDateTime.vue_vue_type_script_setup_true_lang-BJuPH7S7.mjs.map +0 -1
- package/dist/chunks/NcDateTimePicker-CK4rhfEB.mjs +0 -409
- package/dist/chunks/NcDateTimePicker-CK4rhfEB.mjs.map +0 -1
- package/dist/chunks/NcDateTimePickerNative-BeM4WOA4.mjs.map +0 -1
- package/dist/chunks/NcDialog-D1u-qo74.mjs.map +0 -1
- package/dist/chunks/NcDialogButton.vue_vue_type_script_setup_true_lang-Cn-8O9iZ.mjs.map +0 -1
- package/dist/chunks/NcEllipsisedOption-D6Amb91K.mjs.map +0 -1
- package/dist/chunks/NcEmojiPicker-R2GSAiCW.mjs.map +0 -1
- package/dist/chunks/NcEmptyContent-CGAPqk4S.mjs.map +0 -1
- package/dist/chunks/NcFilePicker-C7Xs8E2Q.mjs.map +0 -1
- package/dist/chunks/NcFormBox-3Ql2JSK8.mjs.map +0 -1
- package/dist/chunks/NcFormBoxButton-DIKZK9kp.mjs.map +0 -1
- package/dist/chunks/NcFormBoxCopyButton.vue_vue_type_script_setup_true_lang-BVCoU7LB.mjs.map +0 -1
- package/dist/chunks/NcFormBoxItem-CV8UrJib.mjs.map +0 -1
- package/dist/chunks/NcFormBoxSwitch-C0hMaYEj.mjs.map +0 -1
- package/dist/chunks/NcFormGroup-W-Wgps0q.mjs.map +0 -1
- package/dist/chunks/NcGuestContent-_z22nZMF.mjs +0 -25
- package/dist/chunks/NcGuestContent-_z22nZMF.mjs.map +0 -1
- package/dist/chunks/NcHeaderButton-m4oAOSTa.mjs.map +0 -1
- package/dist/chunks/NcHeaderMenu-DRxcyWNX.mjs.map +0 -1
- package/dist/chunks/NcHighlight.vue_vue_type_script_lang-DnWQDM_2.mjs.map +0 -1
- package/dist/chunks/NcHotkey-9HBkzRAt.mjs.map +0 -1
- package/dist/chunks/NcHotkeyList-BWerT8qH.mjs.map +0 -1
- package/dist/chunks/NcIconSvgWrapper-g8ubWhoz.mjs.map +0 -1
- package/dist/chunks/NcIconToggleSwitch-CWzIC2ar.mjs.map +0 -1
- package/dist/chunks/NcInputConfirmCancel-B6qC3s63.mjs.map +0 -1
- package/dist/chunks/NcInputField-B1bGxYHt.mjs.map +0 -1
- package/dist/chunks/NcKbd-DCsSL73F.mjs.map +0 -1
- package/dist/chunks/NcListItem-DItks2Sq.mjs.map +0 -1
- package/dist/chunks/NcListItemIcon-BKbbR_Vf.mjs.map +0 -1
- package/dist/chunks/NcLoadingIcon-BOVpFVQz.mjs.map +0 -1
- package/dist/chunks/NcMentionBubble.vue_vue_type_style_index_0_scoped_45238efd_lang-BX_KxRP-.mjs.map +0 -1
- package/dist/chunks/NcModal-B-YLND3e.mjs.map +0 -1
- package/dist/chunks/NcNoteCard-mI7qVZ9j.mjs.map +0 -1
- package/dist/chunks/NcPasswordField-Be5_qcfm.mjs.map +0 -1
- package/dist/chunks/NcPopover-CObDh89q.mjs.map +0 -1
- package/dist/chunks/NcProgressBar-C-ane-Ni.mjs.map +0 -1
- package/dist/chunks/NcRadioGroup-DYwRkXaY.mjs.map +0 -1
- package/dist/chunks/NcRadioGroupButton-WKdAdfUy.mjs.map +0 -1
- package/dist/chunks/NcRelatedResourcesPanel-Bk9l-BN3.mjs.map +0 -1
- package/dist/chunks/NcRichContenteditable-BwGkxhDF.mjs.map +0 -1
- package/dist/chunks/NcRichText-Dkk6iX8F.mjs.map +0 -1
- package/dist/chunks/NcSavingIndicatorIcon.vue_vue_type_script_setup_true_lang-DbQnMYZm.mjs.map +0 -1
- package/dist/chunks/NcSelect-BOFzoCwK.mjs.map +0 -1
- package/dist/chunks/NcSelectTags-D7qWNjXa.mjs.map +0 -1
- package/dist/chunks/NcSelectUsers-0AajBWY6.mjs.map +0 -1
- package/dist/chunks/NcSettingsSection-DmfxX2se.mjs.map +0 -1
- package/dist/chunks/NcSettingsSelectGroup-TN64yH4k.mjs.map +0 -1
- package/dist/chunks/NcTextArea-Dxzj4zdb.mjs.map +0 -1
- package/dist/chunks/NcTextField.vue_vue_type_script_setup_true_lang-BQHjkK8r.mjs.map +0 -1
- package/dist/chunks/NcThemeProvider.vue_vue_type_script_setup_true_lang-wie70gn4.mjs.map +0 -1
- package/dist/chunks/NcTimezonePicker.vue_vue_type_script_setup_true_lang-Csd1JQe6.mjs.map +0 -1
- package/dist/chunks/NcUserBubble-BXBgGflZ.mjs.map +0 -1
- package/dist/chunks/NcUserStatusIcon-DsviB2Cr.mjs.map +0 -1
- package/dist/chunks/NcVNodes.vue_vue_type_script_lang-BqUHinRZ.mjs.map +0 -1
- package/dist/chunks/_l10n-CG4CuN3H.mjs.map +0 -1
- package/dist/chunks/_plugin-vue_export-helper-1tPrXgE0.mjs.map +0 -1
- package/dist/chunks/actionGlobal-BZFdtdJL.mjs.map +0 -1
- package/dist/chunks/actionText-BXR0sWNu.mjs.map +0 -1
- package/dist/chunks/appName-DyNMVZpX.mjs.map +0 -1
- package/dist/chunks/autolink-B2azbG18.mjs.map +0 -1
- package/dist/chunks/colors-BDeMBgfq.mjs.map +0 -1
- package/dist/chunks/constants-Ciwvl5xb.mjs.map +0 -1
- package/dist/chunks/constants-wIEKSp2G.mjs.map +0 -1
- package/dist/chunks/createElementId-DhjFt1I9.mjs.map +0 -1
- package/dist/chunks/customPickerElements-Cu7bLbap.mjs.map +0 -1
- package/dist/chunks/emoji-C8k9NUlo.mjs.map +0 -1
- package/dist/chunks/focusTrap-HJQ4pqHV.mjs.map +0 -1
- package/dist/chunks/legacy-BoqDmOCa.mjs.map +0 -1
- package/dist/chunks/logger-D3RVzcfQ.mjs.map +0 -1
- package/dist/chunks/mdi-CpchYUUV.mjs.map +0 -1
- package/dist/chunks/platform-CC2ecGvV.mjs.map +0 -1
- package/dist/chunks/referencePickerModal-CD1BjLPe.mjs.map +0 -1
- package/dist/chunks/rtl-v0UOPAM7.mjs.map +0 -1
- package/dist/chunks/useAppSettingsDialog-C73Wx6iQ.mjs.map +0 -1
- package/dist/chunks/useCopy-PckLYUAU.mjs.map +0 -1
- package/dist/chunks/useNcActions-BzPO2c4h.mjs.map +0 -1
- package/dist/chunks/useNcFormBox-Djlh582y.mjs.map +0 -1
- package/dist/chunks/useNcRadioGroup-D6llQmAl.mjs.map +0 -1
- package/dist/chunks/useTrapStackControl-B6cEicto.mjs.map +0 -1
- /package/dist/assets/{NcActionButtonGroup-Bt8kRk79.css → NcActionButtonGroup.css} +0 -0
- /package/dist/assets/{NcActionCaption-DnG2OyWa.css → NcActionCaption.css} +0 -0
- /package/dist/assets/{NcActionSeparator-Ct2RnclR.css → NcActionSeparator.css} +0 -0
- /package/dist/assets/{NcAppNavigationCaption-ggcWspH2.css → NcAppNavigationCaption.css} +0 -0
- /package/dist/assets/{NcAppNavigationIconBullet-DLQJkObX.css → NcAppNavigationIconBullet.css} +0 -0
- /package/dist/assets/{NcAppNavigationNew-Bn8zj5lM.css → NcAppNavigationNew.css} +0 -0
- /package/dist/assets/{NcAppNavigationSearch-DD7mo6OW.css → NcAppNavigationSearch.css} +0 -0
- /package/dist/assets/{NcAppNavigationSpacer-LST5uYYS.css → NcAppNavigationSpacer.css} +0 -0
- /package/dist/assets/{NcAppSettingsSection-DIw8GLHR.css → NcAppSettingsSection.css} +0 -0
- /package/dist/assets/{NcAppSidebarTab-Xd3HTDbw.css → NcAppSidebarTab.css} +0 -0
- /package/dist/assets/{NcBreadcrumb-BxhZKQlW.css → NcBreadcrumb.css} +0 -0
- /package/dist/assets/{NcChip-DbSI4mFP.css → NcChip.css} +0 -0
- /package/dist/assets/{NcCollectionList-e5JFvzqX.css → NcCollectionList.css} +0 -0
- /package/dist/assets/{NcColorPicker-DVYGs8R3.css → NcColorPicker.css} +0 -0
- /package/dist/assets/{NcContent-DX4Rs6Pc.css → NcContent.css} +0 -0
- /package/dist/assets/{NcCounterBubble-ZnteskDR.css → NcCounterBubble.css} +0 -0
- /package/dist/assets/{NcDashboardWidget-nZuIL1UN.css → NcDashboardWidget.css} +0 -0
- /package/dist/assets/{NcDashboardWidgetItem-DpVmEBwQ.css → NcDashboardWidgetItem.css} +0 -0
- /package/dist/assets/{NcDialog-BSV74Bru.css → NcDialog.css} +0 -0
- /package/dist/assets/{NcEmojiPicker-vNKR9S87.css → NcEmojiPicker.css} +0 -0
- /package/dist/assets/{NcEmptyContent-DJMDuGVz.css → NcEmptyContent.css} +0 -0
- /package/dist/assets/{NcHeaderButton-CVOQgRjm.css → NcHeaderButton.css} +0 -0
- /package/dist/assets/{NcIconSvgWrapper-N3OwSN9O.css → NcIconSvgWrapper.css} +0 -0
- /package/dist/assets/{NcListItemIcon-DJRcmlo1.css → NcListItemIcon.css} +0 -0
- /package/dist/assets/{NcLoadingIcon-CWUlo4XY.css → NcLoadingIcon.css} +0 -0
- /package/dist/assets/{NcModal-D81luiuU.css → NcModal.css} +0 -0
- /package/dist/assets/{NcNoteCard-DfescGKl.css → NcNoteCard.css} +0 -0
- /package/dist/assets/{NcPasswordField-BN4HFgU5.css → NcPasswordField.css} +0 -0
- /package/dist/assets/{NcSettingsSection-f5rBJsKJ.css → NcSettingsSection.css} +0 -0
- /package/dist/assets/{NcSettingsSelectGroup-D_fSrafm.css → NcSettingsSelectGroup.css} +0 -0
- /package/dist/assets/{NcTextArea-BxGe3Lqn.css → NcTextArea.css} +0 -0
- /package/dist/assets/{NcUserBubble-DFUmBxeb.css → NcUserBubble.css} +0 -0
- /package/dist/assets/{NcUserStatusIcon-B3aHoBAd.css → NcUserStatusIcon.css} +0 -0
|
@@ -0,0 +1,2979 @@
|
|
|
1
|
+
import '../assets/NcDateTimePicker.css';
|
|
2
|
+
import { ref, defineComponent, useModel, watchEffect, warn, useTemplateRef, computed, watch, openBlock, createElementBlock, createVNode, unref, mergeProps, createSlots, withCtx, createTextVNode, toDisplayString, createBlock, Teleport, createElementVNode, mergeModels } from "vue";
|
|
3
|
+
import { D as mdiChevronUp, E as mdiChevronDown, c as mdiChevronRight, B as mdiChevronLeft, F as mdiClock, G as mdiCalendarBlank, b as mdiClose } from "./mdi.mjs";
|
|
4
|
+
import { getCanonicalLocale, getFirstDay, getDayNamesMin, getDayNames } from "@nextcloud/l10n";
|
|
5
|
+
import VueDatePicker from "@vuepic/vue-datepicker";
|
|
6
|
+
import { N as NcIconSvgWrapper } from "./NcIconSvgWrapper.mjs";
|
|
7
|
+
import { _ as _sfc_main$1 } from "./NcTimezonePicker.vue_vue_type_script_setup_true_lang.mjs";
|
|
8
|
+
import { r as register, a1 as t14, a as t } from "./_l10n.mjs";
|
|
9
|
+
import { N as NcButton } from "./NcButton.mjs";
|
|
10
|
+
import { enUS as enUS$1 } from "date-fns/locale/en-US";
|
|
11
|
+
import { l as logger } from "./logger.mjs";
|
|
12
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper.mjs";
|
|
13
|
+
const formatDistanceLocale = {
|
|
14
|
+
lessThanXSeconds: {
|
|
15
|
+
one: "less than a second",
|
|
16
|
+
other: "less than {{count}} seconds"
|
|
17
|
+
},
|
|
18
|
+
xSeconds: {
|
|
19
|
+
one: "1 second",
|
|
20
|
+
other: "{{count}} seconds"
|
|
21
|
+
},
|
|
22
|
+
halfAMinute: "half a minute",
|
|
23
|
+
lessThanXMinutes: {
|
|
24
|
+
one: "less than a minute",
|
|
25
|
+
other: "less than {{count}} minutes"
|
|
26
|
+
},
|
|
27
|
+
xMinutes: {
|
|
28
|
+
one: "1 minute",
|
|
29
|
+
other: "{{count}} minutes"
|
|
30
|
+
},
|
|
31
|
+
aboutXHours: {
|
|
32
|
+
one: "about 1 hour",
|
|
33
|
+
other: "about {{count}} hours"
|
|
34
|
+
},
|
|
35
|
+
xHours: {
|
|
36
|
+
one: "1 hour",
|
|
37
|
+
other: "{{count}} hours"
|
|
38
|
+
},
|
|
39
|
+
xDays: {
|
|
40
|
+
one: "1 day",
|
|
41
|
+
other: "{{count}} days"
|
|
42
|
+
},
|
|
43
|
+
aboutXWeeks: {
|
|
44
|
+
one: "about 1 week",
|
|
45
|
+
other: "about {{count}} weeks"
|
|
46
|
+
},
|
|
47
|
+
xWeeks: {
|
|
48
|
+
one: "1 week",
|
|
49
|
+
other: "{{count}} weeks"
|
|
50
|
+
},
|
|
51
|
+
aboutXMonths: {
|
|
52
|
+
one: "about 1 month",
|
|
53
|
+
other: "about {{count}} months"
|
|
54
|
+
},
|
|
55
|
+
xMonths: {
|
|
56
|
+
one: "1 month",
|
|
57
|
+
other: "{{count}} months"
|
|
58
|
+
},
|
|
59
|
+
aboutXYears: {
|
|
60
|
+
one: "about 1 year",
|
|
61
|
+
other: "about {{count}} years"
|
|
62
|
+
},
|
|
63
|
+
xYears: {
|
|
64
|
+
one: "1 year",
|
|
65
|
+
other: "{{count}} years"
|
|
66
|
+
},
|
|
67
|
+
overXYears: {
|
|
68
|
+
one: "over 1 year",
|
|
69
|
+
other: "over {{count}} years"
|
|
70
|
+
},
|
|
71
|
+
almostXYears: {
|
|
72
|
+
one: "almost 1 year",
|
|
73
|
+
other: "almost {{count}} years"
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const formatDistance = (token, count, options) => {
|
|
77
|
+
let result;
|
|
78
|
+
const tokenValue = formatDistanceLocale[token];
|
|
79
|
+
if (typeof tokenValue === "string") {
|
|
80
|
+
result = tokenValue;
|
|
81
|
+
} else if (count === 1) {
|
|
82
|
+
result = tokenValue.one;
|
|
83
|
+
} else {
|
|
84
|
+
result = tokenValue.other.replace("{{count}}", count.toString());
|
|
85
|
+
}
|
|
86
|
+
if (options?.addSuffix) {
|
|
87
|
+
if (options.comparison && options.comparison > 0) {
|
|
88
|
+
return "in " + result;
|
|
89
|
+
} else {
|
|
90
|
+
return result + " ago";
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
94
|
+
};
|
|
95
|
+
function buildFormatLongFn(args) {
|
|
96
|
+
return (options = {}) => {
|
|
97
|
+
const width = options.width ? String(options.width) : args.defaultWidth;
|
|
98
|
+
const format = args.formats[width] || args.formats[args.defaultWidth];
|
|
99
|
+
return format;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
const dateFormats = {
|
|
103
|
+
full: "EEEE, MMMM do, y",
|
|
104
|
+
long: "MMMM do, y",
|
|
105
|
+
medium: "MMM d, y",
|
|
106
|
+
short: "MM/dd/yyyy"
|
|
107
|
+
};
|
|
108
|
+
const timeFormats = {
|
|
109
|
+
full: "h:mm:ss a zzzz",
|
|
110
|
+
long: "h:mm:ss a z",
|
|
111
|
+
medium: "h:mm:ss a",
|
|
112
|
+
short: "h:mm a"
|
|
113
|
+
};
|
|
114
|
+
const dateTimeFormats = {
|
|
115
|
+
full: "{{date}} 'at' {{time}}",
|
|
116
|
+
long: "{{date}} 'at' {{time}}",
|
|
117
|
+
medium: "{{date}}, {{time}}",
|
|
118
|
+
short: "{{date}}, {{time}}"
|
|
119
|
+
};
|
|
120
|
+
const formatLong = {
|
|
121
|
+
date: buildFormatLongFn({
|
|
122
|
+
formats: dateFormats,
|
|
123
|
+
defaultWidth: "full"
|
|
124
|
+
}),
|
|
125
|
+
time: buildFormatLongFn({
|
|
126
|
+
formats: timeFormats,
|
|
127
|
+
defaultWidth: "full"
|
|
128
|
+
}),
|
|
129
|
+
dateTime: buildFormatLongFn({
|
|
130
|
+
formats: dateTimeFormats,
|
|
131
|
+
defaultWidth: "full"
|
|
132
|
+
})
|
|
133
|
+
};
|
|
134
|
+
const formatRelativeLocale = {
|
|
135
|
+
lastWeek: "'last' eeee 'at' p",
|
|
136
|
+
yesterday: "'yesterday at' p",
|
|
137
|
+
today: "'today at' p",
|
|
138
|
+
tomorrow: "'tomorrow at' p",
|
|
139
|
+
nextWeek: "eeee 'at' p",
|
|
140
|
+
other: "P"
|
|
141
|
+
};
|
|
142
|
+
const formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
|
|
143
|
+
function buildLocalizeFn(args) {
|
|
144
|
+
return (value, options) => {
|
|
145
|
+
const context = options?.context ? String(options.context) : "standalone";
|
|
146
|
+
let valuesArray;
|
|
147
|
+
if (context === "formatting" && args.formattingValues) {
|
|
148
|
+
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
149
|
+
const width = options?.width ? String(options.width) : defaultWidth;
|
|
150
|
+
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
151
|
+
} else {
|
|
152
|
+
const defaultWidth = args.defaultWidth;
|
|
153
|
+
const width = options?.width ? String(options.width) : args.defaultWidth;
|
|
154
|
+
valuesArray = args.values[width] || args.values[defaultWidth];
|
|
155
|
+
}
|
|
156
|
+
const index = args.argumentCallback ? args.argumentCallback(value) : value;
|
|
157
|
+
return valuesArray[index];
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
const eraValues = {
|
|
161
|
+
narrow: ["B", "A"],
|
|
162
|
+
abbreviated: ["BC", "AD"],
|
|
163
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
164
|
+
};
|
|
165
|
+
const quarterValues = {
|
|
166
|
+
narrow: ["1", "2", "3", "4"],
|
|
167
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
168
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
169
|
+
};
|
|
170
|
+
const monthValues = {
|
|
171
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
172
|
+
abbreviated: [
|
|
173
|
+
"Jan",
|
|
174
|
+
"Feb",
|
|
175
|
+
"Mar",
|
|
176
|
+
"Apr",
|
|
177
|
+
"May",
|
|
178
|
+
"Jun",
|
|
179
|
+
"Jul",
|
|
180
|
+
"Aug",
|
|
181
|
+
"Sep",
|
|
182
|
+
"Oct",
|
|
183
|
+
"Nov",
|
|
184
|
+
"Dec"
|
|
185
|
+
],
|
|
186
|
+
wide: [
|
|
187
|
+
"January",
|
|
188
|
+
"February",
|
|
189
|
+
"March",
|
|
190
|
+
"April",
|
|
191
|
+
"May",
|
|
192
|
+
"June",
|
|
193
|
+
"July",
|
|
194
|
+
"August",
|
|
195
|
+
"September",
|
|
196
|
+
"October",
|
|
197
|
+
"November",
|
|
198
|
+
"December"
|
|
199
|
+
]
|
|
200
|
+
};
|
|
201
|
+
const dayValues = {
|
|
202
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
203
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
204
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
205
|
+
wide: [
|
|
206
|
+
"Sunday",
|
|
207
|
+
"Monday",
|
|
208
|
+
"Tuesday",
|
|
209
|
+
"Wednesday",
|
|
210
|
+
"Thursday",
|
|
211
|
+
"Friday",
|
|
212
|
+
"Saturday"
|
|
213
|
+
]
|
|
214
|
+
};
|
|
215
|
+
const dayPeriodValues = {
|
|
216
|
+
narrow: {
|
|
217
|
+
am: "a",
|
|
218
|
+
pm: "p",
|
|
219
|
+
midnight: "mi",
|
|
220
|
+
noon: "n",
|
|
221
|
+
morning: "morning",
|
|
222
|
+
afternoon: "afternoon",
|
|
223
|
+
evening: "evening",
|
|
224
|
+
night: "night"
|
|
225
|
+
},
|
|
226
|
+
abbreviated: {
|
|
227
|
+
am: "AM",
|
|
228
|
+
pm: "PM",
|
|
229
|
+
midnight: "midnight",
|
|
230
|
+
noon: "noon",
|
|
231
|
+
morning: "morning",
|
|
232
|
+
afternoon: "afternoon",
|
|
233
|
+
evening: "evening",
|
|
234
|
+
night: "night"
|
|
235
|
+
},
|
|
236
|
+
wide: {
|
|
237
|
+
am: "a.m.",
|
|
238
|
+
pm: "p.m.",
|
|
239
|
+
midnight: "midnight",
|
|
240
|
+
noon: "noon",
|
|
241
|
+
morning: "morning",
|
|
242
|
+
afternoon: "afternoon",
|
|
243
|
+
evening: "evening",
|
|
244
|
+
night: "night"
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
const formattingDayPeriodValues = {
|
|
248
|
+
narrow: {
|
|
249
|
+
am: "a",
|
|
250
|
+
pm: "p",
|
|
251
|
+
midnight: "mi",
|
|
252
|
+
noon: "n",
|
|
253
|
+
morning: "in the morning",
|
|
254
|
+
afternoon: "in the afternoon",
|
|
255
|
+
evening: "in the evening",
|
|
256
|
+
night: "at night"
|
|
257
|
+
},
|
|
258
|
+
abbreviated: {
|
|
259
|
+
am: "AM",
|
|
260
|
+
pm: "PM",
|
|
261
|
+
midnight: "midnight",
|
|
262
|
+
noon: "noon",
|
|
263
|
+
morning: "in the morning",
|
|
264
|
+
afternoon: "in the afternoon",
|
|
265
|
+
evening: "in the evening",
|
|
266
|
+
night: "at night"
|
|
267
|
+
},
|
|
268
|
+
wide: {
|
|
269
|
+
am: "a.m.",
|
|
270
|
+
pm: "p.m.",
|
|
271
|
+
midnight: "midnight",
|
|
272
|
+
noon: "noon",
|
|
273
|
+
morning: "in the morning",
|
|
274
|
+
afternoon: "in the afternoon",
|
|
275
|
+
evening: "in the evening",
|
|
276
|
+
night: "at night"
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
const ordinalNumber = (dirtyNumber, _options) => {
|
|
280
|
+
const number = Number(dirtyNumber);
|
|
281
|
+
const rem100 = number % 100;
|
|
282
|
+
if (rem100 > 20 || rem100 < 10) {
|
|
283
|
+
switch (rem100 % 10) {
|
|
284
|
+
case 1:
|
|
285
|
+
return number + "st";
|
|
286
|
+
case 2:
|
|
287
|
+
return number + "nd";
|
|
288
|
+
case 3:
|
|
289
|
+
return number + "rd";
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return number + "th";
|
|
293
|
+
};
|
|
294
|
+
const localize = {
|
|
295
|
+
ordinalNumber,
|
|
296
|
+
era: buildLocalizeFn({
|
|
297
|
+
values: eraValues,
|
|
298
|
+
defaultWidth: "wide"
|
|
299
|
+
}),
|
|
300
|
+
quarter: buildLocalizeFn({
|
|
301
|
+
values: quarterValues,
|
|
302
|
+
defaultWidth: "wide",
|
|
303
|
+
argumentCallback: (quarter) => quarter - 1
|
|
304
|
+
}),
|
|
305
|
+
month: buildLocalizeFn({
|
|
306
|
+
values: monthValues,
|
|
307
|
+
defaultWidth: "wide"
|
|
308
|
+
}),
|
|
309
|
+
day: buildLocalizeFn({
|
|
310
|
+
values: dayValues,
|
|
311
|
+
defaultWidth: "wide"
|
|
312
|
+
}),
|
|
313
|
+
dayPeriod: buildLocalizeFn({
|
|
314
|
+
values: dayPeriodValues,
|
|
315
|
+
defaultWidth: "wide",
|
|
316
|
+
formattingValues: formattingDayPeriodValues,
|
|
317
|
+
defaultFormattingWidth: "wide"
|
|
318
|
+
})
|
|
319
|
+
};
|
|
320
|
+
function buildMatchFn(args) {
|
|
321
|
+
return (string, options = {}) => {
|
|
322
|
+
const width = options.width;
|
|
323
|
+
const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
324
|
+
const matchResult = string.match(matchPattern);
|
|
325
|
+
if (!matchResult) {
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
328
|
+
const matchedString = matchResult[0];
|
|
329
|
+
const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
330
|
+
const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
|
|
331
|
+
// [TODO] -- I challenge you to fix the type
|
|
332
|
+
findKey(parsePatterns, (pattern) => pattern.test(matchedString))
|
|
333
|
+
);
|
|
334
|
+
let value;
|
|
335
|
+
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
336
|
+
value = options.valueCallback ? (
|
|
337
|
+
// [TODO] -- I challenge you to fix the type
|
|
338
|
+
options.valueCallback(value)
|
|
339
|
+
) : value;
|
|
340
|
+
const rest = string.slice(matchedString.length);
|
|
341
|
+
return { value, rest };
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
function findKey(object, predicate) {
|
|
345
|
+
for (const key in object) {
|
|
346
|
+
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
|
|
347
|
+
return key;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return void 0;
|
|
351
|
+
}
|
|
352
|
+
function findIndex(array, predicate) {
|
|
353
|
+
for (let key = 0; key < array.length; key++) {
|
|
354
|
+
if (predicate(array[key])) {
|
|
355
|
+
return key;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return void 0;
|
|
359
|
+
}
|
|
360
|
+
function buildMatchPatternFn(args) {
|
|
361
|
+
return (string, options = {}) => {
|
|
362
|
+
const matchResult = string.match(args.matchPattern);
|
|
363
|
+
if (!matchResult) return null;
|
|
364
|
+
const matchedString = matchResult[0];
|
|
365
|
+
const parseResult = string.match(args.parsePattern);
|
|
366
|
+
if (!parseResult) return null;
|
|
367
|
+
let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
368
|
+
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
369
|
+
const rest = string.slice(matchedString.length);
|
|
370
|
+
return { value, rest };
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
|
|
374
|
+
const parseOrdinalNumberPattern = /\d+/i;
|
|
375
|
+
const matchEraPatterns = {
|
|
376
|
+
narrow: /^(b|a)/i,
|
|
377
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
378
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
379
|
+
};
|
|
380
|
+
const parseEraPatterns = {
|
|
381
|
+
any: [/^b/i, /^(a|c)/i]
|
|
382
|
+
};
|
|
383
|
+
const matchQuarterPatterns = {
|
|
384
|
+
narrow: /^[1234]/i,
|
|
385
|
+
abbreviated: /^q[1234]/i,
|
|
386
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
387
|
+
};
|
|
388
|
+
const parseQuarterPatterns = {
|
|
389
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
390
|
+
};
|
|
391
|
+
const matchMonthPatterns = {
|
|
392
|
+
narrow: /^[jfmasond]/i,
|
|
393
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
394
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
395
|
+
};
|
|
396
|
+
const parseMonthPatterns = {
|
|
397
|
+
narrow: [
|
|
398
|
+
/^j/i,
|
|
399
|
+
/^f/i,
|
|
400
|
+
/^m/i,
|
|
401
|
+
/^a/i,
|
|
402
|
+
/^m/i,
|
|
403
|
+
/^j/i,
|
|
404
|
+
/^j/i,
|
|
405
|
+
/^a/i,
|
|
406
|
+
/^s/i,
|
|
407
|
+
/^o/i,
|
|
408
|
+
/^n/i,
|
|
409
|
+
/^d/i
|
|
410
|
+
],
|
|
411
|
+
any: [
|
|
412
|
+
/^ja/i,
|
|
413
|
+
/^f/i,
|
|
414
|
+
/^mar/i,
|
|
415
|
+
/^ap/i,
|
|
416
|
+
/^may/i,
|
|
417
|
+
/^jun/i,
|
|
418
|
+
/^jul/i,
|
|
419
|
+
/^au/i,
|
|
420
|
+
/^s/i,
|
|
421
|
+
/^o/i,
|
|
422
|
+
/^n/i,
|
|
423
|
+
/^d/i
|
|
424
|
+
]
|
|
425
|
+
};
|
|
426
|
+
const matchDayPatterns = {
|
|
427
|
+
narrow: /^[smtwf]/i,
|
|
428
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
429
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
430
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
431
|
+
};
|
|
432
|
+
const parseDayPatterns = {
|
|
433
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
434
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
435
|
+
};
|
|
436
|
+
const matchDayPeriodPatterns = {
|
|
437
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
438
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
439
|
+
};
|
|
440
|
+
const parseDayPeriodPatterns = {
|
|
441
|
+
any: {
|
|
442
|
+
am: /^a/i,
|
|
443
|
+
pm: /^p/i,
|
|
444
|
+
midnight: /^mi/i,
|
|
445
|
+
noon: /^no/i,
|
|
446
|
+
morning: /morning/i,
|
|
447
|
+
afternoon: /afternoon/i,
|
|
448
|
+
evening: /evening/i,
|
|
449
|
+
night: /night/i
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
const match = {
|
|
453
|
+
ordinalNumber: buildMatchPatternFn({
|
|
454
|
+
matchPattern: matchOrdinalNumberPattern,
|
|
455
|
+
parsePattern: parseOrdinalNumberPattern,
|
|
456
|
+
valueCallback: (value) => parseInt(value, 10)
|
|
457
|
+
}),
|
|
458
|
+
era: buildMatchFn({
|
|
459
|
+
matchPatterns: matchEraPatterns,
|
|
460
|
+
defaultMatchWidth: "wide",
|
|
461
|
+
parsePatterns: parseEraPatterns,
|
|
462
|
+
defaultParseWidth: "any"
|
|
463
|
+
}),
|
|
464
|
+
quarter: buildMatchFn({
|
|
465
|
+
matchPatterns: matchQuarterPatterns,
|
|
466
|
+
defaultMatchWidth: "wide",
|
|
467
|
+
parsePatterns: parseQuarterPatterns,
|
|
468
|
+
defaultParseWidth: "any",
|
|
469
|
+
valueCallback: (index) => index + 1
|
|
470
|
+
}),
|
|
471
|
+
month: buildMatchFn({
|
|
472
|
+
matchPatterns: matchMonthPatterns,
|
|
473
|
+
defaultMatchWidth: "wide",
|
|
474
|
+
parsePatterns: parseMonthPatterns,
|
|
475
|
+
defaultParseWidth: "any"
|
|
476
|
+
}),
|
|
477
|
+
day: buildMatchFn({
|
|
478
|
+
matchPatterns: matchDayPatterns,
|
|
479
|
+
defaultMatchWidth: "wide",
|
|
480
|
+
parsePatterns: parseDayPatterns,
|
|
481
|
+
defaultParseWidth: "any"
|
|
482
|
+
}),
|
|
483
|
+
dayPeriod: buildMatchFn({
|
|
484
|
+
matchPatterns: matchDayPeriodPatterns,
|
|
485
|
+
defaultMatchWidth: "any",
|
|
486
|
+
parsePatterns: parseDayPeriodPatterns,
|
|
487
|
+
defaultParseWidth: "any"
|
|
488
|
+
})
|
|
489
|
+
};
|
|
490
|
+
const enUS = {
|
|
491
|
+
code: "en-US",
|
|
492
|
+
formatDistance,
|
|
493
|
+
formatLong,
|
|
494
|
+
formatRelative,
|
|
495
|
+
localize,
|
|
496
|
+
match,
|
|
497
|
+
options: {
|
|
498
|
+
weekStartsOn: 0,
|
|
499
|
+
firstWeekContainsDate: 1
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
const dateLongFormatter = (pattern, formatLong2) => {
|
|
503
|
+
switch (pattern) {
|
|
504
|
+
case "P":
|
|
505
|
+
return formatLong2.date({ width: "short" });
|
|
506
|
+
case "PP":
|
|
507
|
+
return formatLong2.date({ width: "medium" });
|
|
508
|
+
case "PPP":
|
|
509
|
+
return formatLong2.date({ width: "long" });
|
|
510
|
+
case "PPPP":
|
|
511
|
+
default:
|
|
512
|
+
return formatLong2.date({ width: "full" });
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
const timeLongFormatter = (pattern, formatLong2) => {
|
|
516
|
+
switch (pattern) {
|
|
517
|
+
case "p":
|
|
518
|
+
return formatLong2.time({ width: "short" });
|
|
519
|
+
case "pp":
|
|
520
|
+
return formatLong2.time({ width: "medium" });
|
|
521
|
+
case "ppp":
|
|
522
|
+
return formatLong2.time({ width: "long" });
|
|
523
|
+
case "pppp":
|
|
524
|
+
default:
|
|
525
|
+
return formatLong2.time({ width: "full" });
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
const dateTimeLongFormatter = (pattern, formatLong2) => {
|
|
529
|
+
const matchResult = pattern.match(/(P+)(p+)?/) || [];
|
|
530
|
+
const datePattern = matchResult[1];
|
|
531
|
+
const timePattern = matchResult[2];
|
|
532
|
+
if (!timePattern) {
|
|
533
|
+
return dateLongFormatter(pattern, formatLong2);
|
|
534
|
+
}
|
|
535
|
+
let dateTimeFormat;
|
|
536
|
+
switch (datePattern) {
|
|
537
|
+
case "P":
|
|
538
|
+
dateTimeFormat = formatLong2.dateTime({ width: "short" });
|
|
539
|
+
break;
|
|
540
|
+
case "PP":
|
|
541
|
+
dateTimeFormat = formatLong2.dateTime({ width: "medium" });
|
|
542
|
+
break;
|
|
543
|
+
case "PPP":
|
|
544
|
+
dateTimeFormat = formatLong2.dateTime({ width: "long" });
|
|
545
|
+
break;
|
|
546
|
+
case "PPPP":
|
|
547
|
+
default:
|
|
548
|
+
dateTimeFormat = formatLong2.dateTime({ width: "full" });
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2));
|
|
552
|
+
};
|
|
553
|
+
const longFormatters = {
|
|
554
|
+
p: timeLongFormatter,
|
|
555
|
+
P: dateTimeLongFormatter
|
|
556
|
+
};
|
|
557
|
+
const dayOfYearTokenRE = /^D+$/;
|
|
558
|
+
const weekYearTokenRE = /^Y+$/;
|
|
559
|
+
const throwTokens = ["D", "DD", "YY", "YYYY"];
|
|
560
|
+
function isProtectedDayOfYearToken(token) {
|
|
561
|
+
return dayOfYearTokenRE.test(token);
|
|
562
|
+
}
|
|
563
|
+
function isProtectedWeekYearToken(token) {
|
|
564
|
+
return weekYearTokenRE.test(token);
|
|
565
|
+
}
|
|
566
|
+
function warnOrThrowProtectedError(token, format, input) {
|
|
567
|
+
const _message = message(token, format, input);
|
|
568
|
+
console.warn(_message);
|
|
569
|
+
if (throwTokens.includes(token)) throw new RangeError(_message);
|
|
570
|
+
}
|
|
571
|
+
function message(token, format, input) {
|
|
572
|
+
const subject = token[0] === "Y" ? "years" : "days of the month";
|
|
573
|
+
return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
574
|
+
}
|
|
575
|
+
const millisecondsInWeek = 6048e5;
|
|
576
|
+
const millisecondsInMinute = 6e4;
|
|
577
|
+
const millisecondsInHour = 36e5;
|
|
578
|
+
const millisecondsInSecond = 1e3;
|
|
579
|
+
const constructFromSymbol = /* @__PURE__ */ Symbol.for("constructDateFrom");
|
|
580
|
+
function constructFrom(date, value) {
|
|
581
|
+
if (typeof date === "function") return date(value);
|
|
582
|
+
if (date && typeof date === "object" && constructFromSymbol in date)
|
|
583
|
+
return date[constructFromSymbol](value);
|
|
584
|
+
if (date instanceof Date) return new date.constructor(value);
|
|
585
|
+
return new Date(value);
|
|
586
|
+
}
|
|
587
|
+
let defaultOptions = {};
|
|
588
|
+
function getDefaultOptions$1() {
|
|
589
|
+
return defaultOptions;
|
|
590
|
+
}
|
|
591
|
+
function getDefaultOptions() {
|
|
592
|
+
return Object.assign({}, getDefaultOptions$1());
|
|
593
|
+
}
|
|
594
|
+
function toDate(argument, context) {
|
|
595
|
+
return constructFrom(context || argument, argument);
|
|
596
|
+
}
|
|
597
|
+
function transpose(date, constructor) {
|
|
598
|
+
const date_ = isConstructor(constructor) ? new constructor(0) : constructFrom(constructor, 0);
|
|
599
|
+
date_.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
|
|
600
|
+
date_.setHours(
|
|
601
|
+
date.getHours(),
|
|
602
|
+
date.getMinutes(),
|
|
603
|
+
date.getSeconds(),
|
|
604
|
+
date.getMilliseconds()
|
|
605
|
+
);
|
|
606
|
+
return date_;
|
|
607
|
+
}
|
|
608
|
+
function isConstructor(constructor) {
|
|
609
|
+
return typeof constructor === "function" && constructor.prototype?.constructor === constructor;
|
|
610
|
+
}
|
|
611
|
+
const TIMEZONE_UNIT_PRIORITY = 10;
|
|
612
|
+
class Setter {
|
|
613
|
+
subPriority = 0;
|
|
614
|
+
validate(_utcDate, _options) {
|
|
615
|
+
return true;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
class ValueSetter extends Setter {
|
|
619
|
+
constructor(value, validateValue, setValue, priority, subPriority) {
|
|
620
|
+
super();
|
|
621
|
+
this.value = value;
|
|
622
|
+
this.validateValue = validateValue;
|
|
623
|
+
this.setValue = setValue;
|
|
624
|
+
this.priority = priority;
|
|
625
|
+
if (subPriority) {
|
|
626
|
+
this.subPriority = subPriority;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
validate(date, options) {
|
|
630
|
+
return this.validateValue(date, this.value, options);
|
|
631
|
+
}
|
|
632
|
+
set(date, flags, options) {
|
|
633
|
+
return this.setValue(date, flags, this.value, options);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
class DateTimezoneSetter extends Setter {
|
|
637
|
+
priority = TIMEZONE_UNIT_PRIORITY;
|
|
638
|
+
subPriority = -1;
|
|
639
|
+
constructor(context, reference) {
|
|
640
|
+
super();
|
|
641
|
+
this.context = context || ((date) => constructFrom(reference, date));
|
|
642
|
+
}
|
|
643
|
+
set(date, flags) {
|
|
644
|
+
if (flags.timestampIsSet) return date;
|
|
645
|
+
return constructFrom(date, transpose(date, this.context));
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
class Parser {
|
|
649
|
+
run(dateString, token, match2, options) {
|
|
650
|
+
const result = this.parse(dateString, token, match2, options);
|
|
651
|
+
if (!result) {
|
|
652
|
+
return null;
|
|
653
|
+
}
|
|
654
|
+
return {
|
|
655
|
+
setter: new ValueSetter(
|
|
656
|
+
result.value,
|
|
657
|
+
this.validate,
|
|
658
|
+
this.set,
|
|
659
|
+
this.priority,
|
|
660
|
+
this.subPriority
|
|
661
|
+
),
|
|
662
|
+
rest: result.rest
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
validate(_utcDate, _value, _options) {
|
|
666
|
+
return true;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
class EraParser extends Parser {
|
|
670
|
+
priority = 140;
|
|
671
|
+
parse(dateString, token, match2) {
|
|
672
|
+
switch (token) {
|
|
673
|
+
// AD, BC
|
|
674
|
+
case "G":
|
|
675
|
+
case "GG":
|
|
676
|
+
case "GGG":
|
|
677
|
+
return match2.era(dateString, { width: "abbreviated" }) || match2.era(dateString, { width: "narrow" });
|
|
678
|
+
// A, B
|
|
679
|
+
case "GGGGG":
|
|
680
|
+
return match2.era(dateString, { width: "narrow" });
|
|
681
|
+
// Anno Domini, Before Christ
|
|
682
|
+
case "GGGG":
|
|
683
|
+
default:
|
|
684
|
+
return match2.era(dateString, { width: "wide" }) || match2.era(dateString, { width: "abbreviated" }) || match2.era(dateString, { width: "narrow" });
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
set(date, flags, value) {
|
|
688
|
+
flags.era = value;
|
|
689
|
+
date.setFullYear(value, 0, 1);
|
|
690
|
+
date.setHours(0, 0, 0, 0);
|
|
691
|
+
return date;
|
|
692
|
+
}
|
|
693
|
+
incompatibleTokens = ["R", "u", "t", "T"];
|
|
694
|
+
}
|
|
695
|
+
const numericPatterns = {
|
|
696
|
+
month: /^(1[0-2]|0?\d)/,
|
|
697
|
+
// 0 to 12
|
|
698
|
+
date: /^(3[0-1]|[0-2]?\d)/,
|
|
699
|
+
// 0 to 31
|
|
700
|
+
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
|
|
701
|
+
// 0 to 366
|
|
702
|
+
week: /^(5[0-3]|[0-4]?\d)/,
|
|
703
|
+
// 0 to 53
|
|
704
|
+
hour23h: /^(2[0-3]|[0-1]?\d)/,
|
|
705
|
+
// 0 to 23
|
|
706
|
+
hour24h: /^(2[0-4]|[0-1]?\d)/,
|
|
707
|
+
// 0 to 24
|
|
708
|
+
hour11h: /^(1[0-1]|0?\d)/,
|
|
709
|
+
// 0 to 11
|
|
710
|
+
hour12h: /^(1[0-2]|0?\d)/,
|
|
711
|
+
// 0 to 12
|
|
712
|
+
minute: /^[0-5]?\d/,
|
|
713
|
+
// 0 to 59
|
|
714
|
+
second: /^[0-5]?\d/,
|
|
715
|
+
// 0 to 59
|
|
716
|
+
singleDigit: /^\d/,
|
|
717
|
+
// 0 to 9
|
|
718
|
+
twoDigits: /^\d{1,2}/,
|
|
719
|
+
// 0 to 99
|
|
720
|
+
threeDigits: /^\d{1,3}/,
|
|
721
|
+
// 0 to 999
|
|
722
|
+
fourDigits: /^\d{1,4}/,
|
|
723
|
+
// 0 to 9999
|
|
724
|
+
anyDigitsSigned: /^-?\d+/,
|
|
725
|
+
singleDigitSigned: /^-?\d/,
|
|
726
|
+
// 0 to 9, -0 to -9
|
|
727
|
+
twoDigitsSigned: /^-?\d{1,2}/,
|
|
728
|
+
// 0 to 99, -0 to -99
|
|
729
|
+
threeDigitsSigned: /^-?\d{1,3}/,
|
|
730
|
+
// 0 to 999, -0 to -999
|
|
731
|
+
fourDigitsSigned: /^-?\d{1,4}/
|
|
732
|
+
// 0 to 9999, -0 to -9999
|
|
733
|
+
};
|
|
734
|
+
const timezonePatterns = {
|
|
735
|
+
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
736
|
+
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
737
|
+
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
738
|
+
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
739
|
+
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
|
|
740
|
+
};
|
|
741
|
+
function mapValue(parseFnResult, mapFn) {
|
|
742
|
+
if (!parseFnResult) {
|
|
743
|
+
return parseFnResult;
|
|
744
|
+
}
|
|
745
|
+
return {
|
|
746
|
+
value: mapFn(parseFnResult.value),
|
|
747
|
+
rest: parseFnResult.rest
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
function parseNumericPattern(pattern, dateString) {
|
|
751
|
+
const matchResult = dateString.match(pattern);
|
|
752
|
+
if (!matchResult) {
|
|
753
|
+
return null;
|
|
754
|
+
}
|
|
755
|
+
return {
|
|
756
|
+
value: parseInt(matchResult[0], 10),
|
|
757
|
+
rest: dateString.slice(matchResult[0].length)
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
function parseTimezonePattern(pattern, dateString) {
|
|
761
|
+
const matchResult = dateString.match(pattern);
|
|
762
|
+
if (!matchResult) {
|
|
763
|
+
return null;
|
|
764
|
+
}
|
|
765
|
+
if (matchResult[0] === "Z") {
|
|
766
|
+
return {
|
|
767
|
+
value: 0,
|
|
768
|
+
rest: dateString.slice(1)
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
const sign = matchResult[1] === "+" ? 1 : -1;
|
|
772
|
+
const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
|
|
773
|
+
const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
|
|
774
|
+
const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
|
|
775
|
+
return {
|
|
776
|
+
value: sign * (hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * millisecondsInSecond),
|
|
777
|
+
rest: dateString.slice(matchResult[0].length)
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
function parseAnyDigitsSigned(dateString) {
|
|
781
|
+
return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);
|
|
782
|
+
}
|
|
783
|
+
function parseNDigits(n, dateString) {
|
|
784
|
+
switch (n) {
|
|
785
|
+
case 1:
|
|
786
|
+
return parseNumericPattern(numericPatterns.singleDigit, dateString);
|
|
787
|
+
case 2:
|
|
788
|
+
return parseNumericPattern(numericPatterns.twoDigits, dateString);
|
|
789
|
+
case 3:
|
|
790
|
+
return parseNumericPattern(numericPatterns.threeDigits, dateString);
|
|
791
|
+
case 4:
|
|
792
|
+
return parseNumericPattern(numericPatterns.fourDigits, dateString);
|
|
793
|
+
default:
|
|
794
|
+
return parseNumericPattern(new RegExp("^\\d{1," + n + "}"), dateString);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
function parseNDigitsSigned(n, dateString) {
|
|
798
|
+
switch (n) {
|
|
799
|
+
case 1:
|
|
800
|
+
return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);
|
|
801
|
+
case 2:
|
|
802
|
+
return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);
|
|
803
|
+
case 3:
|
|
804
|
+
return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);
|
|
805
|
+
case 4:
|
|
806
|
+
return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);
|
|
807
|
+
default:
|
|
808
|
+
return parseNumericPattern(new RegExp("^-?\\d{1," + n + "}"), dateString);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
function dayPeriodEnumToHours(dayPeriod) {
|
|
812
|
+
switch (dayPeriod) {
|
|
813
|
+
case "morning":
|
|
814
|
+
return 4;
|
|
815
|
+
case "evening":
|
|
816
|
+
return 17;
|
|
817
|
+
case "pm":
|
|
818
|
+
case "noon":
|
|
819
|
+
case "afternoon":
|
|
820
|
+
return 12;
|
|
821
|
+
case "am":
|
|
822
|
+
case "midnight":
|
|
823
|
+
case "night":
|
|
824
|
+
default:
|
|
825
|
+
return 0;
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
function normalizeTwoDigitYear(twoDigitYear, currentYear) {
|
|
829
|
+
const isCommonEra = currentYear > 0;
|
|
830
|
+
const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
|
|
831
|
+
let result;
|
|
832
|
+
if (absCurrentYear <= 50) {
|
|
833
|
+
result = twoDigitYear || 100;
|
|
834
|
+
} else {
|
|
835
|
+
const rangeEnd = absCurrentYear + 50;
|
|
836
|
+
const rangeEndCentury = Math.trunc(rangeEnd / 100) * 100;
|
|
837
|
+
const isPreviousCentury = twoDigitYear >= rangeEnd % 100;
|
|
838
|
+
result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
|
|
839
|
+
}
|
|
840
|
+
return isCommonEra ? result : 1 - result;
|
|
841
|
+
}
|
|
842
|
+
function isLeapYearIndex(year) {
|
|
843
|
+
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
|
844
|
+
}
|
|
845
|
+
class YearParser extends Parser {
|
|
846
|
+
priority = 130;
|
|
847
|
+
incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"];
|
|
848
|
+
parse(dateString, token, match2) {
|
|
849
|
+
const valueCallback = (year) => ({
|
|
850
|
+
year,
|
|
851
|
+
isTwoDigitYear: token === "yy"
|
|
852
|
+
});
|
|
853
|
+
switch (token) {
|
|
854
|
+
case "y":
|
|
855
|
+
return mapValue(parseNDigits(4, dateString), valueCallback);
|
|
856
|
+
case "yo":
|
|
857
|
+
return mapValue(
|
|
858
|
+
match2.ordinalNumber(dateString, {
|
|
859
|
+
unit: "year"
|
|
860
|
+
}),
|
|
861
|
+
valueCallback
|
|
862
|
+
);
|
|
863
|
+
default:
|
|
864
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
validate(_date, value) {
|
|
868
|
+
return value.isTwoDigitYear || value.year > 0;
|
|
869
|
+
}
|
|
870
|
+
set(date, flags, value) {
|
|
871
|
+
const currentYear = date.getFullYear();
|
|
872
|
+
if (value.isTwoDigitYear) {
|
|
873
|
+
const normalizedTwoDigitYear = normalizeTwoDigitYear(
|
|
874
|
+
value.year,
|
|
875
|
+
currentYear
|
|
876
|
+
);
|
|
877
|
+
date.setFullYear(normalizedTwoDigitYear, 0, 1);
|
|
878
|
+
date.setHours(0, 0, 0, 0);
|
|
879
|
+
return date;
|
|
880
|
+
}
|
|
881
|
+
const year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
|
882
|
+
date.setFullYear(year, 0, 1);
|
|
883
|
+
date.setHours(0, 0, 0, 0);
|
|
884
|
+
return date;
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
function startOfWeek(date, options) {
|
|
888
|
+
const defaultOptions2 = getDefaultOptions$1();
|
|
889
|
+
const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
|
|
890
|
+
const _date = toDate(date, options?.in);
|
|
891
|
+
const day = _date.getDay();
|
|
892
|
+
const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
893
|
+
_date.setDate(_date.getDate() - diff);
|
|
894
|
+
_date.setHours(0, 0, 0, 0);
|
|
895
|
+
return _date;
|
|
896
|
+
}
|
|
897
|
+
function getWeekYear(date, options) {
|
|
898
|
+
const _date = toDate(date, options?.in);
|
|
899
|
+
const year = _date.getFullYear();
|
|
900
|
+
const defaultOptions2 = getDefaultOptions$1();
|
|
901
|
+
const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
|
|
902
|
+
const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
|
|
903
|
+
firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
|
|
904
|
+
firstWeekOfNextYear.setHours(0, 0, 0, 0);
|
|
905
|
+
const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
|
|
906
|
+
const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
|
|
907
|
+
firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
|
|
908
|
+
firstWeekOfThisYear.setHours(0, 0, 0, 0);
|
|
909
|
+
const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
|
|
910
|
+
if (+_date >= +startOfNextYear) {
|
|
911
|
+
return year + 1;
|
|
912
|
+
} else if (+_date >= +startOfThisYear) {
|
|
913
|
+
return year;
|
|
914
|
+
} else {
|
|
915
|
+
return year - 1;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
class LocalWeekYearParser extends Parser {
|
|
919
|
+
priority = 130;
|
|
920
|
+
parse(dateString, token, match2) {
|
|
921
|
+
const valueCallback = (year) => ({
|
|
922
|
+
year,
|
|
923
|
+
isTwoDigitYear: token === "YY"
|
|
924
|
+
});
|
|
925
|
+
switch (token) {
|
|
926
|
+
case "Y":
|
|
927
|
+
return mapValue(parseNDigits(4, dateString), valueCallback);
|
|
928
|
+
case "Yo":
|
|
929
|
+
return mapValue(
|
|
930
|
+
match2.ordinalNumber(dateString, {
|
|
931
|
+
unit: "year"
|
|
932
|
+
}),
|
|
933
|
+
valueCallback
|
|
934
|
+
);
|
|
935
|
+
default:
|
|
936
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
validate(_date, value) {
|
|
940
|
+
return value.isTwoDigitYear || value.year > 0;
|
|
941
|
+
}
|
|
942
|
+
set(date, flags, value, options) {
|
|
943
|
+
const currentYear = getWeekYear(date, options);
|
|
944
|
+
if (value.isTwoDigitYear) {
|
|
945
|
+
const normalizedTwoDigitYear = normalizeTwoDigitYear(
|
|
946
|
+
value.year,
|
|
947
|
+
currentYear
|
|
948
|
+
);
|
|
949
|
+
date.setFullYear(
|
|
950
|
+
normalizedTwoDigitYear,
|
|
951
|
+
0,
|
|
952
|
+
options.firstWeekContainsDate
|
|
953
|
+
);
|
|
954
|
+
date.setHours(0, 0, 0, 0);
|
|
955
|
+
return startOfWeek(date, options);
|
|
956
|
+
}
|
|
957
|
+
const year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
|
958
|
+
date.setFullYear(year, 0, options.firstWeekContainsDate);
|
|
959
|
+
date.setHours(0, 0, 0, 0);
|
|
960
|
+
return startOfWeek(date, options);
|
|
961
|
+
}
|
|
962
|
+
incompatibleTokens = [
|
|
963
|
+
"y",
|
|
964
|
+
"R",
|
|
965
|
+
"u",
|
|
966
|
+
"Q",
|
|
967
|
+
"q",
|
|
968
|
+
"M",
|
|
969
|
+
"L",
|
|
970
|
+
"I",
|
|
971
|
+
"d",
|
|
972
|
+
"D",
|
|
973
|
+
"i",
|
|
974
|
+
"t",
|
|
975
|
+
"T"
|
|
976
|
+
];
|
|
977
|
+
}
|
|
978
|
+
function startOfISOWeek(date, options) {
|
|
979
|
+
return startOfWeek(date, { ...options, weekStartsOn: 1 });
|
|
980
|
+
}
|
|
981
|
+
class ISOWeekYearParser extends Parser {
|
|
982
|
+
priority = 130;
|
|
983
|
+
parse(dateString, token) {
|
|
984
|
+
if (token === "R") {
|
|
985
|
+
return parseNDigitsSigned(4, dateString);
|
|
986
|
+
}
|
|
987
|
+
return parseNDigitsSigned(token.length, dateString);
|
|
988
|
+
}
|
|
989
|
+
set(date, _flags, value) {
|
|
990
|
+
const firstWeekOfYear = constructFrom(date, 0);
|
|
991
|
+
firstWeekOfYear.setFullYear(value, 0, 4);
|
|
992
|
+
firstWeekOfYear.setHours(0, 0, 0, 0);
|
|
993
|
+
return startOfISOWeek(firstWeekOfYear);
|
|
994
|
+
}
|
|
995
|
+
incompatibleTokens = [
|
|
996
|
+
"G",
|
|
997
|
+
"y",
|
|
998
|
+
"Y",
|
|
999
|
+
"u",
|
|
1000
|
+
"Q",
|
|
1001
|
+
"q",
|
|
1002
|
+
"M",
|
|
1003
|
+
"L",
|
|
1004
|
+
"w",
|
|
1005
|
+
"d",
|
|
1006
|
+
"D",
|
|
1007
|
+
"e",
|
|
1008
|
+
"c",
|
|
1009
|
+
"t",
|
|
1010
|
+
"T"
|
|
1011
|
+
];
|
|
1012
|
+
}
|
|
1013
|
+
class ExtendedYearParser extends Parser {
|
|
1014
|
+
priority = 130;
|
|
1015
|
+
parse(dateString, token) {
|
|
1016
|
+
if (token === "u") {
|
|
1017
|
+
return parseNDigitsSigned(4, dateString);
|
|
1018
|
+
}
|
|
1019
|
+
return parseNDigitsSigned(token.length, dateString);
|
|
1020
|
+
}
|
|
1021
|
+
set(date, _flags, value) {
|
|
1022
|
+
date.setFullYear(value, 0, 1);
|
|
1023
|
+
date.setHours(0, 0, 0, 0);
|
|
1024
|
+
return date;
|
|
1025
|
+
}
|
|
1026
|
+
incompatibleTokens = ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"];
|
|
1027
|
+
}
|
|
1028
|
+
class QuarterParser extends Parser {
|
|
1029
|
+
priority = 120;
|
|
1030
|
+
parse(dateString, token, match2) {
|
|
1031
|
+
switch (token) {
|
|
1032
|
+
// 1, 2, 3, 4
|
|
1033
|
+
case "Q":
|
|
1034
|
+
case "QQ":
|
|
1035
|
+
return parseNDigits(token.length, dateString);
|
|
1036
|
+
// 1st, 2nd, 3rd, 4th
|
|
1037
|
+
case "Qo":
|
|
1038
|
+
return match2.ordinalNumber(dateString, { unit: "quarter" });
|
|
1039
|
+
// Q1, Q2, Q3, Q4
|
|
1040
|
+
case "QQQ":
|
|
1041
|
+
return match2.quarter(dateString, {
|
|
1042
|
+
width: "abbreviated",
|
|
1043
|
+
context: "formatting"
|
|
1044
|
+
}) || match2.quarter(dateString, {
|
|
1045
|
+
width: "narrow",
|
|
1046
|
+
context: "formatting"
|
|
1047
|
+
});
|
|
1048
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1049
|
+
case "QQQQQ":
|
|
1050
|
+
return match2.quarter(dateString, {
|
|
1051
|
+
width: "narrow",
|
|
1052
|
+
context: "formatting"
|
|
1053
|
+
});
|
|
1054
|
+
// 1st quarter, 2nd quarter, ...
|
|
1055
|
+
case "QQQQ":
|
|
1056
|
+
default:
|
|
1057
|
+
return match2.quarter(dateString, {
|
|
1058
|
+
width: "wide",
|
|
1059
|
+
context: "formatting"
|
|
1060
|
+
}) || match2.quarter(dateString, {
|
|
1061
|
+
width: "abbreviated",
|
|
1062
|
+
context: "formatting"
|
|
1063
|
+
}) || match2.quarter(dateString, {
|
|
1064
|
+
width: "narrow",
|
|
1065
|
+
context: "formatting"
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
validate(_date, value) {
|
|
1070
|
+
return value >= 1 && value <= 4;
|
|
1071
|
+
}
|
|
1072
|
+
set(date, _flags, value) {
|
|
1073
|
+
date.setMonth((value - 1) * 3, 1);
|
|
1074
|
+
date.setHours(0, 0, 0, 0);
|
|
1075
|
+
return date;
|
|
1076
|
+
}
|
|
1077
|
+
incompatibleTokens = [
|
|
1078
|
+
"Y",
|
|
1079
|
+
"R",
|
|
1080
|
+
"q",
|
|
1081
|
+
"M",
|
|
1082
|
+
"L",
|
|
1083
|
+
"w",
|
|
1084
|
+
"I",
|
|
1085
|
+
"d",
|
|
1086
|
+
"D",
|
|
1087
|
+
"i",
|
|
1088
|
+
"e",
|
|
1089
|
+
"c",
|
|
1090
|
+
"t",
|
|
1091
|
+
"T"
|
|
1092
|
+
];
|
|
1093
|
+
}
|
|
1094
|
+
class StandAloneQuarterParser extends Parser {
|
|
1095
|
+
priority = 120;
|
|
1096
|
+
parse(dateString, token, match2) {
|
|
1097
|
+
switch (token) {
|
|
1098
|
+
// 1, 2, 3, 4
|
|
1099
|
+
case "q":
|
|
1100
|
+
case "qq":
|
|
1101
|
+
return parseNDigits(token.length, dateString);
|
|
1102
|
+
// 1st, 2nd, 3rd, 4th
|
|
1103
|
+
case "qo":
|
|
1104
|
+
return match2.ordinalNumber(dateString, { unit: "quarter" });
|
|
1105
|
+
// Q1, Q2, Q3, Q4
|
|
1106
|
+
case "qqq":
|
|
1107
|
+
return match2.quarter(dateString, {
|
|
1108
|
+
width: "abbreviated",
|
|
1109
|
+
context: "standalone"
|
|
1110
|
+
}) || match2.quarter(dateString, {
|
|
1111
|
+
width: "narrow",
|
|
1112
|
+
context: "standalone"
|
|
1113
|
+
});
|
|
1114
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1115
|
+
case "qqqqq":
|
|
1116
|
+
return match2.quarter(dateString, {
|
|
1117
|
+
width: "narrow",
|
|
1118
|
+
context: "standalone"
|
|
1119
|
+
});
|
|
1120
|
+
// 1st quarter, 2nd quarter, ...
|
|
1121
|
+
case "qqqq":
|
|
1122
|
+
default:
|
|
1123
|
+
return match2.quarter(dateString, {
|
|
1124
|
+
width: "wide",
|
|
1125
|
+
context: "standalone"
|
|
1126
|
+
}) || match2.quarter(dateString, {
|
|
1127
|
+
width: "abbreviated",
|
|
1128
|
+
context: "standalone"
|
|
1129
|
+
}) || match2.quarter(dateString, {
|
|
1130
|
+
width: "narrow",
|
|
1131
|
+
context: "standalone"
|
|
1132
|
+
});
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
validate(_date, value) {
|
|
1136
|
+
return value >= 1 && value <= 4;
|
|
1137
|
+
}
|
|
1138
|
+
set(date, _flags, value) {
|
|
1139
|
+
date.setMonth((value - 1) * 3, 1);
|
|
1140
|
+
date.setHours(0, 0, 0, 0);
|
|
1141
|
+
return date;
|
|
1142
|
+
}
|
|
1143
|
+
incompatibleTokens = [
|
|
1144
|
+
"Y",
|
|
1145
|
+
"R",
|
|
1146
|
+
"Q",
|
|
1147
|
+
"M",
|
|
1148
|
+
"L",
|
|
1149
|
+
"w",
|
|
1150
|
+
"I",
|
|
1151
|
+
"d",
|
|
1152
|
+
"D",
|
|
1153
|
+
"i",
|
|
1154
|
+
"e",
|
|
1155
|
+
"c",
|
|
1156
|
+
"t",
|
|
1157
|
+
"T"
|
|
1158
|
+
];
|
|
1159
|
+
}
|
|
1160
|
+
class MonthParser extends Parser {
|
|
1161
|
+
incompatibleTokens = [
|
|
1162
|
+
"Y",
|
|
1163
|
+
"R",
|
|
1164
|
+
"q",
|
|
1165
|
+
"Q",
|
|
1166
|
+
"L",
|
|
1167
|
+
"w",
|
|
1168
|
+
"I",
|
|
1169
|
+
"D",
|
|
1170
|
+
"i",
|
|
1171
|
+
"e",
|
|
1172
|
+
"c",
|
|
1173
|
+
"t",
|
|
1174
|
+
"T"
|
|
1175
|
+
];
|
|
1176
|
+
priority = 110;
|
|
1177
|
+
parse(dateString, token, match2) {
|
|
1178
|
+
const valueCallback = (value) => value - 1;
|
|
1179
|
+
switch (token) {
|
|
1180
|
+
// 1, 2, ..., 12
|
|
1181
|
+
case "M":
|
|
1182
|
+
return mapValue(
|
|
1183
|
+
parseNumericPattern(numericPatterns.month, dateString),
|
|
1184
|
+
valueCallback
|
|
1185
|
+
);
|
|
1186
|
+
// 01, 02, ..., 12
|
|
1187
|
+
case "MM":
|
|
1188
|
+
return mapValue(parseNDigits(2, dateString), valueCallback);
|
|
1189
|
+
// 1st, 2nd, ..., 12th
|
|
1190
|
+
case "Mo":
|
|
1191
|
+
return mapValue(
|
|
1192
|
+
match2.ordinalNumber(dateString, {
|
|
1193
|
+
unit: "month"
|
|
1194
|
+
}),
|
|
1195
|
+
valueCallback
|
|
1196
|
+
);
|
|
1197
|
+
// Jan, Feb, ..., Dec
|
|
1198
|
+
case "MMM":
|
|
1199
|
+
return match2.month(dateString, {
|
|
1200
|
+
width: "abbreviated",
|
|
1201
|
+
context: "formatting"
|
|
1202
|
+
}) || match2.month(dateString, { width: "narrow", context: "formatting" });
|
|
1203
|
+
// J, F, ..., D
|
|
1204
|
+
case "MMMMM":
|
|
1205
|
+
return match2.month(dateString, {
|
|
1206
|
+
width: "narrow",
|
|
1207
|
+
context: "formatting"
|
|
1208
|
+
});
|
|
1209
|
+
// January, February, ..., December
|
|
1210
|
+
case "MMMM":
|
|
1211
|
+
default:
|
|
1212
|
+
return match2.month(dateString, { width: "wide", context: "formatting" }) || match2.month(dateString, {
|
|
1213
|
+
width: "abbreviated",
|
|
1214
|
+
context: "formatting"
|
|
1215
|
+
}) || match2.month(dateString, { width: "narrow", context: "formatting" });
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
validate(_date, value) {
|
|
1219
|
+
return value >= 0 && value <= 11;
|
|
1220
|
+
}
|
|
1221
|
+
set(date, _flags, value) {
|
|
1222
|
+
date.setMonth(value, 1);
|
|
1223
|
+
date.setHours(0, 0, 0, 0);
|
|
1224
|
+
return date;
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
class StandAloneMonthParser extends Parser {
|
|
1228
|
+
priority = 110;
|
|
1229
|
+
parse(dateString, token, match2) {
|
|
1230
|
+
const valueCallback = (value) => value - 1;
|
|
1231
|
+
switch (token) {
|
|
1232
|
+
// 1, 2, ..., 12
|
|
1233
|
+
case "L":
|
|
1234
|
+
return mapValue(
|
|
1235
|
+
parseNumericPattern(numericPatterns.month, dateString),
|
|
1236
|
+
valueCallback
|
|
1237
|
+
);
|
|
1238
|
+
// 01, 02, ..., 12
|
|
1239
|
+
case "LL":
|
|
1240
|
+
return mapValue(parseNDigits(2, dateString), valueCallback);
|
|
1241
|
+
// 1st, 2nd, ..., 12th
|
|
1242
|
+
case "Lo":
|
|
1243
|
+
return mapValue(
|
|
1244
|
+
match2.ordinalNumber(dateString, {
|
|
1245
|
+
unit: "month"
|
|
1246
|
+
}),
|
|
1247
|
+
valueCallback
|
|
1248
|
+
);
|
|
1249
|
+
// Jan, Feb, ..., Dec
|
|
1250
|
+
case "LLL":
|
|
1251
|
+
return match2.month(dateString, {
|
|
1252
|
+
width: "abbreviated",
|
|
1253
|
+
context: "standalone"
|
|
1254
|
+
}) || match2.month(dateString, { width: "narrow", context: "standalone" });
|
|
1255
|
+
// J, F, ..., D
|
|
1256
|
+
case "LLLLL":
|
|
1257
|
+
return match2.month(dateString, {
|
|
1258
|
+
width: "narrow",
|
|
1259
|
+
context: "standalone"
|
|
1260
|
+
});
|
|
1261
|
+
// January, February, ..., December
|
|
1262
|
+
case "LLLL":
|
|
1263
|
+
default:
|
|
1264
|
+
return match2.month(dateString, { width: "wide", context: "standalone" }) || match2.month(dateString, {
|
|
1265
|
+
width: "abbreviated",
|
|
1266
|
+
context: "standalone"
|
|
1267
|
+
}) || match2.month(dateString, { width: "narrow", context: "standalone" });
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
validate(_date, value) {
|
|
1271
|
+
return value >= 0 && value <= 11;
|
|
1272
|
+
}
|
|
1273
|
+
set(date, _flags, value) {
|
|
1274
|
+
date.setMonth(value, 1);
|
|
1275
|
+
date.setHours(0, 0, 0, 0);
|
|
1276
|
+
return date;
|
|
1277
|
+
}
|
|
1278
|
+
incompatibleTokens = [
|
|
1279
|
+
"Y",
|
|
1280
|
+
"R",
|
|
1281
|
+
"q",
|
|
1282
|
+
"Q",
|
|
1283
|
+
"M",
|
|
1284
|
+
"w",
|
|
1285
|
+
"I",
|
|
1286
|
+
"D",
|
|
1287
|
+
"i",
|
|
1288
|
+
"e",
|
|
1289
|
+
"c",
|
|
1290
|
+
"t",
|
|
1291
|
+
"T"
|
|
1292
|
+
];
|
|
1293
|
+
}
|
|
1294
|
+
function startOfWeekYear(date, options) {
|
|
1295
|
+
const defaultOptions2 = getDefaultOptions$1();
|
|
1296
|
+
const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
|
|
1297
|
+
const year = getWeekYear(date, options);
|
|
1298
|
+
const firstWeek = constructFrom(options?.in || date, 0);
|
|
1299
|
+
firstWeek.setFullYear(year, 0, firstWeekContainsDate);
|
|
1300
|
+
firstWeek.setHours(0, 0, 0, 0);
|
|
1301
|
+
const _date = startOfWeek(firstWeek, options);
|
|
1302
|
+
return _date;
|
|
1303
|
+
}
|
|
1304
|
+
function getWeek(date, options) {
|
|
1305
|
+
const _date = toDate(date, options?.in);
|
|
1306
|
+
const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
|
|
1307
|
+
return Math.round(diff / millisecondsInWeek) + 1;
|
|
1308
|
+
}
|
|
1309
|
+
function setWeek(date, week, options) {
|
|
1310
|
+
const date_ = toDate(date, options?.in);
|
|
1311
|
+
const diff = getWeek(date_, options) - week;
|
|
1312
|
+
date_.setDate(date_.getDate() - diff * 7);
|
|
1313
|
+
return toDate(date_, options?.in);
|
|
1314
|
+
}
|
|
1315
|
+
class LocalWeekParser extends Parser {
|
|
1316
|
+
priority = 100;
|
|
1317
|
+
parse(dateString, token, match2) {
|
|
1318
|
+
switch (token) {
|
|
1319
|
+
case "w":
|
|
1320
|
+
return parseNumericPattern(numericPatterns.week, dateString);
|
|
1321
|
+
case "wo":
|
|
1322
|
+
return match2.ordinalNumber(dateString, { unit: "week" });
|
|
1323
|
+
default:
|
|
1324
|
+
return parseNDigits(token.length, dateString);
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
validate(_date, value) {
|
|
1328
|
+
return value >= 1 && value <= 53;
|
|
1329
|
+
}
|
|
1330
|
+
set(date, _flags, value, options) {
|
|
1331
|
+
return startOfWeek(setWeek(date, value, options), options);
|
|
1332
|
+
}
|
|
1333
|
+
incompatibleTokens = [
|
|
1334
|
+
"y",
|
|
1335
|
+
"R",
|
|
1336
|
+
"u",
|
|
1337
|
+
"q",
|
|
1338
|
+
"Q",
|
|
1339
|
+
"M",
|
|
1340
|
+
"L",
|
|
1341
|
+
"I",
|
|
1342
|
+
"d",
|
|
1343
|
+
"D",
|
|
1344
|
+
"i",
|
|
1345
|
+
"t",
|
|
1346
|
+
"T"
|
|
1347
|
+
];
|
|
1348
|
+
}
|
|
1349
|
+
function getISOWeekYear(date, options) {
|
|
1350
|
+
const _date = toDate(date, options?.in);
|
|
1351
|
+
const year = _date.getFullYear();
|
|
1352
|
+
const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
|
|
1353
|
+
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
|
|
1354
|
+
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
|
|
1355
|
+
const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
|
|
1356
|
+
const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
|
|
1357
|
+
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
|
|
1358
|
+
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
|
|
1359
|
+
const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
|
|
1360
|
+
if (_date.getTime() >= startOfNextYear.getTime()) {
|
|
1361
|
+
return year + 1;
|
|
1362
|
+
} else if (_date.getTime() >= startOfThisYear.getTime()) {
|
|
1363
|
+
return year;
|
|
1364
|
+
} else {
|
|
1365
|
+
return year - 1;
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
function startOfISOWeekYear(date, options) {
|
|
1369
|
+
const year = getISOWeekYear(date, options);
|
|
1370
|
+
const fourthOfJanuary = constructFrom(date, 0);
|
|
1371
|
+
fourthOfJanuary.setFullYear(year, 0, 4);
|
|
1372
|
+
fourthOfJanuary.setHours(0, 0, 0, 0);
|
|
1373
|
+
return startOfISOWeek(fourthOfJanuary);
|
|
1374
|
+
}
|
|
1375
|
+
function getISOWeek(date, options) {
|
|
1376
|
+
const _date = toDate(date, options?.in);
|
|
1377
|
+
const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
|
|
1378
|
+
return Math.round(diff / millisecondsInWeek) + 1;
|
|
1379
|
+
}
|
|
1380
|
+
function setISOWeek(date, week, options) {
|
|
1381
|
+
const _date = toDate(date, options?.in);
|
|
1382
|
+
const diff = getISOWeek(_date, options) - week;
|
|
1383
|
+
_date.setDate(_date.getDate() - diff * 7);
|
|
1384
|
+
return _date;
|
|
1385
|
+
}
|
|
1386
|
+
class ISOWeekParser extends Parser {
|
|
1387
|
+
priority = 100;
|
|
1388
|
+
parse(dateString, token, match2) {
|
|
1389
|
+
switch (token) {
|
|
1390
|
+
case "I":
|
|
1391
|
+
return parseNumericPattern(numericPatterns.week, dateString);
|
|
1392
|
+
case "Io":
|
|
1393
|
+
return match2.ordinalNumber(dateString, { unit: "week" });
|
|
1394
|
+
default:
|
|
1395
|
+
return parseNDigits(token.length, dateString);
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
validate(_date, value) {
|
|
1399
|
+
return value >= 1 && value <= 53;
|
|
1400
|
+
}
|
|
1401
|
+
set(date, _flags, value) {
|
|
1402
|
+
return startOfISOWeek(setISOWeek(date, value));
|
|
1403
|
+
}
|
|
1404
|
+
incompatibleTokens = [
|
|
1405
|
+
"y",
|
|
1406
|
+
"Y",
|
|
1407
|
+
"u",
|
|
1408
|
+
"q",
|
|
1409
|
+
"Q",
|
|
1410
|
+
"M",
|
|
1411
|
+
"L",
|
|
1412
|
+
"w",
|
|
1413
|
+
"d",
|
|
1414
|
+
"D",
|
|
1415
|
+
"e",
|
|
1416
|
+
"c",
|
|
1417
|
+
"t",
|
|
1418
|
+
"T"
|
|
1419
|
+
];
|
|
1420
|
+
}
|
|
1421
|
+
const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
1422
|
+
const DAYS_IN_MONTH_LEAP_YEAR = [
|
|
1423
|
+
31,
|
|
1424
|
+
29,
|
|
1425
|
+
31,
|
|
1426
|
+
30,
|
|
1427
|
+
31,
|
|
1428
|
+
30,
|
|
1429
|
+
31,
|
|
1430
|
+
31,
|
|
1431
|
+
30,
|
|
1432
|
+
31,
|
|
1433
|
+
30,
|
|
1434
|
+
31
|
|
1435
|
+
];
|
|
1436
|
+
class DateParser extends Parser {
|
|
1437
|
+
priority = 90;
|
|
1438
|
+
subPriority = 1;
|
|
1439
|
+
parse(dateString, token, match2) {
|
|
1440
|
+
switch (token) {
|
|
1441
|
+
case "d":
|
|
1442
|
+
return parseNumericPattern(numericPatterns.date, dateString);
|
|
1443
|
+
case "do":
|
|
1444
|
+
return match2.ordinalNumber(dateString, { unit: "date" });
|
|
1445
|
+
default:
|
|
1446
|
+
return parseNDigits(token.length, dateString);
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
validate(date, value) {
|
|
1450
|
+
const year = date.getFullYear();
|
|
1451
|
+
const isLeapYear = isLeapYearIndex(year);
|
|
1452
|
+
const month = date.getMonth();
|
|
1453
|
+
if (isLeapYear) {
|
|
1454
|
+
return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
|
|
1455
|
+
} else {
|
|
1456
|
+
return value >= 1 && value <= DAYS_IN_MONTH[month];
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
set(date, _flags, value) {
|
|
1460
|
+
date.setDate(value);
|
|
1461
|
+
date.setHours(0, 0, 0, 0);
|
|
1462
|
+
return date;
|
|
1463
|
+
}
|
|
1464
|
+
incompatibleTokens = [
|
|
1465
|
+
"Y",
|
|
1466
|
+
"R",
|
|
1467
|
+
"q",
|
|
1468
|
+
"Q",
|
|
1469
|
+
"w",
|
|
1470
|
+
"I",
|
|
1471
|
+
"D",
|
|
1472
|
+
"i",
|
|
1473
|
+
"e",
|
|
1474
|
+
"c",
|
|
1475
|
+
"t",
|
|
1476
|
+
"T"
|
|
1477
|
+
];
|
|
1478
|
+
}
|
|
1479
|
+
class DayOfYearParser extends Parser {
|
|
1480
|
+
priority = 90;
|
|
1481
|
+
subpriority = 1;
|
|
1482
|
+
parse(dateString, token, match2) {
|
|
1483
|
+
switch (token) {
|
|
1484
|
+
case "D":
|
|
1485
|
+
case "DD":
|
|
1486
|
+
return parseNumericPattern(numericPatterns.dayOfYear, dateString);
|
|
1487
|
+
case "Do":
|
|
1488
|
+
return match2.ordinalNumber(dateString, { unit: "date" });
|
|
1489
|
+
default:
|
|
1490
|
+
return parseNDigits(token.length, dateString);
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
validate(date, value) {
|
|
1494
|
+
const year = date.getFullYear();
|
|
1495
|
+
const isLeapYear = isLeapYearIndex(year);
|
|
1496
|
+
if (isLeapYear) {
|
|
1497
|
+
return value >= 1 && value <= 366;
|
|
1498
|
+
} else {
|
|
1499
|
+
return value >= 1 && value <= 365;
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
set(date, _flags, value) {
|
|
1503
|
+
date.setMonth(0, value);
|
|
1504
|
+
date.setHours(0, 0, 0, 0);
|
|
1505
|
+
return date;
|
|
1506
|
+
}
|
|
1507
|
+
incompatibleTokens = [
|
|
1508
|
+
"Y",
|
|
1509
|
+
"R",
|
|
1510
|
+
"q",
|
|
1511
|
+
"Q",
|
|
1512
|
+
"M",
|
|
1513
|
+
"L",
|
|
1514
|
+
"w",
|
|
1515
|
+
"I",
|
|
1516
|
+
"d",
|
|
1517
|
+
"E",
|
|
1518
|
+
"i",
|
|
1519
|
+
"e",
|
|
1520
|
+
"c",
|
|
1521
|
+
"t",
|
|
1522
|
+
"T"
|
|
1523
|
+
];
|
|
1524
|
+
}
|
|
1525
|
+
function addDays(date, amount, options) {
|
|
1526
|
+
const _date = toDate(date, options?.in);
|
|
1527
|
+
if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
|
|
1528
|
+
if (!amount) return _date;
|
|
1529
|
+
_date.setDate(_date.getDate() + amount);
|
|
1530
|
+
return _date;
|
|
1531
|
+
}
|
|
1532
|
+
function setDay(date, day, options) {
|
|
1533
|
+
const defaultOptions2 = getDefaultOptions$1();
|
|
1534
|
+
const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
|
|
1535
|
+
const date_ = toDate(date, options?.in);
|
|
1536
|
+
const currentDay = date_.getDay();
|
|
1537
|
+
const remainder = day % 7;
|
|
1538
|
+
const dayIndex = (remainder + 7) % 7;
|
|
1539
|
+
const delta = 7 - weekStartsOn;
|
|
1540
|
+
const diff = day < 0 || day > 6 ? day - (currentDay + delta) % 7 : (dayIndex + delta) % 7 - (currentDay + delta) % 7;
|
|
1541
|
+
return addDays(date_, diff, options);
|
|
1542
|
+
}
|
|
1543
|
+
class DayParser extends Parser {
|
|
1544
|
+
priority = 90;
|
|
1545
|
+
parse(dateString, token, match2) {
|
|
1546
|
+
switch (token) {
|
|
1547
|
+
// Tue
|
|
1548
|
+
case "E":
|
|
1549
|
+
case "EE":
|
|
1550
|
+
case "EEE":
|
|
1551
|
+
return match2.day(dateString, {
|
|
1552
|
+
width: "abbreviated",
|
|
1553
|
+
context: "formatting"
|
|
1554
|
+
}) || match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" });
|
|
1555
|
+
// T
|
|
1556
|
+
case "EEEEE":
|
|
1557
|
+
return match2.day(dateString, {
|
|
1558
|
+
width: "narrow",
|
|
1559
|
+
context: "formatting"
|
|
1560
|
+
});
|
|
1561
|
+
// Tu
|
|
1562
|
+
case "EEEEEE":
|
|
1563
|
+
return match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" });
|
|
1564
|
+
// Tuesday
|
|
1565
|
+
case "EEEE":
|
|
1566
|
+
default:
|
|
1567
|
+
return match2.day(dateString, { width: "wide", context: "formatting" }) || match2.day(dateString, {
|
|
1568
|
+
width: "abbreviated",
|
|
1569
|
+
context: "formatting"
|
|
1570
|
+
}) || match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" });
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
validate(_date, value) {
|
|
1574
|
+
return value >= 0 && value <= 6;
|
|
1575
|
+
}
|
|
1576
|
+
set(date, _flags, value, options) {
|
|
1577
|
+
date = setDay(date, value, options);
|
|
1578
|
+
date.setHours(0, 0, 0, 0);
|
|
1579
|
+
return date;
|
|
1580
|
+
}
|
|
1581
|
+
incompatibleTokens = ["D", "i", "e", "c", "t", "T"];
|
|
1582
|
+
}
|
|
1583
|
+
class LocalDayParser extends Parser {
|
|
1584
|
+
priority = 90;
|
|
1585
|
+
parse(dateString, token, match2, options) {
|
|
1586
|
+
const valueCallback = (value) => {
|
|
1587
|
+
const wholeWeekDays = Math.floor((value - 1) / 7) * 7;
|
|
1588
|
+
return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
|
|
1589
|
+
};
|
|
1590
|
+
switch (token) {
|
|
1591
|
+
// 3
|
|
1592
|
+
case "e":
|
|
1593
|
+
case "ee":
|
|
1594
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
1595
|
+
// 3rd
|
|
1596
|
+
case "eo":
|
|
1597
|
+
return mapValue(
|
|
1598
|
+
match2.ordinalNumber(dateString, {
|
|
1599
|
+
unit: "day"
|
|
1600
|
+
}),
|
|
1601
|
+
valueCallback
|
|
1602
|
+
);
|
|
1603
|
+
// Tue
|
|
1604
|
+
case "eee":
|
|
1605
|
+
return match2.day(dateString, {
|
|
1606
|
+
width: "abbreviated",
|
|
1607
|
+
context: "formatting"
|
|
1608
|
+
}) || match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" });
|
|
1609
|
+
// T
|
|
1610
|
+
case "eeeee":
|
|
1611
|
+
return match2.day(dateString, {
|
|
1612
|
+
width: "narrow",
|
|
1613
|
+
context: "formatting"
|
|
1614
|
+
});
|
|
1615
|
+
// Tu
|
|
1616
|
+
case "eeeeee":
|
|
1617
|
+
return match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" });
|
|
1618
|
+
// Tuesday
|
|
1619
|
+
case "eeee":
|
|
1620
|
+
default:
|
|
1621
|
+
return match2.day(dateString, { width: "wide", context: "formatting" }) || match2.day(dateString, {
|
|
1622
|
+
width: "abbreviated",
|
|
1623
|
+
context: "formatting"
|
|
1624
|
+
}) || match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" });
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
validate(_date, value) {
|
|
1628
|
+
return value >= 0 && value <= 6;
|
|
1629
|
+
}
|
|
1630
|
+
set(date, _flags, value, options) {
|
|
1631
|
+
date = setDay(date, value, options);
|
|
1632
|
+
date.setHours(0, 0, 0, 0);
|
|
1633
|
+
return date;
|
|
1634
|
+
}
|
|
1635
|
+
incompatibleTokens = [
|
|
1636
|
+
"y",
|
|
1637
|
+
"R",
|
|
1638
|
+
"u",
|
|
1639
|
+
"q",
|
|
1640
|
+
"Q",
|
|
1641
|
+
"M",
|
|
1642
|
+
"L",
|
|
1643
|
+
"I",
|
|
1644
|
+
"d",
|
|
1645
|
+
"D",
|
|
1646
|
+
"E",
|
|
1647
|
+
"i",
|
|
1648
|
+
"c",
|
|
1649
|
+
"t",
|
|
1650
|
+
"T"
|
|
1651
|
+
];
|
|
1652
|
+
}
|
|
1653
|
+
class StandAloneLocalDayParser extends Parser {
|
|
1654
|
+
priority = 90;
|
|
1655
|
+
parse(dateString, token, match2, options) {
|
|
1656
|
+
const valueCallback = (value) => {
|
|
1657
|
+
const wholeWeekDays = Math.floor((value - 1) / 7) * 7;
|
|
1658
|
+
return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
|
|
1659
|
+
};
|
|
1660
|
+
switch (token) {
|
|
1661
|
+
// 3
|
|
1662
|
+
case "c":
|
|
1663
|
+
case "cc":
|
|
1664
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
1665
|
+
// 3rd
|
|
1666
|
+
case "co":
|
|
1667
|
+
return mapValue(
|
|
1668
|
+
match2.ordinalNumber(dateString, {
|
|
1669
|
+
unit: "day"
|
|
1670
|
+
}),
|
|
1671
|
+
valueCallback
|
|
1672
|
+
);
|
|
1673
|
+
// Tue
|
|
1674
|
+
case "ccc":
|
|
1675
|
+
return match2.day(dateString, {
|
|
1676
|
+
width: "abbreviated",
|
|
1677
|
+
context: "standalone"
|
|
1678
|
+
}) || match2.day(dateString, { width: "short", context: "standalone" }) || match2.day(dateString, { width: "narrow", context: "standalone" });
|
|
1679
|
+
// T
|
|
1680
|
+
case "ccccc":
|
|
1681
|
+
return match2.day(dateString, {
|
|
1682
|
+
width: "narrow",
|
|
1683
|
+
context: "standalone"
|
|
1684
|
+
});
|
|
1685
|
+
// Tu
|
|
1686
|
+
case "cccccc":
|
|
1687
|
+
return match2.day(dateString, { width: "short", context: "standalone" }) || match2.day(dateString, { width: "narrow", context: "standalone" });
|
|
1688
|
+
// Tuesday
|
|
1689
|
+
case "cccc":
|
|
1690
|
+
default:
|
|
1691
|
+
return match2.day(dateString, { width: "wide", context: "standalone" }) || match2.day(dateString, {
|
|
1692
|
+
width: "abbreviated",
|
|
1693
|
+
context: "standalone"
|
|
1694
|
+
}) || match2.day(dateString, { width: "short", context: "standalone" }) || match2.day(dateString, { width: "narrow", context: "standalone" });
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
validate(_date, value) {
|
|
1698
|
+
return value >= 0 && value <= 6;
|
|
1699
|
+
}
|
|
1700
|
+
set(date, _flags, value, options) {
|
|
1701
|
+
date = setDay(date, value, options);
|
|
1702
|
+
date.setHours(0, 0, 0, 0);
|
|
1703
|
+
return date;
|
|
1704
|
+
}
|
|
1705
|
+
incompatibleTokens = [
|
|
1706
|
+
"y",
|
|
1707
|
+
"R",
|
|
1708
|
+
"u",
|
|
1709
|
+
"q",
|
|
1710
|
+
"Q",
|
|
1711
|
+
"M",
|
|
1712
|
+
"L",
|
|
1713
|
+
"I",
|
|
1714
|
+
"d",
|
|
1715
|
+
"D",
|
|
1716
|
+
"E",
|
|
1717
|
+
"i",
|
|
1718
|
+
"e",
|
|
1719
|
+
"t",
|
|
1720
|
+
"T"
|
|
1721
|
+
];
|
|
1722
|
+
}
|
|
1723
|
+
function getISODay(date, options) {
|
|
1724
|
+
const day = toDate(date, options?.in).getDay();
|
|
1725
|
+
return day === 0 ? 7 : day;
|
|
1726
|
+
}
|
|
1727
|
+
function setISODay(date, day, options) {
|
|
1728
|
+
const date_ = toDate(date, options?.in);
|
|
1729
|
+
const currentDay = getISODay(date_, options);
|
|
1730
|
+
const diff = day - currentDay;
|
|
1731
|
+
return addDays(date_, diff, options);
|
|
1732
|
+
}
|
|
1733
|
+
class ISODayParser extends Parser {
|
|
1734
|
+
priority = 90;
|
|
1735
|
+
parse(dateString, token, match2) {
|
|
1736
|
+
const valueCallback = (value) => {
|
|
1737
|
+
if (value === 0) {
|
|
1738
|
+
return 7;
|
|
1739
|
+
}
|
|
1740
|
+
return value;
|
|
1741
|
+
};
|
|
1742
|
+
switch (token) {
|
|
1743
|
+
// 2
|
|
1744
|
+
case "i":
|
|
1745
|
+
case "ii":
|
|
1746
|
+
return parseNDigits(token.length, dateString);
|
|
1747
|
+
// 2nd
|
|
1748
|
+
case "io":
|
|
1749
|
+
return match2.ordinalNumber(dateString, { unit: "day" });
|
|
1750
|
+
// Tue
|
|
1751
|
+
case "iii":
|
|
1752
|
+
return mapValue(
|
|
1753
|
+
match2.day(dateString, {
|
|
1754
|
+
width: "abbreviated",
|
|
1755
|
+
context: "formatting"
|
|
1756
|
+
}) || match2.day(dateString, {
|
|
1757
|
+
width: "short",
|
|
1758
|
+
context: "formatting"
|
|
1759
|
+
}) || match2.day(dateString, {
|
|
1760
|
+
width: "narrow",
|
|
1761
|
+
context: "formatting"
|
|
1762
|
+
}),
|
|
1763
|
+
valueCallback
|
|
1764
|
+
);
|
|
1765
|
+
// T
|
|
1766
|
+
case "iiiii":
|
|
1767
|
+
return mapValue(
|
|
1768
|
+
match2.day(dateString, {
|
|
1769
|
+
width: "narrow",
|
|
1770
|
+
context: "formatting"
|
|
1771
|
+
}),
|
|
1772
|
+
valueCallback
|
|
1773
|
+
);
|
|
1774
|
+
// Tu
|
|
1775
|
+
case "iiiiii":
|
|
1776
|
+
return mapValue(
|
|
1777
|
+
match2.day(dateString, {
|
|
1778
|
+
width: "short",
|
|
1779
|
+
context: "formatting"
|
|
1780
|
+
}) || match2.day(dateString, {
|
|
1781
|
+
width: "narrow",
|
|
1782
|
+
context: "formatting"
|
|
1783
|
+
}),
|
|
1784
|
+
valueCallback
|
|
1785
|
+
);
|
|
1786
|
+
// Tuesday
|
|
1787
|
+
case "iiii":
|
|
1788
|
+
default:
|
|
1789
|
+
return mapValue(
|
|
1790
|
+
match2.day(dateString, {
|
|
1791
|
+
width: "wide",
|
|
1792
|
+
context: "formatting"
|
|
1793
|
+
}) || match2.day(dateString, {
|
|
1794
|
+
width: "abbreviated",
|
|
1795
|
+
context: "formatting"
|
|
1796
|
+
}) || match2.day(dateString, {
|
|
1797
|
+
width: "short",
|
|
1798
|
+
context: "formatting"
|
|
1799
|
+
}) || match2.day(dateString, {
|
|
1800
|
+
width: "narrow",
|
|
1801
|
+
context: "formatting"
|
|
1802
|
+
}),
|
|
1803
|
+
valueCallback
|
|
1804
|
+
);
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
validate(_date, value) {
|
|
1808
|
+
return value >= 1 && value <= 7;
|
|
1809
|
+
}
|
|
1810
|
+
set(date, _flags, value) {
|
|
1811
|
+
date = setISODay(date, value);
|
|
1812
|
+
date.setHours(0, 0, 0, 0);
|
|
1813
|
+
return date;
|
|
1814
|
+
}
|
|
1815
|
+
incompatibleTokens = [
|
|
1816
|
+
"y",
|
|
1817
|
+
"Y",
|
|
1818
|
+
"u",
|
|
1819
|
+
"q",
|
|
1820
|
+
"Q",
|
|
1821
|
+
"M",
|
|
1822
|
+
"L",
|
|
1823
|
+
"w",
|
|
1824
|
+
"d",
|
|
1825
|
+
"D",
|
|
1826
|
+
"E",
|
|
1827
|
+
"e",
|
|
1828
|
+
"c",
|
|
1829
|
+
"t",
|
|
1830
|
+
"T"
|
|
1831
|
+
];
|
|
1832
|
+
}
|
|
1833
|
+
class AMPMParser extends Parser {
|
|
1834
|
+
priority = 80;
|
|
1835
|
+
parse(dateString, token, match2) {
|
|
1836
|
+
switch (token) {
|
|
1837
|
+
case "a":
|
|
1838
|
+
case "aa":
|
|
1839
|
+
case "aaa":
|
|
1840
|
+
return match2.dayPeriod(dateString, {
|
|
1841
|
+
width: "abbreviated",
|
|
1842
|
+
context: "formatting"
|
|
1843
|
+
}) || match2.dayPeriod(dateString, {
|
|
1844
|
+
width: "narrow",
|
|
1845
|
+
context: "formatting"
|
|
1846
|
+
});
|
|
1847
|
+
case "aaaaa":
|
|
1848
|
+
return match2.dayPeriod(dateString, {
|
|
1849
|
+
width: "narrow",
|
|
1850
|
+
context: "formatting"
|
|
1851
|
+
});
|
|
1852
|
+
case "aaaa":
|
|
1853
|
+
default:
|
|
1854
|
+
return match2.dayPeriod(dateString, {
|
|
1855
|
+
width: "wide",
|
|
1856
|
+
context: "formatting"
|
|
1857
|
+
}) || match2.dayPeriod(dateString, {
|
|
1858
|
+
width: "abbreviated",
|
|
1859
|
+
context: "formatting"
|
|
1860
|
+
}) || match2.dayPeriod(dateString, {
|
|
1861
|
+
width: "narrow",
|
|
1862
|
+
context: "formatting"
|
|
1863
|
+
});
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
set(date, _flags, value) {
|
|
1867
|
+
date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);
|
|
1868
|
+
return date;
|
|
1869
|
+
}
|
|
1870
|
+
incompatibleTokens = ["b", "B", "H", "k", "t", "T"];
|
|
1871
|
+
}
|
|
1872
|
+
class AMPMMidnightParser extends Parser {
|
|
1873
|
+
priority = 80;
|
|
1874
|
+
parse(dateString, token, match2) {
|
|
1875
|
+
switch (token) {
|
|
1876
|
+
case "b":
|
|
1877
|
+
case "bb":
|
|
1878
|
+
case "bbb":
|
|
1879
|
+
return match2.dayPeriod(dateString, {
|
|
1880
|
+
width: "abbreviated",
|
|
1881
|
+
context: "formatting"
|
|
1882
|
+
}) || match2.dayPeriod(dateString, {
|
|
1883
|
+
width: "narrow",
|
|
1884
|
+
context: "formatting"
|
|
1885
|
+
});
|
|
1886
|
+
case "bbbbb":
|
|
1887
|
+
return match2.dayPeriod(dateString, {
|
|
1888
|
+
width: "narrow",
|
|
1889
|
+
context: "formatting"
|
|
1890
|
+
});
|
|
1891
|
+
case "bbbb":
|
|
1892
|
+
default:
|
|
1893
|
+
return match2.dayPeriod(dateString, {
|
|
1894
|
+
width: "wide",
|
|
1895
|
+
context: "formatting"
|
|
1896
|
+
}) || match2.dayPeriod(dateString, {
|
|
1897
|
+
width: "abbreviated",
|
|
1898
|
+
context: "formatting"
|
|
1899
|
+
}) || match2.dayPeriod(dateString, {
|
|
1900
|
+
width: "narrow",
|
|
1901
|
+
context: "formatting"
|
|
1902
|
+
});
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
set(date, _flags, value) {
|
|
1906
|
+
date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);
|
|
1907
|
+
return date;
|
|
1908
|
+
}
|
|
1909
|
+
incompatibleTokens = ["a", "B", "H", "k", "t", "T"];
|
|
1910
|
+
}
|
|
1911
|
+
class DayPeriodParser extends Parser {
|
|
1912
|
+
priority = 80;
|
|
1913
|
+
parse(dateString, token, match2) {
|
|
1914
|
+
switch (token) {
|
|
1915
|
+
case "B":
|
|
1916
|
+
case "BB":
|
|
1917
|
+
case "BBB":
|
|
1918
|
+
return match2.dayPeriod(dateString, {
|
|
1919
|
+
width: "abbreviated",
|
|
1920
|
+
context: "formatting"
|
|
1921
|
+
}) || match2.dayPeriod(dateString, {
|
|
1922
|
+
width: "narrow",
|
|
1923
|
+
context: "formatting"
|
|
1924
|
+
});
|
|
1925
|
+
case "BBBBB":
|
|
1926
|
+
return match2.dayPeriod(dateString, {
|
|
1927
|
+
width: "narrow",
|
|
1928
|
+
context: "formatting"
|
|
1929
|
+
});
|
|
1930
|
+
case "BBBB":
|
|
1931
|
+
default:
|
|
1932
|
+
return match2.dayPeriod(dateString, {
|
|
1933
|
+
width: "wide",
|
|
1934
|
+
context: "formatting"
|
|
1935
|
+
}) || match2.dayPeriod(dateString, {
|
|
1936
|
+
width: "abbreviated",
|
|
1937
|
+
context: "formatting"
|
|
1938
|
+
}) || match2.dayPeriod(dateString, {
|
|
1939
|
+
width: "narrow",
|
|
1940
|
+
context: "formatting"
|
|
1941
|
+
});
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
set(date, _flags, value) {
|
|
1945
|
+
date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);
|
|
1946
|
+
return date;
|
|
1947
|
+
}
|
|
1948
|
+
incompatibleTokens = ["a", "b", "t", "T"];
|
|
1949
|
+
}
|
|
1950
|
+
class Hour1to12Parser extends Parser {
|
|
1951
|
+
priority = 70;
|
|
1952
|
+
parse(dateString, token, match2) {
|
|
1953
|
+
switch (token) {
|
|
1954
|
+
case "h":
|
|
1955
|
+
return parseNumericPattern(numericPatterns.hour12h, dateString);
|
|
1956
|
+
case "ho":
|
|
1957
|
+
return match2.ordinalNumber(dateString, { unit: "hour" });
|
|
1958
|
+
default:
|
|
1959
|
+
return parseNDigits(token.length, dateString);
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
validate(_date, value) {
|
|
1963
|
+
return value >= 1 && value <= 12;
|
|
1964
|
+
}
|
|
1965
|
+
set(date, _flags, value) {
|
|
1966
|
+
const isPM = date.getHours() >= 12;
|
|
1967
|
+
if (isPM && value < 12) {
|
|
1968
|
+
date.setHours(value + 12, 0, 0, 0);
|
|
1969
|
+
} else if (!isPM && value === 12) {
|
|
1970
|
+
date.setHours(0, 0, 0, 0);
|
|
1971
|
+
} else {
|
|
1972
|
+
date.setHours(value, 0, 0, 0);
|
|
1973
|
+
}
|
|
1974
|
+
return date;
|
|
1975
|
+
}
|
|
1976
|
+
incompatibleTokens = ["H", "K", "k", "t", "T"];
|
|
1977
|
+
}
|
|
1978
|
+
class Hour0to23Parser extends Parser {
|
|
1979
|
+
priority = 70;
|
|
1980
|
+
parse(dateString, token, match2) {
|
|
1981
|
+
switch (token) {
|
|
1982
|
+
case "H":
|
|
1983
|
+
return parseNumericPattern(numericPatterns.hour23h, dateString);
|
|
1984
|
+
case "Ho":
|
|
1985
|
+
return match2.ordinalNumber(dateString, { unit: "hour" });
|
|
1986
|
+
default:
|
|
1987
|
+
return parseNDigits(token.length, dateString);
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
validate(_date, value) {
|
|
1991
|
+
return value >= 0 && value <= 23;
|
|
1992
|
+
}
|
|
1993
|
+
set(date, _flags, value) {
|
|
1994
|
+
date.setHours(value, 0, 0, 0);
|
|
1995
|
+
return date;
|
|
1996
|
+
}
|
|
1997
|
+
incompatibleTokens = ["a", "b", "h", "K", "k", "t", "T"];
|
|
1998
|
+
}
|
|
1999
|
+
class Hour0To11Parser extends Parser {
|
|
2000
|
+
priority = 70;
|
|
2001
|
+
parse(dateString, token, match2) {
|
|
2002
|
+
switch (token) {
|
|
2003
|
+
case "K":
|
|
2004
|
+
return parseNumericPattern(numericPatterns.hour11h, dateString);
|
|
2005
|
+
case "Ko":
|
|
2006
|
+
return match2.ordinalNumber(dateString, { unit: "hour" });
|
|
2007
|
+
default:
|
|
2008
|
+
return parseNDigits(token.length, dateString);
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
validate(_date, value) {
|
|
2012
|
+
return value >= 0 && value <= 11;
|
|
2013
|
+
}
|
|
2014
|
+
set(date, _flags, value) {
|
|
2015
|
+
const isPM = date.getHours() >= 12;
|
|
2016
|
+
if (isPM && value < 12) {
|
|
2017
|
+
date.setHours(value + 12, 0, 0, 0);
|
|
2018
|
+
} else {
|
|
2019
|
+
date.setHours(value, 0, 0, 0);
|
|
2020
|
+
}
|
|
2021
|
+
return date;
|
|
2022
|
+
}
|
|
2023
|
+
incompatibleTokens = ["h", "H", "k", "t", "T"];
|
|
2024
|
+
}
|
|
2025
|
+
class Hour1To24Parser extends Parser {
|
|
2026
|
+
priority = 70;
|
|
2027
|
+
parse(dateString, token, match2) {
|
|
2028
|
+
switch (token) {
|
|
2029
|
+
case "k":
|
|
2030
|
+
return parseNumericPattern(numericPatterns.hour24h, dateString);
|
|
2031
|
+
case "ko":
|
|
2032
|
+
return match2.ordinalNumber(dateString, { unit: "hour" });
|
|
2033
|
+
default:
|
|
2034
|
+
return parseNDigits(token.length, dateString);
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
validate(_date, value) {
|
|
2038
|
+
return value >= 1 && value <= 24;
|
|
2039
|
+
}
|
|
2040
|
+
set(date, _flags, value) {
|
|
2041
|
+
const hours = value <= 24 ? value % 24 : value;
|
|
2042
|
+
date.setHours(hours, 0, 0, 0);
|
|
2043
|
+
return date;
|
|
2044
|
+
}
|
|
2045
|
+
incompatibleTokens = ["a", "b", "h", "H", "K", "t", "T"];
|
|
2046
|
+
}
|
|
2047
|
+
class MinuteParser extends Parser {
|
|
2048
|
+
priority = 60;
|
|
2049
|
+
parse(dateString, token, match2) {
|
|
2050
|
+
switch (token) {
|
|
2051
|
+
case "m":
|
|
2052
|
+
return parseNumericPattern(numericPatterns.minute, dateString);
|
|
2053
|
+
case "mo":
|
|
2054
|
+
return match2.ordinalNumber(dateString, { unit: "minute" });
|
|
2055
|
+
default:
|
|
2056
|
+
return parseNDigits(token.length, dateString);
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
validate(_date, value) {
|
|
2060
|
+
return value >= 0 && value <= 59;
|
|
2061
|
+
}
|
|
2062
|
+
set(date, _flags, value) {
|
|
2063
|
+
date.setMinutes(value, 0, 0);
|
|
2064
|
+
return date;
|
|
2065
|
+
}
|
|
2066
|
+
incompatibleTokens = ["t", "T"];
|
|
2067
|
+
}
|
|
2068
|
+
class SecondParser extends Parser {
|
|
2069
|
+
priority = 50;
|
|
2070
|
+
parse(dateString, token, match2) {
|
|
2071
|
+
switch (token) {
|
|
2072
|
+
case "s":
|
|
2073
|
+
return parseNumericPattern(numericPatterns.second, dateString);
|
|
2074
|
+
case "so":
|
|
2075
|
+
return match2.ordinalNumber(dateString, { unit: "second" });
|
|
2076
|
+
default:
|
|
2077
|
+
return parseNDigits(token.length, dateString);
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
validate(_date, value) {
|
|
2081
|
+
return value >= 0 && value <= 59;
|
|
2082
|
+
}
|
|
2083
|
+
set(date, _flags, value) {
|
|
2084
|
+
date.setSeconds(value, 0);
|
|
2085
|
+
return date;
|
|
2086
|
+
}
|
|
2087
|
+
incompatibleTokens = ["t", "T"];
|
|
2088
|
+
}
|
|
2089
|
+
class FractionOfSecondParser extends Parser {
|
|
2090
|
+
priority = 30;
|
|
2091
|
+
parse(dateString, token) {
|
|
2092
|
+
const valueCallback = (value) => Math.trunc(value * Math.pow(10, -token.length + 3));
|
|
2093
|
+
return mapValue(parseNDigits(token.length, dateString), valueCallback);
|
|
2094
|
+
}
|
|
2095
|
+
set(date, _flags, value) {
|
|
2096
|
+
date.setMilliseconds(value);
|
|
2097
|
+
return date;
|
|
2098
|
+
}
|
|
2099
|
+
incompatibleTokens = ["t", "T"];
|
|
2100
|
+
}
|
|
2101
|
+
function getTimezoneOffsetInMilliseconds(date) {
|
|
2102
|
+
const _date = toDate(date);
|
|
2103
|
+
const utcDate = new Date(
|
|
2104
|
+
Date.UTC(
|
|
2105
|
+
_date.getFullYear(),
|
|
2106
|
+
_date.getMonth(),
|
|
2107
|
+
_date.getDate(),
|
|
2108
|
+
_date.getHours(),
|
|
2109
|
+
_date.getMinutes(),
|
|
2110
|
+
_date.getSeconds(),
|
|
2111
|
+
_date.getMilliseconds()
|
|
2112
|
+
)
|
|
2113
|
+
);
|
|
2114
|
+
utcDate.setUTCFullYear(_date.getFullYear());
|
|
2115
|
+
return +date - +utcDate;
|
|
2116
|
+
}
|
|
2117
|
+
class ISOTimezoneWithZParser extends Parser {
|
|
2118
|
+
priority = 10;
|
|
2119
|
+
parse(dateString, token) {
|
|
2120
|
+
switch (token) {
|
|
2121
|
+
case "X":
|
|
2122
|
+
return parseTimezonePattern(
|
|
2123
|
+
timezonePatterns.basicOptionalMinutes,
|
|
2124
|
+
dateString
|
|
2125
|
+
);
|
|
2126
|
+
case "XX":
|
|
2127
|
+
return parseTimezonePattern(timezonePatterns.basic, dateString);
|
|
2128
|
+
case "XXXX":
|
|
2129
|
+
return parseTimezonePattern(
|
|
2130
|
+
timezonePatterns.basicOptionalSeconds,
|
|
2131
|
+
dateString
|
|
2132
|
+
);
|
|
2133
|
+
case "XXXXX":
|
|
2134
|
+
return parseTimezonePattern(
|
|
2135
|
+
timezonePatterns.extendedOptionalSeconds,
|
|
2136
|
+
dateString
|
|
2137
|
+
);
|
|
2138
|
+
case "XXX":
|
|
2139
|
+
default:
|
|
2140
|
+
return parseTimezonePattern(timezonePatterns.extended, dateString);
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
set(date, flags, value) {
|
|
2144
|
+
if (flags.timestampIsSet) return date;
|
|
2145
|
+
return constructFrom(
|
|
2146
|
+
date,
|
|
2147
|
+
date.getTime() - getTimezoneOffsetInMilliseconds(date) - value
|
|
2148
|
+
);
|
|
2149
|
+
}
|
|
2150
|
+
incompatibleTokens = ["t", "T", "x"];
|
|
2151
|
+
}
|
|
2152
|
+
class ISOTimezoneParser extends Parser {
|
|
2153
|
+
priority = 10;
|
|
2154
|
+
parse(dateString, token) {
|
|
2155
|
+
switch (token) {
|
|
2156
|
+
case "x":
|
|
2157
|
+
return parseTimezonePattern(
|
|
2158
|
+
timezonePatterns.basicOptionalMinutes,
|
|
2159
|
+
dateString
|
|
2160
|
+
);
|
|
2161
|
+
case "xx":
|
|
2162
|
+
return parseTimezonePattern(timezonePatterns.basic, dateString);
|
|
2163
|
+
case "xxxx":
|
|
2164
|
+
return parseTimezonePattern(
|
|
2165
|
+
timezonePatterns.basicOptionalSeconds,
|
|
2166
|
+
dateString
|
|
2167
|
+
);
|
|
2168
|
+
case "xxxxx":
|
|
2169
|
+
return parseTimezonePattern(
|
|
2170
|
+
timezonePatterns.extendedOptionalSeconds,
|
|
2171
|
+
dateString
|
|
2172
|
+
);
|
|
2173
|
+
case "xxx":
|
|
2174
|
+
default:
|
|
2175
|
+
return parseTimezonePattern(timezonePatterns.extended, dateString);
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
set(date, flags, value) {
|
|
2179
|
+
if (flags.timestampIsSet) return date;
|
|
2180
|
+
return constructFrom(
|
|
2181
|
+
date,
|
|
2182
|
+
date.getTime() - getTimezoneOffsetInMilliseconds(date) - value
|
|
2183
|
+
);
|
|
2184
|
+
}
|
|
2185
|
+
incompatibleTokens = ["t", "T", "X"];
|
|
2186
|
+
}
|
|
2187
|
+
class TimestampSecondsParser extends Parser {
|
|
2188
|
+
priority = 40;
|
|
2189
|
+
parse(dateString) {
|
|
2190
|
+
return parseAnyDigitsSigned(dateString);
|
|
2191
|
+
}
|
|
2192
|
+
set(date, _flags, value) {
|
|
2193
|
+
return [constructFrom(date, value * 1e3), { timestampIsSet: true }];
|
|
2194
|
+
}
|
|
2195
|
+
incompatibleTokens = "*";
|
|
2196
|
+
}
|
|
2197
|
+
class TimestampMillisecondsParser extends Parser {
|
|
2198
|
+
priority = 20;
|
|
2199
|
+
parse(dateString) {
|
|
2200
|
+
return parseAnyDigitsSigned(dateString);
|
|
2201
|
+
}
|
|
2202
|
+
set(date, _flags, value) {
|
|
2203
|
+
return [constructFrom(date, value), { timestampIsSet: true }];
|
|
2204
|
+
}
|
|
2205
|
+
incompatibleTokens = "*";
|
|
2206
|
+
}
|
|
2207
|
+
const parsers = {
|
|
2208
|
+
G: new EraParser(),
|
|
2209
|
+
y: new YearParser(),
|
|
2210
|
+
Y: new LocalWeekYearParser(),
|
|
2211
|
+
R: new ISOWeekYearParser(),
|
|
2212
|
+
u: new ExtendedYearParser(),
|
|
2213
|
+
Q: new QuarterParser(),
|
|
2214
|
+
q: new StandAloneQuarterParser(),
|
|
2215
|
+
M: new MonthParser(),
|
|
2216
|
+
L: new StandAloneMonthParser(),
|
|
2217
|
+
w: new LocalWeekParser(),
|
|
2218
|
+
I: new ISOWeekParser(),
|
|
2219
|
+
d: new DateParser(),
|
|
2220
|
+
D: new DayOfYearParser(),
|
|
2221
|
+
E: new DayParser(),
|
|
2222
|
+
e: new LocalDayParser(),
|
|
2223
|
+
c: new StandAloneLocalDayParser(),
|
|
2224
|
+
i: new ISODayParser(),
|
|
2225
|
+
a: new AMPMParser(),
|
|
2226
|
+
b: new AMPMMidnightParser(),
|
|
2227
|
+
B: new DayPeriodParser(),
|
|
2228
|
+
h: new Hour1to12Parser(),
|
|
2229
|
+
H: new Hour0to23Parser(),
|
|
2230
|
+
K: new Hour0To11Parser(),
|
|
2231
|
+
k: new Hour1To24Parser(),
|
|
2232
|
+
m: new MinuteParser(),
|
|
2233
|
+
s: new SecondParser(),
|
|
2234
|
+
S: new FractionOfSecondParser(),
|
|
2235
|
+
X: new ISOTimezoneWithZParser(),
|
|
2236
|
+
x: new ISOTimezoneParser(),
|
|
2237
|
+
t: new TimestampSecondsParser(),
|
|
2238
|
+
T: new TimestampMillisecondsParser()
|
|
2239
|
+
};
|
|
2240
|
+
const formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
|
2241
|
+
const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
2242
|
+
const escapedStringRegExp = /^'([^]*?)'?$/;
|
|
2243
|
+
const doubleQuoteRegExp = /''/g;
|
|
2244
|
+
const notWhitespaceRegExp = /\S/;
|
|
2245
|
+
const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
2246
|
+
function parse(dateStr, formatStr, referenceDate, options) {
|
|
2247
|
+
const invalidDate = () => constructFrom(options?.in || referenceDate, NaN);
|
|
2248
|
+
const defaultOptions2 = getDefaultOptions();
|
|
2249
|
+
const locale = options?.locale ?? defaultOptions2.locale ?? enUS;
|
|
2250
|
+
const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
|
|
2251
|
+
const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
|
|
2252
|
+
if (!formatStr)
|
|
2253
|
+
return dateStr ? invalidDate() : toDate(referenceDate, options?.in);
|
|
2254
|
+
const subFnOptions = {
|
|
2255
|
+
firstWeekContainsDate,
|
|
2256
|
+
weekStartsOn,
|
|
2257
|
+
locale
|
|
2258
|
+
};
|
|
2259
|
+
const setters = [new DateTimezoneSetter(options?.in, referenceDate)];
|
|
2260
|
+
const tokens = formatStr.match(longFormattingTokensRegExp).map((substring) => {
|
|
2261
|
+
const firstCharacter = substring[0];
|
|
2262
|
+
if (firstCharacter in longFormatters) {
|
|
2263
|
+
const longFormatter = longFormatters[firstCharacter];
|
|
2264
|
+
return longFormatter(substring, locale.formatLong);
|
|
2265
|
+
}
|
|
2266
|
+
return substring;
|
|
2267
|
+
}).join("").match(formattingTokensRegExp);
|
|
2268
|
+
const usedTokens = [];
|
|
2269
|
+
for (let token of tokens) {
|
|
2270
|
+
if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {
|
|
2271
|
+
warnOrThrowProtectedError(token, formatStr, dateStr);
|
|
2272
|
+
}
|
|
2273
|
+
if (!options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {
|
|
2274
|
+
warnOrThrowProtectedError(token, formatStr, dateStr);
|
|
2275
|
+
}
|
|
2276
|
+
const firstCharacter = token[0];
|
|
2277
|
+
const parser = parsers[firstCharacter];
|
|
2278
|
+
if (parser) {
|
|
2279
|
+
const { incompatibleTokens } = parser;
|
|
2280
|
+
if (Array.isArray(incompatibleTokens)) {
|
|
2281
|
+
const incompatibleToken = usedTokens.find(
|
|
2282
|
+
(usedToken) => incompatibleTokens.includes(usedToken.token) || usedToken.token === firstCharacter
|
|
2283
|
+
);
|
|
2284
|
+
if (incompatibleToken) {
|
|
2285
|
+
throw new RangeError(
|
|
2286
|
+
`The format string mustn't contain \`${incompatibleToken.fullToken}\` and \`${token}\` at the same time`
|
|
2287
|
+
);
|
|
2288
|
+
}
|
|
2289
|
+
} else if (parser.incompatibleTokens === "*" && usedTokens.length > 0) {
|
|
2290
|
+
throw new RangeError(
|
|
2291
|
+
`The format string mustn't contain \`${token}\` and any other token at the same time`
|
|
2292
|
+
);
|
|
2293
|
+
}
|
|
2294
|
+
usedTokens.push({ token: firstCharacter, fullToken: token });
|
|
2295
|
+
const parseResult = parser.run(
|
|
2296
|
+
dateStr,
|
|
2297
|
+
token,
|
|
2298
|
+
locale.match,
|
|
2299
|
+
subFnOptions
|
|
2300
|
+
);
|
|
2301
|
+
if (!parseResult) {
|
|
2302
|
+
return invalidDate();
|
|
2303
|
+
}
|
|
2304
|
+
setters.push(parseResult.setter);
|
|
2305
|
+
dateStr = parseResult.rest;
|
|
2306
|
+
} else {
|
|
2307
|
+
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
|
2308
|
+
throw new RangeError(
|
|
2309
|
+
"Format string contains an unescaped latin alphabet character `" + firstCharacter + "`"
|
|
2310
|
+
);
|
|
2311
|
+
}
|
|
2312
|
+
if (token === "''") {
|
|
2313
|
+
token = "'";
|
|
2314
|
+
} else if (firstCharacter === "'") {
|
|
2315
|
+
token = cleanEscapedString(token);
|
|
2316
|
+
}
|
|
2317
|
+
if (dateStr.indexOf(token) === 0) {
|
|
2318
|
+
dateStr = dateStr.slice(token.length);
|
|
2319
|
+
} else {
|
|
2320
|
+
return invalidDate();
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {
|
|
2325
|
+
return invalidDate();
|
|
2326
|
+
}
|
|
2327
|
+
const uniquePrioritySetters = setters.map((setter) => setter.priority).sort((a, b) => b - a).filter((priority, index, array) => array.indexOf(priority) === index).map(
|
|
2328
|
+
(priority) => setters.filter((setter) => setter.priority === priority).sort((a, b) => b.subPriority - a.subPriority)
|
|
2329
|
+
).map((setterArray) => setterArray[0]);
|
|
2330
|
+
let date = toDate(referenceDate, options?.in);
|
|
2331
|
+
if (isNaN(+date)) return invalidDate();
|
|
2332
|
+
const flags = {};
|
|
2333
|
+
for (const setter of uniquePrioritySetters) {
|
|
2334
|
+
if (!setter.validate(date, subFnOptions)) {
|
|
2335
|
+
return invalidDate();
|
|
2336
|
+
}
|
|
2337
|
+
const result = setter.set(date, flags, subFnOptions);
|
|
2338
|
+
if (Array.isArray(result)) {
|
|
2339
|
+
date = result[0];
|
|
2340
|
+
Object.assign(flags, result[1]);
|
|
2341
|
+
} else {
|
|
2342
|
+
date = result;
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
return date;
|
|
2346
|
+
}
|
|
2347
|
+
function cleanEscapedString(input) {
|
|
2348
|
+
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
|
|
2349
|
+
}
|
|
2350
|
+
register(t14);
|
|
2351
|
+
function getDateFormat(locale) {
|
|
2352
|
+
if (locale.code.split("-")[0] === "de") {
|
|
2353
|
+
return "P";
|
|
2354
|
+
}
|
|
2355
|
+
return "PP";
|
|
2356
|
+
}
|
|
2357
|
+
function getTimeFormat() {
|
|
2358
|
+
return "p";
|
|
2359
|
+
}
|
|
2360
|
+
function getDateTimeFormat(locale) {
|
|
2361
|
+
return getDateFormat(locale) + getTimeFormat();
|
|
2362
|
+
}
|
|
2363
|
+
function getWeekFormat() {
|
|
2364
|
+
return "RRRR-II";
|
|
2365
|
+
}
|
|
2366
|
+
function getMonthFormat(locale) {
|
|
2367
|
+
return guessFormat(locale.code, true);
|
|
2368
|
+
}
|
|
2369
|
+
function getYearFormat(locale) {
|
|
2370
|
+
return guessFormat(locale.code, false);
|
|
2371
|
+
}
|
|
2372
|
+
function guessFormat(localeCode, includeMonth) {
|
|
2373
|
+
const sampleDate = new Date(2026, 0, 1);
|
|
2374
|
+
const formatOptions = {
|
|
2375
|
+
year: "numeric",
|
|
2376
|
+
// Specify because other calendar systems are not supported
|
|
2377
|
+
calendar: "gregory"
|
|
2378
|
+
};
|
|
2379
|
+
if (includeMonth) {
|
|
2380
|
+
formatOptions.month = "2-digit";
|
|
2381
|
+
}
|
|
2382
|
+
const formatter = Intl.DateTimeFormat(localeCode, formatOptions);
|
|
2383
|
+
const parts = formatter.formatToParts(sampleDate);
|
|
2384
|
+
const partStrings = parts.map((part) => {
|
|
2385
|
+
switch (part.type) {
|
|
2386
|
+
case "month":
|
|
2387
|
+
return "MM";
|
|
2388
|
+
case "year":
|
|
2389
|
+
return "yyyy";
|
|
2390
|
+
case "literal":
|
|
2391
|
+
return escapeLiteraForFormatString(part.value);
|
|
2392
|
+
// Everything else is not expected and supported.
|
|
2393
|
+
default:
|
|
2394
|
+
return "";
|
|
2395
|
+
}
|
|
2396
|
+
});
|
|
2397
|
+
return partStrings.join("");
|
|
2398
|
+
}
|
|
2399
|
+
function escapeLiteraForFormatString(literalValue) {
|
|
2400
|
+
literalValue = literalValue.replaceAll(/'/g, "''");
|
|
2401
|
+
return literalValue.replaceAll(/[A-Za-z]+/g, (latinCharSeq) => `'${latinCharSeq}'`);
|
|
2402
|
+
}
|
|
2403
|
+
const loader = {};
|
|
2404
|
+
loader["af"] = async () => (await import("date-fns/locale/af")).af;
|
|
2405
|
+
loader["ar-DZ"] = async () => (await import("date-fns/locale/ar-DZ")).arDZ;
|
|
2406
|
+
loader["ar-EG"] = async () => (await import("date-fns/locale/ar-EG")).arEG;
|
|
2407
|
+
loader["ar-MA"] = async () => (await import("date-fns/locale/ar-MA")).arMA;
|
|
2408
|
+
loader["ar-SA"] = async () => (await import("date-fns/locale/ar-SA")).arSA;
|
|
2409
|
+
loader["ar-TN"] = async () => (await import("date-fns/locale/ar-TN")).arTN;
|
|
2410
|
+
loader["ar"] = async () => (await import("date-fns/locale/ar")).ar;
|
|
2411
|
+
loader["az"] = async () => (await import("date-fns/locale/az")).az;
|
|
2412
|
+
loader["be-tarask"] = async () => (await import("date-fns/locale/be-tarask")).beTarasak;
|
|
2413
|
+
loader["be"] = async () => (await import("date-fns/locale/be")).be;
|
|
2414
|
+
loader["bg"] = async () => (await import("date-fns/locale/bg")).bg;
|
|
2415
|
+
loader["bn"] = async () => (await import("date-fns/locale/bn")).bn;
|
|
2416
|
+
loader["bs"] = async () => (await import("date-fns/locale/bs")).bs;
|
|
2417
|
+
loader["ca"] = async () => (await import("date-fns/locale/ca")).ca;
|
|
2418
|
+
loader["ckb"] = async () => (await import("date-fns/locale/ckb")).ckb;
|
|
2419
|
+
loader["cs"] = async () => (await import("date-fns/locale/cs")).cs;
|
|
2420
|
+
loader["cy"] = async () => (await import("date-fns/locale/cy")).cy;
|
|
2421
|
+
loader["da"] = async () => (await import("date-fns/locale/da")).da;
|
|
2422
|
+
loader["de-AT"] = async () => (await import("date-fns/locale/de-AT")).deAT;
|
|
2423
|
+
loader["de"] = async () => (await import("date-fns/locale/de")).de;
|
|
2424
|
+
loader["el"] = async () => (await import("date-fns/locale/el")).el;
|
|
2425
|
+
loader["en-AU"] = async () => (await import("date-fns/locale/en-AU")).enAU;
|
|
2426
|
+
loader["en-CA"] = async () => (await import("date-fns/locale/en-CA")).enCA;
|
|
2427
|
+
loader["en-GB"] = async () => (await import("date-fns/locale/en-GB")).enGB;
|
|
2428
|
+
loader["en-IE"] = async () => (await import("date-fns/locale/en-IE")).enIE;
|
|
2429
|
+
loader["en-IN"] = async () => (await import("date-fns/locale/en-IN")).enIN;
|
|
2430
|
+
loader["en-NZ"] = async () => (await import("date-fns/locale/en-NZ")).enNZ;
|
|
2431
|
+
loader["en-ZA"] = async () => (await import("date-fns/locale/en-ZA")).enZA;
|
|
2432
|
+
loader["eo"] = async () => (await import("date-fns/locale/eo")).eo;
|
|
2433
|
+
loader["es"] = async () => (await import("date-fns/locale/es")).es;
|
|
2434
|
+
loader["et"] = async () => (await import("date-fns/locale/et")).et;
|
|
2435
|
+
loader["eu"] = async () => (await import("date-fns/locale/eu")).eu;
|
|
2436
|
+
loader["fa-IR"] = async () => (await import("date-fns/locale/fa-IR")).faIR;
|
|
2437
|
+
loader["fi"] = async () => (await import("date-fns/locale/fi")).fi;
|
|
2438
|
+
loader["fr-CA"] = async () => (await import("date-fns/locale/fr-CA")).frCA;
|
|
2439
|
+
loader["fr-CH"] = async () => (await import("date-fns/locale/fr-CH")).frCH;
|
|
2440
|
+
loader["fr"] = async () => (await import("date-fns/locale/fr")).fr;
|
|
2441
|
+
loader["fy"] = async () => (await import("date-fns/locale/fy")).fy;
|
|
2442
|
+
loader["gd"] = async () => (await import("date-fns/locale/gd")).gd;
|
|
2443
|
+
loader["gl"] = async () => (await import("date-fns/locale/gl")).gl;
|
|
2444
|
+
loader["gu"] = async () => (await import("date-fns/locale/gu")).gu;
|
|
2445
|
+
loader["he"] = async () => (await import("date-fns/locale/he")).he;
|
|
2446
|
+
loader["hi"] = async () => (await import("date-fns/locale/hi")).hi;
|
|
2447
|
+
loader["hr"] = async () => (await import("date-fns/locale/hr")).hr;
|
|
2448
|
+
loader["ht"] = async () => (await import("date-fns/locale/ht")).ht;
|
|
2449
|
+
loader["hu"] = async () => (await import("date-fns/locale/hu")).hu;
|
|
2450
|
+
loader["hy"] = async () => (await import("date-fns/locale/hy")).hy;
|
|
2451
|
+
loader["id"] = async () => (await import("date-fns/locale/id")).id;
|
|
2452
|
+
loader["is"] = async () => (await import("date-fns/locale/is")).is;
|
|
2453
|
+
loader["it-CH"] = async () => (await import("date-fns/locale/it-CH")).itCH;
|
|
2454
|
+
loader["it"] = async () => (await import("date-fns/locale/it")).it;
|
|
2455
|
+
loader["ja-Hira"] = async () => (await import("date-fns/locale/ja-Hira")).jaHira;
|
|
2456
|
+
loader["ja"] = async () => (await import("date-fns/locale/ja")).ja;
|
|
2457
|
+
loader["ka"] = async () => (await import("date-fns/locale/ka")).ka;
|
|
2458
|
+
loader["kk"] = async () => (await import("date-fns/locale/kk")).kk;
|
|
2459
|
+
loader["km"] = async () => (await import("date-fns/locale/km")).km;
|
|
2460
|
+
loader["kn"] = async () => (await import("date-fns/locale/kn")).kn;
|
|
2461
|
+
loader["ko"] = async () => (await import("date-fns/locale/ko")).ko;
|
|
2462
|
+
loader["lb"] = async () => (await import("date-fns/locale/lb")).lb;
|
|
2463
|
+
loader["lt"] = async () => (await import("date-fns/locale/lt")).lt;
|
|
2464
|
+
loader["lv"] = async () => (await import("date-fns/locale/lv")).lv;
|
|
2465
|
+
loader["mk"] = async () => (await import("date-fns/locale/mk")).mk;
|
|
2466
|
+
loader["mn"] = async () => (await import("date-fns/locale/mn")).mn;
|
|
2467
|
+
loader["ms"] = async () => (await import("date-fns/locale/ms")).ms;
|
|
2468
|
+
loader["mt"] = async () => (await import("date-fns/locale/mt")).mt;
|
|
2469
|
+
loader["nb"] = async () => (await import("date-fns/locale/nb")).nb;
|
|
2470
|
+
loader["nl-BE"] = async () => (await import("date-fns/locale/nl-BE")).nlBE;
|
|
2471
|
+
loader["nl"] = async () => (await import("date-fns/locale/nl")).nl;
|
|
2472
|
+
loader["nn"] = async () => (await import("date-fns/locale/nn")).nn;
|
|
2473
|
+
loader["oc"] = async () => (await import("date-fns/locale/oc")).oc;
|
|
2474
|
+
loader["pl"] = async () => (await import("date-fns/locale/pl")).pl;
|
|
2475
|
+
loader["pt-BR"] = async () => (await import("date-fns/locale/pt-BR")).ptBR;
|
|
2476
|
+
loader["pt"] = async () => (await import("date-fns/locale/pt")).pt;
|
|
2477
|
+
loader["ro"] = async () => (await import("date-fns/locale/ro")).ro;
|
|
2478
|
+
loader["ru"] = async () => (await import("date-fns/locale/ru")).ru;
|
|
2479
|
+
loader["se"] = async () => (await import("date-fns/locale/se")).se;
|
|
2480
|
+
loader["sk"] = async () => (await import("date-fns/locale/sk")).sk;
|
|
2481
|
+
loader["sl"] = async () => (await import("date-fns/locale/sl")).sl;
|
|
2482
|
+
loader["sq"] = async () => (await import("date-fns/locale/sq")).sq;
|
|
2483
|
+
loader["sr-Latn"] = async () => (await import("date-fns/locale/sr-Latn")).srLatn;
|
|
2484
|
+
loader["sr"] = async () => (await import("date-fns/locale/sr")).sr;
|
|
2485
|
+
loader["sv"] = async () => (await import("date-fns/locale/sv")).sv;
|
|
2486
|
+
loader["ta"] = async () => (await import("date-fns/locale/ta")).ta;
|
|
2487
|
+
loader["te"] = async () => (await import("date-fns/locale/te")).te;
|
|
2488
|
+
loader["th"] = async () => (await import("date-fns/locale/th")).th;
|
|
2489
|
+
loader["tr"] = async () => (await import("date-fns/locale/tr")).tr;
|
|
2490
|
+
loader["ug"] = async () => (await import("date-fns/locale/ug")).ug;
|
|
2491
|
+
loader["uk"] = async () => (await import("date-fns/locale/uk")).uk;
|
|
2492
|
+
loader["uz-Cyrl"] = async () => (await import("date-fns/locale/uz-Cyrl")).uzCyrl;
|
|
2493
|
+
loader["uz"] = async () => (await import("date-fns/locale/uz")).uz;
|
|
2494
|
+
loader["vi"] = async () => (await import("date-fns/locale/vi")).vi;
|
|
2495
|
+
loader["zh-CN"] = async () => (await import("date-fns/locale/zh-CN")).zhCN;
|
|
2496
|
+
loader["zh-HK"] = async () => (await import("date-fns/locale/zh-HK")).zhHK;
|
|
2497
|
+
loader["zh-TW"] = async () => (await import("date-fns/locale/zh-TW")).zhTW;
|
|
2498
|
+
/*!
|
|
2499
|
+
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
|
|
2500
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2501
|
+
*/
|
|
2502
|
+
const FALLBACK_LOCALE = enUS$1;
|
|
2503
|
+
let cachedLocale;
|
|
2504
|
+
function useDateFnsLocale() {
|
|
2505
|
+
const localeCode = getCanonicalLocale();
|
|
2506
|
+
if (localeCode === FALLBACK_LOCALE.code) {
|
|
2507
|
+
return {
|
|
2508
|
+
isLoading: ref(false),
|
|
2509
|
+
locale: ref(FALLBACK_LOCALE)
|
|
2510
|
+
};
|
|
2511
|
+
}
|
|
2512
|
+
if (cachedLocale === void 0) {
|
|
2513
|
+
cachedLocale = loadDateFnsLocale(localeCode);
|
|
2514
|
+
}
|
|
2515
|
+
if (cachedLocale instanceof Promise) {
|
|
2516
|
+
const isLoading = ref(true);
|
|
2517
|
+
const locale = ref(FALLBACK_LOCALE);
|
|
2518
|
+
cachedLocale.then((loadedLocale) => {
|
|
2519
|
+
cachedLocale = loadedLocale;
|
|
2520
|
+
isLoading.value = false;
|
|
2521
|
+
locale.value = cachedLocale;
|
|
2522
|
+
});
|
|
2523
|
+
return {
|
|
2524
|
+
isLoading,
|
|
2525
|
+
locale
|
|
2526
|
+
};
|
|
2527
|
+
}
|
|
2528
|
+
return {
|
|
2529
|
+
isLoading: ref(false),
|
|
2530
|
+
locale: ref(cachedLocale)
|
|
2531
|
+
};
|
|
2532
|
+
}
|
|
2533
|
+
async function loadDateFnsLocale(localeCode) {
|
|
2534
|
+
if (localeCode in loader) {
|
|
2535
|
+
try {
|
|
2536
|
+
return await loader[localeCode]();
|
|
2537
|
+
} catch (error) {
|
|
2538
|
+
logger.warn("Failed to load locale.", { localeCode, error });
|
|
2539
|
+
return FALLBACK_LOCALE;
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
if (localeCode.includes("-")) {
|
|
2543
|
+
const shortLocale = localeCode.split("-")[0];
|
|
2544
|
+
return loadDateFnsLocale(shortLocale);
|
|
2545
|
+
}
|
|
2546
|
+
logger.warn("Found no locale to load.", { localeCode });
|
|
2547
|
+
return FALLBACK_LOCALE;
|
|
2548
|
+
}
|
|
2549
|
+
const _hoisted_1 = { class: "vue-date-time-picker__wrapper" };
|
|
2550
|
+
const _hoisted_2 = {
|
|
2551
|
+
ref: "target",
|
|
2552
|
+
class: "vue-date-time-picker__wrapper vue-date-time-picker__wrapper--teleport"
|
|
2553
|
+
};
|
|
2554
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
2555
|
+
__name: "NcDateTimePicker",
|
|
2556
|
+
props: /* @__PURE__ */ mergeModels({
|
|
2557
|
+
appendToBody: { type: Boolean },
|
|
2558
|
+
ariaLabel: { default: t("Datepicker input") },
|
|
2559
|
+
ariaLabelMenu: { default: t("Datepicker menu") },
|
|
2560
|
+
clearable: { type: Boolean },
|
|
2561
|
+
confirm: { type: Boolean },
|
|
2562
|
+
format: { type: [String, Function], default: void 0 },
|
|
2563
|
+
locale: { default: void 0 },
|
|
2564
|
+
max: { default: void 0 },
|
|
2565
|
+
min: { default: void 0 },
|
|
2566
|
+
minuteStep: { default: 10 },
|
|
2567
|
+
modelValue: { default: null },
|
|
2568
|
+
placeholder: { default: void 0 },
|
|
2569
|
+
showTimezoneSelect: { type: Boolean },
|
|
2570
|
+
showWeekNumber: { type: Boolean },
|
|
2571
|
+
type: { default: "date" },
|
|
2572
|
+
inline: { type: Boolean, default: false }
|
|
2573
|
+
}, {
|
|
2574
|
+
"timezoneId": { default: "UTC" },
|
|
2575
|
+
"timezoneIdModifiers": {}
|
|
2576
|
+
}),
|
|
2577
|
+
emits: /* @__PURE__ */ mergeModels(["update:modelValue", "update:timezoneId", "blur"], ["update:timezoneId"]),
|
|
2578
|
+
setup(__props, { emit: __emit }) {
|
|
2579
|
+
const timezoneId = useModel(__props, "timezoneId");
|
|
2580
|
+
const props = __props;
|
|
2581
|
+
const emit = __emit;
|
|
2582
|
+
const realLocale = getCanonicalLocale();
|
|
2583
|
+
watchEffect(() => {
|
|
2584
|
+
if (props.locale !== void 0) {
|
|
2585
|
+
warn("[NcDateTimePicker] The `locale` property is no longer used and will be ignored.");
|
|
2586
|
+
}
|
|
2587
|
+
});
|
|
2588
|
+
const targetElement = useTemplateRef("target");
|
|
2589
|
+
const pickerInstance = useTemplateRef("picker");
|
|
2590
|
+
const value = computed(() => {
|
|
2591
|
+
if (props.modelValue === null && props.clearable) {
|
|
2592
|
+
return null;
|
|
2593
|
+
}
|
|
2594
|
+
if (props.type === "week") {
|
|
2595
|
+
const date = props.modelValue instanceof Date ? props.modelValue : /* @__PURE__ */ new Date();
|
|
2596
|
+
const end = new Date(date);
|
|
2597
|
+
end.setUTCDate(date.getUTCDate() + 6);
|
|
2598
|
+
return [date, end];
|
|
2599
|
+
} else if (props.type === "year") {
|
|
2600
|
+
const date = props.modelValue instanceof Date ? props.modelValue : /* @__PURE__ */ new Date();
|
|
2601
|
+
return date.getUTCFullYear();
|
|
2602
|
+
} else if (props.type === "month") {
|
|
2603
|
+
const date = props.modelValue instanceof Date ? props.modelValue : /* @__PURE__ */ new Date();
|
|
2604
|
+
return { year: date.getUTCFullYear(), month: date.getUTCMonth() };
|
|
2605
|
+
} else if (props.type === "time") {
|
|
2606
|
+
const time = props.modelValue instanceof Date ? props.modelValue : /* @__PURE__ */ new Date();
|
|
2607
|
+
return {
|
|
2608
|
+
hours: time.getHours(),
|
|
2609
|
+
minutes: time.getMinutes(),
|
|
2610
|
+
seconds: time.getSeconds()
|
|
2611
|
+
};
|
|
2612
|
+
} else if (props.type === "time-range") {
|
|
2613
|
+
const time = [props.modelValue].flat();
|
|
2614
|
+
if (time.length !== 2) {
|
|
2615
|
+
const start = /* @__PURE__ */ new Date();
|
|
2616
|
+
const end = new Date(start);
|
|
2617
|
+
end.setHours(end.getHours() + 1);
|
|
2618
|
+
time.splice(0, 2, start, end);
|
|
2619
|
+
}
|
|
2620
|
+
return time.map((date) => ({
|
|
2621
|
+
hours: date.getHours(),
|
|
2622
|
+
minutes: date.getMinutes(),
|
|
2623
|
+
seconds: date.getSeconds()
|
|
2624
|
+
}));
|
|
2625
|
+
} else if (props.type.endsWith("-range")) {
|
|
2626
|
+
if (props.modelValue === void 0) {
|
|
2627
|
+
const start = /* @__PURE__ */ new Date();
|
|
2628
|
+
const end = new Date(start);
|
|
2629
|
+
end.setUTCDate(start.getUTCDate() + 7);
|
|
2630
|
+
return [start, end];
|
|
2631
|
+
}
|
|
2632
|
+
return props.modelValue;
|
|
2633
|
+
}
|
|
2634
|
+
return props.modelValue ?? /* @__PURE__ */ new Date();
|
|
2635
|
+
});
|
|
2636
|
+
const placeholderFallback = computed(() => {
|
|
2637
|
+
if (props.type === "date") {
|
|
2638
|
+
return t("Select date");
|
|
2639
|
+
} else if (props.type === "time") {
|
|
2640
|
+
return t("Select time");
|
|
2641
|
+
} else if (props.type === "datetime") {
|
|
2642
|
+
return t("Select date and time");
|
|
2643
|
+
} else if (props.type === "week") {
|
|
2644
|
+
return t("Select week");
|
|
2645
|
+
} else if (props.type === "month") {
|
|
2646
|
+
return t("Select month");
|
|
2647
|
+
} else if (props.type === "year") {
|
|
2648
|
+
return t("Select year");
|
|
2649
|
+
} else if (props.type.endsWith("-range")) {
|
|
2650
|
+
return t("Select time range");
|
|
2651
|
+
}
|
|
2652
|
+
return t("Select date and time");
|
|
2653
|
+
});
|
|
2654
|
+
const { isLoading: dateFnsLocaleIsLoading, locale: dateFnsLocale } = useDateFnsLocale();
|
|
2655
|
+
watch(dateFnsLocale, () => {
|
|
2656
|
+
pickerInstance.value?.parseModel();
|
|
2657
|
+
}, {
|
|
2658
|
+
// Apply only after new locale was reaplied to VueDatePicker.
|
|
2659
|
+
flush: "post"
|
|
2660
|
+
});
|
|
2661
|
+
const realFormat = computed(() => {
|
|
2662
|
+
if (props.format) {
|
|
2663
|
+
return props.format;
|
|
2664
|
+
}
|
|
2665
|
+
switch (props.type) {
|
|
2666
|
+
case "date":
|
|
2667
|
+
case "date-range":
|
|
2668
|
+
return getDateFormat(dateFnsLocale.value);
|
|
2669
|
+
case "time":
|
|
2670
|
+
case "time-range":
|
|
2671
|
+
return getTimeFormat();
|
|
2672
|
+
case "datetime":
|
|
2673
|
+
case "datetime-range":
|
|
2674
|
+
return getDateTimeFormat(dateFnsLocale.value);
|
|
2675
|
+
case "month":
|
|
2676
|
+
return getMonthFormat(dateFnsLocale.value);
|
|
2677
|
+
case "year":
|
|
2678
|
+
return getYearFormat(dateFnsLocale.value);
|
|
2679
|
+
case "week":
|
|
2680
|
+
return getWeekFormat();
|
|
2681
|
+
}
|
|
2682
|
+
return void 0;
|
|
2683
|
+
});
|
|
2684
|
+
const textInput = computed(() => {
|
|
2685
|
+
const realFormatVal = realFormat.value;
|
|
2686
|
+
if (typeof realFormatVal === "function") {
|
|
2687
|
+
return false;
|
|
2688
|
+
}
|
|
2689
|
+
if (typeof realFormatVal === "string") {
|
|
2690
|
+
return {
|
|
2691
|
+
// This should not be required in Vuepic because `format` is automatically used for parsing.
|
|
2692
|
+
// But v11 has a bug because the format string ist cut off wrongly.
|
|
2693
|
+
// This is fixed in v12.1.0 and can then be simplified.
|
|
2694
|
+
// See https://github.com/Vuepic/vue-datepicker/issues/1208
|
|
2695
|
+
format: (value2) => {
|
|
2696
|
+
return parse(value2, realFormatVal, /* @__PURE__ */ new Date(), { locale: dateFnsLocale.value });
|
|
2697
|
+
}
|
|
2698
|
+
};
|
|
2699
|
+
}
|
|
2700
|
+
return true;
|
|
2701
|
+
});
|
|
2702
|
+
const pickerType = computed(() => ({
|
|
2703
|
+
timePicker: props.type === "time" || props.type === "time-range",
|
|
2704
|
+
yearPicker: props.type === "year",
|
|
2705
|
+
monthPicker: props.type === "month",
|
|
2706
|
+
weekPicker: props.type === "week",
|
|
2707
|
+
range: props.type.endsWith("-range") && {
|
|
2708
|
+
// do not use partial ranges (meaning after selecting the start [Date, null] will be emitted)
|
|
2709
|
+
// if this is needed someday we can enable it,
|
|
2710
|
+
// but its not covered by our component interface (props / events) documentation so just disabled for now.
|
|
2711
|
+
partialRange: false
|
|
2712
|
+
},
|
|
2713
|
+
enableTimePicker: !(props.type === "date" || props.type === "date-range"),
|
|
2714
|
+
flow: props.type === "datetime" ? ["calendar", "time"] : void 0
|
|
2715
|
+
}));
|
|
2716
|
+
const minTime = computed(() => props.min && { hours: props.min.getHours(), minutes: props.min.getMinutes(), seconds: props.min.getSeconds() });
|
|
2717
|
+
const maxTime = computed(() => props.max && { hours: props.max.getHours(), minutes: props.max.getMinutes(), seconds: props.max.getSeconds() });
|
|
2718
|
+
function onUpdateModelValue(value2) {
|
|
2719
|
+
if (value2 === null) {
|
|
2720
|
+
return emit("update:modelValue", null);
|
|
2721
|
+
}
|
|
2722
|
+
if (props.type === "time") {
|
|
2723
|
+
emit("update:modelValue", formatLibraryTime(value2));
|
|
2724
|
+
} else if (props.type === "time-range") {
|
|
2725
|
+
const start = formatLibraryTime(value2[0]);
|
|
2726
|
+
const end = formatLibraryTime(value2[1]);
|
|
2727
|
+
if (end.getTime() < start.getTime()) {
|
|
2728
|
+
end.setDate(end.getDate() + 1);
|
|
2729
|
+
}
|
|
2730
|
+
emit("update:modelValue", [start, end]);
|
|
2731
|
+
} else if (props.type === "month") {
|
|
2732
|
+
const data = value2;
|
|
2733
|
+
emit("update:modelValue", new Date(data.year, data.month, 1));
|
|
2734
|
+
} else if (props.type === "year") {
|
|
2735
|
+
emit("update:modelValue", new Date(value2, 0));
|
|
2736
|
+
} else if (props.type === "week") {
|
|
2737
|
+
emit("update:modelValue", value2[0]);
|
|
2738
|
+
} else {
|
|
2739
|
+
emit("update:modelValue", value2);
|
|
2740
|
+
}
|
|
2741
|
+
}
|
|
2742
|
+
function formatLibraryTime(time) {
|
|
2743
|
+
const date = /* @__PURE__ */ new Date();
|
|
2744
|
+
date.setHours(time.hours);
|
|
2745
|
+
date.setMinutes(time.minutes);
|
|
2746
|
+
date.setSeconds(time.seconds);
|
|
2747
|
+
return date;
|
|
2748
|
+
}
|
|
2749
|
+
const weekStart = getFirstDay();
|
|
2750
|
+
const dayNames = [...getDayNamesMin()];
|
|
2751
|
+
for (let i = 0; i < weekStart; i++) {
|
|
2752
|
+
dayNames.push(dayNames.shift());
|
|
2753
|
+
}
|
|
2754
|
+
const weekNumName = t("W");
|
|
2755
|
+
const ariaLabels = computed(() => ({
|
|
2756
|
+
toggleOverlay: t("Toggle overlay"),
|
|
2757
|
+
menu: props.ariaLabelMenu,
|
|
2758
|
+
input: props.ariaLabel,
|
|
2759
|
+
openTimePicker: t("Open time picker"),
|
|
2760
|
+
closeTimePicker: t("Close time Picker"),
|
|
2761
|
+
incrementValue: (type) => {
|
|
2762
|
+
if (type === "hours") {
|
|
2763
|
+
return t("Increment hours");
|
|
2764
|
+
} else if (type === "minutes") {
|
|
2765
|
+
return t("Increment minutes");
|
|
2766
|
+
}
|
|
2767
|
+
return t("Increment seconds");
|
|
2768
|
+
},
|
|
2769
|
+
decrementValue: (type) => {
|
|
2770
|
+
if (type === "hours") {
|
|
2771
|
+
return t("Decrement hours");
|
|
2772
|
+
} else if (type === "minutes") {
|
|
2773
|
+
return t("Decrement minutes");
|
|
2774
|
+
}
|
|
2775
|
+
return t("Decrement seconds");
|
|
2776
|
+
},
|
|
2777
|
+
openTpOverlay: (type) => {
|
|
2778
|
+
if (type === "hours") {
|
|
2779
|
+
return t("Open hours overlay");
|
|
2780
|
+
} else if (type === "minutes") {
|
|
2781
|
+
return t("Open minutes overlay");
|
|
2782
|
+
}
|
|
2783
|
+
return t("Open seconds overlay");
|
|
2784
|
+
},
|
|
2785
|
+
amPmButton: t("Switch AM/PM mode"),
|
|
2786
|
+
openYearsOverlay: t("Open years overlay"),
|
|
2787
|
+
openMonthsOverlay: t("Open months overlay"),
|
|
2788
|
+
nextMonth: t("Next month"),
|
|
2789
|
+
prevMonth: t("Previous month"),
|
|
2790
|
+
nextYear: t("Next year"),
|
|
2791
|
+
prevYear: t("Previous year"),
|
|
2792
|
+
weekDay: (day) => getDayNames()[day],
|
|
2793
|
+
clearInput: t("Clear value"),
|
|
2794
|
+
calendarIcon: t("Calendar icon"),
|
|
2795
|
+
timePicker: t("Time picker"),
|
|
2796
|
+
monthPicker: (overlay) => overlay ? t("Month picker overlay") : t("Month picker"),
|
|
2797
|
+
yearPicker: (overlay) => overlay ? t("Year picker overlay") : t("Year picker")
|
|
2798
|
+
}));
|
|
2799
|
+
function selectDate() {
|
|
2800
|
+
pickerInstance.value.selectDate();
|
|
2801
|
+
}
|
|
2802
|
+
function cancelSelection() {
|
|
2803
|
+
pickerInstance.value.closeMenu();
|
|
2804
|
+
}
|
|
2805
|
+
const calcMinMaxTime = computed(() => {
|
|
2806
|
+
if (props.type === "datetime") {
|
|
2807
|
+
return {
|
|
2808
|
+
minDate: props.min,
|
|
2809
|
+
maxDate: props.max,
|
|
2810
|
+
minTime: props.min && value.value && sameDay(props.min, value.value) ? minTime.value : void 0,
|
|
2811
|
+
maxTime: props.max && value.value && sameDay(props.max, value.value) ? maxTime.value : void 0
|
|
2812
|
+
};
|
|
2813
|
+
}
|
|
2814
|
+
if (props.type === "datetime-range") {
|
|
2815
|
+
return {
|
|
2816
|
+
minDate: props.min,
|
|
2817
|
+
maxDate: props.max,
|
|
2818
|
+
minTime: props.min && value.value ? sameDay(props.min, value.value[0]) ? minTime.value : void 0 : void 0,
|
|
2819
|
+
maxTime: props.max && value.value ? sameDay(props.max, value.value[1]) ? maxTime.value : void 0 : void 0
|
|
2820
|
+
};
|
|
2821
|
+
}
|
|
2822
|
+
if (props.type === "time" || props.type === "time-range") {
|
|
2823
|
+
return {
|
|
2824
|
+
minTime: props.min ? minTime.value : void 0,
|
|
2825
|
+
maxTime: props.max ? maxTime.value : void 0
|
|
2826
|
+
};
|
|
2827
|
+
}
|
|
2828
|
+
return {
|
|
2829
|
+
minDate: props.min,
|
|
2830
|
+
maxDate: props.max
|
|
2831
|
+
};
|
|
2832
|
+
});
|
|
2833
|
+
function sameDay(a, b) {
|
|
2834
|
+
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
2835
|
+
}
|
|
2836
|
+
return (_ctx, _cache) => {
|
|
2837
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
2838
|
+
createVNode(unref(VueDatePicker), mergeProps({
|
|
2839
|
+
ref: "picker",
|
|
2840
|
+
"aria-labels": ariaLabels.value,
|
|
2841
|
+
autoApply: !__props.confirm,
|
|
2842
|
+
class: ["vue-date-time-picker", { "vue-date-time-picker--clearable": __props.clearable }],
|
|
2843
|
+
cancelText: unref(t)("Cancel"),
|
|
2844
|
+
clearable: __props.clearable,
|
|
2845
|
+
dayNames,
|
|
2846
|
+
placeholder: __props.placeholder ?? placeholderFallback.value,
|
|
2847
|
+
format: realFormat.value,
|
|
2848
|
+
locale: unref(realLocale),
|
|
2849
|
+
formatLocale: unref(dateFnsLocale),
|
|
2850
|
+
readonly: unref(dateFnsLocaleIsLoading),
|
|
2851
|
+
minDate: calcMinMaxTime.value.minDate,
|
|
2852
|
+
maxDate: calcMinMaxTime.value.maxDate,
|
|
2853
|
+
minTime: calcMinMaxTime.value.minTime,
|
|
2854
|
+
maxTime: calcMinMaxTime.value.maxTime,
|
|
2855
|
+
minutesIncrement: __props.minuteStep,
|
|
2856
|
+
modelValue: value.value,
|
|
2857
|
+
nowButtonLabel: unref(t)("Now"),
|
|
2858
|
+
selectText: unref(t)("Pick"),
|
|
2859
|
+
sixWeeks: "fair",
|
|
2860
|
+
inline: __props.inline,
|
|
2861
|
+
teleport: __props.appendToBody ? targetElement.value || void 0 : false,
|
|
2862
|
+
textInput: textInput.value,
|
|
2863
|
+
weekNumName: unref(weekNumName),
|
|
2864
|
+
weekNumbers: __props.showWeekNumber ? { type: "iso" } : void 0,
|
|
2865
|
+
weekStart: unref(weekStart)
|
|
2866
|
+
}, pickerType.value, {
|
|
2867
|
+
"onUpdate:modelValue": onUpdateModelValue,
|
|
2868
|
+
onBlur: _cache[1] || (_cache[1] = ($event) => emit("blur"))
|
|
2869
|
+
}), createSlots({
|
|
2870
|
+
"action-buttons": withCtx(() => [
|
|
2871
|
+
createVNode(unref(NcButton), {
|
|
2872
|
+
size: "small",
|
|
2873
|
+
variant: "tertiary",
|
|
2874
|
+
onClick: cancelSelection
|
|
2875
|
+
}, {
|
|
2876
|
+
default: withCtx(() => [
|
|
2877
|
+
createTextVNode(toDisplayString(unref(t)("Cancel")), 1)
|
|
2878
|
+
]),
|
|
2879
|
+
_: 1
|
|
2880
|
+
}),
|
|
2881
|
+
createVNode(unref(NcButton), {
|
|
2882
|
+
size: "small",
|
|
2883
|
+
variant: "primary",
|
|
2884
|
+
onClick: selectDate
|
|
2885
|
+
}, {
|
|
2886
|
+
default: withCtx(() => [
|
|
2887
|
+
createTextVNode(toDisplayString(unref(t)("Pick")), 1)
|
|
2888
|
+
]),
|
|
2889
|
+
_: 1
|
|
2890
|
+
})
|
|
2891
|
+
]),
|
|
2892
|
+
"clear-icon": withCtx(({ clear }) => [
|
|
2893
|
+
createVNode(unref(NcButton), {
|
|
2894
|
+
"aria-label": unref(t)("Clear value"),
|
|
2895
|
+
variant: "tertiary-no-background",
|
|
2896
|
+
onClick: clear
|
|
2897
|
+
}, {
|
|
2898
|
+
icon: withCtx(() => [
|
|
2899
|
+
createVNode(NcIconSvgWrapper, {
|
|
2900
|
+
inline: "",
|
|
2901
|
+
path: unref(mdiClose),
|
|
2902
|
+
size: 20
|
|
2903
|
+
}, null, 8, ["path"])
|
|
2904
|
+
]),
|
|
2905
|
+
_: 1
|
|
2906
|
+
}, 8, ["aria-label", "onClick"])
|
|
2907
|
+
]),
|
|
2908
|
+
"input-icon": withCtx(() => [
|
|
2909
|
+
createVNode(NcIconSvgWrapper, {
|
|
2910
|
+
path: unref(mdiCalendarBlank),
|
|
2911
|
+
size: 20
|
|
2912
|
+
}, null, 8, ["path"])
|
|
2913
|
+
]),
|
|
2914
|
+
"clock-icon": withCtx(() => [
|
|
2915
|
+
createVNode(NcIconSvgWrapper, {
|
|
2916
|
+
inline: "",
|
|
2917
|
+
path: unref(mdiClock),
|
|
2918
|
+
size: 20
|
|
2919
|
+
}, null, 8, ["path"])
|
|
2920
|
+
]),
|
|
2921
|
+
"arrow-left": withCtx(() => [
|
|
2922
|
+
createVNode(NcIconSvgWrapper, {
|
|
2923
|
+
inline: "",
|
|
2924
|
+
path: unref(mdiChevronLeft),
|
|
2925
|
+
size: 20
|
|
2926
|
+
}, null, 8, ["path"])
|
|
2927
|
+
]),
|
|
2928
|
+
"arrow-right": withCtx(() => [
|
|
2929
|
+
createVNode(NcIconSvgWrapper, {
|
|
2930
|
+
inline: "",
|
|
2931
|
+
path: unref(mdiChevronRight),
|
|
2932
|
+
size: 20
|
|
2933
|
+
}, null, 8, ["path"])
|
|
2934
|
+
]),
|
|
2935
|
+
"arrow-down": withCtx(() => [
|
|
2936
|
+
createVNode(NcIconSvgWrapper, {
|
|
2937
|
+
inline: "",
|
|
2938
|
+
path: unref(mdiChevronDown),
|
|
2939
|
+
size: 20
|
|
2940
|
+
}, null, 8, ["path"])
|
|
2941
|
+
]),
|
|
2942
|
+
"arrow-up": withCtx(() => [
|
|
2943
|
+
createVNode(NcIconSvgWrapper, {
|
|
2944
|
+
inline: "",
|
|
2945
|
+
path: unref(mdiChevronUp),
|
|
2946
|
+
size: 20
|
|
2947
|
+
}, null, 8, ["path"])
|
|
2948
|
+
]),
|
|
2949
|
+
_: 2
|
|
2950
|
+
}, [
|
|
2951
|
+
__props.showTimezoneSelect ? {
|
|
2952
|
+
name: "action-extra",
|
|
2953
|
+
fn: withCtx(() => [
|
|
2954
|
+
createVNode(_sfc_main$1, {
|
|
2955
|
+
modelValue: timezoneId.value,
|
|
2956
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => timezoneId.value = $event),
|
|
2957
|
+
class: "vue-date-time-picker__timezone",
|
|
2958
|
+
appendToBody: false,
|
|
2959
|
+
inputLabel: unref(t)("Time zone")
|
|
2960
|
+
}, null, 8, ["modelValue", "inputLabel"])
|
|
2961
|
+
]),
|
|
2962
|
+
key: "0"
|
|
2963
|
+
} : void 0
|
|
2964
|
+
]), 1040, ["aria-labels", "autoApply", "class", "cancelText", "clearable", "placeholder", "format", "locale", "formatLocale", "readonly", "minDate", "maxDate", "minTime", "maxTime", "minutesIncrement", "modelValue", "nowButtonLabel", "selectText", "inline", "teleport", "textInput", "weekNumName", "weekNumbers", "weekStart"]),
|
|
2965
|
+
(openBlock(), createBlock(Teleport, {
|
|
2966
|
+
to: "body",
|
|
2967
|
+
disabled: !__props.appendToBody
|
|
2968
|
+
}, [
|
|
2969
|
+
createElementVNode("div", _hoisted_2, null, 512)
|
|
2970
|
+
], 8, ["disabled"]))
|
|
2971
|
+
]);
|
|
2972
|
+
};
|
|
2973
|
+
}
|
|
2974
|
+
});
|
|
2975
|
+
const NcDateTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f9ae684c"]]);
|
|
2976
|
+
export {
|
|
2977
|
+
NcDateTimePicker as N
|
|
2978
|
+
};
|
|
2979
|
+
//# sourceMappingURL=NcDateTimePicker.mjs.map
|