@sendbird/uikit-react 3.2.0-rc.0 → 3.2.0-rc.2
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 +85 -93
- package/App.js.map +1 -1
- package/CHANGELOG.md +1 -1
- package/Channel/components/ChannelHeader.js +21 -19
- package/Channel/components/ChannelHeader.js.map +1 -1
- package/Channel/components/ChannelUI.js +29 -26
- package/Channel/components/ChannelUI.js.map +1 -1
- package/Channel/components/FileViewer.js +22 -20
- 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 +35 -32
- package/Channel/components/Message.js.map +1 -1
- package/Channel/components/MessageInput.js +33 -30
- package/Channel/components/MessageInput.js.map +1 -1
- package/Channel/components/MessageList.js +29 -26
- package/Channel/components/MessageList.js.map +1 -1
- package/Channel/components/RemoveMessageModal.js +21 -19
- package/Channel/components/RemoveMessageModal.js.map +1 -1
- package/Channel/components/SuggestedMentionList.js +36 -34
- package/Channel/components/SuggestedMentionList.js.map +1 -1
- package/Channel/components/TypingIndicator.js +21 -19
- 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 +17 -15
- package/Channel/context.js.map +1 -1
- package/Channel.js +27 -24
- package/Channel.js.map +1 -1
- package/ChannelList/components/AddChannel.js +17 -17
- 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 +41 -39
- package/ChannelList/components/ChannelListUI.js.map +1 -1
- package/ChannelList/components/ChannelPreview.js +50 -48
- package/ChannelList/components/ChannelPreview.js.map +1 -1
- package/ChannelList/components/ChannelPreviewAction.js +59 -68
- package/ChannelList/components/ChannelPreviewAction.js.map +1 -1
- package/ChannelList/context.js +12 -10
- package/ChannelList/context.js.map +1 -1
- package/ChannelList.js +30 -28
- package/ChannelList.js.map +1 -1
- package/{ChannelListProvider-6e3b8f43.js → ChannelListProvider-1a22e404.js} +232 -216
- package/ChannelListProvider-1a22e404.js.map +1 -0
- package/{ChannelProvider-b8c6427f.js → ChannelProvider-e38bb434.js} +554 -521
- package/{ChannelProvider-b8c6427f.js.map → ChannelProvider-e38bb434.js.map} +1 -1
- package/ChannelSettings/components/ChannelProfile.js +16 -16
- package/ChannelSettings/components/ChannelProfile.js.map +1 -1
- package/ChannelSettings/components/ChannelSettingsUI.js +28 -26
- package/ChannelSettings/components/ChannelSettingsUI.js.map +1 -1
- package/ChannelSettings/components/EditDetailsModal.js +19 -21
- package/ChannelSettings/components/EditDetailsModal.js.map +1 -1
- package/ChannelSettings/components/LeaveChannel.js +14 -16
- package/ChannelSettings/components/LeaveChannel.js.map +1 -1
- package/ChannelSettings/components/ModerationPanel.js +79 -77
- package/ChannelSettings/components/ModerationPanel.js.map +1 -1
- package/ChannelSettings/components/UserListItem.js +15 -15
- package/ChannelSettings/components/UserListItem.js.map +1 -1
- package/ChannelSettings/components/UserPanel.js +17 -17
- package/ChannelSettings/components/UserPanel.js.map +1 -1
- package/ChannelSettings/context.js +6 -6
- package/ChannelSettings/context.js.map +1 -1
- package/ChannelSettings.js +22 -20
- package/ChannelSettings.js.map +1 -1
- package/CreateChannel/components/CreateChannelUI.js +18 -19
- package/CreateChannel/components/CreateChannelUI.js.map +1 -1
- package/CreateChannel/components/InviteUsers.js +21 -20
- package/CreateChannel/components/InviteUsers.js.map +1 -1
- package/CreateChannel/components/SelectChannelType.js +22 -22
- package/CreateChannel/components/SelectChannelType.js.map +1 -1
- package/CreateChannel/context.js +4 -4
- package/CreateChannel.js +14 -14
- package/CreateChannel.js.map +1 -1
- package/{CreateChannelProvider-712526fd.js → CreateChannelProvider-f740e1f0.js} +3 -3
- package/{CreateChannelProvider-712526fd.js.map → CreateChannelProvider-f740e1f0.js.map} +1 -1
- package/CreateOpenChannel/components/CreateOpenChannelUI.js +13 -13
- package/CreateOpenChannel/components/CreateOpenChannelUI.js.map +1 -1
- package/CreateOpenChannel/context.js +11 -11
- package/CreateOpenChannel/context.js.map +1 -1
- package/CreateOpenChannel.js +9 -9
- package/CreateOpenChannel.js.map +1 -1
- package/EditUserProfile/components/EditUserProfileUI.js +12 -12
- package/EditUserProfile/context.js +13 -13
- package/EditUserProfile/context.js.map +1 -1
- package/EditUserProfile.js +13 -13
- package/EditUserProfile.js.map +1 -1
- package/{LocalizationContext-4cefc770.js → LocalizationContext-78d3faa4.js} +5 -5
- package/{LocalizationContext-4cefc770.js.map → LocalizationContext-78d3faa4.js.map} +1 -1
- package/{MemberList-e4916e55.js → MemberList-057e2466.js} +34 -34
- package/{MemberList-e4916e55.js.map → MemberList-057e2466.js.map} +1 -1
- 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 +17 -15
- package/OpenChannel/components/OpenChannelHeader.js.map +1 -1
- package/OpenChannel/components/OpenChannelInput.js +22 -19
- package/OpenChannel/components/OpenChannelInput.js.map +1 -1
- package/OpenChannel/components/OpenChannelMessage.js +35 -32
- package/OpenChannel/components/OpenChannelMessage.js.map +1 -1
- package/OpenChannel/components/OpenChannelMessageList.js +30 -27
- package/OpenChannel/components/OpenChannelMessageList.js.map +1 -1
- package/OpenChannel/components/OpenChannelUI.js +29 -26
- package/OpenChannel/components/OpenChannelUI.js.map +1 -1
- package/OpenChannel/context.js +14 -12
- package/OpenChannel/context.js.map +1 -1
- package/OpenChannel.js +29 -26
- package/OpenChannel.js.map +1 -1
- package/OpenChannelList/components/OpenChannelListUI.js +19 -19
- package/OpenChannelList/components/OpenChannelListUI.js.map +1 -1
- package/OpenChannelList/components/OpenChannelPreview.js +5 -6
- package/OpenChannelList/components/OpenChannelPreview.js.map +1 -1
- package/OpenChannelList/context.js +4 -4
- package/OpenChannelList.js +12 -12
- package/OpenChannelList.js.map +1 -1
- package/{OpenChannelListProvider-845a2162.js → OpenChannelListProvider-4bddc69f.js} +4 -4
- package/{OpenChannelListProvider-845a2162.js.map → OpenChannelListProvider-4bddc69f.js.map} +1 -1
- package/{OpenChannelProvider-5f19d5d7.js → OpenChannelProvider-bb348405.js} +49 -48
- package/{OpenChannelProvider-5f19d5d7.js.map → OpenChannelProvider-bb348405.js.map} +1 -1
- package/OpenChannelSettings/components/EditDetailsModal.js +20 -19
- package/OpenChannelSettings/components/EditDetailsModal.js.map +1 -1
- package/OpenChannelSettings/components/OpenChannelProfile.js +17 -16
- package/OpenChannelSettings/components/OpenChannelProfile.js.map +1 -1
- package/OpenChannelSettings/components/OpenChannelSettingsUI.js +28 -27
- package/OpenChannelSettings/components/OpenChannelSettingsUI.js.map +1 -1
- package/OpenChannelSettings/components/OperatorUI.js +88 -87
- package/OpenChannelSettings/components/OperatorUI.js.map +1 -1
- package/OpenChannelSettings/components/ParticipantUI.js +17 -16
- package/OpenChannelSettings/components/ParticipantUI.js.map +1 -1
- package/OpenChannelSettings/context.js +15 -14
- package/OpenChannelSettings/context.js.map +1 -1
- package/OpenChannelSettings.js +21 -20
- package/OpenChannelSettings.js.map +1 -1
- package/README.md +2 -7
- package/SendbirdProvider.js +216 -251
- package/SendbirdProvider.js.map +1 -1
- package/{UserProfileContext-2e53d03a.js → UserProfileContext-bc040e78.js} +6 -4
- package/{UserProfileContext-2e53d03a.js.map → UserProfileContext-bc040e78.js.map} +1 -1
- package/__bundle-0dad34cd-6408fa97.js +6 -0
- package/__bundle-0dad34cd-6408fa97.js.map +1 -0
- package/__bundle-57e0c5af-dff5d7e0.js +6 -0
- package/__bundle-57e0c5af-dff5d7e0.js.map +1 -0
- package/__bundle-bd072f34-80eb9bbc.js +6 -0
- package/__bundle-bd072f34-80eb9bbc.js.map +1 -0
- package/_rollupPluginBabelHelpers-64f3f48c.js +43 -0
- package/_rollupPluginBabelHelpers-64f3f48c.js.map +1 -0
- package/actionTypes-fb6947e7.js +6 -0
- package/{actionTypes-517789b8.js.map → actionTypes-fb6947e7.js.map} +1 -1
- package/cjs/App.js +85 -93
- package/cjs/App.js.map +1 -1
- package/cjs/Channel/components/ChannelHeader.js +21 -19
- package/cjs/Channel/components/ChannelHeader.js.map +1 -1
- package/cjs/Channel/components/ChannelUI.js +29 -26
- package/cjs/Channel/components/ChannelUI.js.map +1 -1
- package/cjs/Channel/components/FileViewer.js +22 -20
- 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 +35 -32
- package/cjs/Channel/components/Message.js.map +1 -1
- package/cjs/Channel/components/MessageInput.js +33 -30
- package/cjs/Channel/components/MessageInput.js.map +1 -1
- package/cjs/Channel/components/MessageList.js +29 -26
- package/cjs/Channel/components/MessageList.js.map +1 -1
- package/cjs/Channel/components/RemoveMessageModal.js +21 -19
- package/cjs/Channel/components/RemoveMessageModal.js.map +1 -1
- package/cjs/Channel/components/SuggestedMentionList.js +36 -34
- package/cjs/Channel/components/SuggestedMentionList.js.map +1 -1
- package/cjs/Channel/components/TypingIndicator.js +21 -19
- 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 +17 -15
- package/cjs/Channel/context.js.map +1 -1
- package/cjs/Channel.js +27 -24
- package/cjs/Channel.js.map +1 -1
- package/cjs/ChannelList/components/AddChannel.js +17 -17
- 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 +41 -39
- package/cjs/ChannelList/components/ChannelListUI.js.map +1 -1
- package/cjs/ChannelList/components/ChannelPreview.js +50 -48
- package/cjs/ChannelList/components/ChannelPreview.js.map +1 -1
- package/cjs/ChannelList/components/ChannelPreviewAction.js +59 -68
- package/cjs/ChannelList/components/ChannelPreviewAction.js.map +1 -1
- package/cjs/ChannelList/context.js +12 -10
- package/cjs/ChannelList/context.js.map +1 -1
- package/cjs/ChannelList.js +30 -28
- package/cjs/ChannelList.js.map +1 -1
- package/cjs/{ChannelListProvider-781aa186.js → ChannelListProvider-852ab5ee.js} +231 -215
- package/cjs/ChannelListProvider-852ab5ee.js.map +1 -0
- package/cjs/{ChannelProvider-bbff4ae8.js → ChannelProvider-177cb9c3.js} +558 -525
- package/cjs/{ChannelProvider-bbff4ae8.js.map → ChannelProvider-177cb9c3.js.map} +1 -1
- package/cjs/ChannelSettings/components/ChannelProfile.js +16 -16
- package/cjs/ChannelSettings/components/ChannelProfile.js.map +1 -1
- package/cjs/ChannelSettings/components/ChannelSettingsUI.js +28 -26
- package/cjs/ChannelSettings/components/ChannelSettingsUI.js.map +1 -1
- package/cjs/ChannelSettings/components/EditDetailsModal.js +19 -21
- package/cjs/ChannelSettings/components/EditDetailsModal.js.map +1 -1
- package/cjs/ChannelSettings/components/LeaveChannel.js +14 -16
- package/cjs/ChannelSettings/components/LeaveChannel.js.map +1 -1
- package/cjs/ChannelSettings/components/ModerationPanel.js +79 -77
- package/cjs/ChannelSettings/components/ModerationPanel.js.map +1 -1
- package/cjs/ChannelSettings/components/UserListItem.js +15 -15
- package/cjs/ChannelSettings/components/UserListItem.js.map +1 -1
- package/cjs/ChannelSettings/components/UserPanel.js +17 -17
- 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 +22 -20
- package/cjs/ChannelSettings.js.map +1 -1
- package/cjs/CreateChannel/components/CreateChannelUI.js +18 -19
- package/cjs/CreateChannel/components/CreateChannelUI.js.map +1 -1
- package/cjs/CreateChannel/components/InviteUsers.js +21 -20
- package/cjs/CreateChannel/components/InviteUsers.js.map +1 -1
- package/cjs/CreateChannel/components/SelectChannelType.js +22 -22
- package/cjs/CreateChannel/components/SelectChannelType.js.map +1 -1
- package/cjs/CreateChannel/context.js +4 -4
- package/cjs/CreateChannel.js +14 -14
- package/cjs/CreateChannel.js.map +1 -1
- package/cjs/{CreateChannelProvider-80c88bba.js → CreateChannelProvider-ce623553.js} +3 -3
- package/cjs/{CreateChannelProvider-80c88bba.js.map → CreateChannelProvider-ce623553.js.map} +1 -1
- package/cjs/CreateOpenChannel/components/CreateOpenChannelUI.js +13 -13
- package/cjs/CreateOpenChannel/components/CreateOpenChannelUI.js.map +1 -1
- package/cjs/CreateOpenChannel/context.js +11 -11
- package/cjs/CreateOpenChannel/context.js.map +1 -1
- package/cjs/CreateOpenChannel.js +9 -9
- package/cjs/CreateOpenChannel.js.map +1 -1
- package/cjs/EditUserProfile/components/EditUserProfileUI.js +12 -12
- package/cjs/EditUserProfile/context.js +14 -14
- package/cjs/EditUserProfile/context.js.map +1 -1
- package/cjs/EditUserProfile.js +13 -13
- package/cjs/EditUserProfile.js.map +1 -1
- package/cjs/{LocalizationContext-b5fd4c38.js → LocalizationContext-bde4de59.js} +5 -5
- package/cjs/{LocalizationContext-b5fd4c38.js.map → LocalizationContext-bde4de59.js.map} +1 -1
- package/cjs/{MemberList-10def668.js → MemberList-5f6eaac3.js} +34 -34
- package/cjs/{MemberList-10def668.js.map → MemberList-5f6eaac3.js.map} +1 -1
- 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 +17 -15
- package/cjs/OpenChannel/components/OpenChannelHeader.js.map +1 -1
- package/cjs/OpenChannel/components/OpenChannelInput.js +22 -19
- package/cjs/OpenChannel/components/OpenChannelInput.js.map +1 -1
- package/cjs/OpenChannel/components/OpenChannelMessage.js +35 -32
- package/cjs/OpenChannel/components/OpenChannelMessage.js.map +1 -1
- package/cjs/OpenChannel/components/OpenChannelMessageList.js +30 -27
- package/cjs/OpenChannel/components/OpenChannelMessageList.js.map +1 -1
- package/cjs/OpenChannel/components/OpenChannelUI.js +29 -26
- package/cjs/OpenChannel/components/OpenChannelUI.js.map +1 -1
- package/cjs/OpenChannel/context.js +14 -12
- package/cjs/OpenChannel/context.js.map +1 -1
- package/cjs/OpenChannel.js +29 -26
- package/cjs/OpenChannel.js.map +1 -1
- package/cjs/OpenChannelList/components/OpenChannelListUI.js +19 -19
- package/cjs/OpenChannelList/components/OpenChannelListUI.js.map +1 -1
- package/cjs/OpenChannelList/components/OpenChannelPreview.js +5 -6
- package/cjs/OpenChannelList/components/OpenChannelPreview.js.map +1 -1
- package/cjs/OpenChannelList/context.js +4 -4
- package/cjs/OpenChannelList.js +12 -12
- package/cjs/OpenChannelList.js.map +1 -1
- package/cjs/{OpenChannelListProvider-8e425873.js → OpenChannelListProvider-26a67118.js} +4 -4
- package/cjs/{OpenChannelListProvider-8e425873.js.map → OpenChannelListProvider-26a67118.js.map} +1 -1
- package/cjs/{OpenChannelProvider-39f9e794.js → OpenChannelProvider-8a6ad3db.js} +49 -48
- package/cjs/{OpenChannelProvider-39f9e794.js.map → OpenChannelProvider-8a6ad3db.js.map} +1 -1
- package/cjs/OpenChannelSettings/components/EditDetailsModal.js +20 -19
- package/cjs/OpenChannelSettings/components/EditDetailsModal.js.map +1 -1
- package/cjs/OpenChannelSettings/components/OpenChannelProfile.js +17 -16
- package/cjs/OpenChannelSettings/components/OpenChannelProfile.js.map +1 -1
- package/cjs/OpenChannelSettings/components/OpenChannelSettingsUI.js +28 -27
- package/cjs/OpenChannelSettings/components/OpenChannelSettingsUI.js.map +1 -1
- package/cjs/OpenChannelSettings/components/OperatorUI.js +88 -87
- package/cjs/OpenChannelSettings/components/OperatorUI.js.map +1 -1
- package/cjs/OpenChannelSettings/components/ParticipantUI.js +17 -16
- package/cjs/OpenChannelSettings/components/ParticipantUI.js.map +1 -1
- package/cjs/OpenChannelSettings/context.js +15 -14
- package/cjs/OpenChannelSettings/context.js.map +1 -1
- package/cjs/OpenChannelSettings.js +21 -20
- package/cjs/OpenChannelSettings.js.map +1 -1
- package/cjs/SendbirdProvider.js +215 -251
- package/cjs/SendbirdProvider.js.map +1 -1
- package/cjs/{UserProfileContext-69c9649a.js → UserProfileContext-21660049.js} +6 -4
- package/cjs/{UserProfileContext-69c9649a.js.map → UserProfileContext-21660049.js.map} +1 -1
- package/cjs/__bundle-0dad34cd-794417d3.js +33 -0
- package/cjs/__bundle-0dad34cd-794417d3.js.map +1 -0
- package/cjs/__bundle-57e0c5af-c2950cb7.js +113 -0
- package/cjs/__bundle-57e0c5af-c2950cb7.js.map +1 -0
- package/cjs/__bundle-bd072f34-444fbfec.js +15 -0
- package/cjs/__bundle-bd072f34-444fbfec.js.map +1 -0
- package/cjs/_rollupPluginBabelHelpers-17f5a2c8.js +45 -0
- package/cjs/_rollupPluginBabelHelpers-17f5a2c8.js.map +1 -0
- package/cjs/actionTypes-76c446b3.js +10 -0
- package/cjs/{actionTypes-17aa0989.js.map → actionTypes-76c446b3.js.map} +1 -1
- package/cjs/{color-9e293baf.js → color-1ec1269a.js} +2 -2
- package/cjs/color-1ec1269a.js.map +1 -0
- package/cjs/compareIds-52f07bab.js +18 -0
- package/cjs/compareIds-52f07bab.js.map +1 -0
- package/cjs/{const-17108318.js → const-00ec2acd.js} +1 -1
- package/cjs/const-00ec2acd.js.map +1 -0
- package/cjs/{const-955190c4.js → const-b94ba65d.js} +1 -1
- package/cjs/{const-955190c4.js.map → const-b94ba65d.js.map} +1 -1
- package/cjs/{context-e041c8e0.js → context-3df5068b.js} +2 -2
- package/cjs/{context-e041c8e0.js.map → context-3df5068b.js.map} +1 -1
- package/cjs/dist/index.css +4657 -3676
- package/cjs/dist/index.css.map +1 -1
- package/cjs/groupChannel-da9ec10a.js +11 -0
- package/cjs/groupChannel-da9ec10a.js.map +1 -0
- package/cjs/handlers/ConnectionHandler.js +4 -2
- package/cjs/handlers/ConnectionHandler.js.map +1 -1
- package/cjs/handlers/GroupChannelHandler.js +4 -2
- package/cjs/handlers/GroupChannelHandler.js.map +1 -1
- package/cjs/handlers/OpenChannelHandler.js +3 -2
- package/cjs/handlers/OpenChannelHandler.js.map +1 -1
- package/cjs/handlers/SessionHandler.js +4 -2
- package/cjs/handlers/SessionHandler.js.map +1 -1
- package/cjs/handlers/UserEventHandler.js +4 -2
- package/cjs/handlers/UserEventHandler.js.map +1 -1
- package/cjs/{index-c1697faa.js → index-06b2ea54.js} +299 -319
- package/cjs/index-06b2ea54.js.map +1 -0
- package/cjs/{index-9ce5e5a9.js → index-0c20bfa0.js} +18 -37
- package/cjs/index-0c20bfa0.js.map +1 -0
- package/cjs/{index-550f5039.js → index-216e0934.js} +2 -2
- package/cjs/{index-550f5039.js.map → index-216e0934.js.map} +1 -1
- package/cjs/{index-b9b8972b.js → index-339b2871.js} +14 -13
- package/cjs/{index-b9b8972b.js.map → index-339b2871.js.map} +1 -1
- package/cjs/{index-025aa556.js → index-386d6cc6.js} +13 -13
- package/cjs/{index-025aa556.js.map → index-386d6cc6.js.map} +1 -1
- package/cjs/{index-1512514f.js → index-4fedaa1a.js} +16 -14
- package/cjs/index-4fedaa1a.js.map +1 -0
- package/cjs/{index-5166a415.js → index-50fc77e8.js} +69 -80
- package/cjs/index-50fc77e8.js.map +1 -0
- package/cjs/{index-e9d96b00.js → index-66b53d56.js} +4 -4
- package/cjs/{index-e9d96b00.js.map → index-66b53d56.js.map} +1 -1
- package/cjs/{index-5e2b8c03.js → index-9daabdb8.js} +30 -30
- package/cjs/{index-5e2b8c03.js.map → index-9daabdb8.js.map} +1 -1
- package/cjs/{index-18b120dc.js → index-e4245c04.js} +51 -51
- package/cjs/index-e4245c04.js.map +1 -0
- package/cjs/index.js +39 -36
- package/cjs/index.js.map +1 -1
- package/cjs/openChannel-d4ad53b7.js +10 -0
- package/cjs/openChannel-d4ad53b7.js.map +1 -0
- package/cjs/{openChannelUtils-cffba1c0.js → openChannelUtils-b74500ad.js} +11 -11
- package/cjs/openChannelUtils-b74500ad.js.map +1 -0
- package/cjs/sendbird-cd9bbca0.js +12 -0
- package/cjs/sendbird-cd9bbca0.js.map +1 -0
- package/cjs/sendbirdSelectors.js +22 -22
- package/cjs/sendbirdSelectors.js.map +1 -1
- package/cjs/{stringSet-be457fd7.js → stringSet-edbf423b.js} +4 -4
- package/cjs/{stringSet-be457fd7.js.map → stringSet-edbf423b.js.map} +1 -1
- package/cjs/topics-c5662b44.js +22 -0
- package/cjs/{topics-58ec1c61.js.map → topics-c5662b44.js.map} +1 -1
- package/cjs/{tslib.es6-36205d81.js → tslib.es6-8c7aa47e.js} +2 -2
- package/cjs/tslib.es6-8c7aa47e.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 +3 -4
- 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 +14 -15
- 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 +6 -7
- 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 +74 -73
- 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 +13 -13
- package/cjs/ui/MentionLabel.js.map +1 -1
- package/cjs/ui/MentionUserLabel.js.map +1 -1
- package/cjs/ui/MessageContent.js +19 -19
- package/cjs/ui/MessageContent.js.map +1 -1
- package/cjs/ui/MessageInput.js +178 -19889
- 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 +9 -10
- 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 +11 -11
- 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 +24 -24
- package/cjs/ui/OpenchannelFileMessage.js.map +1 -1
- package/cjs/ui/OpenchannelOGMessage.js +26 -26
- package/cjs/ui/OpenchannelOGMessage.js.map +1 -1
- package/cjs/ui/OpenchannelThumbnailMessage.js +26 -26
- package/cjs/ui/OpenchannelThumbnailMessage.js.map +1 -1
- package/cjs/ui/OpenchannelUserMessage.js +24 -24
- 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 +10 -10
- 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 +17 -17
- package/cjs/ui/UserListItem.js.map +1 -1
- package/cjs/ui/UserProfile.js +11 -11
- package/cjs/ui/UserProfile.js.map +1 -1
- package/cjs/ui/Word.js +15 -10
- package/cjs/ui/Word.js.map +1 -1
- package/cjs/useSendbirdStateContext.js +1 -1
- package/cjs/useSendbirdStateContext.js.map +1 -1
- package/cjs/utils-01f53796.js +6 -0
- package/cjs/{utils-09738454.js.map → utils-01f53796.js.map} +1 -1
- package/cjs/{utils-40fab371.js → utils-1dafbcbf.js} +2 -2
- package/cjs/{utils-40fab371.js.map → utils-1dafbcbf.js.map} +1 -1
- package/cjs/{utils-9419225c.js → utils-b6394fc0.js} +4 -4
- package/cjs/utils-b6394fc0.js.map +1 -0
- package/cjs/{uuid-edc908ea.js → uuid-0e8b271a.js} +2 -2
- package/cjs/{uuid-edc908ea.js.map → uuid-0e8b271a.js.map} +1 -1
- package/cjs/withSendbird.js +13 -15
- package/cjs/withSendbird.js.map +1 -1
- package/{color-402a36fd.js → color-25be65f3.js} +2 -2
- package/{color-402a36fd.js.map → color-25be65f3.js.map} +1 -1
- package/compareIds-3fb63c4f.js +16 -0
- package/compareIds-3fb63c4f.js.map +1 -0
- package/{const-768ef60e.js → const-32a10da6.js} +1 -1
- package/const-32a10da6.js.map +1 -0
- package/{const-6b428cb8.js → const-82d4c478.js} +1 -1
- package/{const-6b428cb8.js.map → const-82d4c478.js.map} +1 -1
- package/{context-bd92675f.js → context-352b7bd9.js} +2 -2
- package/{context-bd92675f.js.map → context-352b7bd9.js.map} +1 -1
- package/dist/index.css +4657 -3676
- package/dist/index.css.map +1 -1
- package/groupChannel-28860f2b.js +8 -0
- package/groupChannel-28860f2b.js.map +1 -0
- package/handlers/ConnectionHandler.js +4 -2
- package/handlers/ConnectionHandler.js.map +1 -1
- package/handlers/GroupChannelHandler.js +5 -3
- package/handlers/GroupChannelHandler.js.map +1 -1
- package/handlers/OpenChannelHandler.js +4 -3
- package/handlers/OpenChannelHandler.js.map +1 -1
- package/handlers/SessionHandler.js +4 -2
- package/handlers/SessionHandler.js.map +1 -1
- package/handlers/UserEventHandler.js +4 -2
- package/handlers/UserEventHandler.js.map +1 -1
- package/{index-3249f6b5.js → index-26e371a5.js} +2 -2
- package/{index-3249f6b5.js.map → index-26e371a5.js.map} +1 -1
- package/{index-3699f160.js → index-31d409a0.js} +18 -37
- package/index-31d409a0.js.map +1 -0
- package/{index-6b896cd8.js → index-327e2586.js} +14 -13
- package/{index-6b896cd8.js.map → index-327e2586.js.map} +1 -1
- package/{index-726a5475.js → index-730972e8.js} +30 -30
- package/{index-726a5475.js.map → index-730972e8.js.map} +1 -1
- package/{index-7fa0a721.js → index-8095ffa6.js} +299 -320
- package/index-8095ffa6.js.map +1 -0
- package/{index-598898d3.js → index-9a33f2b0.js} +16 -14
- package/index-9a33f2b0.js.map +1 -0
- package/{index-176e9ad4.js → index-ab443960.js} +69 -80
- package/index-ab443960.js.map +1 -0
- package/{index-b79c5b07.js → index-be836db2.js} +13 -13
- package/{index-b79c5b07.js.map → index-be836db2.js.map} +1 -1
- package/{index-f59cf800.js → index-eeb90f55.js} +51 -51
- package/index-eeb90f55.js.map +1 -0
- package/{index-a98bd600.js → index-f767d8bd.js} +4 -4
- package/{index-a98bd600.js.map → index-f767d8bd.js.map} +1 -1
- package/index.d.ts +1 -1
- package/index.js +39 -36
- package/index.js.map +1 -1
- package/{openChannel-8c75e1a4.js → openChannel-c1a271aa.js} +3 -2
- package/openChannel-c1a271aa.js.map +1 -0
- package/{openChannelUtils-ecaeb7d7.js → openChannelUtils-a028985c.js} +11 -11
- package/openChannelUtils-a028985c.js.map +1 -0
- package/package.json +2 -3
- package/sendbird-8f18cf5b.js +7 -0
- package/sendbird-8f18cf5b.js.map +1 -0
- package/sendbirdSelectors.js +22 -22
- package/sendbirdSelectors.js.map +1 -1
- package/{stringSet-dc330bcf.js → stringSet-6e7f0195.js} +4 -4
- package/{stringSet-dc330bcf.js.map → stringSet-6e7f0195.js.map} +1 -1
- package/topics-13d4b72d.js +13 -0
- package/{topics-c5198349.js.map → topics-13d4b72d.js.map} +1 -1
- package/{tslib.es6-cb5d77bf.js → tslib.es6-c49bbc0a.js} +2 -2
- package/tslib.es6-c49bbc0a.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 +3 -4
- 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 +14 -15
- 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 +6 -7
- package/ui/FileMessageItemBody.js.map +1 -1
- package/ui/FileViewer.js +11 -12
- package/ui/FileViewer.js.map +1 -1
- package/ui/Icon.js +74 -73
- 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 +13 -13
- package/ui/MentionLabel.js.map +1 -1
- package/ui/MentionUserLabel.js.map +1 -1
- package/ui/MessageContent.js +19 -19
- package/ui/MessageContent.js.map +1 -1
- package/ui/MessageInput.js +178 -19889
- 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 +9 -10
- package/ui/Modal.js.map +1 -1
- package/ui/MutedAvatarOverlay.js +0 -1
- package/ui/MutedAvatarOverlay.js.map +1 -1
- package/ui/OGMessageItemBody.js +11 -11
- 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 +24 -24
- package/ui/OpenchannelFileMessage.js.map +1 -1
- package/ui/OpenchannelOGMessage.js +26 -26
- package/ui/OpenchannelOGMessage.js.map +1 -1
- package/ui/OpenchannelThumbnailMessage.js +26 -26
- package/ui/OpenchannelThumbnailMessage.js.map +1 -1
- package/ui/OpenchannelUserMessage.js +24 -24
- 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 +10 -10
- 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 +17 -17
- package/ui/UserListItem.js.map +1 -1
- package/ui/UserProfile.js +11 -11
- package/ui/UserProfile.js.map +1 -1
- package/ui/Word.js +15 -10
- package/ui/Word.js.map +1 -1
- package/useSendbirdStateContext.js +1 -1
- package/useSendbirdStateContext.js.map +1 -1
- package/{utils-330ed0b1.js → utils-9e478f2a.js} +2 -2
- package/{utils-330ed0b1.js.map → utils-9e478f2a.js.map} +1 -1
- package/{utils-8fb72715.js → utils-c3865334.js} +4 -4
- package/utils-c3865334.js.map +1 -0
- package/utils-e3b472fd.js +4 -0
- package/{utils-629876b9.js.map → utils-e3b472fd.js.map} +1 -1
- package/{uuid-180d497e.js → uuid-741c039a.js} +2 -2
- package/{uuid-180d497e.js.map → uuid-741c039a.js.map} +1 -1
- package/withSendbird.js +13 -15
- package/withSendbird.js.map +1 -1
- package/ChannelListProvider-6e3b8f43.js.map +0 -1
- package/__bundle-bd072f34-95f6bf17.js +0 -8
- package/__bundle-bd072f34-95f6bf17.js.map +0 -1
- package/_rollupPluginBabelHelpers-4527872e.js +0 -130
- package/_rollupPluginBabelHelpers-4527872e.js.map +0 -1
- package/actionTypes-517789b8.js +0 -6
- package/cjs/ChannelListProvider-781aa186.js.map +0 -1
- package/cjs/__bundle-bd072f34-57bee5af.js +0 -106
- package/cjs/__bundle-bd072f34-57bee5af.js.map +0 -1
- package/cjs/_rollupPluginBabelHelpers-f9e4bb55.js +0 -134
- package/cjs/_rollupPluginBabelHelpers-f9e4bb55.js.map +0 -1
- package/cjs/actionTypes-17aa0989.js +0 -10
- package/cjs/color-9e293baf.js.map +0 -1
- package/cjs/compareIds-cf626c9f.js +0 -20
- package/cjs/compareIds-cf626c9f.js.map +0 -1
- package/cjs/const-17108318.js.map +0 -1
- package/cjs/groupChannel-6d56c155.js +0 -11
- package/cjs/groupChannel-6d56c155.js.map +0 -1
- package/cjs/index-1512514f.js.map +0 -1
- package/cjs/index-18b120dc.js.map +0 -1
- package/cjs/index-5166a415.js.map +0 -1
- package/cjs/index-9ce5e5a9.js.map +0 -1
- package/cjs/index-c1697faa.js.map +0 -1
- package/cjs/openChannel-8aabbf3c.js +0 -9
- package/cjs/openChannel-8aabbf3c.js.map +0 -1
- package/cjs/openChannelUtils-cffba1c0.js.map +0 -1
- package/cjs/topics-58ec1c61.js +0 -22
- package/cjs/tslib.es6-36205d81.js.map +0 -1
- package/cjs/utils-09738454.js +0 -6
- package/cjs/utils-9419225c.js.map +0 -1
- package/compareIds-31e2f55c.js +0 -18
- package/compareIds-31e2f55c.js.map +0 -1
- package/const-768ef60e.js.map +0 -1
- package/groupChannel-e2a071e1.js +0 -8
- package/groupChannel-e2a071e1.js.map +0 -1
- package/index-176e9ad4.js.map +0 -1
- package/index-3699f160.js.map +0 -1
- package/index-598898d3.js.map +0 -1
- package/index-7fa0a721.js.map +0 -1
- package/index-f59cf800.js.map +0 -1
- package/openChannel-8c75e1a4.js.map +0 -1
- package/openChannelUtils-ecaeb7d7.js.map +0 -1
- package/package-lock.json +0 -25501
- package/topics-c5198349.js +0 -13
- package/tslib.es6-cb5d77bf.js.map +0 -1
- package/utils-629876b9.js +0 -4
- package/utils-8fb72715.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as defaultLocale } from './index-
|
|
1
|
+
import { d as defaultLocale } from './index-ab443960.js';
|
|
2
2
|
|
|
3
3
|
function requiredArgs(required, args) {
|
|
4
4
|
if (args.length < required) {
|
|
@@ -6,6 +6,7 @@ function requiredArgs(required, args) {
|
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
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); }
|
|
9
10
|
/**
|
|
10
11
|
* @name toDate
|
|
11
12
|
* @category Common Helpers
|
|
@@ -41,7 +42,7 @@ function toDate(argument) {
|
|
|
41
42
|
requiredArgs(1, arguments);
|
|
42
43
|
var argStr = Object.prototype.toString.call(argument); // Clone the date
|
|
43
44
|
|
|
44
|
-
if (argument instanceof Date ||
|
|
45
|
+
if (argument instanceof Date || _typeof$1(argument) === 'object' && argStr === '[object Date]') {
|
|
45
46
|
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
|
46
47
|
return new Date(argument.getTime());
|
|
47
48
|
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
|
@@ -49,7 +50,7 @@ function toDate(argument) {
|
|
|
49
50
|
} else {
|
|
50
51
|
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
|
51
52
|
// eslint-disable-next-line no-console
|
|
52
|
-
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://
|
|
53
|
+
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
|
|
53
54
|
|
|
54
55
|
console.warn(new Error().stack);
|
|
55
56
|
}
|
|
@@ -58,43 +59,56 @@ function toDate(argument) {
|
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
|
|
62
|
+
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); }
|
|
61
63
|
/**
|
|
62
|
-
* @name
|
|
64
|
+
* @name isDate
|
|
63
65
|
* @category Common Helpers
|
|
64
|
-
* @summary Is the given date
|
|
66
|
+
* @summary Is the given value a date?
|
|
65
67
|
*
|
|
66
68
|
* @description
|
|
67
|
-
* Returns
|
|
68
|
-
* Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
|
|
69
|
-
* Invalid Date is a Date, whose time value is NaN.
|
|
69
|
+
* Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
|
|
70
70
|
*
|
|
71
|
-
*
|
|
71
|
+
* @param {*} value - the value to check
|
|
72
|
+
* @returns {boolean} true if the given value is a date
|
|
73
|
+
* @throws {TypeError} 1 arguments required
|
|
72
74
|
*
|
|
73
|
-
*
|
|
75
|
+
* @example
|
|
76
|
+
* // For a valid date:
|
|
77
|
+
* const result = isDate(new Date())
|
|
78
|
+
* //=> true
|
|
74
79
|
*
|
|
75
|
-
*
|
|
80
|
+
* @example
|
|
81
|
+
* // For an invalid date:
|
|
82
|
+
* const result = isDate(new Date(NaN))
|
|
83
|
+
* //=> true
|
|
76
84
|
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
85
|
+
* @example
|
|
86
|
+
* // For some value:
|
|
87
|
+
* const result = isDate('2014-02-31')
|
|
88
|
+
* //=> false
|
|
80
89
|
*
|
|
81
|
-
*
|
|
90
|
+
* @example
|
|
91
|
+
* // For an object:
|
|
92
|
+
* const result = isDate({})
|
|
93
|
+
* //=> false
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
function isDate(value) {
|
|
97
|
+
requiredArgs(1, arguments);
|
|
98
|
+
return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @name isValid
|
|
103
|
+
* @category Common Helpers
|
|
104
|
+
* @summary Is the given date valid?
|
|
82
105
|
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* | `new Date('')` | `false` | `false` |
|
|
88
|
-
* | `new Date(1488370835081)` | `true` | `true` |
|
|
89
|
-
* | `new Date(NaN)` | `false` | `false` |
|
|
90
|
-
* | `'2016-01-01'` | `TypeError` | `false` |
|
|
91
|
-
* | `''` | `TypeError` | `false` |
|
|
92
|
-
* | `1488370835081` | `TypeError` | `true` |
|
|
93
|
-
* | `NaN` | `TypeError` | `false` |
|
|
106
|
+
* @description
|
|
107
|
+
* Returns false if argument is Invalid Date and true otherwise.
|
|
108
|
+
* Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
|
|
109
|
+
* Invalid Date is a Date, whose time value is NaN.
|
|
94
110
|
*
|
|
95
|
-
*
|
|
96
|
-
* that try to coerce arguments to the expected type
|
|
97
|
-
* (which is also the case with other *date-fns* functions).
|
|
111
|
+
* Time value of Date: http://es5.github.io/#x15.9.1.1
|
|
98
112
|
*
|
|
99
113
|
* @param {*} date - the date to check
|
|
100
114
|
* @returns {Boolean} the date is valid
|
|
@@ -102,24 +116,29 @@ function toDate(argument) {
|
|
|
102
116
|
*
|
|
103
117
|
* @example
|
|
104
118
|
* // For the valid date:
|
|
105
|
-
*
|
|
119
|
+
* const result = isValid(new Date(2014, 1, 31))
|
|
106
120
|
* //=> true
|
|
107
121
|
*
|
|
108
122
|
* @example
|
|
109
123
|
* // For the value, convertable into a date:
|
|
110
|
-
*
|
|
124
|
+
* const result = isValid(1393804800000)
|
|
111
125
|
* //=> true
|
|
112
126
|
*
|
|
113
127
|
* @example
|
|
114
128
|
* // For the invalid date:
|
|
115
|
-
*
|
|
129
|
+
* const result = isValid(new Date(''))
|
|
116
130
|
* //=> false
|
|
117
131
|
*/
|
|
118
132
|
|
|
119
133
|
function isValid(dirtyDate) {
|
|
120
134
|
requiredArgs(1, arguments);
|
|
135
|
+
|
|
136
|
+
if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
|
|
121
140
|
var date = toDate(dirtyDate);
|
|
122
|
-
return !isNaN(date);
|
|
141
|
+
return !isNaN(Number(date));
|
|
123
142
|
}
|
|
124
143
|
|
|
125
144
|
function toInteger(dirtyNumber) {
|
|
@@ -144,10 +163,6 @@ function toInteger(dirtyNumber) {
|
|
|
144
163
|
* @description
|
|
145
164
|
* Add the specified number of milliseconds to the given date.
|
|
146
165
|
*
|
|
147
|
-
* ### v2.0.0 breaking changes:
|
|
148
|
-
*
|
|
149
|
-
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
150
|
-
*
|
|
151
166
|
* @param {Date|Number} date - the date to be changed
|
|
152
167
|
* @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`.
|
|
153
168
|
* @returns {Date} the new date with the milliseconds added
|
|
@@ -174,10 +189,6 @@ function addMilliseconds(dirtyDate, dirtyAmount) {
|
|
|
174
189
|
* @description
|
|
175
190
|
* Subtract the specified number of milliseconds from the given date.
|
|
176
191
|
*
|
|
177
|
-
* ### v2.0.0 breaking changes:
|
|
178
|
-
*
|
|
179
|
-
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
180
|
-
*
|
|
181
192
|
* @param {Date|Number} date - the date to be changed
|
|
182
193
|
* @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`.
|
|
183
194
|
* @returns {Date} the new date with the milliseconds subtracted
|
|
@@ -195,103 +206,7 @@ function subMilliseconds(dirtyDate, dirtyAmount) {
|
|
|
195
206
|
return addMilliseconds(dirtyDate, -amount);
|
|
196
207
|
}
|
|
197
208
|
|
|
198
|
-
|
|
199
|
-
var sign = number < 0 ? '-' : '';
|
|
200
|
-
var output = Math.abs(number).toString();
|
|
201
|
-
|
|
202
|
-
while (output.length < targetLength) {
|
|
203
|
-
output = '0' + output;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
return sign + output;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/*
|
|
210
|
-
* | | Unit | | Unit |
|
|
211
|
-
* |-----|--------------------------------|-----|--------------------------------|
|
|
212
|
-
* | a | AM, PM | A* | |
|
|
213
|
-
* | d | Day of month | D | |
|
|
214
|
-
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
215
|
-
* | m | Minute | M | Month |
|
|
216
|
-
* | s | Second | S | Fraction of second |
|
|
217
|
-
* | y | Year (abs) | Y | |
|
|
218
|
-
*
|
|
219
|
-
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
220
|
-
*/
|
|
221
|
-
|
|
222
|
-
var formatters$2 = {
|
|
223
|
-
// Year
|
|
224
|
-
y: function (date, token) {
|
|
225
|
-
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
|
|
226
|
-
// | Year | y | yy | yyy | yyyy | yyyyy |
|
|
227
|
-
// |----------|-------|----|-------|-------|-------|
|
|
228
|
-
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
|
|
229
|
-
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
|
|
230
|
-
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
|
231
|
-
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
|
232
|
-
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
|
233
|
-
var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
234
|
-
|
|
235
|
-
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
236
|
-
return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
|
|
237
|
-
},
|
|
238
|
-
// Month
|
|
239
|
-
M: function (date, token) {
|
|
240
|
-
var month = date.getUTCMonth();
|
|
241
|
-
return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
|
|
242
|
-
},
|
|
243
|
-
// Day of the month
|
|
244
|
-
d: function (date, token) {
|
|
245
|
-
return addLeadingZeros(date.getUTCDate(), token.length);
|
|
246
|
-
},
|
|
247
|
-
// AM or PM
|
|
248
|
-
a: function (date, token) {
|
|
249
|
-
var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
|
|
250
|
-
|
|
251
|
-
switch (token) {
|
|
252
|
-
case 'a':
|
|
253
|
-
case 'aa':
|
|
254
|
-
return dayPeriodEnumValue.toUpperCase();
|
|
255
|
-
|
|
256
|
-
case 'aaa':
|
|
257
|
-
return dayPeriodEnumValue;
|
|
258
|
-
|
|
259
|
-
case 'aaaaa':
|
|
260
|
-
return dayPeriodEnumValue[0];
|
|
261
|
-
|
|
262
|
-
case 'aaaa':
|
|
263
|
-
default:
|
|
264
|
-
return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
// Hour [1-12]
|
|
268
|
-
h: function (date, token) {
|
|
269
|
-
return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
|
|
270
|
-
},
|
|
271
|
-
// Hour [0-23]
|
|
272
|
-
H: function (date, token) {
|
|
273
|
-
return addLeadingZeros(date.getUTCHours(), token.length);
|
|
274
|
-
},
|
|
275
|
-
// Minute
|
|
276
|
-
m: function (date, token) {
|
|
277
|
-
return addLeadingZeros(date.getUTCMinutes(), token.length);
|
|
278
|
-
},
|
|
279
|
-
// Second
|
|
280
|
-
s: function (date, token) {
|
|
281
|
-
return addLeadingZeros(date.getUTCSeconds(), token.length);
|
|
282
|
-
},
|
|
283
|
-
// Fraction of second
|
|
284
|
-
S: function (date, token) {
|
|
285
|
-
var numberOfDigits = token.length;
|
|
286
|
-
var milliseconds = date.getUTCMilliseconds();
|
|
287
|
-
var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
|
|
288
|
-
return addLeadingZeros(fractionalSeconds, token.length);
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
|
|
293
|
-
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
294
|
-
|
|
209
|
+
var MILLISECONDS_IN_DAY = 86400000;
|
|
295
210
|
function getUTCDayOfYear(dirtyDate) {
|
|
296
211
|
requiredArgs(1, arguments);
|
|
297
212
|
var date = toDate(dirtyDate);
|
|
@@ -303,8 +218,6 @@ function getUTCDayOfYear(dirtyDate) {
|
|
|
303
218
|
return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
|
|
304
219
|
}
|
|
305
220
|
|
|
306
|
-
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
307
|
-
|
|
308
221
|
function startOfUTCISOWeek(dirtyDate) {
|
|
309
222
|
requiredArgs(1, arguments);
|
|
310
223
|
var weekStartsOn = 1;
|
|
@@ -316,8 +229,6 @@ function startOfUTCISOWeek(dirtyDate) {
|
|
|
316
229
|
return date;
|
|
317
230
|
}
|
|
318
231
|
|
|
319
|
-
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
320
|
-
|
|
321
232
|
function getUTCISOWeekYear(dirtyDate) {
|
|
322
233
|
requiredArgs(1, arguments);
|
|
323
234
|
var date = toDate(dirtyDate);
|
|
@@ -340,8 +251,6 @@ function getUTCISOWeekYear(dirtyDate) {
|
|
|
340
251
|
}
|
|
341
252
|
}
|
|
342
253
|
|
|
343
|
-
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
344
|
-
|
|
345
254
|
function startOfUTCISOWeekYear(dirtyDate) {
|
|
346
255
|
requiredArgs(1, arguments);
|
|
347
256
|
var year = getUTCISOWeekYear(dirtyDate);
|
|
@@ -352,9 +261,7 @@ function startOfUTCISOWeekYear(dirtyDate) {
|
|
|
352
261
|
return date;
|
|
353
262
|
}
|
|
354
263
|
|
|
355
|
-
var MILLISECONDS_IN_WEEK$1 = 604800000;
|
|
356
|
-
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
357
|
-
|
|
264
|
+
var MILLISECONDS_IN_WEEK$1 = 604800000;
|
|
358
265
|
function getUTCISOWeek(dirtyDate) {
|
|
359
266
|
requiredArgs(1, arguments);
|
|
360
267
|
var date = toDate(dirtyDate);
|
|
@@ -365,15 +272,17 @@ function getUTCISOWeek(dirtyDate) {
|
|
|
365
272
|
return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
|
|
366
273
|
}
|
|
367
274
|
|
|
368
|
-
|
|
275
|
+
var defaultOptions = {};
|
|
276
|
+
function getDefaultOptions() {
|
|
277
|
+
return defaultOptions;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function startOfUTCWeek(dirtyDate, options) {
|
|
281
|
+
var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
369
282
|
|
|
370
|
-
function startOfUTCWeek(dirtyDate, dirtyOptions) {
|
|
371
283
|
requiredArgs(1, arguments);
|
|
372
|
-
var
|
|
373
|
-
var locale = options.locale;
|
|
374
|
-
var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
|
|
375
|
-
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
|
|
376
|
-
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
284
|
+
var defaultOptions = getDefaultOptions();
|
|
285
|
+
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
|
|
377
286
|
|
|
378
287
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
379
288
|
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
|
@@ -387,17 +296,14 @@ function startOfUTCWeek(dirtyDate, dirtyOptions) {
|
|
|
387
296
|
return date;
|
|
388
297
|
}
|
|
389
298
|
|
|
390
|
-
|
|
299
|
+
function getUTCWeekYear(dirtyDate, options) {
|
|
300
|
+
var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
391
301
|
|
|
392
|
-
function getUTCWeekYear(dirtyDate, dirtyOptions) {
|
|
393
302
|
requiredArgs(1, arguments);
|
|
394
|
-
var date = toDate(dirtyDate
|
|
303
|
+
var date = toDate(dirtyDate);
|
|
395
304
|
var year = date.getUTCFullYear();
|
|
396
|
-
var
|
|
397
|
-
var locale = options.locale;
|
|
398
|
-
var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
|
|
399
|
-
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
|
400
|
-
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
|
305
|
+
var defaultOptions = getDefaultOptions();
|
|
306
|
+
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
|
|
401
307
|
|
|
402
308
|
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
403
309
|
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
|
@@ -406,11 +312,11 @@ function getUTCWeekYear(dirtyDate, dirtyOptions) {
|
|
|
406
312
|
var firstWeekOfNextYear = new Date(0);
|
|
407
313
|
firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
|
|
408
314
|
firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
|
|
409
|
-
var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear,
|
|
315
|
+
var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
|
|
410
316
|
var firstWeekOfThisYear = new Date(0);
|
|
411
317
|
firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
|
|
412
318
|
firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
|
|
413
|
-
var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear,
|
|
319
|
+
var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
|
|
414
320
|
|
|
415
321
|
if (date.getTime() >= startOfNextYear.getTime()) {
|
|
416
322
|
return year + 1;
|
|
@@ -421,26 +327,21 @@ function getUTCWeekYear(dirtyDate, dirtyOptions) {
|
|
|
421
327
|
}
|
|
422
328
|
}
|
|
423
329
|
|
|
424
|
-
|
|
330
|
+
function startOfUTCWeekYear(dirtyDate, options) {
|
|
331
|
+
var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
425
332
|
|
|
426
|
-
function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
|
|
427
333
|
requiredArgs(1, arguments);
|
|
428
|
-
var
|
|
429
|
-
var locale = options.locale;
|
|
430
|
-
var
|
|
431
|
-
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
|
432
|
-
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
|
|
433
|
-
var year = getUTCWeekYear(dirtyDate, dirtyOptions);
|
|
334
|
+
var defaultOptions = getDefaultOptions();
|
|
335
|
+
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);
|
|
336
|
+
var year = getUTCWeekYear(dirtyDate, options);
|
|
434
337
|
var firstWeek = new Date(0);
|
|
435
338
|
firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
|
|
436
339
|
firstWeek.setUTCHours(0, 0, 0, 0);
|
|
437
|
-
var date = startOfUTCWeek(firstWeek,
|
|
340
|
+
var date = startOfUTCWeek(firstWeek, options);
|
|
438
341
|
return date;
|
|
439
342
|
}
|
|
440
343
|
|
|
441
|
-
var MILLISECONDS_IN_WEEK = 604800000;
|
|
442
|
-
// See issue: https://github.com/date-fns/date-fns/issues/376
|
|
443
|
-
|
|
344
|
+
var MILLISECONDS_IN_WEEK = 604800000;
|
|
444
345
|
function getUTCWeek(dirtyDate, options) {
|
|
445
346
|
requiredArgs(1, arguments);
|
|
446
347
|
var date = toDate(dirtyDate);
|
|
@@ -451,6 +352,100 @@ function getUTCWeek(dirtyDate, options) {
|
|
|
451
352
|
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
|
|
452
353
|
}
|
|
453
354
|
|
|
355
|
+
function addLeadingZeros(number, targetLength) {
|
|
356
|
+
var sign = number < 0 ? '-' : '';
|
|
357
|
+
var output = Math.abs(number).toString();
|
|
358
|
+
|
|
359
|
+
while (output.length < targetLength) {
|
|
360
|
+
output = '0' + output;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return sign + output;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/*
|
|
367
|
+
* | | Unit | | Unit |
|
|
368
|
+
* |-----|--------------------------------|-----|--------------------------------|
|
|
369
|
+
* | a | AM, PM | A* | |
|
|
370
|
+
* | d | Day of month | D | |
|
|
371
|
+
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
372
|
+
* | m | Minute | M | Month |
|
|
373
|
+
* | s | Second | S | Fraction of second |
|
|
374
|
+
* | y | Year (abs) | Y | |
|
|
375
|
+
*
|
|
376
|
+
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
377
|
+
*/
|
|
378
|
+
|
|
379
|
+
var formatters$2 = {
|
|
380
|
+
// Year
|
|
381
|
+
y: function y(date, token) {
|
|
382
|
+
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
|
|
383
|
+
// | Year | y | yy | yyy | yyyy | yyyyy |
|
|
384
|
+
// |----------|-------|----|-------|-------|-------|
|
|
385
|
+
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
|
|
386
|
+
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
|
|
387
|
+
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
|
388
|
+
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
|
389
|
+
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
|
390
|
+
var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
391
|
+
|
|
392
|
+
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
393
|
+
return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
|
|
394
|
+
},
|
|
395
|
+
// Month
|
|
396
|
+
M: function M(date, token) {
|
|
397
|
+
var month = date.getUTCMonth();
|
|
398
|
+
return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
|
|
399
|
+
},
|
|
400
|
+
// Day of the month
|
|
401
|
+
d: function d(date, token) {
|
|
402
|
+
return addLeadingZeros(date.getUTCDate(), token.length);
|
|
403
|
+
},
|
|
404
|
+
// AM or PM
|
|
405
|
+
a: function a(date, token) {
|
|
406
|
+
var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
|
|
407
|
+
|
|
408
|
+
switch (token) {
|
|
409
|
+
case 'a':
|
|
410
|
+
case 'aa':
|
|
411
|
+
return dayPeriodEnumValue.toUpperCase();
|
|
412
|
+
|
|
413
|
+
case 'aaa':
|
|
414
|
+
return dayPeriodEnumValue;
|
|
415
|
+
|
|
416
|
+
case 'aaaaa':
|
|
417
|
+
return dayPeriodEnumValue[0];
|
|
418
|
+
|
|
419
|
+
case 'aaaa':
|
|
420
|
+
default:
|
|
421
|
+
return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
// Hour [1-12]
|
|
425
|
+
h: function h(date, token) {
|
|
426
|
+
return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
|
|
427
|
+
},
|
|
428
|
+
// Hour [0-23]
|
|
429
|
+
H: function H(date, token) {
|
|
430
|
+
return addLeadingZeros(date.getUTCHours(), token.length);
|
|
431
|
+
},
|
|
432
|
+
// Minute
|
|
433
|
+
m: function m(date, token) {
|
|
434
|
+
return addLeadingZeros(date.getUTCMinutes(), token.length);
|
|
435
|
+
},
|
|
436
|
+
// Second
|
|
437
|
+
s: function s(date, token) {
|
|
438
|
+
return addLeadingZeros(date.getUTCSeconds(), token.length);
|
|
439
|
+
},
|
|
440
|
+
// Fraction of second
|
|
441
|
+
S: function S(date, token) {
|
|
442
|
+
var numberOfDigits = token.length;
|
|
443
|
+
var milliseconds = date.getUTCMilliseconds();
|
|
444
|
+
var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
|
|
445
|
+
return addLeadingZeros(fractionalSeconds, token.length);
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
|
|
454
449
|
var dayPeriodEnum = {
|
|
455
450
|
am: 'am',
|
|
456
451
|
pm: 'pm',
|
|
@@ -460,56 +455,56 @@ var dayPeriodEnum = {
|
|
|
460
455
|
afternoon: 'afternoon',
|
|
461
456
|
evening: 'evening',
|
|
462
457
|
night: 'night'
|
|
463
|
-
/*
|
|
464
|
-
* | | Unit | | Unit |
|
|
465
|
-
* |-----|--------------------------------|-----|--------------------------------|
|
|
466
|
-
* | a | AM, PM | A* | Milliseconds in day |
|
|
467
|
-
* | b | AM, PM, noon, midnight | B | Flexible day period |
|
|
468
|
-
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
|
|
469
|
-
* | d | Day of month | D | Day of year |
|
|
470
|
-
* | e | Local day of week | E | Day of week |
|
|
471
|
-
* | f | | F* | Day of week in month |
|
|
472
|
-
* | g* | Modified Julian day | G | Era |
|
|
473
|
-
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
474
|
-
* | i! | ISO day of week | I! | ISO week of year |
|
|
475
|
-
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
|
|
476
|
-
* | k | Hour [1-24] | K | Hour [0-11] |
|
|
477
|
-
* | l* | (deprecated) | L | Stand-alone month |
|
|
478
|
-
* | m | Minute | M | Month |
|
|
479
|
-
* | n | | N | |
|
|
480
|
-
* | o! | Ordinal number modifier | O | Timezone (GMT) |
|
|
481
|
-
* | p! | Long localized time | P! | Long localized date |
|
|
482
|
-
* | q | Stand-alone quarter | Q | Quarter |
|
|
483
|
-
* | r* | Related Gregorian year | R! | ISO week-numbering year |
|
|
484
|
-
* | s | Second | S | Fraction of second |
|
|
485
|
-
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
|
|
486
|
-
* | u | Extended year | U* | Cyclic year |
|
|
487
|
-
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
|
|
488
|
-
* | w | Local week of year | W* | Week of month |
|
|
489
|
-
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
|
|
490
|
-
* | y | Year (abs) | Y | Local week-numbering year |
|
|
491
|
-
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
|
|
492
|
-
*
|
|
493
|
-
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
494
|
-
*
|
|
495
|
-
* Letters marked by ! are non-standard, but implemented by date-fns:
|
|
496
|
-
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
|
|
497
|
-
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
|
|
498
|
-
* i.e. 7 for Sunday, 1 for Monday, etc.
|
|
499
|
-
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
|
|
500
|
-
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
|
|
501
|
-
* `R` is supposed to be used in conjunction with `I` and `i`
|
|
502
|
-
* for universal ISO week-numbering date, whereas
|
|
503
|
-
* `Y` is supposed to be used in conjunction with `w` and `e`
|
|
504
|
-
* for week-numbering date specific to the locale.
|
|
505
|
-
* - `P` is long localized date format
|
|
506
|
-
* - `p` is long localized time format
|
|
507
|
-
*/
|
|
508
|
-
|
|
509
458
|
};
|
|
459
|
+
|
|
460
|
+
/*
|
|
461
|
+
* | | Unit | | Unit |
|
|
462
|
+
* |-----|--------------------------------|-----|--------------------------------|
|
|
463
|
+
* | a | AM, PM | A* | Milliseconds in day |
|
|
464
|
+
* | b | AM, PM, noon, midnight | B | Flexible day period |
|
|
465
|
+
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
|
|
466
|
+
* | d | Day of month | D | Day of year |
|
|
467
|
+
* | e | Local day of week | E | Day of week |
|
|
468
|
+
* | f | | F* | Day of week in month |
|
|
469
|
+
* | g* | Modified Julian day | G | Era |
|
|
470
|
+
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
471
|
+
* | i! | ISO day of week | I! | ISO week of year |
|
|
472
|
+
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
|
|
473
|
+
* | k | Hour [1-24] | K | Hour [0-11] |
|
|
474
|
+
* | l* | (deprecated) | L | Stand-alone month |
|
|
475
|
+
* | m | Minute | M | Month |
|
|
476
|
+
* | n | | N | |
|
|
477
|
+
* | o! | Ordinal number modifier | O | Timezone (GMT) |
|
|
478
|
+
* | p! | Long localized time | P! | Long localized date |
|
|
479
|
+
* | q | Stand-alone quarter | Q | Quarter |
|
|
480
|
+
* | r* | Related Gregorian year | R! | ISO week-numbering year |
|
|
481
|
+
* | s | Second | S | Fraction of second |
|
|
482
|
+
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
|
|
483
|
+
* | u | Extended year | U* | Cyclic year |
|
|
484
|
+
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
|
|
485
|
+
* | w | Local week of year | W* | Week of month |
|
|
486
|
+
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
|
|
487
|
+
* | y | Year (abs) | Y | Local week-numbering year |
|
|
488
|
+
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
|
|
489
|
+
*
|
|
490
|
+
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
491
|
+
*
|
|
492
|
+
* Letters marked by ! are non-standard, but implemented by date-fns:
|
|
493
|
+
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
|
|
494
|
+
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
|
|
495
|
+
* i.e. 7 for Sunday, 1 for Monday, etc.
|
|
496
|
+
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
|
|
497
|
+
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
|
|
498
|
+
* `R` is supposed to be used in conjunction with `I` and `i`
|
|
499
|
+
* for universal ISO week-numbering date, whereas
|
|
500
|
+
* `Y` is supposed to be used in conjunction with `w` and `e`
|
|
501
|
+
* for week-numbering date specific to the locale.
|
|
502
|
+
* - `P` is long localized date format
|
|
503
|
+
* - `p` is long localized time format
|
|
504
|
+
*/
|
|
510
505
|
var formatters = {
|
|
511
506
|
// Era
|
|
512
|
-
G: function (date, token, localize) {
|
|
507
|
+
G: function G(date, token, localize) {
|
|
513
508
|
var era = date.getUTCFullYear() > 0 ? 1 : 0;
|
|
514
509
|
|
|
515
510
|
switch (token) {
|
|
@@ -536,7 +531,7 @@ var formatters = {
|
|
|
536
531
|
}
|
|
537
532
|
},
|
|
538
533
|
// Year
|
|
539
|
-
y: function (date, token, localize) {
|
|
534
|
+
y: function y(date, token, localize) {
|
|
540
535
|
// Ordinal number
|
|
541
536
|
if (token === 'yo') {
|
|
542
537
|
var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
@@ -550,7 +545,7 @@ var formatters = {
|
|
|
550
545
|
return formatters$2.y(date, token);
|
|
551
546
|
},
|
|
552
547
|
// Local week-numbering year
|
|
553
|
-
Y: function (date, token, localize, options) {
|
|
548
|
+
Y: function Y(date, token, localize, options) {
|
|
554
549
|
var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
555
550
|
|
|
556
551
|
var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
|
|
@@ -571,7 +566,7 @@ var formatters = {
|
|
|
571
566
|
return addLeadingZeros(weekYear, token.length);
|
|
572
567
|
},
|
|
573
568
|
// ISO week-numbering year
|
|
574
|
-
R: function (date, token) {
|
|
569
|
+
R: function R(date, token) {
|
|
575
570
|
var isoWeekYear = getUTCISOWeekYear(date); // Padding
|
|
576
571
|
|
|
577
572
|
return addLeadingZeros(isoWeekYear, token.length);
|
|
@@ -585,12 +580,12 @@ var formatters = {
|
|
|
585
580
|
// | BC 2 | 2 | -1 |
|
|
586
581
|
// Also `yy` always returns the last two digits of a year,
|
|
587
582
|
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
588
|
-
u: function (date, token) {
|
|
583
|
+
u: function u(date, token) {
|
|
589
584
|
var year = date.getUTCFullYear();
|
|
590
585
|
return addLeadingZeros(year, token.length);
|
|
591
586
|
},
|
|
592
587
|
// Quarter
|
|
593
|
-
Q: function (date, token, localize) {
|
|
588
|
+
Q: function Q(date, token, localize) {
|
|
594
589
|
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
595
590
|
|
|
596
591
|
switch (token) {
|
|
@@ -632,7 +627,7 @@ var formatters = {
|
|
|
632
627
|
}
|
|
633
628
|
},
|
|
634
629
|
// Stand-alone quarter
|
|
635
|
-
q: function (date, token, localize) {
|
|
630
|
+
q: function q(date, token, localize) {
|
|
636
631
|
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
637
632
|
|
|
638
633
|
switch (token) {
|
|
@@ -674,7 +669,7 @@ var formatters = {
|
|
|
674
669
|
}
|
|
675
670
|
},
|
|
676
671
|
// Month
|
|
677
|
-
M: function (date, token, localize) {
|
|
672
|
+
M: function M(date, token, localize) {
|
|
678
673
|
var month = date.getUTCMonth();
|
|
679
674
|
|
|
680
675
|
switch (token) {
|
|
@@ -712,7 +707,7 @@ var formatters = {
|
|
|
712
707
|
}
|
|
713
708
|
},
|
|
714
709
|
// Stand-alone month
|
|
715
|
-
L: function (date, token, localize) {
|
|
710
|
+
L: function L(date, token, localize) {
|
|
716
711
|
var month = date.getUTCMonth();
|
|
717
712
|
|
|
718
713
|
switch (token) {
|
|
@@ -754,7 +749,7 @@ var formatters = {
|
|
|
754
749
|
}
|
|
755
750
|
},
|
|
756
751
|
// Local week of year
|
|
757
|
-
w: function (date, token, localize, options) {
|
|
752
|
+
w: function w(date, token, localize, options) {
|
|
758
753
|
var week = getUTCWeek(date, options);
|
|
759
754
|
|
|
760
755
|
if (token === 'wo') {
|
|
@@ -766,7 +761,7 @@ var formatters = {
|
|
|
766
761
|
return addLeadingZeros(week, token.length);
|
|
767
762
|
},
|
|
768
763
|
// ISO week of year
|
|
769
|
-
I: function (date, token, localize) {
|
|
764
|
+
I: function I(date, token, localize) {
|
|
770
765
|
var isoWeek = getUTCISOWeek(date);
|
|
771
766
|
|
|
772
767
|
if (token === 'Io') {
|
|
@@ -778,7 +773,7 @@ var formatters = {
|
|
|
778
773
|
return addLeadingZeros(isoWeek, token.length);
|
|
779
774
|
},
|
|
780
775
|
// Day of the month
|
|
781
|
-
d: function (date, token, localize) {
|
|
776
|
+
d: function d(date, token, localize) {
|
|
782
777
|
if (token === 'do') {
|
|
783
778
|
return localize.ordinalNumber(date.getUTCDate(), {
|
|
784
779
|
unit: 'date'
|
|
@@ -788,7 +783,7 @@ var formatters = {
|
|
|
788
783
|
return formatters$2.d(date, token);
|
|
789
784
|
},
|
|
790
785
|
// Day of year
|
|
791
|
-
D: function (date, token, localize) {
|
|
786
|
+
D: function D(date, token, localize) {
|
|
792
787
|
var dayOfYear = getUTCDayOfYear(date);
|
|
793
788
|
|
|
794
789
|
if (token === 'Do') {
|
|
@@ -800,7 +795,7 @@ var formatters = {
|
|
|
800
795
|
return addLeadingZeros(dayOfYear, token.length);
|
|
801
796
|
},
|
|
802
797
|
// Day of week
|
|
803
|
-
E: function (date, token, localize) {
|
|
798
|
+
E: function E(date, token, localize) {
|
|
804
799
|
var dayOfWeek = date.getUTCDay();
|
|
805
800
|
|
|
806
801
|
switch (token) {
|
|
@@ -837,7 +832,7 @@ var formatters = {
|
|
|
837
832
|
}
|
|
838
833
|
},
|
|
839
834
|
// Local day of week
|
|
840
|
-
e: function (date, token, localize, options) {
|
|
835
|
+
e: function e(date, token, localize, options) {
|
|
841
836
|
var dayOfWeek = date.getUTCDay();
|
|
842
837
|
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
843
838
|
|
|
@@ -886,7 +881,7 @@ var formatters = {
|
|
|
886
881
|
}
|
|
887
882
|
},
|
|
888
883
|
// Stand-alone local day of week
|
|
889
|
-
c: function (date, token, localize, options) {
|
|
884
|
+
c: function c(date, token, localize, options) {
|
|
890
885
|
var dayOfWeek = date.getUTCDay();
|
|
891
886
|
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
892
887
|
|
|
@@ -935,7 +930,7 @@ var formatters = {
|
|
|
935
930
|
}
|
|
936
931
|
},
|
|
937
932
|
// ISO day of week
|
|
938
|
-
i: function (date, token, localize) {
|
|
933
|
+
i: function i(date, token, localize) {
|
|
939
934
|
var dayOfWeek = date.getUTCDay();
|
|
940
935
|
var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
|
941
936
|
|
|
@@ -985,7 +980,7 @@ var formatters = {
|
|
|
985
980
|
}
|
|
986
981
|
},
|
|
987
982
|
// AM or PM
|
|
988
|
-
a: function (date, token, localize) {
|
|
983
|
+
a: function a(date, token, localize) {
|
|
989
984
|
var hours = date.getUTCHours();
|
|
990
985
|
var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
|
|
991
986
|
|
|
@@ -1018,7 +1013,7 @@ var formatters = {
|
|
|
1018
1013
|
}
|
|
1019
1014
|
},
|
|
1020
1015
|
// AM, PM, midnight, noon
|
|
1021
|
-
b: function (date, token, localize) {
|
|
1016
|
+
b: function b(date, token, localize) {
|
|
1022
1017
|
var hours = date.getUTCHours();
|
|
1023
1018
|
var dayPeriodEnumValue;
|
|
1024
1019
|
|
|
@@ -1059,7 +1054,7 @@ var formatters = {
|
|
|
1059
1054
|
}
|
|
1060
1055
|
},
|
|
1061
1056
|
// in the morning, in the afternoon, in the evening, at night
|
|
1062
|
-
B: function (date, token, localize) {
|
|
1057
|
+
B: function B(date, token, localize) {
|
|
1063
1058
|
var hours = date.getUTCHours();
|
|
1064
1059
|
var dayPeriodEnumValue;
|
|
1065
1060
|
|
|
@@ -1097,7 +1092,7 @@ var formatters = {
|
|
|
1097
1092
|
}
|
|
1098
1093
|
},
|
|
1099
1094
|
// Hour [1-12]
|
|
1100
|
-
h: function (date, token, localize) {
|
|
1095
|
+
h: function h(date, token, localize) {
|
|
1101
1096
|
if (token === 'ho') {
|
|
1102
1097
|
var hours = date.getUTCHours() % 12;
|
|
1103
1098
|
if (hours === 0) hours = 12;
|
|
@@ -1109,7 +1104,7 @@ var formatters = {
|
|
|
1109
1104
|
return formatters$2.h(date, token);
|
|
1110
1105
|
},
|
|
1111
1106
|
// Hour [0-23]
|
|
1112
|
-
H: function (date, token, localize) {
|
|
1107
|
+
H: function H(date, token, localize) {
|
|
1113
1108
|
if (token === 'Ho') {
|
|
1114
1109
|
return localize.ordinalNumber(date.getUTCHours(), {
|
|
1115
1110
|
unit: 'hour'
|
|
@@ -1119,7 +1114,7 @@ var formatters = {
|
|
|
1119
1114
|
return formatters$2.H(date, token);
|
|
1120
1115
|
},
|
|
1121
1116
|
// Hour [0-11]
|
|
1122
|
-
K: function (date, token, localize) {
|
|
1117
|
+
K: function K(date, token, localize) {
|
|
1123
1118
|
var hours = date.getUTCHours() % 12;
|
|
1124
1119
|
|
|
1125
1120
|
if (token === 'Ko') {
|
|
@@ -1131,7 +1126,7 @@ var formatters = {
|
|
|
1131
1126
|
return addLeadingZeros(hours, token.length);
|
|
1132
1127
|
},
|
|
1133
1128
|
// Hour [1-24]
|
|
1134
|
-
k: function (date, token, localize) {
|
|
1129
|
+
k: function k(date, token, localize) {
|
|
1135
1130
|
var hours = date.getUTCHours();
|
|
1136
1131
|
if (hours === 0) hours = 24;
|
|
1137
1132
|
|
|
@@ -1144,7 +1139,7 @@ var formatters = {
|
|
|
1144
1139
|
return addLeadingZeros(hours, token.length);
|
|
1145
1140
|
},
|
|
1146
1141
|
// Minute
|
|
1147
|
-
m: function (date, token, localize) {
|
|
1142
|
+
m: function m(date, token, localize) {
|
|
1148
1143
|
if (token === 'mo') {
|
|
1149
1144
|
return localize.ordinalNumber(date.getUTCMinutes(), {
|
|
1150
1145
|
unit: 'minute'
|
|
@@ -1154,7 +1149,7 @@ var formatters = {
|
|
|
1154
1149
|
return formatters$2.m(date, token);
|
|
1155
1150
|
},
|
|
1156
1151
|
// Second
|
|
1157
|
-
s: function (date, token, localize) {
|
|
1152
|
+
s: function s(date, token, localize) {
|
|
1158
1153
|
if (token === 'so') {
|
|
1159
1154
|
return localize.ordinalNumber(date.getUTCSeconds(), {
|
|
1160
1155
|
unit: 'second'
|
|
@@ -1164,11 +1159,11 @@ var formatters = {
|
|
|
1164
1159
|
return formatters$2.s(date, token);
|
|
1165
1160
|
},
|
|
1166
1161
|
// Fraction of second
|
|
1167
|
-
S: function (date, token) {
|
|
1162
|
+
S: function S(date, token) {
|
|
1168
1163
|
return formatters$2.S(date, token);
|
|
1169
1164
|
},
|
|
1170
1165
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1171
|
-
X: function (date, token, _localize, options) {
|
|
1166
|
+
X: function X(date, token, _localize, options) {
|
|
1172
1167
|
var originalDate = options._originalDate || date;
|
|
1173
1168
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1174
1169
|
|
|
@@ -1200,7 +1195,7 @@ var formatters = {
|
|
|
1200
1195
|
}
|
|
1201
1196
|
},
|
|
1202
1197
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1203
|
-
x: function (date, token, _localize, options) {
|
|
1198
|
+
x: function x(date, token, _localize, options) {
|
|
1204
1199
|
var originalDate = options._originalDate || date;
|
|
1205
1200
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1206
1201
|
|
|
@@ -1228,7 +1223,7 @@ var formatters = {
|
|
|
1228
1223
|
}
|
|
1229
1224
|
},
|
|
1230
1225
|
// Timezone (GMT)
|
|
1231
|
-
O: function (date, token, _localize, options) {
|
|
1226
|
+
O: function O(date, token, _localize, options) {
|
|
1232
1227
|
var originalDate = options._originalDate || date;
|
|
1233
1228
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1234
1229
|
|
|
@@ -1246,7 +1241,7 @@ var formatters = {
|
|
|
1246
1241
|
}
|
|
1247
1242
|
},
|
|
1248
1243
|
// Timezone (specific non-location)
|
|
1249
|
-
z: function (date, token, _localize, options) {
|
|
1244
|
+
z: function z(date, token, _localize, options) {
|
|
1250
1245
|
var originalDate = options._originalDate || date;
|
|
1251
1246
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1252
1247
|
|
|
@@ -1264,13 +1259,13 @@ var formatters = {
|
|
|
1264
1259
|
}
|
|
1265
1260
|
},
|
|
1266
1261
|
// Seconds timestamp
|
|
1267
|
-
t: function (date, token, _localize, options) {
|
|
1262
|
+
t: function t(date, token, _localize, options) {
|
|
1268
1263
|
var originalDate = options._originalDate || date;
|
|
1269
1264
|
var timestamp = Math.floor(originalDate.getTime() / 1000);
|
|
1270
1265
|
return addLeadingZeros(timestamp, token.length);
|
|
1271
1266
|
},
|
|
1272
1267
|
// Milliseconds timestamp
|
|
1273
|
-
T: function (date, token, _localize, options) {
|
|
1268
|
+
T: function T(date, token, _localize, options) {
|
|
1274
1269
|
var originalDate = options._originalDate || date;
|
|
1275
1270
|
var timestamp = originalDate.getTime();
|
|
1276
1271
|
return addLeadingZeros(timestamp, token.length);
|
|
@@ -1311,7 +1306,7 @@ function formatTimezone(offset, dirtyDelimiter) {
|
|
|
1311
1306
|
|
|
1312
1307
|
var formatters$1 = formatters;
|
|
1313
1308
|
|
|
1314
|
-
function dateLongFormatter(pattern, formatLong) {
|
|
1309
|
+
var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
|
|
1315
1310
|
switch (pattern) {
|
|
1316
1311
|
case 'P':
|
|
1317
1312
|
return formatLong.date({
|
|
@@ -1334,9 +1329,9 @@ function dateLongFormatter(pattern, formatLong) {
|
|
|
1334
1329
|
width: 'full'
|
|
1335
1330
|
});
|
|
1336
1331
|
}
|
|
1337
|
-
}
|
|
1332
|
+
};
|
|
1338
1333
|
|
|
1339
|
-
function timeLongFormatter(pattern, formatLong) {
|
|
1334
|
+
var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
|
|
1340
1335
|
switch (pattern) {
|
|
1341
1336
|
case 'p':
|
|
1342
1337
|
return formatLong.time({
|
|
@@ -1359,10 +1354,10 @@ function timeLongFormatter(pattern, formatLong) {
|
|
|
1359
1354
|
width: 'full'
|
|
1360
1355
|
});
|
|
1361
1356
|
}
|
|
1362
|
-
}
|
|
1357
|
+
};
|
|
1363
1358
|
|
|
1364
|
-
function dateTimeLongFormatter(pattern, formatLong) {
|
|
1365
|
-
var matchResult = pattern.match(/(P+)(p+)?/);
|
|
1359
|
+
var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
|
|
1360
|
+
var matchResult = pattern.match(/(P+)(p+)?/) || [];
|
|
1366
1361
|
var datePattern = matchResult[1];
|
|
1367
1362
|
var timePattern = matchResult[2];
|
|
1368
1363
|
|
|
@@ -1400,7 +1395,7 @@ function dateTimeLongFormatter(pattern, formatLong) {
|
|
|
1400
1395
|
}
|
|
1401
1396
|
|
|
1402
1397
|
return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
|
|
1403
|
-
}
|
|
1398
|
+
};
|
|
1404
1399
|
|
|
1405
1400
|
var longFormatters = {
|
|
1406
1401
|
p: timeLongFormatter,
|
|
@@ -1435,13 +1430,13 @@ function isProtectedWeekYearToken(token) {
|
|
|
1435
1430
|
}
|
|
1436
1431
|
function throwProtectedError(token, format, input) {
|
|
1437
1432
|
if (token === 'YYYY') {
|
|
1438
|
-
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://
|
|
1433
|
+
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"));
|
|
1439
1434
|
} else if (token === 'YY') {
|
|
1440
|
-
throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://
|
|
1435
|
+
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"));
|
|
1441
1436
|
} else if (token === 'D') {
|
|
1442
|
-
throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://
|
|
1437
|
+
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"));
|
|
1443
1438
|
} else if (token === 'DD') {
|
|
1444
|
-
throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://
|
|
1439
|
+
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"));
|
|
1445
1440
|
}
|
|
1446
1441
|
}
|
|
1447
1442
|
|
|
@@ -1472,7 +1467,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
1472
1467
|
* Return the formatted date string in the given format. The result may vary by locale.
|
|
1473
1468
|
*
|
|
1474
1469
|
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
|
|
1475
|
-
* > See: https://
|
|
1470
|
+
* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
1476
1471
|
*
|
|
1477
1472
|
* The characters wrapped between two single quotes characters (') are escaped.
|
|
1478
1473
|
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
|
|
@@ -1551,28 +1546,28 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
1551
1546
|
* | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
|
|
1552
1547
|
* | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
|
|
1553
1548
|
* | | EEEEE | M, T, W, T, F, S, S | |
|
|
1554
|
-
* | | EEEEEE | Mo, Tu, We, Th, Fr,
|
|
1549
|
+
* | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
1555
1550
|
* | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
|
|
1556
1551
|
* | | io | 1st, 2nd, ..., 7th | 7 |
|
|
1557
1552
|
* | | ii | 01, 02, ..., 07 | 7 |
|
|
1558
1553
|
* | | iii | Mon, Tue, Wed, ..., Sun | 7 |
|
|
1559
1554
|
* | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
|
|
1560
1555
|
* | | iiiii | M, T, W, T, F, S, S | 7 |
|
|
1561
|
-
* | | iiiiii | Mo, Tu, We, Th, Fr,
|
|
1556
|
+
* | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
|
|
1562
1557
|
* | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
|
|
1563
1558
|
* | | eo | 2nd, 3rd, ..., 1st | 7 |
|
|
1564
1559
|
* | | ee | 02, 03, ..., 01 | |
|
|
1565
1560
|
* | | eee | Mon, Tue, Wed, ..., Sun | |
|
|
1566
1561
|
* | | eeee | Monday, Tuesday, ..., Sunday | 2 |
|
|
1567
1562
|
* | | eeeee | M, T, W, T, F, S, S | |
|
|
1568
|
-
* | | eeeeee | Mo, Tu, We, Th, Fr,
|
|
1563
|
+
* | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
1569
1564
|
* | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
|
|
1570
1565
|
* | | co | 2nd, 3rd, ..., 1st | 7 |
|
|
1571
1566
|
* | | cc | 02, 03, ..., 01 | |
|
|
1572
1567
|
* | | ccc | Mon, Tue, Wed, ..., Sun | |
|
|
1573
1568
|
* | | cccc | Monday, Tuesday, ..., Sunday | 2 |
|
|
1574
1569
|
* | | ccccc | M, T, W, T, F, S, S | |
|
|
1575
|
-
* | | cccccc | Mo, Tu, We, Th, Fr,
|
|
1570
|
+
* | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
1576
1571
|
* | AM, PM | a..aa | AM, PM | |
|
|
1577
1572
|
* | | aaa | am, pm | |
|
|
1578
1573
|
* | | aaaa | a.m., p.m. | 2 |
|
|
@@ -1708,30 +1703,10 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
1708
1703
|
* - `p`: long localized time
|
|
1709
1704
|
*
|
|
1710
1705
|
* 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
|
|
1711
|
-
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://
|
|
1712
|
-
*
|
|
1713
|
-
* 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
|
|
1714
|
-
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
|
|
1715
|
-
*
|
|
1716
|
-
* ### v2.0.0 breaking changes:
|
|
1717
|
-
*
|
|
1718
|
-
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
1719
|
-
*
|
|
1720
|
-
* - The second argument is now required for the sake of explicitness.
|
|
1706
|
+
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
1721
1707
|
*
|
|
1722
|
-
*
|
|
1723
|
-
*
|
|
1724
|
-
* format(new Date(2016, 0, 1))
|
|
1725
|
-
*
|
|
1726
|
-
* // v2.0.0 onward
|
|
1727
|
-
* format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
|
|
1728
|
-
* ```
|
|
1729
|
-
*
|
|
1730
|
-
* - New format string API for `format` function
|
|
1731
|
-
* which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
|
|
1732
|
-
* See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
|
|
1733
|
-
*
|
|
1734
|
-
* - Characters are now escaped using single quote symbols (`'`) instead of square brackets.
|
|
1708
|
+
* 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
|
|
1709
|
+
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
1735
1710
|
*
|
|
1736
1711
|
* @param {Date|Number} date - the original date
|
|
1737
1712
|
* @param {String} format - the string of tokens
|
|
@@ -1740,9 +1715,9 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
1740
1715
|
* @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
|
|
1741
1716
|
* @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
|
|
1742
1717
|
* @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
|
|
1743
|
-
* see: https://
|
|
1718
|
+
* see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
1744
1719
|
* @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
|
|
1745
|
-
* see: https://
|
|
1720
|
+
* see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
1746
1721
|
* @returns {String} the formatted date string
|
|
1747
1722
|
* @throws {TypeError} 2 arguments required
|
|
1748
1723
|
* @throws {RangeError} `date` must not be Invalid Date
|
|
@@ -1750,47 +1725,45 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
1750
1725
|
* @throws {RangeError} `options.locale` must contain `formatLong` property
|
|
1751
1726
|
* @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
|
|
1752
1727
|
* @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
|
|
1753
|
-
* @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://
|
|
1754
|
-
* @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://
|
|
1755
|
-
* @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://
|
|
1756
|
-
* @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://
|
|
1728
|
+
* @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
|
|
1729
|
+
* @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
|
|
1730
|
+
* @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
|
|
1731
|
+
* @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
|
|
1757
1732
|
* @throws {RangeError} format string contains an unescaped latin alphabet character
|
|
1758
1733
|
*
|
|
1759
1734
|
* @example
|
|
1760
1735
|
* // Represent 11 February 2014 in middle-endian format:
|
|
1761
|
-
*
|
|
1736
|
+
* const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
|
|
1762
1737
|
* //=> '02/11/2014'
|
|
1763
1738
|
*
|
|
1764
1739
|
* @example
|
|
1765
1740
|
* // Represent 2 July 2014 in Esperanto:
|
|
1766
1741
|
* import { eoLocale } from 'date-fns/locale/eo'
|
|
1767
|
-
*
|
|
1742
|
+
* const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
|
|
1768
1743
|
* locale: eoLocale
|
|
1769
1744
|
* })
|
|
1770
1745
|
* //=> '2-a de julio 2014'
|
|
1771
1746
|
*
|
|
1772
1747
|
* @example
|
|
1773
1748
|
* // Escape string by single quote characters:
|
|
1774
|
-
*
|
|
1749
|
+
* const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
|
|
1775
1750
|
* //=> "3 o'clock"
|
|
1776
1751
|
*/
|
|
1777
1752
|
|
|
1778
|
-
function format(dirtyDate, dirtyFormatStr,
|
|
1753
|
+
function format(dirtyDate, dirtyFormatStr, options) {
|
|
1754
|
+
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;
|
|
1755
|
+
|
|
1779
1756
|
requiredArgs(2, arguments);
|
|
1780
1757
|
var formatStr = String(dirtyFormatStr);
|
|
1781
|
-
var
|
|
1782
|
-
var locale = options.locale
|
|
1783
|
-
var
|
|
1784
|
-
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
|
1785
|
-
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
|
1758
|
+
var defaultOptions = getDefaultOptions();
|
|
1759
|
+
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 : defaultLocale;
|
|
1760
|
+
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
|
|
1786
1761
|
|
|
1787
1762
|
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
1788
1763
|
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
|
1789
1764
|
}
|
|
1790
1765
|
|
|
1791
|
-
var
|
|
1792
|
-
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
|
|
1793
|
-
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
|
1766
|
+
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
|
|
1794
1767
|
|
|
1795
1768
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
1796
1769
|
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
|
@@ -1826,7 +1799,7 @@ function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
|
|
1826
1799
|
|
|
1827
1800
|
if (firstCharacter === 'p' || firstCharacter === 'P') {
|
|
1828
1801
|
var longFormatter = longFormatters$1[firstCharacter];
|
|
1829
|
-
return longFormatter(substring, locale.formatLong
|
|
1802
|
+
return longFormatter(substring, locale.formatLong);
|
|
1830
1803
|
}
|
|
1831
1804
|
|
|
1832
1805
|
return substring;
|
|
@@ -1845,12 +1818,12 @@ function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
|
|
1845
1818
|
var formatter = formatters$1[firstCharacter];
|
|
1846
1819
|
|
|
1847
1820
|
if (formatter) {
|
|
1848
|
-
if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
|
|
1849
|
-
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
|
|
1821
|
+
if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
|
|
1822
|
+
throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
|
|
1850
1823
|
}
|
|
1851
1824
|
|
|
1852
|
-
if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
|
|
1853
|
-
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
|
|
1825
|
+
if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
|
|
1826
|
+
throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
|
|
1854
1827
|
}
|
|
1855
1828
|
|
|
1856
1829
|
return formatter(utcDate, substring, locale.localize, formatterOptions);
|
|
@@ -1866,8 +1839,14 @@ function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
|
|
1866
1839
|
}
|
|
1867
1840
|
|
|
1868
1841
|
function cleanEscapedString(input) {
|
|
1869
|
-
|
|
1842
|
+
var matched = input.match(escapedStringRegExp);
|
|
1843
|
+
|
|
1844
|
+
if (!matched) {
|
|
1845
|
+
return input;
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
return matched[1].replace(doubleQuoteRegExp, "'");
|
|
1870
1849
|
}
|
|
1871
1850
|
|
|
1872
|
-
export { toInteger as a, format as f, getTimezoneOffsetInMilliseconds as g, requiredArgs as r, subMilliseconds as s, toDate as t };
|
|
1873
|
-
//# sourceMappingURL=index-
|
|
1851
|
+
export { toInteger as a, getDefaultOptions as b, format as f, getTimezoneOffsetInMilliseconds as g, requiredArgs as r, subMilliseconds as s, toDate as t };
|
|
1852
|
+
//# sourceMappingURL=index-8095ffa6.js.map
|