@sendbird/uikit-react 3.1.3 → 3.2.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App.js +84 -96
- package/App.js.map +1 -1
- package/CHANGELOG.md +42 -0
- package/Channel/components/ChannelHeader.js +20 -22
- package/Channel/components/ChannelHeader.js.map +1 -1
- package/Channel/components/ChannelUI.js +30 -31
- package/Channel/components/ChannelUI.js.map +1 -1
- package/Channel/components/FileViewer.js +20 -22
- package/Channel/components/FileViewer.js.map +1 -1
- package/Channel/components/FrozenNotification.js +5 -6
- package/Channel/components/FrozenNotification.js.map +1 -1
- package/Channel/components/Message.js +34 -35
- package/Channel/components/Message.js.map +1 -1
- package/Channel/components/MessageInput.js +35 -33
- package/Channel/components/MessageInput.js.map +1 -1
- package/Channel/components/MessageList.js +28 -29
- package/Channel/components/MessageList.js.map +1 -1
- package/Channel/components/RemoveMessageModal.js +20 -22
- package/Channel/components/RemoveMessageModal.js.map +1 -1
- package/Channel/components/SuggestedMentionList.js +34 -36
- package/Channel/components/SuggestedMentionList.js.map +1 -1
- package/Channel/components/TypingIndicator.js +20 -22
- package/Channel/components/TypingIndicator.js.map +1 -1
- package/Channel/components/UnreadCount.js +5 -6
- package/Channel/components/UnreadCount.js.map +1 -1
- package/Channel/context.js +15 -17
- package/Channel/context.js.map +1 -1
- package/Channel.js +26 -27
- package/Channel.js.map +1 -1
- package/ChannelList/components/AddChannel.js +18 -18
- package/ChannelList/components/AddChannel.js.map +1 -1
- package/ChannelList/components/ChannelListHeader.js +10 -10
- package/ChannelList/components/ChannelListHeader.js.map +1 -1
- package/ChannelList/components/ChannelListUI.js +40 -42
- package/ChannelList/components/ChannelListUI.js.map +1 -1
- package/ChannelList/components/ChannelPreview.js +48 -50
- package/ChannelList/components/ChannelPreview.js.map +1 -1
- package/ChannelList/components/ChannelPreviewAction.js +61 -73
- package/ChannelList/components/ChannelPreviewAction.js.map +1 -1
- package/ChannelList/context.js +10 -12
- package/ChannelList/context.js.map +1 -1
- package/ChannelList.js +29 -31
- package/ChannelList.js.map +1 -1
- package/{ChannelListProvider-0157b613.js → ChannelListProvider-368bd7f1.js} +236 -219
- package/ChannelListProvider-368bd7f1.js.map +1 -0
- package/{ChannelProvider-57689107.js → ChannelProvider-59559ed8.js} +557 -524
- package/{ChannelProvider-57689107.js.map → ChannelProvider-59559ed8.js.map} +1 -1
- package/ChannelSettings/components/ChannelProfile.js +17 -17
- package/ChannelSettings/components/ChannelProfile.js.map +1 -1
- package/ChannelSettings/components/ChannelSettingsUI.js +27 -29
- package/ChannelSettings/components/ChannelSettingsUI.js.map +1 -1
- package/ChannelSettings/components/EditDetailsModal.js +21 -23
- package/ChannelSettings/components/EditDetailsModal.js.map +1 -1
- package/ChannelSettings/components/LeaveChannel.js +18 -19
- package/ChannelSettings/components/LeaveChannel.js.map +1 -1
- package/ChannelSettings/components/ModerationPanel.js +91 -90
- package/ChannelSettings/components/ModerationPanel.js.map +1 -1
- package/ChannelSettings/components/UserListItem.js +16 -16
- package/ChannelSettings/components/UserListItem.js.map +1 -1
- package/ChannelSettings/components/UserPanel.js +18 -18
- package/ChannelSettings/components/UserPanel.js.map +1 -1
- package/ChannelSettings/context.js +6 -6
- package/ChannelSettings/context.js.map +1 -1
- package/ChannelSettings.js +21 -23
- package/ChannelSettings.js.map +1 -1
- package/CreateChannel/components/CreateChannelUI.js +19 -20
- package/CreateChannel/components/CreateChannelUI.js.map +1 -1
- package/CreateChannel/components/InviteUsers.js +23 -22
- package/CreateChannel/components/InviteUsers.js.map +1 -1
- package/CreateChannel/components/SelectChannelType.js +23 -23
- package/CreateChannel/components/SelectChannelType.js.map +1 -1
- package/CreateChannel/context.js +4 -4
- package/CreateChannel.js +15 -15
- package/CreateChannel.js.map +1 -1
- package/{CreateChannelProvider-f84fd7e5.js → CreateChannelProvider-9c2113ca.js} +3 -3
- package/{CreateChannelProvider-f84fd7e5.js.map → CreateChannelProvider-9c2113ca.js.map} +1 -1
- package/CreateOpenChannel/components/CreateOpenChannelUI.js +128 -0
- package/CreateOpenChannel/components/CreateOpenChannelUI.js.map +1 -0
- package/CreateOpenChannel/context.js +63 -0
- package/CreateOpenChannel/context.js.map +1 -0
- package/CreateOpenChannel.js +45 -0
- package/CreateOpenChannel.js.map +1 -0
- package/EditUserProfile/components/EditUserProfileUI.js +13 -13
- package/EditUserProfile/context.js +13 -13
- package/EditUserProfile/context.js.map +1 -1
- package/EditUserProfile.js +14 -14
- package/EditUserProfile.js.map +1 -1
- package/{LocalizationContext-5b475a64.js → LocalizationContext-10829cf3.js} +5 -5
- package/{LocalizationContext-5b475a64.js.map → LocalizationContext-10829cf3.js.map} +1 -1
- package/{MemberList-004dd3e6.js → MemberList-e049f915.js} +42 -39
- package/MemberList-e049f915.js.map +1 -0
- package/MessageSearch/components/MessageSearchUI.js +17 -17
- package/MessageSearch/components/MessageSearchUI.js.map +1 -1
- package/MessageSearch/context.js +6 -6
- package/MessageSearch/context.js.map +1 -1
- package/MessageSearch.js +14 -14
- package/MessageSearch.js.map +1 -1
- package/OpenChannel/components/FrozenChannelNotification.js +5 -6
- package/OpenChannel/components/FrozenChannelNotification.js.map +1 -1
- package/OpenChannel/components/OpenChannelHeader.js +15 -17
- package/OpenChannel/components/OpenChannelHeader.js.map +1 -1
- package/OpenChannel/components/OpenChannelInput.js +23 -22
- package/OpenChannel/components/OpenChannelInput.js.map +1 -1
- package/OpenChannel/components/OpenChannelMessage.js +36 -35
- package/OpenChannel/components/OpenChannelMessage.js.map +1 -1
- package/OpenChannel/components/OpenChannelMessageList.js +74 -69
- package/OpenChannel/components/OpenChannelMessageList.js.map +1 -1
- package/OpenChannel/components/OpenChannelUI.js +30 -29
- package/OpenChannel/components/OpenChannelUI.js.map +1 -1
- package/OpenChannel/context.js +12 -14
- package/OpenChannel/context.js.map +1 -1
- package/OpenChannel.js +31 -30
- package/OpenChannel.js.map +1 -1
- package/OpenChannelList/components/OpenChannelListUI.js +195 -0
- package/OpenChannelList/components/OpenChannelListUI.js.map +1 -0
- package/OpenChannelList/components/OpenChannelPreview.js +67 -0
- package/OpenChannelList/components/OpenChannelPreview.js.map +1 -0
- package/OpenChannelList/context.js +8 -0
- package/OpenChannelList/context.js.map +1 -0
- package/OpenChannelList.js +58 -0
- package/OpenChannelList.js.map +1 -0
- package/OpenChannelListProvider-95ce73b1.js +434 -0
- package/OpenChannelListProvider-95ce73b1.js.map +1 -0
- package/{OpenChannelProvider-f5d504ec.js → OpenChannelProvider-b360d5fe.js} +48 -49
- package/OpenChannelProvider-b360d5fe.js.map +1 -0
- package/OpenChannelSettings/components/EditDetailsModal.js +42 -40
- package/OpenChannelSettings/components/EditDetailsModal.js.map +1 -1
- package/OpenChannelSettings/components/OpenChannelProfile.js +17 -17
- package/OpenChannelSettings/components/OpenChannelProfile.js.map +1 -1
- package/OpenChannelSettings/components/OpenChannelSettingsUI.js +30 -30
- package/OpenChannelSettings/components/OpenChannelSettingsUI.js.map +1 -1
- package/OpenChannelSettings/components/OperatorUI.js +94 -95
- package/OpenChannelSettings/components/OperatorUI.js.map +1 -1
- package/OpenChannelSettings/components/ParticipantUI.js +18 -19
- package/OpenChannelSettings/components/ParticipantUI.js.map +1 -1
- package/OpenChannelSettings/context.js +20 -15
- package/OpenChannelSettings/context.js.map +1 -1
- package/OpenChannelSettings.js +21 -22
- package/OpenChannelSettings.js.map +1 -1
- package/README.md +3 -8
- package/SendbirdProvider.js +220 -258
- package/SendbirdProvider.js.map +1 -1
- package/{UserProfileContext-a2483e23.js → UserProfileContext-beacab28.js} +6 -4
- package/{UserProfileContext-a2483e23.js.map → UserProfileContext-beacab28.js.map} +1 -1
- package/__bundle-c41dd401-d4ab6c10.js +22 -0
- package/__bundle-c41dd401-d4ab6c10.js.map +1 -0
- package/_rollupPluginBabelHelpers-22c28a74.js +43 -0
- package/_rollupPluginBabelHelpers-22c28a74.js.map +1 -0
- package/actionTypes-fd0f0a6c.js +6 -0
- package/{actionTypes-3a618022.js.map → actionTypes-fd0f0a6c.js.map} +1 -1
- package/cjs/App.js +84 -96
- package/cjs/App.js.map +1 -1
- package/cjs/Channel/components/ChannelHeader.js +20 -22
- package/cjs/Channel/components/ChannelHeader.js.map +1 -1
- package/cjs/Channel/components/ChannelUI.js +28 -29
- package/cjs/Channel/components/ChannelUI.js.map +1 -1
- package/cjs/Channel/components/FileViewer.js +20 -22
- package/cjs/Channel/components/FileViewer.js.map +1 -1
- package/cjs/Channel/components/FrozenNotification.js +5 -6
- package/cjs/Channel/components/FrozenNotification.js.map +1 -1
- package/cjs/Channel/components/Message.js +34 -35
- package/cjs/Channel/components/Message.js.map +1 -1
- package/cjs/Channel/components/MessageInput.js +35 -33
- package/cjs/Channel/components/MessageInput.js.map +1 -1
- package/cjs/Channel/components/MessageList.js +28 -29
- package/cjs/Channel/components/MessageList.js.map +1 -1
- package/cjs/Channel/components/RemoveMessageModal.js +20 -22
- package/cjs/Channel/components/RemoveMessageModal.js.map +1 -1
- package/cjs/Channel/components/SuggestedMentionList.js +34 -36
- package/cjs/Channel/components/SuggestedMentionList.js.map +1 -1
- package/cjs/Channel/components/TypingIndicator.js +20 -22
- package/cjs/Channel/components/TypingIndicator.js.map +1 -1
- package/cjs/Channel/components/UnreadCount.js +5 -6
- package/cjs/Channel/components/UnreadCount.js.map +1 -1
- package/cjs/Channel/context.js +15 -17
- package/cjs/Channel/context.js.map +1 -1
- package/cjs/Channel.js +26 -27
- package/cjs/Channel.js.map +1 -1
- package/cjs/ChannelList/components/AddChannel.js +18 -18
- package/cjs/ChannelList/components/AddChannel.js.map +1 -1
- package/cjs/ChannelList/components/ChannelListHeader.js +10 -10
- package/cjs/ChannelList/components/ChannelListHeader.js.map +1 -1
- package/cjs/ChannelList/components/ChannelListUI.js +40 -42
- package/cjs/ChannelList/components/ChannelListUI.js.map +1 -1
- package/cjs/ChannelList/components/ChannelPreview.js +48 -50
- package/cjs/ChannelList/components/ChannelPreview.js.map +1 -1
- package/cjs/ChannelList/components/ChannelPreviewAction.js +61 -73
- package/cjs/ChannelList/components/ChannelPreviewAction.js.map +1 -1
- package/cjs/ChannelList/context.js +10 -12
- package/cjs/ChannelList/context.js.map +1 -1
- package/cjs/ChannelList.js +29 -31
- package/cjs/ChannelList.js.map +1 -1
- package/cjs/{ChannelListProvider-3e882076.js → ChannelListProvider-dba82f83.js} +235 -218
- package/cjs/ChannelListProvider-dba82f83.js.map +1 -0
- package/cjs/{ChannelProvider-b7e7f2ff.js → ChannelProvider-dd81a327.js} +561 -528
- package/cjs/{ChannelProvider-b7e7f2ff.js.map → ChannelProvider-dd81a327.js.map} +1 -1
- package/cjs/ChannelSettings/components/ChannelProfile.js +17 -17
- package/cjs/ChannelSettings/components/ChannelProfile.js.map +1 -1
- package/cjs/ChannelSettings/components/ChannelSettingsUI.js +27 -29
- package/cjs/ChannelSettings/components/ChannelSettingsUI.js.map +1 -1
- package/cjs/ChannelSettings/components/EditDetailsModal.js +21 -23
- package/cjs/ChannelSettings/components/EditDetailsModal.js.map +1 -1
- package/cjs/ChannelSettings/components/LeaveChannel.js +18 -19
- package/cjs/ChannelSettings/components/LeaveChannel.js.map +1 -1
- package/cjs/ChannelSettings/components/ModerationPanel.js +95 -94
- package/cjs/ChannelSettings/components/ModerationPanel.js.map +1 -1
- package/cjs/ChannelSettings/components/UserListItem.js +16 -16
- package/cjs/ChannelSettings/components/UserListItem.js.map +1 -1
- package/cjs/ChannelSettings/components/UserPanel.js +18 -18
- package/cjs/ChannelSettings/components/UserPanel.js.map +1 -1
- package/cjs/ChannelSettings/context.js +6 -6
- package/cjs/ChannelSettings/context.js.map +1 -1
- package/cjs/ChannelSettings.js +21 -23
- package/cjs/ChannelSettings.js.map +1 -1
- package/cjs/CreateChannel/components/CreateChannelUI.js +19 -20
- package/cjs/CreateChannel/components/CreateChannelUI.js.map +1 -1
- package/cjs/CreateChannel/components/InviteUsers.js +23 -22
- package/cjs/CreateChannel/components/InviteUsers.js.map +1 -1
- package/cjs/CreateChannel/components/SelectChannelType.js +23 -23
- package/cjs/CreateChannel/components/SelectChannelType.js.map +1 -1
- package/cjs/CreateChannel/context.js +4 -4
- package/cjs/CreateChannel.js +15 -15
- package/cjs/CreateChannel.js.map +1 -1
- package/cjs/{CreateChannelProvider-cea018b0.js → CreateChannelProvider-771bf00b.js} +3 -3
- package/cjs/{CreateChannelProvider-cea018b0.js.map → CreateChannelProvider-771bf00b.js.map} +1 -1
- package/cjs/CreateOpenChannel/components/CreateOpenChannelUI.js +134 -0
- package/cjs/CreateOpenChannel/components/CreateOpenChannelUI.js.map +1 -0
- package/cjs/CreateOpenChannel/context.js +72 -0
- package/cjs/CreateOpenChannel/context.js.map +1 -0
- package/cjs/CreateOpenChannel.js +51 -0
- package/cjs/CreateOpenChannel.js.map +1 -0
- package/cjs/EditUserProfile/components/EditUserProfileUI.js +13 -13
- package/cjs/EditUserProfile/context.js +14 -14
- package/cjs/EditUserProfile/context.js.map +1 -1
- package/cjs/EditUserProfile.js +14 -14
- package/cjs/EditUserProfile.js.map +1 -1
- package/cjs/{LocalizationContext-c13ae9d5.js → LocalizationContext-b051aa28.js} +5 -5
- package/cjs/{LocalizationContext-c13ae9d5.js.map → LocalizationContext-b051aa28.js.map} +1 -1
- package/cjs/{MemberList-e062045b.js → MemberList-6c0cdd90.js} +44 -41
- package/cjs/MemberList-6c0cdd90.js.map +1 -0
- package/cjs/MessageSearch/components/MessageSearchUI.js +17 -17
- package/cjs/MessageSearch/components/MessageSearchUI.js.map +1 -1
- package/cjs/MessageSearch/context.js +6 -6
- package/cjs/MessageSearch/context.js.map +1 -1
- package/cjs/MessageSearch.js +14 -14
- package/cjs/MessageSearch.js.map +1 -1
- package/cjs/OpenChannel/components/FrozenChannelNotification.js +5 -6
- package/cjs/OpenChannel/components/FrozenChannelNotification.js.map +1 -1
- package/cjs/OpenChannel/components/OpenChannelHeader.js +15 -17
- package/cjs/OpenChannel/components/OpenChannelHeader.js.map +1 -1
- package/cjs/OpenChannel/components/OpenChannelInput.js +23 -22
- package/cjs/OpenChannel/components/OpenChannelInput.js.map +1 -1
- package/cjs/OpenChannel/components/OpenChannelMessage.js +36 -35
- package/cjs/OpenChannel/components/OpenChannelMessage.js.map +1 -1
- package/cjs/OpenChannel/components/OpenChannelMessageList.js +74 -69
- package/cjs/OpenChannel/components/OpenChannelMessageList.js.map +1 -1
- package/cjs/OpenChannel/components/OpenChannelUI.js +30 -29
- package/cjs/OpenChannel/components/OpenChannelUI.js.map +1 -1
- package/cjs/OpenChannel/context.js +12 -14
- package/cjs/OpenChannel/context.js.map +1 -1
- package/cjs/OpenChannel.js +31 -30
- package/cjs/OpenChannel.js.map +1 -1
- package/cjs/OpenChannelList/components/OpenChannelListUI.js +201 -0
- package/cjs/OpenChannelList/components/OpenChannelListUI.js.map +1 -0
- package/cjs/OpenChannelList/components/OpenChannelPreview.js +73 -0
- package/cjs/OpenChannelList/components/OpenChannelPreview.js.map +1 -0
- package/cjs/OpenChannelList/context.js +18 -0
- package/cjs/OpenChannelList/context.js.map +1 -0
- package/cjs/OpenChannelList.js +64 -0
- package/cjs/OpenChannelList.js.map +1 -0
- package/cjs/OpenChannelListProvider-3eed20f7.js +443 -0
- package/cjs/OpenChannelListProvider-3eed20f7.js.map +1 -0
- package/cjs/{OpenChannelProvider-341f9a01.js → OpenChannelProvider-e4f3a05c.js} +48 -49
- package/cjs/OpenChannelProvider-e4f3a05c.js.map +1 -0
- package/cjs/OpenChannelSettings/components/EditDetailsModal.js +42 -40
- package/cjs/OpenChannelSettings/components/EditDetailsModal.js.map +1 -1
- package/cjs/OpenChannelSettings/components/OpenChannelProfile.js +17 -17
- package/cjs/OpenChannelSettings/components/OpenChannelProfile.js.map +1 -1
- package/cjs/OpenChannelSettings/components/OpenChannelSettingsUI.js +30 -30
- package/cjs/OpenChannelSettings/components/OpenChannelSettingsUI.js.map +1 -1
- package/cjs/OpenChannelSettings/components/OperatorUI.js +98 -99
- package/cjs/OpenChannelSettings/components/OperatorUI.js.map +1 -1
- package/cjs/OpenChannelSettings/components/ParticipantUI.js +18 -19
- package/cjs/OpenChannelSettings/components/ParticipantUI.js.map +1 -1
- package/cjs/OpenChannelSettings/context.js +20 -15
- package/cjs/OpenChannelSettings/context.js.map +1 -1
- package/cjs/OpenChannelSettings.js +21 -22
- package/cjs/OpenChannelSettings.js.map +1 -1
- package/cjs/SendbirdProvider.js +220 -257
- package/cjs/SendbirdProvider.js.map +1 -1
- package/cjs/{UserProfileContext-f7c125ca.js → UserProfileContext-fa684629.js} +6 -4
- package/cjs/{UserProfileContext-f7c125ca.js.map → UserProfileContext-fa684629.js.map} +1 -1
- package/cjs/__bundle-c41dd401-1f364afe.js +120 -0
- package/cjs/__bundle-c41dd401-1f364afe.js.map +1 -0
- package/cjs/_rollupPluginBabelHelpers-c7da8657.js +45 -0
- package/cjs/_rollupPluginBabelHelpers-c7da8657.js.map +1 -0
- package/cjs/actionTypes-1bc31680.js +10 -0
- package/cjs/{actionTypes-b3af2b15.js.map → actionTypes-1bc31680.js.map} +1 -1
- package/cjs/{color-f0ffb253.js → color-8c864d64.js} +10 -10
- package/cjs/color-8c864d64.js.map +1 -0
- package/cjs/compareIds-a7236494.js +18 -0
- package/cjs/compareIds-a7236494.js.map +1 -0
- package/cjs/{const-84c58686.js → const-baa5e08a.js} +1 -1
- package/cjs/const-baa5e08a.js.map +1 -0
- package/cjs/{const-459420a0.js → const-de0fa0d4.js} +1 -1
- package/cjs/{const-459420a0.js.map → const-de0fa0d4.js.map} +1 -1
- package/cjs/{context-01248097.js → context-867cfd7f.js} +2 -2
- package/cjs/{context-01248097.js.map → context-867cfd7f.js.map} +1 -1
- package/cjs/dist/index.css +4693 -3624
- package/cjs/dist/index.css.map +1 -1
- package/cjs/groupChannel-95ba4a71.js +11 -0
- package/cjs/groupChannel-95ba4a71.js.map +1 -0
- package/cjs/handlers/ConnectionHandler.js +2 -4
- package/cjs/handlers/ConnectionHandler.js.map +1 -1
- package/cjs/handlers/GroupChannelHandler.js +3 -5
- package/cjs/handlers/GroupChannelHandler.js.map +1 -1
- package/cjs/handlers/OpenChannelHandler.js +2 -3
- package/cjs/handlers/OpenChannelHandler.js.map +1 -1
- package/cjs/handlers/SessionHandler.js +2 -4
- package/cjs/handlers/SessionHandler.js.map +1 -1
- package/cjs/handlers/UserEventHandler.js +2 -4
- package/cjs/handlers/UserEventHandler.js.map +1 -1
- package/cjs/{index-0add0c83.js → index-511e268c.js} +15 -15
- package/cjs/index-511e268c.js.map +1 -0
- package/cjs/{index-63b56a0e.js → index-53015903.js} +69 -80
- package/cjs/index-53015903.js.map +1 -0
- package/cjs/{index-dad73aff.js → index-62c9ad2d.js} +14 -13
- package/cjs/{index-dad73aff.js.map → index-62c9ad2d.js.map} +1 -1
- package/cjs/{index-243538a2.js → index-6d02996a.js} +16 -14
- package/cjs/index-6d02996a.js.map +1 -0
- package/cjs/{index-a00a0f18.js → index-76deed83.js} +34 -34
- package/cjs/index-76deed83.js.map +1 -0
- package/cjs/{index-2d53c0e6.js → index-78d342b2.js} +15 -14
- package/cjs/index-78d342b2.js.map +1 -0
- package/cjs/{index-c8f7702f.js → index-907bf834.js} +54 -54
- package/cjs/index-907bf834.js.map +1 -0
- package/cjs/{index-2f58ecfc.js → index-b478bf3b.js} +18 -37
- package/cjs/index-b478bf3b.js.map +1 -0
- package/cjs/{index-701d44c1.js → index-c4369117.js} +299 -319
- package/cjs/index-c4369117.js.map +1 -0
- package/cjs/{index-98e4f7b2.js → index-d31051df.js} +2 -2
- package/cjs/index-d31051df.js.map +1 -0
- package/cjs/index.js +38 -39
- package/cjs/index.js.map +1 -1
- package/cjs/openChannel-4789903c.js +9 -0
- package/cjs/openChannel-4789903c.js.map +1 -0
- package/cjs/{openChannelUtils-7a336d09.js → openChannelUtils-fc2ec8df.js} +11 -11
- package/cjs/openChannelUtils-fc2ec8df.js.map +1 -0
- package/cjs/sendbirdSelectors.js +22 -22
- package/cjs/sendbirdSelectors.js.map +1 -1
- package/cjs/{stringSet-bd0c293d.js → stringSet-9d251780.js} +21 -6
- package/cjs/stringSet-9d251780.js.map +1 -0
- package/cjs/topics-ac8d2b51.js +22 -0
- package/cjs/topics-ac8d2b51.js.map +1 -0
- package/cjs/{tslib.es6-f57d0c81.js → tslib.es6-9b1c82d5.js} +2 -2
- package/cjs/tslib.es6-9b1c82d5.js.map +1 -0
- package/cjs/ui/Accordion.js +4 -5
- package/cjs/ui/Accordion.js.map +1 -1
- package/cjs/ui/AccordionGroup.js +2 -2
- package/cjs/ui/AccordionGroup.js.map +1 -1
- package/cjs/ui/AdminMessage.js +3 -4
- package/cjs/ui/AdminMessage.js.map +1 -1
- package/cjs/ui/Avatar.js +6 -7
- package/cjs/ui/Avatar.js.map +1 -1
- package/cjs/ui/Badge.js +5 -6
- package/cjs/ui/Badge.js.map +1 -1
- package/cjs/ui/Button.js +85 -9
- package/cjs/ui/Button.js.map +1 -1
- package/cjs/ui/ChannelAvatar.js +3 -4
- package/cjs/ui/ChannelAvatar.js.map +1 -1
- package/cjs/ui/Checkbox.js +1 -1
- package/cjs/ui/Checkbox.js.map +1 -1
- package/cjs/ui/ConnectionStatus.js +4 -5
- package/cjs/ui/ConnectionStatus.js.map +1 -1
- package/cjs/ui/ContextMenu.js +16 -16
- package/cjs/ui/ContextMenu.js.map +1 -1
- package/cjs/ui/DateSeparator.js +5 -6
- package/cjs/ui/DateSeparator.js.map +1 -1
- package/cjs/ui/EmojiReactions.js +13 -14
- package/cjs/ui/EmojiReactions.js.map +1 -1
- package/cjs/ui/FileMessageItemBody.js +7 -8
- package/cjs/ui/FileMessageItemBody.js.map +1 -1
- package/cjs/ui/FileViewer.js +11 -12
- package/cjs/ui/FileViewer.js.map +1 -1
- package/cjs/ui/Icon.js +75 -74
- package/cjs/ui/Icon.js.map +1 -1
- package/cjs/ui/IconButton.js +7 -7
- package/cjs/ui/IconButton.js.map +1 -1
- package/cjs/ui/ImageRenderer.js +8 -10
- package/cjs/ui/ImageRenderer.js.map +1 -1
- package/cjs/ui/Input.js +4 -5
- package/cjs/ui/Input.js.map +1 -1
- package/cjs/ui/Label.js +2 -3
- package/cjs/ui/Label.js.map +1 -1
- package/cjs/ui/LinkLabel.js +14 -13
- package/cjs/ui/LinkLabel.js.map +1 -1
- package/cjs/ui/Loader.js +1 -2
- package/cjs/ui/Loader.js.map +1 -1
- package/cjs/ui/MentionLabel.js +14 -14
- package/cjs/ui/MentionLabel.js.map +1 -1
- package/cjs/ui/MentionUserLabel.js.map +1 -1
- package/cjs/ui/MessageContent.js +20 -20
- package/cjs/ui/MessageContent.js.map +1 -1
- package/cjs/ui/MessageInput.js +214 -10044
- package/cjs/ui/MessageInput.js.map +1 -1
- package/cjs/ui/MessageItemMenu.js +17 -18
- package/cjs/ui/MessageItemMenu.js.map +1 -1
- package/cjs/ui/MessageItemReactionMenu.js +12 -13
- package/cjs/ui/MessageItemReactionMenu.js.map +1 -1
- package/cjs/ui/MessageSearchFileItem.js +13 -24
- package/cjs/ui/MessageSearchFileItem.js.map +1 -1
- package/cjs/ui/MessageSearchItem.js +12 -14
- package/cjs/ui/MessageSearchItem.js.map +1 -1
- package/cjs/ui/MessageStatus.js +7 -8
- package/cjs/ui/MessageStatus.js.map +1 -1
- package/cjs/ui/Modal.js +15 -15
- package/cjs/ui/Modal.js.map +1 -1
- package/cjs/ui/MutedAvatarOverlay.js +0 -1
- package/cjs/ui/MutedAvatarOverlay.js.map +1 -1
- package/cjs/ui/OGMessageItemBody.js +12 -12
- package/cjs/ui/OGMessageItemBody.js.map +1 -1
- package/cjs/ui/OpenChannelAdminMessage.js +3 -4
- package/cjs/ui/OpenChannelAdminMessage.js.map +1 -1
- package/cjs/ui/OpenChannelAvatar.js +6 -7
- package/cjs/ui/OpenChannelAvatar.js.map +1 -1
- package/cjs/ui/OpenchannelConversationHeader.js +6 -7
- package/cjs/ui/OpenchannelConversationHeader.js.map +1 -1
- package/cjs/ui/OpenchannelFileMessage.js +25 -25
- package/cjs/ui/OpenchannelFileMessage.js.map +1 -1
- package/cjs/ui/OpenchannelOGMessage.js +49 -54
- package/cjs/ui/OpenchannelOGMessage.js.map +1 -1
- package/cjs/ui/OpenchannelThumbnailMessage.js +27 -27
- package/cjs/ui/OpenchannelThumbnailMessage.js.map +1 -1
- package/cjs/ui/OpenchannelUserMessage.js +25 -25
- package/cjs/ui/OpenchannelUserMessage.js.map +1 -1
- package/cjs/ui/PlaceHolder.js +6 -7
- package/cjs/ui/PlaceHolder.js.map +1 -1
- package/cjs/ui/QuoteMessage.js +10 -11
- package/cjs/ui/QuoteMessage.js.map +1 -1
- package/cjs/ui/QuoteMessageInput.js +7 -8
- package/cjs/ui/QuoteMessageInput.js.map +1 -1
- package/cjs/ui/ReactionBadge.js +4 -5
- package/cjs/ui/ReactionBadge.js.map +1 -1
- package/cjs/ui/ReactionButton.js +6 -6
- package/cjs/ui/ReactionButton.js.map +1 -1
- package/cjs/ui/SortByRow.js +2 -2
- package/cjs/ui/SortByRow.js.map +1 -1
- package/cjs/ui/TextButton.js +8 -9
- package/cjs/ui/TextButton.js.map +1 -1
- package/cjs/ui/TextMessageItemBody.js +11 -11
- package/cjs/ui/TextMessageItemBody.js.map +1 -1
- package/cjs/ui/ThumbnailMessageItemBody.js +5 -6
- package/cjs/ui/ThumbnailMessageItemBody.js.map +1 -1
- package/cjs/ui/Tooltip.js +3 -4
- package/cjs/ui/Tooltip.js.map +1 -1
- package/cjs/ui/TooltipWrapper.js +5 -5
- package/cjs/ui/TooltipWrapper.js.map +1 -1
- package/cjs/ui/UnknownMessageItemBody.js +6 -7
- package/cjs/ui/UnknownMessageItemBody.js.map +1 -1
- package/cjs/ui/UserListItem.js +18 -18
- package/cjs/ui/UserListItem.js.map +1 -1
- package/cjs/ui/UserProfile.js +13 -13
- package/cjs/ui/UserProfile.js.map +1 -1
- package/cjs/ui/Word.js +18 -15
- package/cjs/ui/Word.js.map +1 -1
- package/cjs/useSendbirdStateContext.js +1 -1
- package/cjs/useSendbirdStateContext.js.map +1 -1
- package/cjs/{utils-438c14b6.js → utils-655acd99.js} +4 -4
- package/cjs/utils-655acd99.js.map +1 -0
- package/cjs/{utils-959685f6.js → utils-8c634fd2.js} +2 -2
- package/cjs/{utils-959685f6.js.map → utils-8c634fd2.js.map} +1 -1
- package/cjs/utils-8e6fef1c.js +6 -0
- package/cjs/{utils-760ac018.js.map → utils-8e6fef1c.js.map} +1 -1
- package/cjs/{uuid-1942f440.js → uuid-c32d01d6.js} +2 -2
- package/cjs/{uuid-1942f440.js.map → uuid-c32d01d6.js.map} +1 -1
- package/cjs/withSendbird.js +13 -15
- package/cjs/withSendbird.js.map +1 -1
- package/{color-83cfc07a.js → color-fff21001.js} +10 -10
- package/color-fff21001.js.map +1 -0
- package/compareIds-332d261c.js +16 -0
- package/compareIds-332d261c.js.map +1 -0
- package/{const-71ceda85.js → const-03293011.js} +1 -1
- package/const-03293011.js.map +1 -0
- package/{const-7867ac6a.js → const-78e336dd.js} +1 -1
- package/{const-7867ac6a.js.map → const-78e336dd.js.map} +1 -1
- package/{context-2f6f1c17.js → context-44e184de.js} +2 -2
- package/{context-2f6f1c17.js.map → context-44e184de.js.map} +1 -1
- package/dist/index.css +4693 -3624
- package/dist/index.css.map +1 -1
- package/groupChannel-3301a732.js +8 -0
- package/groupChannel-3301a732.js.map +1 -0
- package/handlers/ConnectionHandler.js +2 -4
- package/handlers/ConnectionHandler.js.map +1 -1
- package/handlers/GroupChannelHandler.js +3 -5
- package/handlers/GroupChannelHandler.js.map +1 -1
- package/handlers/OpenChannelHandler.js +3 -4
- package/handlers/OpenChannelHandler.js.map +1 -1
- package/handlers/SessionHandler.js +2 -4
- package/handlers/SessionHandler.js.map +1 -1
- package/handlers/UserEventHandler.js +2 -4
- package/handlers/UserEventHandler.js.map +1 -1
- package/{index-952d5f9b.js → index-00b281a3.js} +18 -37
- package/index-00b281a3.js.map +1 -0
- package/{index-4400a360.js → index-3ddec9e9.js} +299 -320
- package/index-3ddec9e9.js.map +1 -0
- package/{index-24a5ab49.js → index-46beca69.js} +54 -54
- package/index-46beca69.js.map +1 -0
- package/{index-d545f604.js → index-49d3a217.js} +33 -33
- package/index-49d3a217.js.map +1 -0
- package/{index-1086dd43.js → index-5e788130.js} +2 -2
- package/index-5e788130.js.map +1 -0
- package/{index-e028fd23.js → index-7b043ab9.js} +14 -13
- package/{index-e028fd23.js.map → index-7b043ab9.js.map} +1 -1
- package/{index-2f85a795.js → index-8bd6c997.js} +16 -14
- package/index-8bd6c997.js.map +1 -0
- package/{index-25496c01.js → index-940576d8.js} +69 -80
- package/index-940576d8.js.map +1 -0
- package/{index-c3a36db0.js → index-e5aab3b4.js} +15 -15
- package/index-e5aab3b4.js.map +1 -0
- package/{index-7a790c96.js → index-ed8e5d48.js} +15 -14
- package/index-ed8e5d48.js.map +1 -0
- package/index.d.ts +207 -97
- package/index.js +38 -39
- package/index.js.map +1 -1
- package/openChannel-2aef0cd5.js +6 -0
- package/openChannel-2aef0cd5.js.map +1 -0
- package/{openChannelUtils-f64223c9.js → openChannelUtils-d27d1e28.js} +11 -11
- package/openChannelUtils-d27d1e28.js.map +1 -0
- package/package.json +4 -3
- package/sendbirdSelectors.js +22 -22
- package/sendbirdSelectors.js.map +1 -1
- package/{stringSet-c4a61372.js → stringSet-804c49f3.js} +21 -6
- package/stringSet-804c49f3.js.map +1 -0
- package/topics-24c0f724.js +13 -0
- package/topics-24c0f724.js.map +1 -0
- package/{tslib.es6-72a2f141.js → tslib.es6-4faaa58d.js} +2 -2
- package/tslib.es6-4faaa58d.js.map +1 -0
- package/ui/Accordion.js +4 -5
- package/ui/Accordion.js.map +1 -1
- package/ui/AccordionGroup.js +2 -2
- package/ui/AccordionGroup.js.map +1 -1
- package/ui/AdminMessage.js +3 -4
- package/ui/AdminMessage.js.map +1 -1
- package/ui/Avatar.js +6 -7
- package/ui/Avatar.js.map +1 -1
- package/ui/Badge.js +5 -6
- package/ui/Badge.js.map +1 -1
- package/ui/Button.js +82 -6
- package/ui/Button.js.map +1 -1
- package/ui/ChannelAvatar.js +3 -4
- package/ui/ChannelAvatar.js.map +1 -1
- package/ui/Checkbox.js +1 -1
- package/ui/Checkbox.js.map +1 -1
- package/ui/ConnectionStatus.js +4 -5
- package/ui/ConnectionStatus.js.map +1 -1
- package/ui/ContextMenu.js +16 -16
- package/ui/ContextMenu.js.map +1 -1
- package/ui/DateSeparator.js +5 -6
- package/ui/DateSeparator.js.map +1 -1
- package/ui/EmojiReactions.js +13 -14
- package/ui/EmojiReactions.js.map +1 -1
- package/ui/FileMessageItemBody.js +7 -8
- package/ui/FileMessageItemBody.js.map +1 -1
- package/ui/FileViewer.js +11 -12
- package/ui/FileViewer.js.map +1 -1
- package/ui/Icon.js +75 -75
- package/ui/Icon.js.map +1 -1
- package/ui/IconButton.js +7 -7
- package/ui/IconButton.js.map +1 -1
- package/ui/ImageRenderer.js +8 -10
- package/ui/ImageRenderer.js.map +1 -1
- package/ui/Input.js +4 -5
- package/ui/Input.js.map +1 -1
- package/ui/Label.js +2 -3
- package/ui/Label.js.map +1 -1
- package/ui/LinkLabel.js +14 -13
- package/ui/LinkLabel.js.map +1 -1
- package/ui/Loader.js +1 -2
- package/ui/Loader.js.map +1 -1
- package/ui/MentionLabel.js +14 -14
- package/ui/MentionLabel.js.map +1 -1
- package/ui/MentionUserLabel.js.map +1 -1
- package/ui/MessageContent.js +20 -20
- package/ui/MessageContent.js.map +1 -1
- package/ui/MessageInput.js +212 -10042
- package/ui/MessageInput.js.map +1 -1
- package/ui/MessageItemMenu.js +17 -18
- package/ui/MessageItemMenu.js.map +1 -1
- package/ui/MessageItemReactionMenu.js +12 -13
- package/ui/MessageItemReactionMenu.js.map +1 -1
- package/ui/MessageSearchFileItem.js +13 -24
- package/ui/MessageSearchFileItem.js.map +1 -1
- package/ui/MessageSearchItem.js +12 -14
- package/ui/MessageSearchItem.js.map +1 -1
- package/ui/MessageStatus.js +7 -8
- package/ui/MessageStatus.js.map +1 -1
- package/ui/Modal.js +13 -13
- package/ui/Modal.js.map +1 -1
- package/ui/MutedAvatarOverlay.js +0 -1
- package/ui/MutedAvatarOverlay.js.map +1 -1
- package/ui/OGMessageItemBody.js +12 -12
- package/ui/OGMessageItemBody.js.map +1 -1
- package/ui/OpenChannelAdminMessage.js +3 -4
- package/ui/OpenChannelAdminMessage.js.map +1 -1
- package/ui/OpenChannelAvatar.js +6 -7
- package/ui/OpenChannelAvatar.js.map +1 -1
- package/ui/OpenchannelConversationHeader.js +6 -7
- package/ui/OpenchannelConversationHeader.js.map +1 -1
- package/ui/OpenchannelFileMessage.js +25 -25
- package/ui/OpenchannelFileMessage.js.map +1 -1
- package/ui/OpenchannelOGMessage.js +49 -54
- package/ui/OpenchannelOGMessage.js.map +1 -1
- package/ui/OpenchannelThumbnailMessage.js +27 -27
- package/ui/OpenchannelThumbnailMessage.js.map +1 -1
- package/ui/OpenchannelUserMessage.js +25 -25
- package/ui/OpenchannelUserMessage.js.map +1 -1
- package/ui/PlaceHolder.js +6 -7
- package/ui/PlaceHolder.js.map +1 -1
- package/ui/QuoteMessage.js +10 -11
- package/ui/QuoteMessage.js.map +1 -1
- package/ui/QuoteMessageInput.js +7 -8
- package/ui/QuoteMessageInput.js.map +1 -1
- package/ui/ReactionBadge.js +4 -5
- package/ui/ReactionBadge.js.map +1 -1
- package/ui/ReactionButton.js +6 -6
- package/ui/ReactionButton.js.map +1 -1
- package/ui/SortByRow.js +2 -2
- package/ui/SortByRow.js.map +1 -1
- package/ui/TextButton.js +8 -9
- package/ui/TextButton.js.map +1 -1
- package/ui/TextMessageItemBody.js +11 -11
- package/ui/TextMessageItemBody.js.map +1 -1
- package/ui/ThumbnailMessageItemBody.js +5 -6
- package/ui/ThumbnailMessageItemBody.js.map +1 -1
- package/ui/Tooltip.js +3 -4
- package/ui/Tooltip.js.map +1 -1
- package/ui/TooltipWrapper.js +5 -5
- package/ui/TooltipWrapper.js.map +1 -1
- package/ui/UnknownMessageItemBody.js +6 -7
- package/ui/UnknownMessageItemBody.js.map +1 -1
- package/ui/UserListItem.js +18 -18
- package/ui/UserListItem.js.map +1 -1
- package/ui/UserProfile.js +12 -12
- package/ui/UserProfile.js.map +1 -1
- package/ui/Word.js +18 -15
- package/ui/Word.js.map +1 -1
- package/useSendbirdStateContext.js +1 -1
- package/useSendbirdStateContext.js.map +1 -1
- package/{utils-12da1022.js → utils-28acb86e.js} +2 -2
- package/{utils-12da1022.js.map → utils-28acb86e.js.map} +1 -1
- package/utils-32938255.js +4 -0
- package/{utils-2c4d166e.js.map → utils-32938255.js.map} +1 -1
- package/{utils-bc7d8f0c.js → utils-47a3394f.js} +4 -4
- package/utils-47a3394f.js.map +1 -0
- package/{uuid-8a4db02f.js → uuid-4521c466.js} +2 -2
- package/{uuid-8a4db02f.js.map → uuid-4521c466.js.map} +1 -1
- package/withSendbird.js +13 -15
- package/withSendbird.js.map +1 -1
- package/ChannelListProvider-0157b613.js.map +0 -1
- package/MemberList-004dd3e6.js.map +0 -1
- package/OpenChannelProvider-f5d504ec.js.map +0 -1
- package/__bundle-6316ce22-63d15802.js +0 -20
- package/__bundle-6316ce22-63d15802.js.map +0 -1
- package/__bundle-7dfccc8c-d5c3938c.js +0 -6
- package/__bundle-7dfccc8c-d5c3938c.js.map +0 -1
- package/__bundle-fbda47dd-b1c87af3.js +0 -6
- package/__bundle-fbda47dd-b1c87af3.js.map +0 -1
- package/_rollupPluginBabelHelpers-b2b008c2.js +0 -130
- package/_rollupPluginBabelHelpers-b2b008c2.js.map +0 -1
- package/actionTypes-3a618022.js +0 -6
- package/cjs/ChannelListProvider-3e882076.js.map +0 -1
- package/cjs/MemberList-e062045b.js.map +0 -1
- package/cjs/OpenChannelProvider-341f9a01.js.map +0 -1
- package/cjs/__bundle-6316ce22-054c7ff6.js +0 -127
- package/cjs/__bundle-6316ce22-054c7ff6.js.map +0 -1
- package/cjs/__bundle-7dfccc8c-826eb0ef.js +0 -15
- package/cjs/__bundle-7dfccc8c-826eb0ef.js.map +0 -1
- package/cjs/__bundle-fbda47dd-4cb7267d.js +0 -33
- package/cjs/__bundle-fbda47dd-4cb7267d.js.map +0 -1
- package/cjs/_rollupPluginBabelHelpers-09706ebf.js +0 -134
- package/cjs/_rollupPluginBabelHelpers-09706ebf.js.map +0 -1
- package/cjs/actionTypes-b3af2b15.js +0 -10
- package/cjs/color-f0ffb253.js.map +0 -1
- package/cjs/compareIds-10371145.js +0 -20
- package/cjs/compareIds-10371145.js.map +0 -1
- package/cjs/const-84c58686.js.map +0 -1
- package/cjs/groupChannel-4934c435.js +0 -11
- package/cjs/groupChannel-4934c435.js.map +0 -1
- package/cjs/index-0add0c83.js.map +0 -1
- package/cjs/index-243538a2.js.map +0 -1
- package/cjs/index-2d53c0e6.js.map +0 -1
- package/cjs/index-2f58ecfc.js.map +0 -1
- package/cjs/index-63b56a0e.js.map +0 -1
- package/cjs/index-701d44c1.js.map +0 -1
- package/cjs/index-98e4f7b2.js.map +0 -1
- package/cjs/index-a00a0f18.js.map +0 -1
- package/cjs/index-c8f7702f.js.map +0 -1
- package/cjs/index-d889bc81.js +0 -90
- package/cjs/index-d889bc81.js.map +0 -1
- package/cjs/openChannel-e95532d8.js +0 -10
- package/cjs/openChannel-e95532d8.js.map +0 -1
- package/cjs/openChannelUtils-7a336d09.js.map +0 -1
- package/cjs/sendbird-e3e5c8ae.js +0 -12
- package/cjs/sendbird-e3e5c8ae.js.map +0 -1
- package/cjs/stringSet-bd0c293d.js.map +0 -1
- package/cjs/topics-f3fe3bf3.js +0 -18
- package/cjs/topics-f3fe3bf3.js.map +0 -1
- package/cjs/tslib.es6-f57d0c81.js.map +0 -1
- package/cjs/ui/ChannelPreview.js +0 -212
- package/cjs/ui/ChannelPreview.js.map +0 -1
- package/cjs/ui/ChatHeader.js +0 -120
- package/cjs/ui/ChatHeader.js.map +0 -1
- package/cjs/utils-438c14b6.js.map +0 -1
- package/cjs/utils-760ac018.js +0 -6
- package/color-83cfc07a.js.map +0 -1
- package/compareIds-9455ecb0.js +0 -18
- package/compareIds-9455ecb0.js.map +0 -1
- package/const-71ceda85.js.map +0 -1
- package/groupChannel-de6b26ee.js +0 -8
- package/groupChannel-de6b26ee.js.map +0 -1
- package/index-1086dd43.js.map +0 -1
- package/index-16e14c17.js +0 -82
- package/index-16e14c17.js.map +0 -1
- package/index-24a5ab49.js.map +0 -1
- package/index-25496c01.js.map +0 -1
- package/index-2f85a795.js.map +0 -1
- package/index-4400a360.js.map +0 -1
- package/index-7a790c96.js.map +0 -1
- package/index-952d5f9b.js.map +0 -1
- package/index-c3a36db0.js.map +0 -1
- package/index-d545f604.js.map +0 -1
- package/openChannel-825f8e93.js +0 -7
- package/openChannel-825f8e93.js.map +0 -1
- package/openChannelUtils-f64223c9.js.map +0 -1
- package/sendbird-21239b88.js +0 -7
- package/sendbird-21239b88.js.map +0 -1
- package/stringSet-c4a61372.js.map +0 -1
- package/topics-851d221c.js +0 -10
- package/topics-851d221c.js.map +0 -1
- package/tslib.es6-72a2f141.js.map +0 -1
- package/ui/ChannelPreview.js +0 -205
- package/ui/ChannelPreview.js.map +0 -1
- package/ui/ChatHeader.js +0 -114
- package/ui/ChatHeader.js.map +0 -1
- package/utils-2c4d166e.js +0 -4
- package/utils-bc7d8f0c.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-53015903.js');
|
|
4
4
|
|
|
5
5
|
function requiredArgs(required, args) {
|
|
6
6
|
if (args.length < required) {
|
|
@@ -8,6 +8,7 @@ function requiredArgs(required, args) {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
|
|
11
12
|
/**
|
|
12
13
|
* @name toDate
|
|
13
14
|
* @category Common Helpers
|
|
@@ -43,7 +44,7 @@ function toDate(argument) {
|
|
|
43
44
|
requiredArgs(1, arguments);
|
|
44
45
|
var argStr = Object.prototype.toString.call(argument); // Clone the date
|
|
45
46
|
|
|
46
|
-
if (argument instanceof Date ||
|
|
47
|
+
if (argument instanceof Date || _typeof$1(argument) === 'object' && argStr === '[object Date]') {
|
|
47
48
|
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
|
48
49
|
return new Date(argument.getTime());
|
|
49
50
|
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
|
@@ -51,7 +52,7 @@ function toDate(argument) {
|
|
|
51
52
|
} else {
|
|
52
53
|
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
|
53
54
|
// eslint-disable-next-line no-console
|
|
54
|
-
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://
|
|
55
|
+
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"); // eslint-disable-next-line no-console
|
|
55
56
|
|
|
56
57
|
console.warn(new Error().stack);
|
|
57
58
|
}
|
|
@@ -60,43 +61,56 @@ function toDate(argument) {
|
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
63
65
|
/**
|
|
64
|
-
* @name
|
|
66
|
+
* @name isDate
|
|
65
67
|
* @category Common Helpers
|
|
66
|
-
* @summary Is the given date
|
|
68
|
+
* @summary Is the given value a date?
|
|
67
69
|
*
|
|
68
70
|
* @description
|
|
69
|
-
* Returns
|
|
70
|
-
* Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
|
|
71
|
-
* Invalid Date is a Date, whose time value is NaN.
|
|
71
|
+
* Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
|
|
72
72
|
*
|
|
73
|
-
*
|
|
73
|
+
* @param {*} value - the value to check
|
|
74
|
+
* @returns {boolean} true if the given value is a date
|
|
75
|
+
* @throws {TypeError} 1 arguments required
|
|
74
76
|
*
|
|
75
|
-
*
|
|
77
|
+
* @example
|
|
78
|
+
* // For a valid date:
|
|
79
|
+
* const result = isDate(new Date())
|
|
80
|
+
* //=> true
|
|
76
81
|
*
|
|
77
|
-
*
|
|
82
|
+
* @example
|
|
83
|
+
* // For an invalid date:
|
|
84
|
+
* const result = isDate(new Date(NaN))
|
|
85
|
+
* //=> true
|
|
78
86
|
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
87
|
+
* @example
|
|
88
|
+
* // For some value:
|
|
89
|
+
* const result = isDate('2014-02-31')
|
|
90
|
+
* //=> false
|
|
82
91
|
*
|
|
83
|
-
*
|
|
92
|
+
* @example
|
|
93
|
+
* // For an object:
|
|
94
|
+
* const result = isDate({})
|
|
95
|
+
* //=> false
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
function isDate(value) {
|
|
99
|
+
requiredArgs(1, arguments);
|
|
100
|
+
return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @name isValid
|
|
105
|
+
* @category Common Helpers
|
|
106
|
+
* @summary Is the given date valid?
|
|
84
107
|
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* | `new Date('')` | `false` | `false` |
|
|
90
|
-
* | `new Date(1488370835081)` | `true` | `true` |
|
|
91
|
-
* | `new Date(NaN)` | `false` | `false` |
|
|
92
|
-
* | `'2016-01-01'` | `TypeError` | `false` |
|
|
93
|
-
* | `''` | `TypeError` | `false` |
|
|
94
|
-
* | `1488370835081` | `TypeError` | `true` |
|
|
95
|
-
* | `NaN` | `TypeError` | `false` |
|
|
108
|
+
* @description
|
|
109
|
+
* Returns false if argument is Invalid Date and true otherwise.
|
|
110
|
+
* Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
|
|
111
|
+
* Invalid Date is a Date, whose time value is NaN.
|
|
96
112
|
*
|
|
97
|
-
*
|
|
98
|
-
* that try to coerce arguments to the expected type
|
|
99
|
-
* (which is also the case with other *date-fns* functions).
|
|
113
|
+
* Time value of Date: http://es5.github.io/#x15.9.1.1
|
|
100
114
|
*
|
|
101
115
|
* @param {*} date - the date to check
|
|
102
116
|
* @returns {Boolean} the date is valid
|
|
@@ -104,24 +118,29 @@ function toDate(argument) {
|
|
|
104
118
|
*
|
|
105
119
|
* @example
|
|
106
120
|
* // For the valid date:
|
|
107
|
-
*
|
|
121
|
+
* const result = isValid(new Date(2014, 1, 31))
|
|
108
122
|
* //=> true
|
|
109
123
|
*
|
|
110
124
|
* @example
|
|
111
125
|
* // For the value, convertable into a date:
|
|
112
|
-
*
|
|
126
|
+
* const result = isValid(1393804800000)
|
|
113
127
|
* //=> true
|
|
114
128
|
*
|
|
115
129
|
* @example
|
|
116
130
|
* // For the invalid date:
|
|
117
|
-
*
|
|
131
|
+
* const result = isValid(new Date(''))
|
|
118
132
|
* //=> false
|
|
119
133
|
*/
|
|
120
134
|
|
|
121
135
|
function isValid(dirtyDate) {
|
|
122
136
|
requiredArgs(1, arguments);
|
|
137
|
+
|
|
138
|
+
if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
|
|
123
142
|
var date = toDate(dirtyDate);
|
|
124
|
-
return !isNaN(date);
|
|
143
|
+
return !isNaN(Number(date));
|
|
125
144
|
}
|
|
126
145
|
|
|
127
146
|
function toInteger(dirtyNumber) {
|
|
@@ -146,10 +165,6 @@ function toInteger(dirtyNumber) {
|
|
|
146
165
|
* @description
|
|
147
166
|
* Add the specified number of milliseconds to the given date.
|
|
148
167
|
*
|
|
149
|
-
* ### v2.0.0 breaking changes:
|
|
150
|
-
*
|
|
151
|
-
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
152
|
-
*
|
|
153
168
|
* @param {Date|Number} date - the date to be changed
|
|
154
169
|
* @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
|
|
155
170
|
* @returns {Date} the new date with the milliseconds added
|
|
@@ -176,10 +191,6 @@ function addMilliseconds(dirtyDate, dirtyAmount) {
|
|
|
176
191
|
* @description
|
|
177
192
|
* Subtract the specified number of milliseconds from the given date.
|
|
178
193
|
*
|
|
179
|
-
* ### v2.0.0 breaking changes:
|
|
180
|
-
*
|
|
181
|
-
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
182
|
-
*
|
|
183
194
|
* @param {Date|Number} date - the date to be changed
|
|
184
195
|
* @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
|
|
185
196
|
* @returns {Date} the new date with the milliseconds subtracted
|
|
@@ -197,103 +208,7 @@ function subMilliseconds(dirtyDate, dirtyAmount) {
|
|
|
197
208
|
return addMilliseconds(dirtyDate, -amount);
|
|
198
209
|
}
|
|
199
210
|
|
|
200
|
-
|
|
201
|
-
var sign = number < 0 ? '-' : '';
|
|
202
|
-
var output = Math.abs(number).toString();
|
|
203
|
-
|
|
204
|
-
while (output.length < targetLength) {
|
|
205
|
-
output = '0' + output;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
return sign + output;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/*
|
|
212
|
-
* | | Unit | | Unit |
|
|
213
|
-
* |-----|--------------------------------|-----|--------------------------------|
|
|
214
|
-
* | a | AM, PM | A* | |
|
|
215
|
-
* | d | Day of month | D | |
|
|
216
|
-
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
217
|
-
* | m | Minute | M | Month |
|
|
218
|
-
* | s | Second | S | Fraction of second |
|
|
219
|
-
* | y | Year (abs) | Y | |
|
|
220
|
-
*
|
|
221
|
-
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
222
|
-
*/
|
|
223
|
-
|
|
224
|
-
var formatters$2 = {
|
|
225
|
-
// Year
|
|
226
|
-
y: function (date, token) {
|
|
227
|
-
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
|
|
228
|
-
// | Year | y | yy | yyy | yyyy | yyyyy |
|
|
229
|
-
// |----------|-------|----|-------|-------|-------|
|
|
230
|
-
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
|
|
231
|
-
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
|
|
232
|
-
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
|
233
|
-
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
|
234
|
-
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
|
235
|
-
var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
236
|
-
|
|
237
|
-
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
238
|
-
return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
|
|
239
|
-
},
|
|
240
|
-
// Month
|
|
241
|
-
M: function (date, token) {
|
|
242
|
-
var month = date.getUTCMonth();
|
|
243
|
-
return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
|
|
244
|
-
},
|
|
245
|
-
// Day of the month
|
|
246
|
-
d: function (date, token) {
|
|
247
|
-
return addLeadingZeros(date.getUTCDate(), token.length);
|
|
248
|
-
},
|
|
249
|
-
// AM or PM
|
|
250
|
-
a: function (date, token) {
|
|
251
|
-
var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
|
|
252
|
-
|
|
253
|
-
switch (token) {
|
|
254
|
-
case 'a':
|
|
255
|
-
case 'aa':
|
|
256
|
-
return dayPeriodEnumValue.toUpperCase();
|
|
257
|
-
|
|
258
|
-
case 'aaa':
|
|
259
|
-
return dayPeriodEnumValue;
|
|
260
|
-
|
|
261
|
-
case 'aaaaa':
|
|
262
|
-
return dayPeriodEnumValue[0];
|
|
263
|
-
|
|
264
|
-
case 'aaaa':
|
|
265
|
-
default:
|
|
266
|
-
return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
|
|
267
|
-
}
|
|
268
|
-
},
|
|
269
|
-
// Hour [1-12]
|
|
270
|
-
h: function (date, token) {
|
|
271
|
-
return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
|
|
272
|
-
},
|
|
273
|
-
// Hour [0-23]
|
|
274
|
-
H: function (date, token) {
|
|
275
|
-
return addLeadingZeros(date.getUTCHours(), token.length);
|
|
276
|
-
},
|
|
277
|
-
// Minute
|
|
278
|
-
m: function (date, token) {
|
|
279
|
-
return addLeadingZeros(date.getUTCMinutes(), token.length);
|
|
280
|
-
},
|
|
281
|
-
// Second
|
|
282
|
-
s: function (date, token) {
|
|
283
|
-
return addLeadingZeros(date.getUTCSeconds(), token.length);
|
|
284
|
-
},
|
|
285
|
-
// Fraction of second
|
|
286
|
-
S: function (date, token) {
|
|
287
|
-
var numberOfDigits = token.length;
|
|
288
|
-
var milliseconds = date.getUTCMilliseconds();
|
|
289
|
-
var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
|
|
290
|
-
return addLeadingZeros(fractionalSeconds, token.length);
|
|
291
|
-
}
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
|
|
295
|
-
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
296
|
-
|
|
211
|
+
var MILLISECONDS_IN_DAY = 86400000;
|
|
297
212
|
function getUTCDayOfYear(dirtyDate) {
|
|
298
213
|
requiredArgs(1, arguments);
|
|
299
214
|
var date = toDate(dirtyDate);
|
|
@@ -305,8 +220,6 @@ function getUTCDayOfYear(dirtyDate) {
|
|
|
305
220
|
return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
|
|
306
221
|
}
|
|
307
222
|
|
|
308
|
-
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
309
|
-
|
|
310
223
|
function startOfUTCISOWeek(dirtyDate) {
|
|
311
224
|
requiredArgs(1, arguments);
|
|
312
225
|
var weekStartsOn = 1;
|
|
@@ -318,8 +231,6 @@ function startOfUTCISOWeek(dirtyDate) {
|
|
|
318
231
|
return date;
|
|
319
232
|
}
|
|
320
233
|
|
|
321
|
-
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
322
|
-
|
|
323
234
|
function getUTCISOWeekYear(dirtyDate) {
|
|
324
235
|
requiredArgs(1, arguments);
|
|
325
236
|
var date = toDate(dirtyDate);
|
|
@@ -342,8 +253,6 @@ function getUTCISOWeekYear(dirtyDate) {
|
|
|
342
253
|
}
|
|
343
254
|
}
|
|
344
255
|
|
|
345
|
-
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
346
|
-
|
|
347
256
|
function startOfUTCISOWeekYear(dirtyDate) {
|
|
348
257
|
requiredArgs(1, arguments);
|
|
349
258
|
var year = getUTCISOWeekYear(dirtyDate);
|
|
@@ -354,9 +263,7 @@ function startOfUTCISOWeekYear(dirtyDate) {
|
|
|
354
263
|
return date;
|
|
355
264
|
}
|
|
356
265
|
|
|
357
|
-
var MILLISECONDS_IN_WEEK$1 = 604800000;
|
|
358
|
-
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
359
|
-
|
|
266
|
+
var MILLISECONDS_IN_WEEK$1 = 604800000;
|
|
360
267
|
function getUTCISOWeek(dirtyDate) {
|
|
361
268
|
requiredArgs(1, arguments);
|
|
362
269
|
var date = toDate(dirtyDate);
|
|
@@ -367,15 +274,17 @@ function getUTCISOWeek(dirtyDate) {
|
|
|
367
274
|
return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
|
|
368
275
|
}
|
|
369
276
|
|
|
370
|
-
|
|
277
|
+
var defaultOptions = {};
|
|
278
|
+
function getDefaultOptions() {
|
|
279
|
+
return defaultOptions;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function startOfUTCWeek(dirtyDate, options) {
|
|
283
|
+
var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
371
284
|
|
|
372
|
-
function startOfUTCWeek(dirtyDate, dirtyOptions) {
|
|
373
285
|
requiredArgs(1, arguments);
|
|
374
|
-
var
|
|
375
|
-
var locale = options.locale;
|
|
376
|
-
var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
|
|
377
|
-
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
|
|
378
|
-
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
286
|
+
var defaultOptions = getDefaultOptions();
|
|
287
|
+
var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
379
288
|
|
|
380
289
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
381
290
|
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
|
@@ -389,17 +298,14 @@ function startOfUTCWeek(dirtyDate, dirtyOptions) {
|
|
|
389
298
|
return date;
|
|
390
299
|
}
|
|
391
300
|
|
|
392
|
-
|
|
301
|
+
function getUTCWeekYear(dirtyDate, options) {
|
|
302
|
+
var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
393
303
|
|
|
394
|
-
function getUTCWeekYear(dirtyDate, dirtyOptions) {
|
|
395
304
|
requiredArgs(1, arguments);
|
|
396
|
-
var date = toDate(dirtyDate
|
|
305
|
+
var date = toDate(dirtyDate);
|
|
397
306
|
var year = date.getUTCFullYear();
|
|
398
|
-
var
|
|
399
|
-
var locale = options.locale;
|
|
400
|
-
var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
|
|
401
|
-
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
|
402
|
-
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
|
307
|
+
var defaultOptions = getDefaultOptions();
|
|
308
|
+
var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
|
403
309
|
|
|
404
310
|
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
405
311
|
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
|
@@ -408,11 +314,11 @@ function getUTCWeekYear(dirtyDate, dirtyOptions) {
|
|
|
408
314
|
var firstWeekOfNextYear = new Date(0);
|
|
409
315
|
firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
|
|
410
316
|
firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
|
|
411
|
-
var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear,
|
|
317
|
+
var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
|
|
412
318
|
var firstWeekOfThisYear = new Date(0);
|
|
413
319
|
firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
|
|
414
320
|
firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
|
|
415
|
-
var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear,
|
|
321
|
+
var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
|
|
416
322
|
|
|
417
323
|
if (date.getTime() >= startOfNextYear.getTime()) {
|
|
418
324
|
return year + 1;
|
|
@@ -423,26 +329,21 @@ function getUTCWeekYear(dirtyDate, dirtyOptions) {
|
|
|
423
329
|
}
|
|
424
330
|
}
|
|
425
331
|
|
|
426
|
-
|
|
332
|
+
function startOfUTCWeekYear(dirtyDate, options) {
|
|
333
|
+
var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
427
334
|
|
|
428
|
-
function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
|
|
429
335
|
requiredArgs(1, arguments);
|
|
430
|
-
var
|
|
431
|
-
var locale = options.locale;
|
|
432
|
-
var
|
|
433
|
-
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
|
434
|
-
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
|
|
435
|
-
var year = getUTCWeekYear(dirtyDate, dirtyOptions);
|
|
336
|
+
var defaultOptions = getDefaultOptions();
|
|
337
|
+
var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
|
|
338
|
+
var year = getUTCWeekYear(dirtyDate, options);
|
|
436
339
|
var firstWeek = new Date(0);
|
|
437
340
|
firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
|
|
438
341
|
firstWeek.setUTCHours(0, 0, 0, 0);
|
|
439
|
-
var date = startOfUTCWeek(firstWeek,
|
|
342
|
+
var date = startOfUTCWeek(firstWeek, options);
|
|
440
343
|
return date;
|
|
441
344
|
}
|
|
442
345
|
|
|
443
|
-
var MILLISECONDS_IN_WEEK = 604800000;
|
|
444
|
-
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
445
|
-
|
|
346
|
+
var MILLISECONDS_IN_WEEK = 604800000;
|
|
446
347
|
function getUTCWeek(dirtyDate, options) {
|
|
447
348
|
requiredArgs(1, arguments);
|
|
448
349
|
var date = toDate(dirtyDate);
|
|
@@ -453,6 +354,100 @@ function getUTCWeek(dirtyDate, options) {
|
|
|
453
354
|
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
|
|
454
355
|
}
|
|
455
356
|
|
|
357
|
+
function addLeadingZeros(number, targetLength) {
|
|
358
|
+
var sign = number < 0 ? '-' : '';
|
|
359
|
+
var output = Math.abs(number).toString();
|
|
360
|
+
|
|
361
|
+
while (output.length < targetLength) {
|
|
362
|
+
output = '0' + output;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
return sign + output;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/*
|
|
369
|
+
* | | Unit | | Unit |
|
|
370
|
+
* |-----|--------------------------------|-----|--------------------------------|
|
|
371
|
+
* | a | AM, PM | A* | |
|
|
372
|
+
* | d | Day of month | D | |
|
|
373
|
+
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
374
|
+
* | m | Minute | M | Month |
|
|
375
|
+
* | s | Second | S | Fraction of second |
|
|
376
|
+
* | y | Year (abs) | Y | |
|
|
377
|
+
*
|
|
378
|
+
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
379
|
+
*/
|
|
380
|
+
|
|
381
|
+
var formatters$2 = {
|
|
382
|
+
// Year
|
|
383
|
+
y: function y(date, token) {
|
|
384
|
+
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
|
|
385
|
+
// | Year | y | yy | yyy | yyyy | yyyyy |
|
|
386
|
+
// |----------|-------|----|-------|-------|-------|
|
|
387
|
+
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
|
|
388
|
+
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
|
|
389
|
+
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
|
390
|
+
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
|
391
|
+
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
|
392
|
+
var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
393
|
+
|
|
394
|
+
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
395
|
+
return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
|
|
396
|
+
},
|
|
397
|
+
// Month
|
|
398
|
+
M: function M(date, token) {
|
|
399
|
+
var month = date.getUTCMonth();
|
|
400
|
+
return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
|
|
401
|
+
},
|
|
402
|
+
// Day of the month
|
|
403
|
+
d: function d(date, token) {
|
|
404
|
+
return addLeadingZeros(date.getUTCDate(), token.length);
|
|
405
|
+
},
|
|
406
|
+
// AM or PM
|
|
407
|
+
a: function a(date, token) {
|
|
408
|
+
var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
|
|
409
|
+
|
|
410
|
+
switch (token) {
|
|
411
|
+
case 'a':
|
|
412
|
+
case 'aa':
|
|
413
|
+
return dayPeriodEnumValue.toUpperCase();
|
|
414
|
+
|
|
415
|
+
case 'aaa':
|
|
416
|
+
return dayPeriodEnumValue;
|
|
417
|
+
|
|
418
|
+
case 'aaaaa':
|
|
419
|
+
return dayPeriodEnumValue[0];
|
|
420
|
+
|
|
421
|
+
case 'aaaa':
|
|
422
|
+
default:
|
|
423
|
+
return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
// Hour [1-12]
|
|
427
|
+
h: function h(date, token) {
|
|
428
|
+
return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
|
|
429
|
+
},
|
|
430
|
+
// Hour [0-23]
|
|
431
|
+
H: function H(date, token) {
|
|
432
|
+
return addLeadingZeros(date.getUTCHours(), token.length);
|
|
433
|
+
},
|
|
434
|
+
// Minute
|
|
435
|
+
m: function m(date, token) {
|
|
436
|
+
return addLeadingZeros(date.getUTCMinutes(), token.length);
|
|
437
|
+
},
|
|
438
|
+
// Second
|
|
439
|
+
s: function s(date, token) {
|
|
440
|
+
return addLeadingZeros(date.getUTCSeconds(), token.length);
|
|
441
|
+
},
|
|
442
|
+
// Fraction of second
|
|
443
|
+
S: function S(date, token) {
|
|
444
|
+
var numberOfDigits = token.length;
|
|
445
|
+
var milliseconds = date.getUTCMilliseconds();
|
|
446
|
+
var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
|
|
447
|
+
return addLeadingZeros(fractionalSeconds, token.length);
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
|
|
456
451
|
var dayPeriodEnum = {
|
|
457
452
|
am: 'am',
|
|
458
453
|
pm: 'pm',
|
|
@@ -462,56 +457,56 @@ var dayPeriodEnum = {
|
|
|
462
457
|
afternoon: 'afternoon',
|
|
463
458
|
evening: 'evening',
|
|
464
459
|
night: 'night'
|
|
465
|
-
/*
|
|
466
|
-
* | | Unit | | Unit |
|
|
467
|
-
* |-----|--------------------------------|-----|--------------------------------|
|
|
468
|
-
* | a | AM, PM | A* | Milliseconds in day |
|
|
469
|
-
* | b | AM, PM, noon, midnight | B | Flexible day period |
|
|
470
|
-
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
|
|
471
|
-
* | d | Day of month | D | Day of year |
|
|
472
|
-
* | e | Local day of week | E | Day of week |
|
|
473
|
-
* | f | | F* | Day of week in month |
|
|
474
|
-
* | g* | Modified Julian day | G | Era |
|
|
475
|
-
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
476
|
-
* | i! | ISO day of week | I! | ISO week of year |
|
|
477
|
-
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
|
|
478
|
-
* | k | Hour [1-24] | K | Hour [0-11] |
|
|
479
|
-
* | l* | (deprecated) | L | Stand-alone month |
|
|
480
|
-
* | m | Minute | M | Month |
|
|
481
|
-
* | n | | N | |
|
|
482
|
-
* | o! | Ordinal number modifier | O | Timezone (GMT) |
|
|
483
|
-
* | p! | Long localized time | P! | Long localized date |
|
|
484
|
-
* | q | Stand-alone quarter | Q | Quarter |
|
|
485
|
-
* | r* | Related Gregorian year | R! | ISO week-numbering year |
|
|
486
|
-
* | s | Second | S | Fraction of second |
|
|
487
|
-
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
|
|
488
|
-
* | u | Extended year | U* | Cyclic year |
|
|
489
|
-
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
|
|
490
|
-
* | w | Local week of year | W* | Week of month |
|
|
491
|
-
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
|
|
492
|
-
* | y | Year (abs) | Y | Local week-numbering year |
|
|
493
|
-
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
|
|
494
|
-
*
|
|
495
|
-
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
496
|
-
*
|
|
497
|
-
* Letters marked by ! are non-standard, but implemented by date-fns:
|
|
498
|
-
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
|
|
499
|
-
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
|
|
500
|
-
* i.e. 7 for Sunday, 1 for Monday, etc.
|
|
501
|
-
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
|
|
502
|
-
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
|
|
503
|
-
* `R` is supposed to be used in conjunction with `I` and `i`
|
|
504
|
-
* for universal ISO week-numbering date, whereas
|
|
505
|
-
* `Y` is supposed to be used in conjunction with `w` and `e`
|
|
506
|
-
* for week-numbering date specific to the locale.
|
|
507
|
-
* - `P` is long localized date format
|
|
508
|
-
* - `p` is long localized time format
|
|
509
|
-
*/
|
|
510
|
-
|
|
511
460
|
};
|
|
461
|
+
|
|
462
|
+
/*
|
|
463
|
+
* | | Unit | | Unit |
|
|
464
|
+
* |-----|--------------------------------|-----|--------------------------------|
|
|
465
|
+
* | a | AM, PM | A* | Milliseconds in day |
|
|
466
|
+
* | b | AM, PM, noon, midnight | B | Flexible day period |
|
|
467
|
+
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
|
|
468
|
+
* | d | Day of month | D | Day of year |
|
|
469
|
+
* | e | Local day of week | E | Day of week |
|
|
470
|
+
* | f | | F* | Day of week in month |
|
|
471
|
+
* | g* | Modified Julian day | G | Era |
|
|
472
|
+
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
473
|
+
* | i! | ISO day of week | I! | ISO week of year |
|
|
474
|
+
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
|
|
475
|
+
* | k | Hour [1-24] | K | Hour [0-11] |
|
|
476
|
+
* | l* | (deprecated) | L | Stand-alone month |
|
|
477
|
+
* | m | Minute | M | Month |
|
|
478
|
+
* | n | | N | |
|
|
479
|
+
* | o! | Ordinal number modifier | O | Timezone (GMT) |
|
|
480
|
+
* | p! | Long localized time | P! | Long localized date |
|
|
481
|
+
* | q | Stand-alone quarter | Q | Quarter |
|
|
482
|
+
* | r* | Related Gregorian year | R! | ISO week-numbering year |
|
|
483
|
+
* | s | Second | S | Fraction of second |
|
|
484
|
+
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
|
|
485
|
+
* | u | Extended year | U* | Cyclic year |
|
|
486
|
+
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
|
|
487
|
+
* | w | Local week of year | W* | Week of month |
|
|
488
|
+
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
|
|
489
|
+
* | y | Year (abs) | Y | Local week-numbering year |
|
|
490
|
+
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
|
|
491
|
+
*
|
|
492
|
+
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
493
|
+
*
|
|
494
|
+
* Letters marked by ! are non-standard, but implemented by date-fns:
|
|
495
|
+
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
|
|
496
|
+
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
|
|
497
|
+
* i.e. 7 for Sunday, 1 for Monday, etc.
|
|
498
|
+
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
|
|
499
|
+
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
|
|
500
|
+
* `R` is supposed to be used in conjunction with `I` and `i`
|
|
501
|
+
* for universal ISO week-numbering date, whereas
|
|
502
|
+
* `Y` is supposed to be used in conjunction with `w` and `e`
|
|
503
|
+
* for week-numbering date specific to the locale.
|
|
504
|
+
* - `P` is long localized date format
|
|
505
|
+
* - `p` is long localized time format
|
|
506
|
+
*/
|
|
512
507
|
var formatters = {
|
|
513
508
|
// Era
|
|
514
|
-
G: function (date, token, localize) {
|
|
509
|
+
G: function G(date, token, localize) {
|
|
515
510
|
var era = date.getUTCFullYear() > 0 ? 1 : 0;
|
|
516
511
|
|
|
517
512
|
switch (token) {
|
|
@@ -538,7 +533,7 @@ var formatters = {
|
|
|
538
533
|
}
|
|
539
534
|
},
|
|
540
535
|
// Year
|
|
541
|
-
y: function (date, token, localize) {
|
|
536
|
+
y: function y(date, token, localize) {
|
|
542
537
|
// Ordinal number
|
|
543
538
|
if (token === 'yo') {
|
|
544
539
|
var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
@@ -552,7 +547,7 @@ var formatters = {
|
|
|
552
547
|
return formatters$2.y(date, token);
|
|
553
548
|
},
|
|
554
549
|
// Local week-numbering year
|
|
555
|
-
Y: function (date, token, localize, options) {
|
|
550
|
+
Y: function Y(date, token, localize, options) {
|
|
556
551
|
var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
557
552
|
|
|
558
553
|
var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
|
|
@@ -573,7 +568,7 @@ var formatters = {
|
|
|
573
568
|
return addLeadingZeros(weekYear, token.length);
|
|
574
569
|
},
|
|
575
570
|
// ISO week-numbering year
|
|
576
|
-
R: function (date, token) {
|
|
571
|
+
R: function R(date, token) {
|
|
577
572
|
var isoWeekYear = getUTCISOWeekYear(date); // Padding
|
|
578
573
|
|
|
579
574
|
return addLeadingZeros(isoWeekYear, token.length);
|
|
@@ -587,12 +582,12 @@ var formatters = {
|
|
|
587
582
|
// | BC 2 | 2 | -1 |
|
|
588
583
|
// Also `yy` always returns the last two digits of a year,
|
|
589
584
|
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
590
|
-
u: function (date, token) {
|
|
585
|
+
u: function u(date, token) {
|
|
591
586
|
var year = date.getUTCFullYear();
|
|
592
587
|
return addLeadingZeros(year, token.length);
|
|
593
588
|
},
|
|
594
589
|
// Quarter
|
|
595
|
-
Q: function (date, token, localize) {
|
|
590
|
+
Q: function Q(date, token, localize) {
|
|
596
591
|
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
597
592
|
|
|
598
593
|
switch (token) {
|
|
@@ -634,7 +629,7 @@ var formatters = {
|
|
|
634
629
|
}
|
|
635
630
|
},
|
|
636
631
|
// Stand-alone quarter
|
|
637
|
-
q: function (date, token, localize) {
|
|
632
|
+
q: function q(date, token, localize) {
|
|
638
633
|
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
639
634
|
|
|
640
635
|
switch (token) {
|
|
@@ -676,7 +671,7 @@ var formatters = {
|
|
|
676
671
|
}
|
|
677
672
|
},
|
|
678
673
|
// Month
|
|
679
|
-
M: function (date, token, localize) {
|
|
674
|
+
M: function M(date, token, localize) {
|
|
680
675
|
var month = date.getUTCMonth();
|
|
681
676
|
|
|
682
677
|
switch (token) {
|
|
@@ -714,7 +709,7 @@ var formatters = {
|
|
|
714
709
|
}
|
|
715
710
|
},
|
|
716
711
|
// Stand-alone month
|
|
717
|
-
L: function (date, token, localize) {
|
|
712
|
+
L: function L(date, token, localize) {
|
|
718
713
|
var month = date.getUTCMonth();
|
|
719
714
|
|
|
720
715
|
switch (token) {
|
|
@@ -756,7 +751,7 @@ var formatters = {
|
|
|
756
751
|
}
|
|
757
752
|
},
|
|
758
753
|
// Local week of year
|
|
759
|
-
w: function (date, token, localize, options) {
|
|
754
|
+
w: function w(date, token, localize, options) {
|
|
760
755
|
var week = getUTCWeek(date, options);
|
|
761
756
|
|
|
762
757
|
if (token === 'wo') {
|
|
@@ -768,7 +763,7 @@ var formatters = {
|
|
|
768
763
|
return addLeadingZeros(week, token.length);
|
|
769
764
|
},
|
|
770
765
|
// ISO week of year
|
|
771
|
-
I: function (date, token, localize) {
|
|
766
|
+
I: function I(date, token, localize) {
|
|
772
767
|
var isoWeek = getUTCISOWeek(date);
|
|
773
768
|
|
|
774
769
|
if (token === 'Io') {
|
|
@@ -780,7 +775,7 @@ var formatters = {
|
|
|
780
775
|
return addLeadingZeros(isoWeek, token.length);
|
|
781
776
|
},
|
|
782
777
|
// Day of the month
|
|
783
|
-
d: function (date, token, localize) {
|
|
778
|
+
d: function d(date, token, localize) {
|
|
784
779
|
if (token === 'do') {
|
|
785
780
|
return localize.ordinalNumber(date.getUTCDate(), {
|
|
786
781
|
unit: 'date'
|
|
@@ -790,7 +785,7 @@ var formatters = {
|
|
|
790
785
|
return formatters$2.d(date, token);
|
|
791
786
|
},
|
|
792
787
|
// Day of year
|
|
793
|
-
D: function (date, token, localize) {
|
|
788
|
+
D: function D(date, token, localize) {
|
|
794
789
|
var dayOfYear = getUTCDayOfYear(date);
|
|
795
790
|
|
|
796
791
|
if (token === 'Do') {
|
|
@@ -802,7 +797,7 @@ var formatters = {
|
|
|
802
797
|
return addLeadingZeros(dayOfYear, token.length);
|
|
803
798
|
},
|
|
804
799
|
// Day of week
|
|
805
|
-
E: function (date, token, localize) {
|
|
800
|
+
E: function E(date, token, localize) {
|
|
806
801
|
var dayOfWeek = date.getUTCDay();
|
|
807
802
|
|
|
808
803
|
switch (token) {
|
|
@@ -839,7 +834,7 @@ var formatters = {
|
|
|
839
834
|
}
|
|
840
835
|
},
|
|
841
836
|
// Local day of week
|
|
842
|
-
e: function (date, token, localize, options) {
|
|
837
|
+
e: function e(date, token, localize, options) {
|
|
843
838
|
var dayOfWeek = date.getUTCDay();
|
|
844
839
|
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
845
840
|
|
|
@@ -888,7 +883,7 @@ var formatters = {
|
|
|
888
883
|
}
|
|
889
884
|
},
|
|
890
885
|
// Stand-alone local day of week
|
|
891
|
-
c: function (date, token, localize, options) {
|
|
886
|
+
c: function c(date, token, localize, options) {
|
|
892
887
|
var dayOfWeek = date.getUTCDay();
|
|
893
888
|
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
894
889
|
|
|
@@ -937,7 +932,7 @@ var formatters = {
|
|
|
937
932
|
}
|
|
938
933
|
},
|
|
939
934
|
// ISO day of week
|
|
940
|
-
i: function (date, token, localize) {
|
|
935
|
+
i: function i(date, token, localize) {
|
|
941
936
|
var dayOfWeek = date.getUTCDay();
|
|
942
937
|
var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
|
943
938
|
|
|
@@ -987,7 +982,7 @@ var formatters = {
|
|
|
987
982
|
}
|
|
988
983
|
},
|
|
989
984
|
// AM or PM
|
|
990
|
-
a: function (date, token, localize) {
|
|
985
|
+
a: function a(date, token, localize) {
|
|
991
986
|
var hours = date.getUTCHours();
|
|
992
987
|
var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
|
|
993
988
|
|
|
@@ -1020,7 +1015,7 @@ var formatters = {
|
|
|
1020
1015
|
}
|
|
1021
1016
|
},
|
|
1022
1017
|
// AM, PM, midnight, noon
|
|
1023
|
-
b: function (date, token, localize) {
|
|
1018
|
+
b: function b(date, token, localize) {
|
|
1024
1019
|
var hours = date.getUTCHours();
|
|
1025
1020
|
var dayPeriodEnumValue;
|
|
1026
1021
|
|
|
@@ -1061,7 +1056,7 @@ var formatters = {
|
|
|
1061
1056
|
}
|
|
1062
1057
|
},
|
|
1063
1058
|
// in the morning, in the afternoon, in the evening, at night
|
|
1064
|
-
B: function (date, token, localize) {
|
|
1059
|
+
B: function B(date, token, localize) {
|
|
1065
1060
|
var hours = date.getUTCHours();
|
|
1066
1061
|
var dayPeriodEnumValue;
|
|
1067
1062
|
|
|
@@ -1099,7 +1094,7 @@ var formatters = {
|
|
|
1099
1094
|
}
|
|
1100
1095
|
},
|
|
1101
1096
|
// Hour [1-12]
|
|
1102
|
-
h: function (date, token, localize) {
|
|
1097
|
+
h: function h(date, token, localize) {
|
|
1103
1098
|
if (token === 'ho') {
|
|
1104
1099
|
var hours = date.getUTCHours() % 12;
|
|
1105
1100
|
if (hours === 0) hours = 12;
|
|
@@ -1111,7 +1106,7 @@ var formatters = {
|
|
|
1111
1106
|
return formatters$2.h(date, token);
|
|
1112
1107
|
},
|
|
1113
1108
|
// Hour [0-23]
|
|
1114
|
-
H: function (date, token, localize) {
|
|
1109
|
+
H: function H(date, token, localize) {
|
|
1115
1110
|
if (token === 'Ho') {
|
|
1116
1111
|
return localize.ordinalNumber(date.getUTCHours(), {
|
|
1117
1112
|
unit: 'hour'
|
|
@@ -1121,7 +1116,7 @@ var formatters = {
|
|
|
1121
1116
|
return formatters$2.H(date, token);
|
|
1122
1117
|
},
|
|
1123
1118
|
// Hour [0-11]
|
|
1124
|
-
K: function (date, token, localize) {
|
|
1119
|
+
K: function K(date, token, localize) {
|
|
1125
1120
|
var hours = date.getUTCHours() % 12;
|
|
1126
1121
|
|
|
1127
1122
|
if (token === 'Ko') {
|
|
@@ -1133,7 +1128,7 @@ var formatters = {
|
|
|
1133
1128
|
return addLeadingZeros(hours, token.length);
|
|
1134
1129
|
},
|
|
1135
1130
|
// Hour [1-24]
|
|
1136
|
-
k: function (date, token, localize) {
|
|
1131
|
+
k: function k(date, token, localize) {
|
|
1137
1132
|
var hours = date.getUTCHours();
|
|
1138
1133
|
if (hours === 0) hours = 24;
|
|
1139
1134
|
|
|
@@ -1146,7 +1141,7 @@ var formatters = {
|
|
|
1146
1141
|
return addLeadingZeros(hours, token.length);
|
|
1147
1142
|
},
|
|
1148
1143
|
// Minute
|
|
1149
|
-
m: function (date, token, localize) {
|
|
1144
|
+
m: function m(date, token, localize) {
|
|
1150
1145
|
if (token === 'mo') {
|
|
1151
1146
|
return localize.ordinalNumber(date.getUTCMinutes(), {
|
|
1152
1147
|
unit: 'minute'
|
|
@@ -1156,7 +1151,7 @@ var formatters = {
|
|
|
1156
1151
|
return formatters$2.m(date, token);
|
|
1157
1152
|
},
|
|
1158
1153
|
// Second
|
|
1159
|
-
s: function (date, token, localize) {
|
|
1154
|
+
s: function s(date, token, localize) {
|
|
1160
1155
|
if (token === 'so') {
|
|
1161
1156
|
return localize.ordinalNumber(date.getUTCSeconds(), {
|
|
1162
1157
|
unit: 'second'
|
|
@@ -1166,11 +1161,11 @@ var formatters = {
|
|
|
1166
1161
|
return formatters$2.s(date, token);
|
|
1167
1162
|
},
|
|
1168
1163
|
// Fraction of second
|
|
1169
|
-
S: function (date, token) {
|
|
1164
|
+
S: function S(date, token) {
|
|
1170
1165
|
return formatters$2.S(date, token);
|
|
1171
1166
|
},
|
|
1172
1167
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1173
|
-
X: function (date, token, _localize, options) {
|
|
1168
|
+
X: function X(date, token, _localize, options) {
|
|
1174
1169
|
var originalDate = options._originalDate || date;
|
|
1175
1170
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1176
1171
|
|
|
@@ -1202,7 +1197,7 @@ var formatters = {
|
|
|
1202
1197
|
}
|
|
1203
1198
|
},
|
|
1204
1199
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1205
|
-
x: function (date, token, _localize, options) {
|
|
1200
|
+
x: function x(date, token, _localize, options) {
|
|
1206
1201
|
var originalDate = options._originalDate || date;
|
|
1207
1202
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1208
1203
|
|
|
@@ -1230,7 +1225,7 @@ var formatters = {
|
|
|
1230
1225
|
}
|
|
1231
1226
|
},
|
|
1232
1227
|
// Timezone (GMT)
|
|
1233
|
-
O: function (date, token, _localize, options) {
|
|
1228
|
+
O: function O(date, token, _localize, options) {
|
|
1234
1229
|
var originalDate = options._originalDate || date;
|
|
1235
1230
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1236
1231
|
|
|
@@ -1248,7 +1243,7 @@ var formatters = {
|
|
|
1248
1243
|
}
|
|
1249
1244
|
},
|
|
1250
1245
|
// Timezone (specific non-location)
|
|
1251
|
-
z: function (date, token, _localize, options) {
|
|
1246
|
+
z: function z(date, token, _localize, options) {
|
|
1252
1247
|
var originalDate = options._originalDate || date;
|
|
1253
1248
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1254
1249
|
|
|
@@ -1266,13 +1261,13 @@ var formatters = {
|
|
|
1266
1261
|
}
|
|
1267
1262
|
},
|
|
1268
1263
|
// Seconds timestamp
|
|
1269
|
-
t: function (date, token, _localize, options) {
|
|
1264
|
+
t: function t(date, token, _localize, options) {
|
|
1270
1265
|
var originalDate = options._originalDate || date;
|
|
1271
1266
|
var timestamp = Math.floor(originalDate.getTime() / 1000);
|
|
1272
1267
|
return addLeadingZeros(timestamp, token.length);
|
|
1273
1268
|
},
|
|
1274
1269
|
// Milliseconds timestamp
|
|
1275
|
-
T: function (date, token, _localize, options) {
|
|
1270
|
+
T: function T(date, token, _localize, options) {
|
|
1276
1271
|
var originalDate = options._originalDate || date;
|
|
1277
1272
|
var timestamp = originalDate.getTime();
|
|
1278
1273
|
return addLeadingZeros(timestamp, token.length);
|
|
@@ -1313,7 +1308,7 @@ function formatTimezone(offset, dirtyDelimiter) {
|
|
|
1313
1308
|
|
|
1314
1309
|
var formatters$1 = formatters;
|
|
1315
1310
|
|
|
1316
|
-
function dateLongFormatter(pattern, formatLong) {
|
|
1311
|
+
var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
|
|
1317
1312
|
switch (pattern) {
|
|
1318
1313
|
case 'P':
|
|
1319
1314
|
return formatLong.date({
|
|
@@ -1336,9 +1331,9 @@ function dateLongFormatter(pattern, formatLong) {
|
|
|
1336
1331
|
width: 'full'
|
|
1337
1332
|
});
|
|
1338
1333
|
}
|
|
1339
|
-
}
|
|
1334
|
+
};
|
|
1340
1335
|
|
|
1341
|
-
function timeLongFormatter(pattern, formatLong) {
|
|
1336
|
+
var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
|
|
1342
1337
|
switch (pattern) {
|
|
1343
1338
|
case 'p':
|
|
1344
1339
|
return formatLong.time({
|
|
@@ -1361,10 +1356,10 @@ function timeLongFormatter(pattern, formatLong) {
|
|
|
1361
1356
|
width: 'full'
|
|
1362
1357
|
});
|
|
1363
1358
|
}
|
|
1364
|
-
}
|
|
1359
|
+
};
|
|
1365
1360
|
|
|
1366
|
-
function dateTimeLongFormatter(pattern, formatLong) {
|
|
1367
|
-
var matchResult = pattern.match(/(P+)(p+)?/);
|
|
1361
|
+
var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
|
|
1362
|
+
var matchResult = pattern.match(/(P+)(p+)?/) || [];
|
|
1368
1363
|
var datePattern = matchResult[1];
|
|
1369
1364
|
var timePattern = matchResult[2];
|
|
1370
1365
|
|
|
@@ -1402,7 +1397,7 @@ function dateTimeLongFormatter(pattern, formatLong) {
|
|
|
1402
1397
|
}
|
|
1403
1398
|
|
|
1404
1399
|
return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
|
|
1405
|
-
}
|
|
1400
|
+
};
|
|
1406
1401
|
|
|
1407
1402
|
var longFormatters = {
|
|
1408
1403
|
p: timeLongFormatter,
|
|
@@ -1437,13 +1432,13 @@ function isProtectedWeekYearToken(token) {
|
|
|
1437
1432
|
}
|
|
1438
1433
|
function throwProtectedError(token, format, input) {
|
|
1439
1434
|
if (token === 'YYYY') {
|
|
1440
|
-
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://
|
|
1435
|
+
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
|
|
1441
1436
|
} else if (token === 'YY') {
|
|
1442
|
-
throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://
|
|
1437
|
+
throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
|
|
1443
1438
|
} else if (token === 'D') {
|
|
1444
|
-
throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://
|
|
1439
|
+
throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
|
|
1445
1440
|
} else if (token === 'DD') {
|
|
1446
|
-
throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://
|
|
1441
|
+
throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
|
|
1447
1442
|
}
|
|
1448
1443
|
}
|
|
1449
1444
|
|
|
@@ -1474,7 +1469,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
1474
1469
|
* Return the formatted date string in the given format. The result may vary by locale.
|
|
1475
1470
|
*
|
|
1476
1471
|
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
|
|
1477
|
-
* > See: https://
|
|
1472
|
+
* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
1478
1473
|
*
|
|
1479
1474
|
* The characters wrapped between two single quotes characters (') are escaped.
|
|
1480
1475
|
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
|
|
@@ -1553,28 +1548,28 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
1553
1548
|
* | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
|
|
1554
1549
|
* | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
|
|
1555
1550
|
* | | EEEEE | M, T, W, T, F, S, S | |
|
|
1556
|
-
* | | EEEEEE | Mo, Tu, We, Th, Fr,
|
|
1551
|
+
* | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
1557
1552
|
* | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
|
|
1558
1553
|
* | | io | 1st, 2nd, ..., 7th | 7 |
|
|
1559
1554
|
* | | ii | 01, 02, ..., 07 | 7 |
|
|
1560
1555
|
* | | iii | Mon, Tue, Wed, ..., Sun | 7 |
|
|
1561
1556
|
* | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
|
|
1562
1557
|
* | | iiiii | M, T, W, T, F, S, S | 7 |
|
|
1563
|
-
* | | iiiiii | Mo, Tu, We, Th, Fr,
|
|
1558
|
+
* | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
|
|
1564
1559
|
* | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
|
|
1565
1560
|
* | | eo | 2nd, 3rd, ..., 1st | 7 |
|
|
1566
1561
|
* | | ee | 02, 03, ..., 01 | |
|
|
1567
1562
|
* | | eee | Mon, Tue, Wed, ..., Sun | |
|
|
1568
1563
|
* | | eeee | Monday, Tuesday, ..., Sunday | 2 |
|
|
1569
1564
|
* | | eeeee | M, T, W, T, F, S, S | |
|
|
1570
|
-
* | | eeeeee | Mo, Tu, We, Th, Fr,
|
|
1565
|
+
* | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
1571
1566
|
* | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
|
|
1572
1567
|
* | | co | 2nd, 3rd, ..., 1st | 7 |
|
|
1573
1568
|
* | | cc | 02, 03, ..., 01 | |
|
|
1574
1569
|
* | | ccc | Mon, Tue, Wed, ..., Sun | |
|
|
1575
1570
|
* | | cccc | Monday, Tuesday, ..., Sunday | 2 |
|
|
1576
1571
|
* | | ccccc | M, T, W, T, F, S, S | |
|
|
1577
|
-
* | | cccccc | Mo, Tu, We, Th, Fr,
|
|
1572
|
+
* | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
1578
1573
|
* | AM, PM | a..aa | AM, PM | |
|
|
1579
1574
|
* | | aaa | am, pm | |
|
|
1580
1575
|
* | | aaaa | a.m., p.m. | 2 |
|
|
@@ -1710,30 +1705,10 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
1710
1705
|
* - `p`: long localized time
|
|
1711
1706
|
*
|
|
1712
1707
|
* 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
|
|
1713
|
-
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://
|
|
1714
|
-
*
|
|
1715
|
-
* 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
|
|
1716
|
-
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
|
|
1717
|
-
*
|
|
1718
|
-
* ### v2.0.0 breaking changes:
|
|
1719
|
-
*
|
|
1720
|
-
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
1721
|
-
*
|
|
1722
|
-
* - The second argument is now required for the sake of explicitness.
|
|
1708
|
+
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
1723
1709
|
*
|
|
1724
|
-
*
|
|
1725
|
-
*
|
|
1726
|
-
* format(new Date(2016, 0, 1))
|
|
1727
|
-
*
|
|
1728
|
-
* // v2.0.0 onward
|
|
1729
|
-
* format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
|
|
1730
|
-
* ```
|
|
1731
|
-
*
|
|
1732
|
-
* - New format string API for `format` function
|
|
1733
|
-
* which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
|
|
1734
|
-
* See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
|
|
1735
|
-
*
|
|
1736
|
-
* - Characters are now escaped using single quote symbols (`'`) instead of square brackets.
|
|
1710
|
+
* 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
|
|
1711
|
+
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
1737
1712
|
*
|
|
1738
1713
|
* @param {Date|Number} date - the original date
|
|
1739
1714
|
* @param {String} format - the string of tokens
|
|
@@ -1742,9 +1717,9 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
1742
1717
|
* @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
|
|
1743
1718
|
* @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
|
|
1744
1719
|
* @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
|
|
1745
|
-
* see: https://
|
|
1720
|
+
* see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
1746
1721
|
* @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
|
|
1747
|
-
* see: https://
|
|
1722
|
+
* see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
1748
1723
|
* @returns {String} the formatted date string
|
|
1749
1724
|
* @throws {TypeError} 2 arguments required
|
|
1750
1725
|
* @throws {RangeError} `date` must not be Invalid Date
|
|
@@ -1752,47 +1727,45 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
1752
1727
|
* @throws {RangeError} `options.locale` must contain `formatLong` property
|
|
1753
1728
|
* @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
|
|
1754
1729
|
* @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
|
|
1755
|
-
* @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://
|
|
1756
|
-
* @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://
|
|
1757
|
-
* @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://
|
|
1758
|
-
* @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://
|
|
1730
|
+
* @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
1731
|
+
* @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
1732
|
+
* @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
1733
|
+
* @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
1759
1734
|
* @throws {RangeError} format string contains an unescaped latin alphabet character
|
|
1760
1735
|
*
|
|
1761
1736
|
* @example
|
|
1762
1737
|
* // Represent 11 February 2014 in middle-endian format:
|
|
1763
|
-
*
|
|
1738
|
+
* const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
|
|
1764
1739
|
* //=> '02/11/2014'
|
|
1765
1740
|
*
|
|
1766
1741
|
* @example
|
|
1767
1742
|
* // Represent 2 July 2014 in Esperanto:
|
|
1768
1743
|
* import { eoLocale } from 'date-fns/locale/eo'
|
|
1769
|
-
*
|
|
1744
|
+
* const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
|
|
1770
1745
|
* locale: eoLocale
|
|
1771
1746
|
* })
|
|
1772
1747
|
* //=> '2-a de julio 2014'
|
|
1773
1748
|
*
|
|
1774
1749
|
* @example
|
|
1775
1750
|
* // Escape string by single quote characters:
|
|
1776
|
-
*
|
|
1751
|
+
* const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
|
|
1777
1752
|
* //=> "3 o'clock"
|
|
1778
1753
|
*/
|
|
1779
1754
|
|
|
1780
|
-
function format(dirtyDate, dirtyFormatStr,
|
|
1755
|
+
function format(dirtyDate, dirtyFormatStr, options) {
|
|
1756
|
+
var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
|
|
1757
|
+
|
|
1781
1758
|
requiredArgs(2, arguments);
|
|
1782
1759
|
var formatStr = String(dirtyFormatStr);
|
|
1783
|
-
var
|
|
1784
|
-
var locale = options.locale
|
|
1785
|
-
var
|
|
1786
|
-
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
|
1787
|
-
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
|
1760
|
+
var defaultOptions = getDefaultOptions();
|
|
1761
|
+
var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : index.defaultLocale;
|
|
1762
|
+
var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
|
1788
1763
|
|
|
1789
1764
|
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
1790
1765
|
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
|
1791
1766
|
}
|
|
1792
1767
|
|
|
1793
|
-
var
|
|
1794
|
-
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
|
|
1795
|
-
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
1768
|
+
var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
1796
1769
|
|
|
1797
1770
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
1798
1771
|
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
|
@@ -1828,7 +1801,7 @@ function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
|
|
1828
1801
|
|
|
1829
1802
|
if (firstCharacter === 'p' || firstCharacter === 'P') {
|
|
1830
1803
|
var longFormatter = longFormatters$1[firstCharacter];
|
|
1831
|
-
return longFormatter(substring, locale.formatLong
|
|
1804
|
+
return longFormatter(substring, locale.formatLong);
|
|
1832
1805
|
}
|
|
1833
1806
|
|
|
1834
1807
|
return substring;
|
|
@@ -1847,12 +1820,12 @@ function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
|
|
1847
1820
|
var formatter = formatters$1[firstCharacter];
|
|
1848
1821
|
|
|
1849
1822
|
if (formatter) {
|
|
1850
|
-
if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
|
|
1851
|
-
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
|
|
1823
|
+
if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
|
|
1824
|
+
throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
|
|
1852
1825
|
}
|
|
1853
1826
|
|
|
1854
|
-
if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
|
|
1855
|
-
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
|
|
1827
|
+
if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
|
|
1828
|
+
throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
|
|
1856
1829
|
}
|
|
1857
1830
|
|
|
1858
1831
|
return formatter(utcDate, substring, locale.localize, formatterOptions);
|
|
@@ -1868,13 +1841,20 @@ function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
|
|
1868
1841
|
}
|
|
1869
1842
|
|
|
1870
1843
|
function cleanEscapedString(input) {
|
|
1871
|
-
|
|
1844
|
+
var matched = input.match(escapedStringRegExp);
|
|
1845
|
+
|
|
1846
|
+
if (!matched) {
|
|
1847
|
+
return input;
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
return matched[1].replace(doubleQuoteRegExp, "'");
|
|
1872
1851
|
}
|
|
1873
1852
|
|
|
1874
1853
|
exports.format = format;
|
|
1854
|
+
exports.getDefaultOptions = getDefaultOptions;
|
|
1875
1855
|
exports.getTimezoneOffsetInMilliseconds = getTimezoneOffsetInMilliseconds;
|
|
1876
1856
|
exports.requiredArgs = requiredArgs;
|
|
1877
1857
|
exports.subMilliseconds = subMilliseconds;
|
|
1878
1858
|
exports.toDate = toDate;
|
|
1879
1859
|
exports.toInteger = toInteger;
|
|
1880
|
-
//# sourceMappingURL=index-
|
|
1860
|
+
//# sourceMappingURL=index-c4369117.js.map
|