@sparkle-learning/core 0.0.27 → 0.0.30
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/dist/cjs/{PrivateRoute-cee9b061.js → PrivateRoute-043bb7d3.js} +6 -40
- package/dist/cjs/{active-router-3bd7b540.js → active-router-eedb3bfe.js} +1 -1
- package/dist/cjs/{animation-05337433.js → animation-6132e37f.js} +28 -4
- package/dist/cjs/app-globals-9869bf67.js +9 -0
- package/dist/cjs/{auth.store-aba3d22f.js → auth.store-ff3fda09.js} +1869 -357
- package/dist/cjs/compass-svg.cjs.entry.js +1 -1
- package/dist/cjs/context-consumer.cjs.entry.js +1 -1
- package/dist/cjs/course-select.cjs.entry.js +1 -1
- package/dist/cjs/{cubic-bezier-24e309bf.js → cubic-bezier-293f4663.js} +3 -0
- package/dist/cjs/dir-5af5259a.js +20 -0
- package/dist/cjs/{facilitator.service-e1e2f719.js → facilitator.service-faac5c0c.js} +1 -1
- package/dist/cjs/feed.service-66405969.js +124 -0
- package/dist/cjs/focus-visible-ad3828a7.js +63 -0
- package/dist/cjs/framework-delegate-2470a246.js +113 -0
- package/dist/cjs/{gesture-controller-e824cfb3.js → gesture-controller-07c31f70.js} +3 -0
- package/dist/cjs/{haptic-415dac5b.js → haptic-91e86eb7.js} +3 -0
- package/dist/cjs/{hardware-back-button-ca468aae.js → hardware-back-button-f7b5d99e.js} +3 -0
- package/dist/cjs/header-mobile-collapse_61.cjs.entry.js +18001 -0
- package/dist/cjs/{helpers-26770c32.js → helpers-7e28976c.js} +122 -3
- package/dist/cjs/{icons-a0fef92b.js → icons-b8a2231a.js} +1 -1
- package/dist/cjs/{index-427d03fb.js → index-185f9c5a.js} +3 -0
- package/dist/cjs/{index-6eff209d.js → index-43642662.js} +24 -3
- package/dist/cjs/{index-7bcd36a0.js → index-459a5fa9.js} +20 -4
- package/dist/cjs/index-8540d72e.js +42 -0
- package/dist/cjs/{index-58b3ee93.js → index-b12edb26.js} +34 -5
- package/dist/cjs/{index-fbf4d3bf.js → index-bae2a754.js} +303 -207
- package/dist/cjs/index.cjs.js +8 -7
- package/dist/cjs/index.es-ef3efdfb.js +10671 -0
- package/dist/cjs/{input-shims-213e83f8.js → input-shims-6c442c9f.js} +34 -10
- package/dist/cjs/ion-accordion-group.cjs.entry.js +197 -0
- package/dist/cjs/ion-accordion.cjs.entry.js +340 -0
- package/dist/cjs/ion-action-sheet_4.cjs.entry.js +2203 -0
- package/dist/cjs/ion-app.cjs.entry.js +23 -8
- package/dist/cjs/ion-back-button.cjs.entry.js +14 -9
- package/dist/cjs/ion-backdrop.cjs.entry.js +3 -3
- package/dist/cjs/ion-badge.cjs.entry.js +3 -3
- package/dist/cjs/ion-breadcrumb.cjs.entry.js +103 -0
- package/dist/cjs/ion-breadcrumbs.cjs.entry.js +135 -0
- package/dist/cjs/ion-buttons_3.cjs.entry.js +7 -6
- package/dist/cjs/ion-card-header.cjs.entry.js +3 -3
- package/dist/cjs/ion-card-subtitle.cjs.entry.js +3 -3
- package/dist/cjs/ion-card-title.cjs.entry.js +3 -3
- package/dist/cjs/ion-chip.cjs.entry.js +3 -3
- package/dist/cjs/ion-content_2.cjs.entry.js +144 -56
- package/dist/cjs/ion-datetime.cjs.entry.js +1902 -779
- package/dist/cjs/ion-fab-button.cjs.entry.js +5 -4
- package/dist/cjs/ion-fab-list.cjs.entry.js +2 -2
- package/dist/cjs/ion-fab.cjs.entry.js +2 -2
- package/dist/cjs/ion-footer.cjs.entry.js +79 -4
- package/dist/cjs/ion-img.cjs.entry.js +33 -7
- package/dist/cjs/ion-infinite-scroll-content.cjs.entry.js +3 -3
- package/dist/cjs/ion-infinite-scroll.cjs.entry.js +4 -2
- package/dist/cjs/ion-item-divider.cjs.entry.js +3 -3
- package/dist/cjs/ion-item-group.cjs.entry.js +2 -2
- package/dist/cjs/ion-item-option.cjs.entry.js +4 -4
- package/dist/cjs/ion-item-options.cjs.entry.js +3 -3
- package/dist/cjs/ion-item-sliding.cjs.entry.js +52 -8
- package/dist/cjs/ion-loading.cjs.entry.js +23 -11
- package/dist/cjs/ion-menu-button.cjs.entry.js +17 -11
- package/dist/cjs/ion-menu-toggle.cjs.entry.js +7 -7
- package/dist/cjs/ion-menu.cjs.entry.js +141 -29
- package/dist/cjs/ion-modal.cjs.entry.js +649 -75
- package/dist/cjs/ion-nav-link.cjs.entry.js +4 -1
- package/dist/cjs/ion-nav.cjs.entry.js +140 -137
- package/dist/cjs/ion-picker-column-internal_2.cjs.entry.js +700 -0
- package/dist/cjs/ion-picker-column.cjs.entry.js +5 -5
- package/dist/cjs/ion-picker.cjs.entry.js +18 -11
- package/dist/cjs/ion-progress-bar.cjs.entry.js +17 -13
- package/dist/cjs/ion-refresher-content.cjs.entry.js +7 -6
- package/dist/cjs/ion-refresher.cjs.entry.js +83 -84
- package/dist/cjs/ion-reorder-group.cjs.entry.js +9 -8
- package/dist/cjs/ion-reorder.cjs.entry.js +5 -4
- package/dist/cjs/ion-route-redirect.cjs.entry.js +1 -1
- package/dist/cjs/ion-route.cjs.entry.js +1 -1
- package/dist/cjs/ion-router-link.cjs.entry.js +3 -3
- package/dist/cjs/ion-router-outlet.cjs.entry.js +50 -12
- package/dist/cjs/ion-router.cjs.entry.js +378 -234
- package/dist/cjs/ion-searchbar.cjs.entry.js +50 -17
- package/dist/cjs/ion-segment-button.cjs.entry.js +12 -9
- package/dist/cjs/ion-segment.cjs.entry.js +89 -10
- package/dist/cjs/ion-select_2.cjs.entry.js +64 -30
- package/dist/cjs/ion-skeleton-text.cjs.entry.js +4 -4
- package/dist/cjs/ion-slide.cjs.entry.js +2 -2
- package/dist/cjs/ion-slides.cjs.entry.js +19 -32
- package/dist/cjs/ion-split-pane.cjs.entry.js +8 -3
- package/dist/cjs/ion-tab-bar.cjs.entry.js +25 -12
- package/dist/cjs/ion-tab-button.cjs.entry.js +2 -2
- package/dist/cjs/ion-tab.cjs.entry.js +3 -2
- package/dist/cjs/ion-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ion-textarea.cjs.entry.js +9 -8
- package/dist/cjs/ion-thumbnail.cjs.entry.js +2 -2
- package/dist/cjs/ion-toast.cjs.entry.js +37 -27
- package/dist/cjs/ion-toggle.cjs.entry.js +15 -15
- package/dist/cjs/ion-virtual-scroll.cjs.entry.js +13 -3
- package/dist/cjs/{ionic-global-4930d319.js → ionic-global-878073d1.js} +103 -77
- package/dist/cjs/{ios.transition-6e1fd3d6.js → ios.transition-c3bfb096.js} +8 -5
- package/dist/cjs/{keyboard-1dcbde6c.js → keyboard-dfd76ac3.js} +3 -0
- package/dist/cjs/loader.cjs.js +5 -5
- package/dist/cjs/localstorage.service-6346a41d.js +40 -0
- package/dist/cjs/{md.transition-3652ad78.js → md.transition-7eb9a1a7.js} +7 -4
- package/dist/cjs/{menu-toggle-util-a8fb4c56.js → menu-toggle-util-cb549c2c.js} +4 -1
- package/dist/cjs/{overlays-08a817ea.js → overlays-0a748609.js} +188 -47
- package/dist/cjs/{purify-596fc2d6.js → purify-d0ad2883.js} +187 -74
- package/dist/cjs/sparkle-animation-player.cjs.entry.js +56 -50
- package/dist/cjs/sparkle-character-intro.cjs.entry.js +26 -0
- package/dist/cjs/sparkle-code.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-compass-post.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-compass.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-core.cjs.js +7 -7
- package/dist/cjs/sparkle-emoji.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +7 -7
- package/dist/cjs/sparkle-feed-post.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-feedback.cjs.entry.js +7 -7
- package/dist/cjs/sparkle-goal-form.cjs.entry.js +15 -14
- package/dist/cjs/sparkle-gww-comment-list.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-gww-graph.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-lower-content-nav.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-menu-collapsible.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-modal-image.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-notfound-page.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-overlay.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-poll.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz-container.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz-feedback_5.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-select.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-tab.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-table-of-contents.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-tabs.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-youtube.cjs.entry.js +2 -2
- package/dist/cjs/{spinner-configs-559523fd.js → spinner-configs-6f6b7ef0.js} +36 -1
- package/dist/cjs/status-tap-8697433c.js +40 -0
- package/dist/cjs/stencil-async-content.cjs.entry.js +1 -1
- package/dist/cjs/stencil-route-title.cjs.entry.js +2 -2
- package/dist/cjs/stencil-router-prompt.cjs.entry.js +2 -2
- package/dist/cjs/{student.service-41c7c78d.js → student.service-744c3155.js} +1 -1
- package/dist/cjs/{swipe-back-c1951cbd.js → swipe-back-7e08b5e0.js} +32 -8
- package/dist/cjs/{swiper.bundle-cbea42d8.js → swiper.bundle-8c897c07.js} +4 -4
- package/dist/cjs/{tap-click-cd858b48.js → tap-click-1caf1780.js} +8 -1
- package/dist/cjs/{theme-98ccfc24.js → theme-4252ac15.js} +3 -0
- package/dist/cjs/util-d383acb8.js +2462 -0
- package/dist/collection/collection-manifest.json +9 -2
- package/dist/collection/components/layout/page/page.js +1 -0
- package/dist/collection/components/sparkle-animation-player/sparkle-animation-player.js +78 -66
- package/dist/collection/components/sparkle-character-intro/assets/characters/character-img.jpg +0 -0
- package/dist/collection/components/sparkle-character-intro/assets/characters/jen.png +0 -0
- package/dist/collection/components/sparkle-character-intro/assets/characters/kimberly.png +0 -0
- package/dist/collection/components/sparkle-character-intro/assets/characters/valeria.png +0 -0
- package/dist/collection/components/sparkle-character-intro/assets/characters/yuna.png +0 -0
- package/dist/collection/components/sparkle-character-intro/assets/characters/zynab.png +0 -0
- package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.css +67 -0
- package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.js +64 -0
- package/dist/collection/components/sparkle-course-root/sparkle-course-root.js +48 -43
- package/dist/collection/components/sparkle-youtube/sparkle-youtube.js +6 -2
- package/dist/collection/util.js +1 -0
- package/dist/esm/{PrivateRoute-9f0973bb.js → PrivateRoute-b9937c45.js} +3 -37
- package/dist/esm/{active-router-b3ae32c7.js → active-router-909088d6.js} +1 -1
- package/dist/esm/{animation-72fdacfb.js → animation-b306f6c2.js} +28 -4
- package/dist/esm/app-globals-5c736ae5.js +7 -0
- package/dist/esm/auth.store-3ed2389e.js +4061 -0
- package/dist/esm/compass-svg.entry.js +1 -1
- package/dist/esm/context-consumer.entry.js +1 -1
- package/dist/esm/course-select.entry.js +1 -1
- package/dist/esm/{cubic-bezier-ed243a9b.js → cubic-bezier-a7ad9c8e.js} +3 -0
- package/dist/esm/dir-03012648.js +18 -0
- package/dist/esm/{facilitator.service-cddb2feb.js → facilitator.service-ec0a9739.js} +1 -1
- package/dist/esm/feed.service-33b83cb7.js +119 -0
- package/dist/esm/focus-visible-40cda868.js +61 -0
- package/dist/esm/framework-delegate-3bc58c27.js +109 -0
- package/dist/esm/{gesture-controller-604336b7.js → gesture-controller-686622ba.js} +3 -0
- package/dist/esm/{haptic-67928174.js → haptic-99c9e346.js} +4 -1
- package/dist/esm/{hardware-back-button-508e48cf.js → hardware-back-button-b6ccf74a.js} +3 -0
- package/dist/esm/header-mobile-collapse_61.entry.js +17937 -0
- package/dist/esm/{helpers-e7f66b2b.js → helpers-39367fe1.js} +119 -4
- package/dist/esm/{icons-33e5804c.js → icons-5debfbaf.js} +1 -1
- package/dist/esm/{index-cc97b114.js → index-435af8e6.js} +3 -0
- package/dist/esm/{index-55fc9f5e.js → index-5568e3fa.js} +303 -208
- package/dist/esm/{index-dc09784f.js → index-9594837e.js} +20 -4
- package/dist/esm/{index-b2ad0f1a.js → index-a12c14bd.js} +25 -4
- package/dist/esm/{index-a94619f9.js → index-c26d8655.js} +34 -5
- package/dist/esm/index-dc61f152.js +22 -0
- package/dist/esm/index.es-97dd8174.js +10585 -0
- package/dist/esm/index.js +8 -7
- package/dist/esm/{input-shims-3a97fa86.js → input-shims-cc98ea92.js} +34 -10
- package/dist/esm/ion-accordion-group.entry.js +193 -0
- package/dist/esm/ion-accordion.entry.js +336 -0
- package/dist/esm/ion-action-sheet_4.entry.js +2196 -0
- package/dist/esm/ion-app.entry.js +23 -8
- package/dist/esm/ion-back-button.entry.js +14 -9
- package/dist/esm/ion-backdrop.entry.js +3 -3
- package/dist/esm/ion-badge.entry.js +3 -3
- package/dist/esm/ion-breadcrumb.entry.js +99 -0
- package/dist/esm/ion-breadcrumbs.entry.js +131 -0
- package/dist/esm/ion-buttons_3.entry.js +7 -6
- package/dist/esm/ion-card-header.entry.js +3 -3
- package/dist/esm/ion-card-subtitle.entry.js +3 -3
- package/dist/esm/ion-card-title.entry.js +3 -3
- package/dist/esm/ion-chip.entry.js +3 -3
- package/dist/esm/ion-content_2.entry.js +144 -56
- package/dist/esm/ion-datetime.entry.js +1902 -779
- package/dist/esm/ion-fab-button.entry.js +5 -4
- package/dist/esm/ion-fab-list.entry.js +2 -2
- package/dist/esm/ion-fab.entry.js +2 -2
- package/dist/esm/ion-footer.entry.js +79 -4
- package/dist/esm/ion-img.entry.js +33 -7
- package/dist/esm/ion-infinite-scroll-content.entry.js +3 -3
- package/dist/esm/ion-infinite-scroll.entry.js +4 -2
- package/dist/esm/ion-item-divider.entry.js +3 -3
- package/dist/esm/ion-item-group.entry.js +2 -2
- package/dist/esm/ion-item-option.entry.js +4 -4
- package/dist/esm/ion-item-options.entry.js +3 -3
- package/dist/esm/ion-item-sliding.entry.js +52 -8
- package/dist/esm/ion-loading.entry.js +23 -11
- package/dist/esm/ion-menu-button.entry.js +17 -11
- package/dist/esm/ion-menu-toggle.entry.js +7 -7
- package/dist/esm/ion-menu.entry.js +141 -29
- package/dist/esm/ion-modal.entry.js +649 -75
- package/dist/esm/ion-nav-link.entry.js +4 -1
- package/dist/esm/ion-nav.entry.js +140 -137
- package/dist/esm/ion-picker-column-internal_2.entry.js +695 -0
- package/dist/esm/ion-picker-column.entry.js +5 -5
- package/dist/esm/ion-picker.entry.js +18 -11
- package/dist/esm/ion-progress-bar.entry.js +17 -13
- package/dist/esm/ion-refresher-content.entry.js +7 -6
- package/dist/esm/ion-refresher.entry.js +82 -83
- package/dist/esm/ion-reorder-group.entry.js +9 -8
- package/dist/esm/ion-reorder.entry.js +5 -4
- package/dist/esm/ion-route-redirect.entry.js +1 -1
- package/dist/esm/ion-route.entry.js +1 -1
- package/dist/esm/ion-router-link.entry.js +3 -3
- package/dist/esm/ion-router-outlet.entry.js +50 -12
- package/dist/esm/ion-router.entry.js +378 -234
- package/dist/esm/ion-searchbar.entry.js +50 -17
- package/dist/esm/ion-segment-button.entry.js +12 -9
- package/dist/esm/ion-segment.entry.js +89 -10
- package/dist/esm/ion-select_2.entry.js +64 -30
- package/dist/esm/ion-skeleton-text.entry.js +4 -4
- package/dist/esm/ion-slide.entry.js +2 -2
- package/dist/esm/ion-slides.entry.js +19 -32
- package/dist/esm/ion-split-pane.entry.js +8 -3
- package/dist/esm/ion-tab-bar.entry.js +25 -12
- package/dist/esm/ion-tab-button.entry.js +2 -2
- package/dist/esm/ion-tab.entry.js +3 -2
- package/dist/esm/ion-tabs.entry.js +1 -1
- package/dist/esm/ion-textarea.entry.js +9 -8
- package/dist/esm/ion-thumbnail.entry.js +2 -2
- package/dist/esm/ion-toast.entry.js +37 -27
- package/dist/esm/ion-toggle.entry.js +15 -15
- package/dist/esm/ion-virtual-scroll.entry.js +13 -3
- package/dist/esm/{ionic-global-1f9287cc.js → ionic-global-0939c477.js} +103 -77
- package/dist/esm/{ios.transition-d01abefd.js → ios.transition-b4ca8a33.js} +8 -5
- package/dist/esm/{keyboard-06906eac.js → keyboard-2503e874.js} +3 -0
- package/dist/esm/loader.js +5 -5
- package/dist/esm/localstorage.service-4bf408c8.js +36 -0
- package/dist/esm/{md.transition-245ffa55.js → md.transition-ca5e0322.js} +7 -4
- package/dist/esm/{menu-toggle-util-fe83fcf5.js → menu-toggle-util-7fa22c2f.js} +4 -1
- package/dist/esm/{overlays-8363621c.js → overlays-34cfa9e0.js} +187 -47
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/polyfills/index.js +2 -2
- package/dist/esm/{purify-4247e2d0.js → purify-ffce2b4c.js} +185 -72
- package/dist/esm/sparkle-animation-player.entry.js +56 -50
- package/dist/esm/sparkle-character-intro.entry.js +22 -0
- package/dist/esm/sparkle-code.entry.js +2 -2
- package/dist/esm/sparkle-compass-post.entry.js +1 -1
- package/dist/esm/sparkle-compass.entry.js +1 -1
- package/dist/esm/sparkle-core.js +7 -7
- package/dist/esm/sparkle-emoji.entry.js +1 -1
- package/dist/esm/sparkle-facilitator-notes-form.entry.js +7 -7
- package/dist/esm/sparkle-feed-post.entry.js +1 -1
- package/dist/esm/sparkle-feedback.entry.js +7 -7
- package/dist/esm/sparkle-goal-form.entry.js +8 -7
- package/dist/esm/sparkle-gww-comment-list.entry.js +1 -1
- package/dist/esm/sparkle-gww-graph.entry.js +1 -1
- package/dist/esm/sparkle-lower-content-nav.entry.js +1 -1
- package/dist/esm/sparkle-menu-collapsible.entry.js +2 -2
- package/dist/esm/sparkle-modal-image.entry.js +1 -1
- package/dist/esm/sparkle-notfound-page.entry.js +1 -1
- package/dist/esm/sparkle-overlay.entry.js +1 -1
- package/dist/esm/sparkle-poll.entry.js +1 -1
- package/dist/esm/sparkle-quiz-container.entry.js +1 -1
- package/dist/esm/sparkle-quiz-feedback_5.entry.js +1 -1
- package/dist/esm/sparkle-quiz.entry.js +2 -2
- package/dist/esm/sparkle-select.entry.js +1 -1
- package/dist/esm/sparkle-sidebar.entry.js +1 -1
- package/dist/esm/sparkle-tab.entry.js +1 -1
- package/dist/esm/sparkle-table-of-contents.entry.js +1 -1
- package/dist/esm/sparkle-tabs.entry.js +1 -1
- package/dist/esm/sparkle-youtube.entry.js +2 -2
- package/dist/esm/{spinner-configs-9536fae2.js → spinner-configs-f609a655.js} +36 -1
- package/dist/esm/status-tap-6351a0cb.js +38 -0
- package/dist/esm/stencil-async-content.entry.js +1 -1
- package/dist/esm/stencil-route-title.entry.js +2 -2
- package/dist/esm/stencil-router-prompt.entry.js +2 -2
- package/dist/esm/{student.service-c36c5a75.js → student.service-29b688ba.js} +1 -1
- package/dist/esm/{swipe-back-21f58ecf.js → swipe-back-34251834.js} +32 -8
- package/dist/esm/{swiper.bundle-d4422d52.js → swiper.bundle-b6a959de.js} +4 -4
- package/dist/esm/{tap-click-8c728329.js → tap-click-13f1fb0d.js} +8 -1
- package/dist/esm/{theme-12606872.js → theme-c336c9d9.js} +3 -0
- package/dist/esm/util-6ef753e9.js +2451 -0
- package/dist/loader/index.d.ts +0 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/accordion/accordion.ios.css +75 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/accordion/accordion.md.css +72 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/accordion-group/accordion-group.ios.css +25 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/accordion-group/accordion-group.md.css +59 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/action-sheet/action-sheet.ios.css +10 -19
- package/dist/node_modules/@ionic/core/dist/collection/components/action-sheet/action-sheet.md.css +19 -16
- package/dist/node_modules/@ionic/core/dist/collection/components/alert/alert.md.css +2 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/back-button/back-button.ios.css +4 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/back-button/back-button.md.css +4 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumb/breadcrumb.ios.css +234 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumb/breadcrumb.md.css +237 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumbs/breadcrumbs.ios.css +38 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumbs/breadcrumbs.md.css +37 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/button/button.ios.css +0 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/button/button.md.css +5 -5
- package/dist/node_modules/@ionic/core/dist/collection/components/content/content.css +60 -14
- package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.ios.css +586 -68
- package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.md.css +575 -68
- package/dist/node_modules/@ionic/core/dist/collection/components/footer/footer.ios.css +4 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/header/header.ios.css +16 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/input/input.ios.css +9 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/input/input.md.css +9 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/item/item.ios.css +105 -17
- package/dist/node_modules/@ionic/core/dist/collection/components/item/item.md.css +295 -22
- package/dist/node_modules/@ionic/core/dist/collection/components/item-options/item-options.ios.css +6 -6
- package/dist/node_modules/@ionic/core/dist/collection/components/item-options/item-options.md.css +6 -6
- package/dist/node_modules/@ionic/core/dist/collection/components/item-sliding/item-sliding.css +2 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/label/label.ios.css +7 -3
- package/dist/node_modules/@ionic/core/dist/collection/components/label/label.md.css +100 -18
- package/dist/node_modules/@ionic/core/dist/collection/components/list/list.ios.css +1 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.ios.css +2 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.md.css +2 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.ios.css +74 -11
- package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.md.css +48 -4
- package/dist/node_modules/@ionic/core/dist/collection/components/picker-column-internal/picker-column-internal.ios.css +59 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/picker-column-internal/picker-column-internal.md.css +62 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/picker-internal/picker-internal.ios.css +122 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/picker-internal/picker-internal.md.css +118 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/popover/popover.ios.css +83 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/popover/popover.md.css +49 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/progress-bar/progress-bar.ios.css +53 -38
- package/dist/node_modules/@ionic/core/dist/collection/components/progress-bar/progress-bar.md.css +53 -38
- package/dist/node_modules/@ionic/core/dist/collection/components/range/range.ios.css +3 -3
- package/dist/node_modules/@ionic/core/dist/collection/components/range/range.md.css +5 -5
- package/dist/node_modules/@ionic/core/dist/collection/components/refresher/refresher.ios.css +12 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/refresher/refresher.md.css +2 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/searchbar/searchbar.ios.css +1 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/searchbar/searchbar.md.css +1 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/segment-button/segment-button.ios.css +4 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/segment-button/segment-button.md.css +4 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/select/select.ios.css +1 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/select/select.md.css +30 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/select-popover/{select-popover.css → select-popover.ios.css} +4 -4
- package/dist/node_modules/@ionic/core/dist/collection/components/select-popover/select-popover.md.css +37 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/skeleton-text/skeleton-text.css +4 -4
- package/dist/node_modules/@ionic/core/dist/collection/components/spinner/spinner.css +15 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/tab-bar/tab-bar.ios.css +2 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/tab-bar/tab-bar.md.css +1 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.ios.css +9 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.md.css +9 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/title/title.ios.css +4 -3
- package/dist/node_modules/@ionic/core/dist/collection/components/toast/toast.ios.css +14 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/toast/toast.md.css +14 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.ios.css +1 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.md.css +1 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/toolbar/toolbar.ios.css +3 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/toolbar/toolbar.md.css +2 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/virtual-scroll/virtual-scroll.css +1 -1
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/button/button.css +49 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/cards/card/card.css +208 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/cards/cards.css +31 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/code/code.css +245 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/dropdown/dropdown.css +115 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/header/header-mobile-collapse/header-mobile-collapse.css +255 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/header/header.css +232 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/menu/collapsible/collapsible.css +3 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/menu/menu-toggle/menu-toggle.css +25 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/menu/menu.css +71 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/nav/nav.css +194 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/notfound-page/notfound-page.css +4 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/overlay/overlay.css +67 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/page-footer/page-footer.css +18 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/pagination/pagination.css +89 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/select/select.css +52 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/sidebar/sidebar.css +98 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/sparkle-lower-content-nav/sparkle-lower-content-nav.css +8 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/table-of-contents/table-of-contents.css +37 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/tabs/tabs.css +64 -0
- package/dist/sparkle-core/assets/characters/character-img.jpg +0 -0
- package/dist/sparkle-core/assets/characters/jen.png +0 -0
- package/dist/sparkle-core/assets/characters/kimberly.png +0 -0
- package/dist/sparkle-core/assets/characters/valeria.png +0 -0
- package/dist/sparkle-core/assets/characters/yuna.png +0 -0
- package/dist/sparkle-core/assets/characters/zynab.png +0 -0
- package/dist/sparkle-core/index.esm.js +1 -1
- package/dist/sparkle-core/p-0146afa0.entry.js +1 -0
- package/dist/sparkle-core/{p-52355989.entry.js → p-016a7aaf.entry.js} +1 -1
- package/dist/sparkle-core/p-0187adef.entry.js +1 -0
- package/dist/sparkle-core/p-03189863.js +1 -0
- package/dist/sparkle-core/{p-d4d9aa4a.entry.js → p-03ec54a8.entry.js} +1 -1
- package/dist/sparkle-core/p-04583c51.entry.js +1 -0
- package/dist/sparkle-core/{p-6d506f4e.js → p-052caa63.js} +1 -1
- package/dist/sparkle-core/{p-016bf847.entry.js → p-057f6a23.entry.js} +1 -1
- package/dist/sparkle-core/p-0580419b.entry.js +1 -0
- package/dist/sparkle-core/{p-c563b4de.js → p-063cd168.js} +4 -1
- package/dist/sparkle-core/p-081968cc.entry.js +1 -0
- package/dist/sparkle-core/p-0934f5dd.entry.js +1 -0
- package/dist/sparkle-core/{p-3f5d7a08.entry.js → p-11cf398a.entry.js} +1 -1
- package/dist/sparkle-core/p-1339830f.entry.js +1 -0
- package/dist/sparkle-core/p-145e40f5.entry.js +1 -0
- package/dist/sparkle-core/{p-68f3c93d.entry.js → p-1726da2f.entry.js} +1 -1
- package/dist/sparkle-core/p-173d5461.entry.js +7 -0
- package/dist/sparkle-core/p-18e62133.entry.js +1 -0
- package/dist/sparkle-core/p-1af044f7.js +3 -0
- package/dist/sparkle-core/p-1b78dea1.entry.js +1 -0
- package/dist/sparkle-core/p-1cef8572.js +4 -0
- package/dist/sparkle-core/p-1df05176.js +4 -0
- package/dist/sparkle-core/p-21bf4ca0.entry.js +1 -0
- package/dist/sparkle-core/p-21db4e8e.entry.js +1 -0
- package/dist/sparkle-core/p-23a9f7d1.entry.js +1 -0
- package/dist/sparkle-core/p-289a35ed.entry.js +1 -0
- package/dist/sparkle-core/p-2ee6a5f9.entry.js +1 -0
- package/dist/sparkle-core/p-350adbaa.entry.js +1 -0
- package/dist/sparkle-core/{p-bccd9036.entry.js → p-35a7bd6c.entry.js} +1 -1
- package/dist/sparkle-core/{p-66e3bd1c.entry.js → p-37c00e39.entry.js} +1 -1
- package/dist/sparkle-core/p-389500fd.js +4 -0
- package/dist/sparkle-core/p-39e5a90f.entry.js +1 -0
- package/dist/sparkle-core/{p-ac5e5308.entry.js → p-3a202a38.entry.js} +1 -1
- package/dist/sparkle-core/p-3defe550.entry.js +1 -0
- package/dist/sparkle-core/p-45e6db62.entry.js +1 -0
- package/dist/sparkle-core/{p-581ca370.entry.js → p-48f9b960.entry.js} +1 -1
- package/dist/sparkle-core/{p-0efbc0b3.entry.js → p-4dc3ef96.entry.js} +1 -1
- package/dist/sparkle-core/p-506221fe.js +4 -0
- package/dist/sparkle-core/p-50aac721.entry.js +7 -0
- package/dist/sparkle-core/p-513794b0.js +16 -0
- package/dist/sparkle-core/{p-2e4e8117.js → p-5264da79.js} +3 -0
- package/dist/sparkle-core/{p-40db85ac.entry.js → p-547b70c6.entry.js} +1 -1
- package/dist/sparkle-core/p-5598650a.entry.js +1 -0
- package/dist/sparkle-core/p-55ae49e1.js +4 -0
- package/dist/sparkle-core/p-58e98f89.entry.js +1 -0
- package/dist/sparkle-core/p-59f7bf6e.entry.js +1 -0
- package/dist/sparkle-core/p-5a3d0e6b.js +4 -0
- package/dist/sparkle-core/{p-85d31769.entry.js → p-5b40aae5.entry.js} +1 -1
- package/dist/sparkle-core/p-5c9aa1f9.entry.js +4 -0
- package/dist/sparkle-core/p-5d2e54ee.entry.js +1 -0
- package/dist/sparkle-core/p-5d409601.js +1 -0
- package/dist/sparkle-core/{p-afbaad64.entry.js → p-5f45d206.entry.js} +1 -1
- package/dist/sparkle-core/p-5ff6416d.entry.js +7 -0
- package/dist/sparkle-core/{p-cf2332bb.entry.js → p-62a6c96f.entry.js} +1 -1
- package/dist/sparkle-core/p-64e72f8f.js +4 -0
- package/dist/sparkle-core/p-660e0742.js +1 -0
- package/dist/sparkle-core/{p-d5023db0.entry.js → p-667accac.entry.js} +1 -1
- package/dist/sparkle-core/{p-9ca56f5d.entry.js → p-680663a2.entry.js} +1 -1
- package/dist/sparkle-core/{p-e975924a.entry.js → p-6823e6c1.entry.js} +1 -1
- package/dist/sparkle-core/p-69e7783d.js +4 -0
- package/dist/sparkle-core/p-6bbabb80.entry.js +1 -0
- package/dist/sparkle-core/p-6bf07a28.js +1 -0
- package/dist/sparkle-core/p-6c6145cd.js +4 -0
- package/dist/sparkle-core/p-6c90bde6.entry.js +5 -0
- package/dist/sparkle-core/p-6e88764b.entry.js +4 -0
- package/dist/sparkle-core/p-6ee40949.js +1 -0
- package/dist/sparkle-core/p-6fbe3ca3.entry.js +1 -0
- package/dist/sparkle-core/{p-f2660943.js → p-6fd4985d.js} +3 -0
- package/dist/sparkle-core/{p-8fc9298a.js → p-703ca87c.js} +3 -0
- package/dist/sparkle-core/{p-1bf8bed6.entry.js → p-7052c43a.entry.js} +1 -1
- package/dist/sparkle-core/{p-111520a0.js → p-70b2452c.js} +3 -0
- package/dist/sparkle-core/p-713590fc.js +5 -0
- package/dist/sparkle-core/p-7493ee15.entry.js +1 -0
- package/dist/sparkle-core/p-75572037.js +1 -0
- package/dist/sparkle-core/{p-eb56aa20.entry.js → p-768bcc9e.entry.js} +1 -1
- package/dist/sparkle-core/p-797c23ed.entry.js +1 -0
- package/dist/sparkle-core/{p-03eb2164.js → p-7c38a70b.js} +1 -1
- package/dist/sparkle-core/{p-09d43bee.entry.js → p-7d61177b.entry.js} +1 -1
- package/dist/sparkle-core/p-7dbfc316.js +1 -0
- package/dist/sparkle-core/p-7e61973d.entry.js +7 -0
- package/dist/sparkle-core/{p-3cd28c60.entry.js → p-82e98d07.entry.js} +1 -1
- package/dist/sparkle-core/p-838fa86d.entry.js +18 -0
- package/dist/sparkle-core/p-855ca600.js +1 -0
- package/dist/sparkle-core/p-857f3696.entry.js +1 -0
- package/dist/sparkle-core/{p-8f72be08.js → p-8c6b6038.js} +3 -0
- package/dist/sparkle-core/p-8fe2e51f.entry.js +4 -0
- package/dist/sparkle-core/{p-f72a6e6d.entry.js → p-90389886.entry.js} +1 -1
- package/dist/sparkle-core/p-932bfb69.entry.js +1 -0
- package/dist/sparkle-core/p-935e7cfc.js +1 -0
- package/dist/sparkle-core/{p-c70b9765.entry.js → p-941eaa3a.entry.js} +1 -1
- package/dist/sparkle-core/p-95004267.entry.js +1 -0
- package/dist/sparkle-core/p-950effe7.entry.js +1 -0
- package/dist/sparkle-core/{p-1ca4bf1d.entry.js → p-996361f9.entry.js} +1 -1
- package/dist/sparkle-core/p-9a17f2ad.js +4 -0
- package/dist/sparkle-core/p-9a443f51.js +1 -1
- package/dist/sparkle-core/p-9babd345.js +1 -0
- package/dist/sparkle-core/p-9cfdeb18.entry.js +1 -0
- package/dist/sparkle-core/p-a080e768.entry.js +1 -0
- package/dist/sparkle-core/p-a1cab0f3.js +4 -0
- package/dist/sparkle-core/p-a7cc0052.entry.js +4 -0
- package/dist/sparkle-core/p-a9ccb0df.js +4 -0
- package/dist/sparkle-core/p-a9ee3f6d.entry.js +1 -0
- package/dist/sparkle-core/{p-abe2676a.entry.js → p-aa87c7f0.entry.js} +1 -1
- package/dist/sparkle-core/{p-e818b11d.entry.js → p-aa9ebc39.entry.js} +1 -1
- package/dist/sparkle-core/p-ae1f145d.entry.js +1 -0
- package/dist/sparkle-core/{p-73a646fb.entry.js → p-b07a2cf2.entry.js} +1 -1
- package/dist/sparkle-core/{p-c82b05e0.entry.js → p-b3909012.entry.js} +1 -1
- package/dist/sparkle-core/p-b3e6427d.js +7 -0
- package/dist/sparkle-core/p-b49ca0ea.entry.js +1 -0
- package/dist/sparkle-core/p-b81e20fe.entry.js +4 -0
- package/dist/sparkle-core/p-bca0e465.entry.js +1 -0
- package/dist/sparkle-core/p-c1279cc9.entry.js +1 -0
- package/dist/sparkle-core/{p-82d95fcd.entry.js → p-c1376096.entry.js} +1 -1
- package/dist/sparkle-core/p-c3986a52.entry.js +1 -0
- package/dist/sparkle-core/p-c3d3d5c4.entry.js +1 -0
- package/dist/sparkle-core/p-c48bbc7c.entry.js +4 -0
- package/dist/sparkle-core/p-c5b9bdd6.entry.js +1 -0
- package/dist/sparkle-core/{p-15d68269.entry.js → p-c69b0a7a.entry.js} +1 -1
- package/dist/sparkle-core/p-cbbeed67.entry.js +1 -0
- package/dist/sparkle-core/p-d4a435f8.entry.js +1 -0
- package/dist/sparkle-core/p-d4c07aca.js +4 -0
- package/dist/sparkle-core/p-d5b05ece.entry.js +5 -0
- package/dist/sparkle-core/p-d7baf31e.entry.js +1 -0
- package/dist/sparkle-core/p-d8d3524a.js +1 -0
- package/dist/sparkle-core/p-df0070c5.entry.js +352 -0
- package/dist/sparkle-core/{p-22926eed.entry.js → p-e0fced48.entry.js} +1 -1
- package/dist/sparkle-core/p-e1cba44b.entry.js +4 -0
- package/dist/sparkle-core/p-e225581a.js +7 -0
- package/dist/sparkle-core/{p-4e28ca37.entry.js → p-e3fdd0a8.entry.js} +1 -1
- package/dist/sparkle-core/p-e72d4450.js +4 -0
- package/dist/sparkle-core/p-eb70a23c.entry.js +1 -0
- package/dist/sparkle-core/{p-f9143c5d.entry.js → p-ecd39170.entry.js} +1 -1
- package/dist/sparkle-core/{p-151afa9e.entry.js → p-ed0e9d29.entry.js} +1 -1
- package/dist/sparkle-core/{p-92d42c10.entry.js → p-ee0d7f19.entry.js} +1 -1
- package/dist/sparkle-core/p-f4001fdf.js +4 -0
- package/dist/sparkle-core/p-f9b73032.entry.js +1 -0
- package/dist/sparkle-core/p-faa912d7.entry.js +1 -0
- package/dist/sparkle-core/{p-a250e2ae.entry.js → p-fbd7eeca.entry.js} +1 -1
- package/dist/sparkle-core/p-fc933591.entry.js +1 -0
- package/dist/sparkle-core/p-fef04ab5.js +4 -0
- package/dist/sparkle-core/sparkle-core.css +1 -1
- package/dist/sparkle-core/sparkle-core.esm.js +1 -1
- package/dist/sparkle-core/svg/balloon-outline.svg +1 -0
- package/dist/sparkle-core/svg/balloon-sharp.svg +1 -0
- package/dist/sparkle-core/svg/balloon.svg +1 -0
- package/dist/sparkle-core/svg/bowling-ball-outline.svg +1 -0
- package/dist/sparkle-core/svg/bowling-ball-sharp.svg +1 -0
- package/dist/sparkle-core/svg/bowling-ball.svg +1 -0
- package/dist/sparkle-core/svg/calendar-number-outline.svg +1 -0
- package/dist/sparkle-core/svg/calendar-number-sharp.svg +1 -0
- package/dist/sparkle-core/svg/calendar-number.svg +1 -0
- package/dist/sparkle-core/svg/diamond-outline.svg +1 -0
- package/dist/sparkle-core/svg/diamond-sharp.svg +1 -0
- package/dist/sparkle-core/svg/diamond.svg +1 -0
- package/dist/sparkle-core/svg/footsteps-outline.svg +1 -0
- package/dist/sparkle-core/svg/footsteps-sharp.svg +1 -0
- package/dist/sparkle-core/svg/footsteps.svg +1 -0
- package/dist/sparkle-core/svg/id-card-outline.svg +1 -0
- package/dist/sparkle-core/svg/id-card-sharp.svg +1 -0
- package/dist/sparkle-core/svg/id-card.svg +1 -0
- package/dist/sparkle-core/svg/logo-apple-ar.svg +1 -0
- package/dist/sparkle-core/svg/prism-outline.svg +1 -0
- package/dist/sparkle-core/svg/prism-sharp.svg +1 -0
- package/dist/sparkle-core/svg/prism.svg +1 -0
- package/dist/sparkle-core/svg/scale-outline.svg +1 -0
- package/dist/sparkle-core/svg/scale-sharp.svg +1 -0
- package/dist/sparkle-core/svg/scale.svg +1 -0
- package/dist/sparkle-core/svg/shield-half-outline.svg +1 -0
- package/dist/sparkle-core/svg/shield-half-sharp.svg +1 -0
- package/dist/sparkle-core/svg/shield-half.svg +1 -0
- package/dist/sparkle-core/svg/sparkles-outline.svg +1 -0
- package/dist/sparkle-core/svg/sparkles-sharp.svg +1 -0
- package/dist/sparkle-core/svg/sparkles.svg +1 -0
- package/dist/sparkle-core/swiper/swiper.bundle.js +2 -2
- package/dist/types/components/sparkle-animation-player/sparkle-animation-player.d.ts +1 -0
- package/dist/types/components/sparkle-character-intro/sparkle-character-intro.d.ts +7 -0
- package/dist/types/components/sparkle-course-root/sparkle-course-root.d.ts +2 -2
- package/dist/types/components/sparkle-youtube/sparkle-youtube.d.ts +1 -1
- package/dist/types/components.d.ts +17 -0
- package/dist/types/models/definitions.d.ts +8 -0
- package/dist/types/stencil-public-runtime.d.ts +200 -190
- package/dist/types/util.d.ts +1 -0
- package/package.json +26 -26
- package/dist/cjs/app-globals-98121d6d.js +0 -9
- package/dist/cjs/button-active-9456fb4d.js +0 -66
- package/dist/cjs/feed.service-518d18fd.js +0 -5802
- package/dist/cjs/focus-visible-1583bc8e.js +0 -45
- package/dist/cjs/framework-delegate-72815681.js +0 -37
- package/dist/cjs/header-mobile-collapse_60.cjs.entry.js +0 -86
- package/dist/cjs/index.es-baef3314.js +0 -13834
- package/dist/cjs/ion-action-sheet.cjs.entry.js +0 -261
- package/dist/cjs/ion-alert.cjs.entry.js +0 -455
- package/dist/cjs/ion-note.cjs.entry.js +0 -29
- package/dist/cjs/ion-popover.cjs.entry.js +0 -365
- package/dist/cjs/ion-select-popover.cjs.entry.js +0 -35
- package/dist/cjs/status-tap-466a7c6a.js +0 -25
- package/dist/esm/app-globals-6451faf3.js +0 -7
- package/dist/esm/auth.store-dd944bc2.js +0 -2552
- package/dist/esm/button-active-97535443.js +0 -64
- package/dist/esm/feed.service-0fda1e36.js +0 -5787
- package/dist/esm/focus-visible-abf04ce3.js +0 -43
- package/dist/esm/framework-delegate-2c397da3.js +0 -34
- package/dist/esm/header-mobile-collapse_60.entry.js +0 -19
- package/dist/esm/index.es-a5bf9a49.js +0 -13748
- package/dist/esm/ion-action-sheet.entry.js +0 -257
- package/dist/esm/ion-alert.entry.js +0 -451
- package/dist/esm/ion-note.entry.js +0 -25
- package/dist/esm/ion-popover.entry.js +0 -361
- package/dist/esm/ion-select-popover.entry.js +0 -31
- package/dist/esm/status-tap-9221cd79.js +0 -23
- package/dist/sparkle-core/p-019d9d02.entry.js +0 -1
- package/dist/sparkle-core/p-02d6d899.js +0 -1
- package/dist/sparkle-core/p-03fd27d0.entry.js +0 -1
- package/dist/sparkle-core/p-07018d29.js +0 -1
- package/dist/sparkle-core/p-083d57a6.entry.js +0 -1
- package/dist/sparkle-core/p-090f2624.js +0 -1
- package/dist/sparkle-core/p-0e1c7c8c.js +0 -1
- package/dist/sparkle-core/p-101feae9.js +0 -1
- package/dist/sparkle-core/p-13b0cdfc.entry.js +0 -1
- package/dist/sparkle-core/p-13c9bf3a.entry.js +0 -1
- package/dist/sparkle-core/p-169920f1.js +0 -1
- package/dist/sparkle-core/p-1e1f5e98.entry.js +0 -1
- package/dist/sparkle-core/p-1e866c41.entry.js +0 -1
- package/dist/sparkle-core/p-2474bf60.entry.js +0 -1
- package/dist/sparkle-core/p-25bbf9b4.entry.js +0 -1
- package/dist/sparkle-core/p-2a45b732.js +0 -1
- package/dist/sparkle-core/p-2abf4d37.entry.js +0 -1
- package/dist/sparkle-core/p-2c5edb9f.entry.js +0 -1
- package/dist/sparkle-core/p-2d966d35.js +0 -1
- package/dist/sparkle-core/p-30b641a4.entry.js +0 -1
- package/dist/sparkle-core/p-34ea6639.entry.js +0 -1
- package/dist/sparkle-core/p-359422b6.entry.js +0 -1
- package/dist/sparkle-core/p-37bfb548.entry.js +0 -1
- package/dist/sparkle-core/p-38307b31.js +0 -1
- package/dist/sparkle-core/p-3a29a75b.entry.js +0 -1
- package/dist/sparkle-core/p-3bb55510.entry.js +0 -1
- package/dist/sparkle-core/p-3be0a218.js +0 -1
- package/dist/sparkle-core/p-417a8dd6.js +0 -1
- package/dist/sparkle-core/p-447163be.entry.js +0 -1
- package/dist/sparkle-core/p-49265a8e.entry.js +0 -1
- package/dist/sparkle-core/p-4950f841.entry.js +0 -1
- package/dist/sparkle-core/p-4b7db0e6.js +0 -1
- package/dist/sparkle-core/p-4d8cb365.entry.js +0 -1
- package/dist/sparkle-core/p-5073899e.entry.js +0 -1
- package/dist/sparkle-core/p-5b366c20.entry.js +0 -1
- package/dist/sparkle-core/p-5dce20b9.entry.js +0 -1
- package/dist/sparkle-core/p-6006beec.entry.js +0 -1
- package/dist/sparkle-core/p-600d04fc.entry.js +0 -1
- package/dist/sparkle-core/p-60828739.entry.js +0 -1
- package/dist/sparkle-core/p-6112b180.entry.js +0 -1
- package/dist/sparkle-core/p-66eb6b7a.entry.js +0 -1
- package/dist/sparkle-core/p-67ddec3f.entry.js +0 -1
- package/dist/sparkle-core/p-68cb7d41.entry.js +0 -1
- package/dist/sparkle-core/p-69cd49de.js +0 -1
- package/dist/sparkle-core/p-6edbdde5.entry.js +0 -1
- package/dist/sparkle-core/p-6f0ecbe3.js +0 -1
- package/dist/sparkle-core/p-765b8593.js +0 -1
- package/dist/sparkle-core/p-770128c8.js +0 -1
- package/dist/sparkle-core/p-7840618d.js +0 -1
- package/dist/sparkle-core/p-7b37d523.entry.js +0 -1
- package/dist/sparkle-core/p-7d83d006.entry.js +0 -1
- package/dist/sparkle-core/p-7f3d5344.js +0 -1
- package/dist/sparkle-core/p-81651f26.entry.js +0 -1
- package/dist/sparkle-core/p-86148067.entry.js +0 -1
- package/dist/sparkle-core/p-8b5bc1d6.entry.js +0 -1
- package/dist/sparkle-core/p-8c3ee44c.entry.js +0 -1
- package/dist/sparkle-core/p-9007a06b.entry.js +0 -1
- package/dist/sparkle-core/p-90482861.entry.js +0 -1
- package/dist/sparkle-core/p-a061537e.entry.js +0 -1
- package/dist/sparkle-core/p-a38ea475.js +0 -1
- package/dist/sparkle-core/p-ad1ddf1f.js +0 -483
- package/dist/sparkle-core/p-aef0bba0.js +0 -1
- package/dist/sparkle-core/p-b080c1e3.entry.js +0 -1
- package/dist/sparkle-core/p-b11fe0c7.js +0 -1
- package/dist/sparkle-core/p-bac45a26.entry.js +0 -1
- package/dist/sparkle-core/p-bbe5977b.entry.js +0 -1
- package/dist/sparkle-core/p-bc568dcb.js +0 -1
- package/dist/sparkle-core/p-bfb55f1d.js +0 -3
- package/dist/sparkle-core/p-c163c16d.entry.js +0 -1
- package/dist/sparkle-core/p-c3166584.entry.js +0 -1
- package/dist/sparkle-core/p-c34269ae.entry.js +0 -1
- package/dist/sparkle-core/p-c466ee32.js +0 -1
- package/dist/sparkle-core/p-c6710592.entry.js +0 -1
- package/dist/sparkle-core/p-c7022391.entry.js +0 -1
- package/dist/sparkle-core/p-d4ad796c.js +0 -1
- package/dist/sparkle-core/p-d6152660.entry.js +0 -1
- package/dist/sparkle-core/p-d63406d8.js +0 -1
- package/dist/sparkle-core/p-dba672d5.entry.js +0 -1
- package/dist/sparkle-core/p-dd73d01a.entry.js +0 -1
- package/dist/sparkle-core/p-de33872d.entry.js +0 -1
- package/dist/sparkle-core/p-dee2128a.entry.js +0 -1
- package/dist/sparkle-core/p-df07e132.entry.js +0 -1
- package/dist/sparkle-core/p-e5d5aaa5.js +0 -1
- package/dist/sparkle-core/p-e72c6d87.entry.js +0 -1
- package/dist/sparkle-core/p-e8df6ea6.entry.js +0 -1
- package/dist/sparkle-core/p-ef2a2172.js +0 -1
- package/dist/sparkle-core/p-f1a4ab33.entry.js +0 -1
- package/dist/sparkle-core/p-f43ac631.entry.js +0 -1
- package/dist/sparkle-core/p-f8063d7b.js +0 -1
- package/dist/sparkle-core/p-fd62283e.entry.js +0 -1
- package/dist/sparkle-core/p-fef71e0e.entry.js +0 -1
@@ -0,0 +1,2451 @@
|
|
1
|
+
function toInteger(dirtyNumber) {
|
2
|
+
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
3
|
+
return NaN;
|
4
|
+
}
|
5
|
+
|
6
|
+
var number = Number(dirtyNumber);
|
7
|
+
|
8
|
+
if (isNaN(number)) {
|
9
|
+
return number;
|
10
|
+
}
|
11
|
+
|
12
|
+
return number < 0 ? Math.ceil(number) : Math.floor(number);
|
13
|
+
}
|
14
|
+
|
15
|
+
function requiredArgs(required, args) {
|
16
|
+
if (args.length < required) {
|
17
|
+
throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
/**
|
22
|
+
* @name toDate
|
23
|
+
* @category Common Helpers
|
24
|
+
* @summary Convert the given argument to an instance of Date.
|
25
|
+
*
|
26
|
+
* @description
|
27
|
+
* Convert the given argument to an instance of Date.
|
28
|
+
*
|
29
|
+
* If the argument is an instance of Date, the function returns its clone.
|
30
|
+
*
|
31
|
+
* If the argument is a number, it is treated as a timestamp.
|
32
|
+
*
|
33
|
+
* If the argument is none of the above, the function returns Invalid Date.
|
34
|
+
*
|
35
|
+
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
36
|
+
*
|
37
|
+
* @param {Date|Number} argument - the value to convert
|
38
|
+
* @returns {Date} the parsed date in the local time zone
|
39
|
+
* @throws {TypeError} 1 argument required
|
40
|
+
*
|
41
|
+
* @example
|
42
|
+
* // Clone the date:
|
43
|
+
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
44
|
+
* //=> Tue Feb 11 2014 11:30:30
|
45
|
+
*
|
46
|
+
* @example
|
47
|
+
* // Convert the timestamp to date:
|
48
|
+
* const result = toDate(1392098430000)
|
49
|
+
* //=> Tue Feb 11 2014 11:30:30
|
50
|
+
*/
|
51
|
+
|
52
|
+
function toDate(argument) {
|
53
|
+
requiredArgs(1, arguments);
|
54
|
+
var argStr = Object.prototype.toString.call(argument); // Clone the date
|
55
|
+
|
56
|
+
if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
|
57
|
+
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
58
|
+
return new Date(argument.getTime());
|
59
|
+
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
60
|
+
return new Date(argument);
|
61
|
+
} else {
|
62
|
+
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
63
|
+
// eslint-disable-next-line no-console
|
64
|
+
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://git.io/fjule"); // eslint-disable-next-line no-console
|
65
|
+
|
66
|
+
console.warn(new Error().stack);
|
67
|
+
}
|
68
|
+
|
69
|
+
return new Date(NaN);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
/**
|
74
|
+
* @name addMilliseconds
|
75
|
+
* @category Millisecond Helpers
|
76
|
+
* @summary Add the specified number of milliseconds to the given date.
|
77
|
+
*
|
78
|
+
* @description
|
79
|
+
* Add the specified number of milliseconds to the given date.
|
80
|
+
*
|
81
|
+
* ### v2.0.0 breaking changes:
|
82
|
+
*
|
83
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
84
|
+
*
|
85
|
+
* @param {Date|Number} date - the date to be changed
|
86
|
+
* @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`.
|
87
|
+
* @returns {Date} the new date with the milliseconds added
|
88
|
+
* @throws {TypeError} 2 arguments required
|
89
|
+
*
|
90
|
+
* @example
|
91
|
+
* // Add 750 milliseconds to 10 July 2014 12:45:30.000:
|
92
|
+
* const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
|
93
|
+
* //=> Thu Jul 10 2014 12:45:30.750
|
94
|
+
*/
|
95
|
+
|
96
|
+
function addMilliseconds(dirtyDate, dirtyAmount) {
|
97
|
+
requiredArgs(2, arguments);
|
98
|
+
var timestamp = toDate(dirtyDate).getTime();
|
99
|
+
var amount = toInteger(dirtyAmount);
|
100
|
+
return new Date(timestamp + amount);
|
101
|
+
}
|
102
|
+
|
103
|
+
/**
|
104
|
+
* Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
|
105
|
+
* They usually appear for dates that denote time before the timezones were introduced
|
106
|
+
* (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
|
107
|
+
* and GMT+01:00:00 after that date)
|
108
|
+
*
|
109
|
+
* Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
|
110
|
+
* which would lead to incorrect calculations.
|
111
|
+
*
|
112
|
+
* This function returns the timezone offset in milliseconds that takes seconds in account.
|
113
|
+
*/
|
114
|
+
function getTimezoneOffsetInMilliseconds(date) {
|
115
|
+
var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
|
116
|
+
utcDate.setUTCFullYear(date.getFullYear());
|
117
|
+
return date.getTime() - utcDate.getTime();
|
118
|
+
}
|
119
|
+
|
120
|
+
/**
|
121
|
+
* @name isDate
|
122
|
+
* @category Common Helpers
|
123
|
+
* @summary Is the given value a date?
|
124
|
+
*
|
125
|
+
* @description
|
126
|
+
* Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
|
127
|
+
*
|
128
|
+
* ### v2.0.0 breaking changes:
|
129
|
+
*
|
130
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
131
|
+
*
|
132
|
+
* @param {*} value - the value to check
|
133
|
+
* @returns {boolean} true if the given value is a date
|
134
|
+
* @throws {TypeError} 1 arguments required
|
135
|
+
*
|
136
|
+
* @example
|
137
|
+
* // For a valid date:
|
138
|
+
* const result = isDate(new Date())
|
139
|
+
* //=> true
|
140
|
+
*
|
141
|
+
* @example
|
142
|
+
* // For an invalid date:
|
143
|
+
* const result = isDate(new Date(NaN))
|
144
|
+
* //=> true
|
145
|
+
*
|
146
|
+
* @example
|
147
|
+
* // For some value:
|
148
|
+
* const result = isDate('2014-02-31')
|
149
|
+
* //=> false
|
150
|
+
*
|
151
|
+
* @example
|
152
|
+
* // For an object:
|
153
|
+
* const result = isDate({})
|
154
|
+
* //=> false
|
155
|
+
*/
|
156
|
+
|
157
|
+
function isDate(value) {
|
158
|
+
requiredArgs(1, arguments);
|
159
|
+
return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';
|
160
|
+
}
|
161
|
+
|
162
|
+
/**
|
163
|
+
* @name isValid
|
164
|
+
* @category Common Helpers
|
165
|
+
* @summary Is the given date valid?
|
166
|
+
*
|
167
|
+
* @description
|
168
|
+
* Returns false if argument is Invalid Date and true otherwise.
|
169
|
+
* Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
|
170
|
+
* Invalid Date is a Date, whose time value is NaN.
|
171
|
+
*
|
172
|
+
* Time value of Date: http://es5.github.io/#x15.9.1.1
|
173
|
+
*
|
174
|
+
* ### v2.0.0 breaking changes:
|
175
|
+
*
|
176
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
177
|
+
*
|
178
|
+
* - Now `isValid` doesn't throw an exception
|
179
|
+
* if the first argument is not an instance of Date.
|
180
|
+
* Instead, argument is converted beforehand using `toDate`.
|
181
|
+
*
|
182
|
+
* Examples:
|
183
|
+
*
|
184
|
+
* | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
|
185
|
+
* |---------------------------|---------------|---------------|
|
186
|
+
* | `new Date()` | `true` | `true` |
|
187
|
+
* | `new Date('2016-01-01')` | `true` | `true` |
|
188
|
+
* | `new Date('')` | `false` | `false` |
|
189
|
+
* | `new Date(1488370835081)` | `true` | `true` |
|
190
|
+
* | `new Date(NaN)` | `false` | `false` |
|
191
|
+
* | `'2016-01-01'` | `TypeError` | `false` |
|
192
|
+
* | `''` | `TypeError` | `false` |
|
193
|
+
* | `1488370835081` | `TypeError` | `true` |
|
194
|
+
* | `NaN` | `TypeError` | `false` |
|
195
|
+
*
|
196
|
+
* We introduce this change to make *date-fns* consistent with ECMAScript behavior
|
197
|
+
* that try to coerce arguments to the expected type
|
198
|
+
* (which is also the case with other *date-fns* functions).
|
199
|
+
*
|
200
|
+
* @param {*} date - the date to check
|
201
|
+
* @returns {Boolean} the date is valid
|
202
|
+
* @throws {TypeError} 1 argument required
|
203
|
+
*
|
204
|
+
* @example
|
205
|
+
* // For the valid date:
|
206
|
+
* const result = isValid(new Date(2014, 1, 31))
|
207
|
+
* //=> true
|
208
|
+
*
|
209
|
+
* @example
|
210
|
+
* // For the value, convertable into a date:
|
211
|
+
* const result = isValid(1393804800000)
|
212
|
+
* //=> true
|
213
|
+
*
|
214
|
+
* @example
|
215
|
+
* // For the invalid date:
|
216
|
+
* const result = isValid(new Date(''))
|
217
|
+
* //=> false
|
218
|
+
*/
|
219
|
+
|
220
|
+
function isValid(dirtyDate) {
|
221
|
+
requiredArgs(1, arguments);
|
222
|
+
|
223
|
+
if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
|
224
|
+
return false;
|
225
|
+
}
|
226
|
+
|
227
|
+
var date = toDate(dirtyDate);
|
228
|
+
return !isNaN(Number(date));
|
229
|
+
}
|
230
|
+
|
231
|
+
var formatDistanceLocale = {
|
232
|
+
lessThanXSeconds: {
|
233
|
+
one: 'less than a second',
|
234
|
+
other: 'less than {{count}} seconds'
|
235
|
+
},
|
236
|
+
xSeconds: {
|
237
|
+
one: '1 second',
|
238
|
+
other: '{{count}} seconds'
|
239
|
+
},
|
240
|
+
halfAMinute: 'half a minute',
|
241
|
+
lessThanXMinutes: {
|
242
|
+
one: 'less than a minute',
|
243
|
+
other: 'less than {{count}} minutes'
|
244
|
+
},
|
245
|
+
xMinutes: {
|
246
|
+
one: '1 minute',
|
247
|
+
other: '{{count}} minutes'
|
248
|
+
},
|
249
|
+
aboutXHours: {
|
250
|
+
one: 'about 1 hour',
|
251
|
+
other: 'about {{count}} hours'
|
252
|
+
},
|
253
|
+
xHours: {
|
254
|
+
one: '1 hour',
|
255
|
+
other: '{{count}} hours'
|
256
|
+
},
|
257
|
+
xDays: {
|
258
|
+
one: '1 day',
|
259
|
+
other: '{{count}} days'
|
260
|
+
},
|
261
|
+
aboutXWeeks: {
|
262
|
+
one: 'about 1 week',
|
263
|
+
other: 'about {{count}} weeks'
|
264
|
+
},
|
265
|
+
xWeeks: {
|
266
|
+
one: '1 week',
|
267
|
+
other: '{{count}} weeks'
|
268
|
+
},
|
269
|
+
aboutXMonths: {
|
270
|
+
one: 'about 1 month',
|
271
|
+
other: 'about {{count}} months'
|
272
|
+
},
|
273
|
+
xMonths: {
|
274
|
+
one: '1 month',
|
275
|
+
other: '{{count}} months'
|
276
|
+
},
|
277
|
+
aboutXYears: {
|
278
|
+
one: 'about 1 year',
|
279
|
+
other: 'about {{count}} years'
|
280
|
+
},
|
281
|
+
xYears: {
|
282
|
+
one: '1 year',
|
283
|
+
other: '{{count}} years'
|
284
|
+
},
|
285
|
+
overXYears: {
|
286
|
+
one: 'over 1 year',
|
287
|
+
other: 'over {{count}} years'
|
288
|
+
},
|
289
|
+
almostXYears: {
|
290
|
+
one: 'almost 1 year',
|
291
|
+
other: 'almost {{count}} years'
|
292
|
+
}
|
293
|
+
};
|
294
|
+
|
295
|
+
var formatDistance = function (token, count, options) {
|
296
|
+
var result;
|
297
|
+
var tokenValue = formatDistanceLocale[token];
|
298
|
+
|
299
|
+
if (typeof tokenValue === 'string') {
|
300
|
+
result = tokenValue;
|
301
|
+
} else if (count === 1) {
|
302
|
+
result = tokenValue.one;
|
303
|
+
} else {
|
304
|
+
result = tokenValue.other.replace('{{count}}', count.toString());
|
305
|
+
}
|
306
|
+
|
307
|
+
if (options !== null && options !== void 0 && options.addSuffix) {
|
308
|
+
if (options.comparison && options.comparison > 0) {
|
309
|
+
return 'in ' + result;
|
310
|
+
} else {
|
311
|
+
return result + ' ago';
|
312
|
+
}
|
313
|
+
}
|
314
|
+
|
315
|
+
return result;
|
316
|
+
};
|
317
|
+
|
318
|
+
function buildFormatLongFn(args) {
|
319
|
+
return function () {
|
320
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
321
|
+
// TODO: Remove String()
|
322
|
+
var width = options.width ? String(options.width) : args.defaultWidth;
|
323
|
+
var format = args.formats[width] || args.formats[args.defaultWidth];
|
324
|
+
return format;
|
325
|
+
};
|
326
|
+
}
|
327
|
+
|
328
|
+
var dateFormats = {
|
329
|
+
full: 'EEEE, MMMM do, y',
|
330
|
+
long: 'MMMM do, y',
|
331
|
+
medium: 'MMM d, y',
|
332
|
+
short: 'MM/dd/yyyy'
|
333
|
+
};
|
334
|
+
var timeFormats = {
|
335
|
+
full: 'h:mm:ss a zzzz',
|
336
|
+
long: 'h:mm:ss a z',
|
337
|
+
medium: 'h:mm:ss a',
|
338
|
+
short: 'h:mm a'
|
339
|
+
};
|
340
|
+
var dateTimeFormats = {
|
341
|
+
full: "{{date}} 'at' {{time}}",
|
342
|
+
long: "{{date}} 'at' {{time}}",
|
343
|
+
medium: '{{date}}, {{time}}',
|
344
|
+
short: '{{date}}, {{time}}'
|
345
|
+
};
|
346
|
+
var formatLong = {
|
347
|
+
date: buildFormatLongFn({
|
348
|
+
formats: dateFormats,
|
349
|
+
defaultWidth: 'full'
|
350
|
+
}),
|
351
|
+
time: buildFormatLongFn({
|
352
|
+
formats: timeFormats,
|
353
|
+
defaultWidth: 'full'
|
354
|
+
}),
|
355
|
+
dateTime: buildFormatLongFn({
|
356
|
+
formats: dateTimeFormats,
|
357
|
+
defaultWidth: 'full'
|
358
|
+
})
|
359
|
+
};
|
360
|
+
|
361
|
+
var formatRelativeLocale = {
|
362
|
+
lastWeek: "'last' eeee 'at' p",
|
363
|
+
yesterday: "'yesterday at' p",
|
364
|
+
today: "'today at' p",
|
365
|
+
tomorrow: "'tomorrow at' p",
|
366
|
+
nextWeek: "eeee 'at' p",
|
367
|
+
other: 'P'
|
368
|
+
};
|
369
|
+
|
370
|
+
var formatRelative = function (token, _date, _baseDate, _options) {
|
371
|
+
return formatRelativeLocale[token];
|
372
|
+
};
|
373
|
+
|
374
|
+
function buildLocalizeFn(args) {
|
375
|
+
return function (dirtyIndex, dirtyOptions) {
|
376
|
+
var options = dirtyOptions || {};
|
377
|
+
var context = options.context ? String(options.context) : 'standalone';
|
378
|
+
var valuesArray;
|
379
|
+
|
380
|
+
if (context === 'formatting' && args.formattingValues) {
|
381
|
+
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
382
|
+
var width = options.width ? String(options.width) : defaultWidth;
|
383
|
+
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
384
|
+
} else {
|
385
|
+
var _defaultWidth = args.defaultWidth;
|
386
|
+
|
387
|
+
var _width = options.width ? String(options.width) : args.defaultWidth;
|
388
|
+
|
389
|
+
valuesArray = args.values[_width] || args.values[_defaultWidth];
|
390
|
+
}
|
391
|
+
|
392
|
+
var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
|
393
|
+
|
394
|
+
return valuesArray[index];
|
395
|
+
};
|
396
|
+
}
|
397
|
+
|
398
|
+
var eraValues = {
|
399
|
+
narrow: ['B', 'A'],
|
400
|
+
abbreviated: ['BC', 'AD'],
|
401
|
+
wide: ['Before Christ', 'Anno Domini']
|
402
|
+
};
|
403
|
+
var quarterValues = {
|
404
|
+
narrow: ['1', '2', '3', '4'],
|
405
|
+
abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
|
406
|
+
wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
|
407
|
+
}; // Note: in English, the names of days of the week and months are capitalized.
|
408
|
+
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
|
409
|
+
// Generally, formatted dates should look like they are in the middle of a sentence,
|
410
|
+
// e.g. in Spanish language the weekdays and months should be in the lowercase.
|
411
|
+
|
412
|
+
var monthValues = {
|
413
|
+
narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
|
414
|
+
abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
415
|
+
wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
|
416
|
+
};
|
417
|
+
var dayValues = {
|
418
|
+
narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
|
419
|
+
short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
|
420
|
+
abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
421
|
+
wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
|
422
|
+
};
|
423
|
+
var dayPeriodValues = {
|
424
|
+
narrow: {
|
425
|
+
am: 'a',
|
426
|
+
pm: 'p',
|
427
|
+
midnight: 'mi',
|
428
|
+
noon: 'n',
|
429
|
+
morning: 'morning',
|
430
|
+
afternoon: 'afternoon',
|
431
|
+
evening: 'evening',
|
432
|
+
night: 'night'
|
433
|
+
},
|
434
|
+
abbreviated: {
|
435
|
+
am: 'AM',
|
436
|
+
pm: 'PM',
|
437
|
+
midnight: 'midnight',
|
438
|
+
noon: 'noon',
|
439
|
+
morning: 'morning',
|
440
|
+
afternoon: 'afternoon',
|
441
|
+
evening: 'evening',
|
442
|
+
night: 'night'
|
443
|
+
},
|
444
|
+
wide: {
|
445
|
+
am: 'a.m.',
|
446
|
+
pm: 'p.m.',
|
447
|
+
midnight: 'midnight',
|
448
|
+
noon: 'noon',
|
449
|
+
morning: 'morning',
|
450
|
+
afternoon: 'afternoon',
|
451
|
+
evening: 'evening',
|
452
|
+
night: 'night'
|
453
|
+
}
|
454
|
+
};
|
455
|
+
var formattingDayPeriodValues = {
|
456
|
+
narrow: {
|
457
|
+
am: 'a',
|
458
|
+
pm: 'p',
|
459
|
+
midnight: 'mi',
|
460
|
+
noon: 'n',
|
461
|
+
morning: 'in the morning',
|
462
|
+
afternoon: 'in the afternoon',
|
463
|
+
evening: 'in the evening',
|
464
|
+
night: 'at night'
|
465
|
+
},
|
466
|
+
abbreviated: {
|
467
|
+
am: 'AM',
|
468
|
+
pm: 'PM',
|
469
|
+
midnight: 'midnight',
|
470
|
+
noon: 'noon',
|
471
|
+
morning: 'in the morning',
|
472
|
+
afternoon: 'in the afternoon',
|
473
|
+
evening: 'in the evening',
|
474
|
+
night: 'at night'
|
475
|
+
},
|
476
|
+
wide: {
|
477
|
+
am: 'a.m.',
|
478
|
+
pm: 'p.m.',
|
479
|
+
midnight: 'midnight',
|
480
|
+
noon: 'noon',
|
481
|
+
morning: 'in the morning',
|
482
|
+
afternoon: 'in the afternoon',
|
483
|
+
evening: 'in the evening',
|
484
|
+
night: 'at night'
|
485
|
+
}
|
486
|
+
};
|
487
|
+
|
488
|
+
var ordinalNumber = function (dirtyNumber, _options) {
|
489
|
+
var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
|
490
|
+
// if they are different for different grammatical genders,
|
491
|
+
// use `options.unit`.
|
492
|
+
//
|
493
|
+
// `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
|
494
|
+
// 'day', 'hour', 'minute', 'second'.
|
495
|
+
|
496
|
+
var rem100 = number % 100;
|
497
|
+
|
498
|
+
if (rem100 > 20 || rem100 < 10) {
|
499
|
+
switch (rem100 % 10) {
|
500
|
+
case 1:
|
501
|
+
return number + 'st';
|
502
|
+
|
503
|
+
case 2:
|
504
|
+
return number + 'nd';
|
505
|
+
|
506
|
+
case 3:
|
507
|
+
return number + 'rd';
|
508
|
+
}
|
509
|
+
}
|
510
|
+
|
511
|
+
return number + 'th';
|
512
|
+
};
|
513
|
+
|
514
|
+
var localize = {
|
515
|
+
ordinalNumber: ordinalNumber,
|
516
|
+
era: buildLocalizeFn({
|
517
|
+
values: eraValues,
|
518
|
+
defaultWidth: 'wide'
|
519
|
+
}),
|
520
|
+
quarter: buildLocalizeFn({
|
521
|
+
values: quarterValues,
|
522
|
+
defaultWidth: 'wide',
|
523
|
+
argumentCallback: function (quarter) {
|
524
|
+
return quarter - 1;
|
525
|
+
}
|
526
|
+
}),
|
527
|
+
month: buildLocalizeFn({
|
528
|
+
values: monthValues,
|
529
|
+
defaultWidth: 'wide'
|
530
|
+
}),
|
531
|
+
day: buildLocalizeFn({
|
532
|
+
values: dayValues,
|
533
|
+
defaultWidth: 'wide'
|
534
|
+
}),
|
535
|
+
dayPeriod: buildLocalizeFn({
|
536
|
+
values: dayPeriodValues,
|
537
|
+
defaultWidth: 'wide',
|
538
|
+
formattingValues: formattingDayPeriodValues,
|
539
|
+
defaultFormattingWidth: 'wide'
|
540
|
+
})
|
541
|
+
};
|
542
|
+
|
543
|
+
function buildMatchFn(args) {
|
544
|
+
return function (string) {
|
545
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
546
|
+
var width = options.width;
|
547
|
+
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
548
|
+
var matchResult = string.match(matchPattern);
|
549
|
+
|
550
|
+
if (!matchResult) {
|
551
|
+
return null;
|
552
|
+
}
|
553
|
+
|
554
|
+
var matchedString = matchResult[0];
|
555
|
+
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
556
|
+
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
|
557
|
+
return pattern.test(matchedString);
|
558
|
+
}) : findKey(parsePatterns, function (pattern) {
|
559
|
+
return pattern.test(matchedString);
|
560
|
+
});
|
561
|
+
var value;
|
562
|
+
value = args.valueCallback ? args.valueCallback(key) : key;
|
563
|
+
value = options.valueCallback ? options.valueCallback(value) : value;
|
564
|
+
var rest = string.slice(matchedString.length);
|
565
|
+
return {
|
566
|
+
value: value,
|
567
|
+
rest: rest
|
568
|
+
};
|
569
|
+
};
|
570
|
+
}
|
571
|
+
|
572
|
+
function findKey(object, predicate) {
|
573
|
+
for (var key in object) {
|
574
|
+
if (object.hasOwnProperty(key) && predicate(object[key])) {
|
575
|
+
return key;
|
576
|
+
}
|
577
|
+
}
|
578
|
+
|
579
|
+
return undefined;
|
580
|
+
}
|
581
|
+
|
582
|
+
function findIndex(array, predicate) {
|
583
|
+
for (var key = 0; key < array.length; key++) {
|
584
|
+
if (predicate(array[key])) {
|
585
|
+
return key;
|
586
|
+
}
|
587
|
+
}
|
588
|
+
|
589
|
+
return undefined;
|
590
|
+
}
|
591
|
+
|
592
|
+
function buildMatchPatternFn(args) {
|
593
|
+
return function (string) {
|
594
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
595
|
+
var matchResult = string.match(args.matchPattern);
|
596
|
+
if (!matchResult) return null;
|
597
|
+
var matchedString = matchResult[0];
|
598
|
+
var parseResult = string.match(args.parsePattern);
|
599
|
+
if (!parseResult) return null;
|
600
|
+
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
601
|
+
value = options.valueCallback ? options.valueCallback(value) : value;
|
602
|
+
var rest = string.slice(matchedString.length);
|
603
|
+
return {
|
604
|
+
value: value,
|
605
|
+
rest: rest
|
606
|
+
};
|
607
|
+
};
|
608
|
+
}
|
609
|
+
|
610
|
+
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
|
611
|
+
var parseOrdinalNumberPattern = /\d+/i;
|
612
|
+
var matchEraPatterns = {
|
613
|
+
narrow: /^(b|a)/i,
|
614
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
615
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
616
|
+
};
|
617
|
+
var parseEraPatterns = {
|
618
|
+
any: [/^b/i, /^(a|c)/i]
|
619
|
+
};
|
620
|
+
var matchQuarterPatterns = {
|
621
|
+
narrow: /^[1234]/i,
|
622
|
+
abbreviated: /^q[1234]/i,
|
623
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
624
|
+
};
|
625
|
+
var parseQuarterPatterns = {
|
626
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
627
|
+
};
|
628
|
+
var matchMonthPatterns = {
|
629
|
+
narrow: /^[jfmasond]/i,
|
630
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
631
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
632
|
+
};
|
633
|
+
var parseMonthPatterns = {
|
634
|
+
narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
|
635
|
+
any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
|
636
|
+
};
|
637
|
+
var matchDayPatterns = {
|
638
|
+
narrow: /^[smtwf]/i,
|
639
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
640
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
641
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
642
|
+
};
|
643
|
+
var parseDayPatterns = {
|
644
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
645
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
646
|
+
};
|
647
|
+
var matchDayPeriodPatterns = {
|
648
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
649
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
650
|
+
};
|
651
|
+
var parseDayPeriodPatterns = {
|
652
|
+
any: {
|
653
|
+
am: /^a/i,
|
654
|
+
pm: /^p/i,
|
655
|
+
midnight: /^mi/i,
|
656
|
+
noon: /^no/i,
|
657
|
+
morning: /morning/i,
|
658
|
+
afternoon: /afternoon/i,
|
659
|
+
evening: /evening/i,
|
660
|
+
night: /night/i
|
661
|
+
}
|
662
|
+
};
|
663
|
+
var match = {
|
664
|
+
ordinalNumber: buildMatchPatternFn({
|
665
|
+
matchPattern: matchOrdinalNumberPattern,
|
666
|
+
parsePattern: parseOrdinalNumberPattern,
|
667
|
+
valueCallback: function (value) {
|
668
|
+
return parseInt(value, 10);
|
669
|
+
}
|
670
|
+
}),
|
671
|
+
era: buildMatchFn({
|
672
|
+
matchPatterns: matchEraPatterns,
|
673
|
+
defaultMatchWidth: 'wide',
|
674
|
+
parsePatterns: parseEraPatterns,
|
675
|
+
defaultParseWidth: 'any'
|
676
|
+
}),
|
677
|
+
quarter: buildMatchFn({
|
678
|
+
matchPatterns: matchQuarterPatterns,
|
679
|
+
defaultMatchWidth: 'wide',
|
680
|
+
parsePatterns: parseQuarterPatterns,
|
681
|
+
defaultParseWidth: 'any',
|
682
|
+
valueCallback: function (index) {
|
683
|
+
return index + 1;
|
684
|
+
}
|
685
|
+
}),
|
686
|
+
month: buildMatchFn({
|
687
|
+
matchPatterns: matchMonthPatterns,
|
688
|
+
defaultMatchWidth: 'wide',
|
689
|
+
parsePatterns: parseMonthPatterns,
|
690
|
+
defaultParseWidth: 'any'
|
691
|
+
}),
|
692
|
+
day: buildMatchFn({
|
693
|
+
matchPatterns: matchDayPatterns,
|
694
|
+
defaultMatchWidth: 'wide',
|
695
|
+
parsePatterns: parseDayPatterns,
|
696
|
+
defaultParseWidth: 'any'
|
697
|
+
}),
|
698
|
+
dayPeriod: buildMatchFn({
|
699
|
+
matchPatterns: matchDayPeriodPatterns,
|
700
|
+
defaultMatchWidth: 'any',
|
701
|
+
parsePatterns: parseDayPeriodPatterns,
|
702
|
+
defaultParseWidth: 'any'
|
703
|
+
})
|
704
|
+
};
|
705
|
+
|
706
|
+
/**
|
707
|
+
* @type {Locale}
|
708
|
+
* @category Locales
|
709
|
+
* @summary English locale (United States).
|
710
|
+
* @language English
|
711
|
+
* @iso-639-2 eng
|
712
|
+
* @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
|
713
|
+
* @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
|
714
|
+
*/
|
715
|
+
var locale = {
|
716
|
+
code: 'en-US',
|
717
|
+
formatDistance: formatDistance,
|
718
|
+
formatLong: formatLong,
|
719
|
+
formatRelative: formatRelative,
|
720
|
+
localize: localize,
|
721
|
+
match: match,
|
722
|
+
options: {
|
723
|
+
weekStartsOn: 0
|
724
|
+
/* Sunday */
|
725
|
+
,
|
726
|
+
firstWeekContainsDate: 1
|
727
|
+
}
|
728
|
+
};
|
729
|
+
|
730
|
+
/**
|
731
|
+
* @name subMilliseconds
|
732
|
+
* @category Millisecond Helpers
|
733
|
+
* @summary Subtract the specified number of milliseconds from the given date.
|
734
|
+
*
|
735
|
+
* @description
|
736
|
+
* Subtract the specified number of milliseconds from the given date.
|
737
|
+
*
|
738
|
+
* ### v2.0.0 breaking changes:
|
739
|
+
*
|
740
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
741
|
+
*
|
742
|
+
* @param {Date|Number} date - the date to be changed
|
743
|
+
* @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`.
|
744
|
+
* @returns {Date} the new date with the milliseconds subtracted
|
745
|
+
* @throws {TypeError} 2 arguments required
|
746
|
+
*
|
747
|
+
* @example
|
748
|
+
* // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
|
749
|
+
* const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
|
750
|
+
* //=> Thu Jul 10 2014 12:45:29.250
|
751
|
+
*/
|
752
|
+
|
753
|
+
function subMilliseconds(dirtyDate, dirtyAmount) {
|
754
|
+
requiredArgs(2, arguments);
|
755
|
+
var amount = toInteger(dirtyAmount);
|
756
|
+
return addMilliseconds(dirtyDate, -amount);
|
757
|
+
}
|
758
|
+
|
759
|
+
var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
|
760
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
761
|
+
|
762
|
+
function getUTCDayOfYear(dirtyDate) {
|
763
|
+
requiredArgs(1, arguments);
|
764
|
+
var date = toDate(dirtyDate);
|
765
|
+
var timestamp = date.getTime();
|
766
|
+
date.setUTCMonth(0, 1);
|
767
|
+
date.setUTCHours(0, 0, 0, 0);
|
768
|
+
var startOfYearTimestamp = date.getTime();
|
769
|
+
var difference = timestamp - startOfYearTimestamp;
|
770
|
+
return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
|
771
|
+
}
|
772
|
+
|
773
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
774
|
+
|
775
|
+
function startOfUTCISOWeek(dirtyDate) {
|
776
|
+
requiredArgs(1, arguments);
|
777
|
+
var weekStartsOn = 1;
|
778
|
+
var date = toDate(dirtyDate);
|
779
|
+
var day = date.getUTCDay();
|
780
|
+
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
781
|
+
date.setUTCDate(date.getUTCDate() - diff);
|
782
|
+
date.setUTCHours(0, 0, 0, 0);
|
783
|
+
return date;
|
784
|
+
}
|
785
|
+
|
786
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
787
|
+
|
788
|
+
function getUTCISOWeekYear(dirtyDate) {
|
789
|
+
requiredArgs(1, arguments);
|
790
|
+
var date = toDate(dirtyDate);
|
791
|
+
var year = date.getUTCFullYear();
|
792
|
+
var fourthOfJanuaryOfNextYear = new Date(0);
|
793
|
+
fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
|
794
|
+
fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
|
795
|
+
var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
|
796
|
+
var fourthOfJanuaryOfThisYear = new Date(0);
|
797
|
+
fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
|
798
|
+
fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
|
799
|
+
var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
|
800
|
+
|
801
|
+
if (date.getTime() >= startOfNextYear.getTime()) {
|
802
|
+
return year + 1;
|
803
|
+
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
804
|
+
return year;
|
805
|
+
} else {
|
806
|
+
return year - 1;
|
807
|
+
}
|
808
|
+
}
|
809
|
+
|
810
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
811
|
+
|
812
|
+
function startOfUTCISOWeekYear(dirtyDate) {
|
813
|
+
requiredArgs(1, arguments);
|
814
|
+
var year = getUTCISOWeekYear(dirtyDate);
|
815
|
+
var fourthOfJanuary = new Date(0);
|
816
|
+
fourthOfJanuary.setUTCFullYear(year, 0, 4);
|
817
|
+
fourthOfJanuary.setUTCHours(0, 0, 0, 0);
|
818
|
+
var date = startOfUTCISOWeek(fourthOfJanuary);
|
819
|
+
return date;
|
820
|
+
}
|
821
|
+
|
822
|
+
var MILLISECONDS_IN_WEEK$1 = 604800000; // This function will be a part of public API when UTC function will be implemented.
|
823
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
824
|
+
|
825
|
+
function getUTCISOWeek(dirtyDate) {
|
826
|
+
requiredArgs(1, arguments);
|
827
|
+
var date = toDate(dirtyDate);
|
828
|
+
var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
|
829
|
+
// because the number of milliseconds in a week is not constant
|
830
|
+
// (e.g. it's different in the week of the daylight saving time clock shift)
|
831
|
+
|
832
|
+
return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
|
833
|
+
}
|
834
|
+
|
835
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
836
|
+
|
837
|
+
function startOfUTCWeek(dirtyDate, dirtyOptions) {
|
838
|
+
requiredArgs(1, arguments);
|
839
|
+
var options = dirtyOptions || {};
|
840
|
+
var locale = options.locale;
|
841
|
+
var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
|
842
|
+
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
|
843
|
+
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
844
|
+
|
845
|
+
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
846
|
+
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
847
|
+
}
|
848
|
+
|
849
|
+
var date = toDate(dirtyDate);
|
850
|
+
var day = date.getUTCDay();
|
851
|
+
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
852
|
+
date.setUTCDate(date.getUTCDate() - diff);
|
853
|
+
date.setUTCHours(0, 0, 0, 0);
|
854
|
+
return date;
|
855
|
+
}
|
856
|
+
|
857
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
858
|
+
|
859
|
+
function getUTCWeekYear(dirtyDate, dirtyOptions) {
|
860
|
+
requiredArgs(1, arguments);
|
861
|
+
var date = toDate(dirtyDate);
|
862
|
+
var year = date.getUTCFullYear();
|
863
|
+
var options = dirtyOptions || {};
|
864
|
+
var locale = options.locale;
|
865
|
+
var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
|
866
|
+
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
867
|
+
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
868
|
+
|
869
|
+
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
870
|
+
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
871
|
+
}
|
872
|
+
|
873
|
+
var firstWeekOfNextYear = new Date(0);
|
874
|
+
firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
|
875
|
+
firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
|
876
|
+
var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
|
877
|
+
var firstWeekOfThisYear = new Date(0);
|
878
|
+
firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
|
879
|
+
firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
|
880
|
+
var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
|
881
|
+
|
882
|
+
if (date.getTime() >= startOfNextYear.getTime()) {
|
883
|
+
return year + 1;
|
884
|
+
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
885
|
+
return year;
|
886
|
+
} else {
|
887
|
+
return year - 1;
|
888
|
+
}
|
889
|
+
}
|
890
|
+
|
891
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
892
|
+
|
893
|
+
function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
|
894
|
+
requiredArgs(1, arguments);
|
895
|
+
var options = dirtyOptions || {};
|
896
|
+
var locale = options.locale;
|
897
|
+
var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
|
898
|
+
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
899
|
+
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
|
900
|
+
var year = getUTCWeekYear(dirtyDate, dirtyOptions);
|
901
|
+
var firstWeek = new Date(0);
|
902
|
+
firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
|
903
|
+
firstWeek.setUTCHours(0, 0, 0, 0);
|
904
|
+
var date = startOfUTCWeek(firstWeek, dirtyOptions);
|
905
|
+
return date;
|
906
|
+
}
|
907
|
+
|
908
|
+
var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.
|
909
|
+
// See issue: https://github.com/date-fns/date-fns/issues/376
|
910
|
+
|
911
|
+
function getUTCWeek(dirtyDate, options) {
|
912
|
+
requiredArgs(1, arguments);
|
913
|
+
var date = toDate(dirtyDate);
|
914
|
+
var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
|
915
|
+
// because the number of milliseconds in a week is not constant
|
916
|
+
// (e.g. it's different in the week of the daylight saving time clock shift)
|
917
|
+
|
918
|
+
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
|
919
|
+
}
|
920
|
+
|
921
|
+
function addLeadingZeros(number, targetLength) {
|
922
|
+
var sign = number < 0 ? '-' : '';
|
923
|
+
var output = Math.abs(number).toString();
|
924
|
+
|
925
|
+
while (output.length < targetLength) {
|
926
|
+
output = '0' + output;
|
927
|
+
}
|
928
|
+
|
929
|
+
return sign + output;
|
930
|
+
}
|
931
|
+
|
932
|
+
/*
|
933
|
+
* | | Unit | | Unit |
|
934
|
+
* |-----|--------------------------------|-----|--------------------------------|
|
935
|
+
* | a | AM, PM | A* | |
|
936
|
+
* | d | Day of month | D | |
|
937
|
+
* | h | Hour [1-12] | H | Hour [0-23] |
|
938
|
+
* | m | Minute | M | Month |
|
939
|
+
* | s | Second | S | Fraction of second |
|
940
|
+
* | y | Year (abs) | Y | |
|
941
|
+
*
|
942
|
+
* Letters marked by * are not implemented but reserved by Unicode standard.
|
943
|
+
*/
|
944
|
+
|
945
|
+
var formatters$1 = {
|
946
|
+
// Year
|
947
|
+
y: function (date, token) {
|
948
|
+
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
|
949
|
+
// | Year | y | yy | yyy | yyyy | yyyyy |
|
950
|
+
// |----------|-------|----|-------|-------|-------|
|
951
|
+
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
|
952
|
+
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
|
953
|
+
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
954
|
+
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
955
|
+
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
956
|
+
var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
957
|
+
|
958
|
+
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
959
|
+
return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
|
960
|
+
},
|
961
|
+
// Month
|
962
|
+
M: function (date, token) {
|
963
|
+
var month = date.getUTCMonth();
|
964
|
+
return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
|
965
|
+
},
|
966
|
+
// Day of the month
|
967
|
+
d: function (date, token) {
|
968
|
+
return addLeadingZeros(date.getUTCDate(), token.length);
|
969
|
+
},
|
970
|
+
// AM or PM
|
971
|
+
a: function (date, token) {
|
972
|
+
var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
|
973
|
+
|
974
|
+
switch (token) {
|
975
|
+
case 'a':
|
976
|
+
case 'aa':
|
977
|
+
return dayPeriodEnumValue.toUpperCase();
|
978
|
+
|
979
|
+
case 'aaa':
|
980
|
+
return dayPeriodEnumValue;
|
981
|
+
|
982
|
+
case 'aaaaa':
|
983
|
+
return dayPeriodEnumValue[0];
|
984
|
+
|
985
|
+
case 'aaaa':
|
986
|
+
default:
|
987
|
+
return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
|
988
|
+
}
|
989
|
+
},
|
990
|
+
// Hour [1-12]
|
991
|
+
h: function (date, token) {
|
992
|
+
return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
|
993
|
+
},
|
994
|
+
// Hour [0-23]
|
995
|
+
H: function (date, token) {
|
996
|
+
return addLeadingZeros(date.getUTCHours(), token.length);
|
997
|
+
},
|
998
|
+
// Minute
|
999
|
+
m: function (date, token) {
|
1000
|
+
return addLeadingZeros(date.getUTCMinutes(), token.length);
|
1001
|
+
},
|
1002
|
+
// Second
|
1003
|
+
s: function (date, token) {
|
1004
|
+
return addLeadingZeros(date.getUTCSeconds(), token.length);
|
1005
|
+
},
|
1006
|
+
// Fraction of second
|
1007
|
+
S: function (date, token) {
|
1008
|
+
var numberOfDigits = token.length;
|
1009
|
+
var milliseconds = date.getUTCMilliseconds();
|
1010
|
+
var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
|
1011
|
+
return addLeadingZeros(fractionalSeconds, token.length);
|
1012
|
+
}
|
1013
|
+
};
|
1014
|
+
|
1015
|
+
var dayPeriodEnum = {
|
1016
|
+
am: 'am',
|
1017
|
+
pm: 'pm',
|
1018
|
+
midnight: 'midnight',
|
1019
|
+
noon: 'noon',
|
1020
|
+
morning: 'morning',
|
1021
|
+
afternoon: 'afternoon',
|
1022
|
+
evening: 'evening',
|
1023
|
+
night: 'night'
|
1024
|
+
};
|
1025
|
+
/*
|
1026
|
+
* | | Unit | | Unit |
|
1027
|
+
* |-----|--------------------------------|-----|--------------------------------|
|
1028
|
+
* | a | AM, PM | A* | Milliseconds in day |
|
1029
|
+
* | b | AM, PM, noon, midnight | B | Flexible day period |
|
1030
|
+
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
|
1031
|
+
* | d | Day of month | D | Day of year |
|
1032
|
+
* | e | Local day of week | E | Day of week |
|
1033
|
+
* | f | | F* | Day of week in month |
|
1034
|
+
* | g* | Modified Julian day | G | Era |
|
1035
|
+
* | h | Hour [1-12] | H | Hour [0-23] |
|
1036
|
+
* | i! | ISO day of week | I! | ISO week of year |
|
1037
|
+
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
|
1038
|
+
* | k | Hour [1-24] | K | Hour [0-11] |
|
1039
|
+
* | l* | (deprecated) | L | Stand-alone month |
|
1040
|
+
* | m | Minute | M | Month |
|
1041
|
+
* | n | | N | |
|
1042
|
+
* | o! | Ordinal number modifier | O | Timezone (GMT) |
|
1043
|
+
* | p! | Long localized time | P! | Long localized date |
|
1044
|
+
* | q | Stand-alone quarter | Q | Quarter |
|
1045
|
+
* | r* | Related Gregorian year | R! | ISO week-numbering year |
|
1046
|
+
* | s | Second | S | Fraction of second |
|
1047
|
+
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
|
1048
|
+
* | u | Extended year | U* | Cyclic year |
|
1049
|
+
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
|
1050
|
+
* | w | Local week of year | W* | Week of month |
|
1051
|
+
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
|
1052
|
+
* | y | Year (abs) | Y | Local week-numbering year |
|
1053
|
+
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
|
1054
|
+
*
|
1055
|
+
* Letters marked by * are not implemented but reserved by Unicode standard.
|
1056
|
+
*
|
1057
|
+
* Letters marked by ! are non-standard, but implemented by date-fns:
|
1058
|
+
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
|
1059
|
+
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
|
1060
|
+
* i.e. 7 for Sunday, 1 for Monday, etc.
|
1061
|
+
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
|
1062
|
+
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
|
1063
|
+
* `R` is supposed to be used in conjunction with `I` and `i`
|
1064
|
+
* for universal ISO week-numbering date, whereas
|
1065
|
+
* `Y` is supposed to be used in conjunction with `w` and `e`
|
1066
|
+
* for week-numbering date specific to the locale.
|
1067
|
+
* - `P` is long localized date format
|
1068
|
+
* - `p` is long localized time format
|
1069
|
+
*/
|
1070
|
+
|
1071
|
+
var formatters = {
|
1072
|
+
// Era
|
1073
|
+
G: function (date, token, localize) {
|
1074
|
+
var era = date.getUTCFullYear() > 0 ? 1 : 0;
|
1075
|
+
|
1076
|
+
switch (token) {
|
1077
|
+
// AD, BC
|
1078
|
+
case 'G':
|
1079
|
+
case 'GG':
|
1080
|
+
case 'GGG':
|
1081
|
+
return localize.era(era, {
|
1082
|
+
width: 'abbreviated'
|
1083
|
+
});
|
1084
|
+
// A, B
|
1085
|
+
|
1086
|
+
case 'GGGGG':
|
1087
|
+
return localize.era(era, {
|
1088
|
+
width: 'narrow'
|
1089
|
+
});
|
1090
|
+
// Anno Domini, Before Christ
|
1091
|
+
|
1092
|
+
case 'GGGG':
|
1093
|
+
default:
|
1094
|
+
return localize.era(era, {
|
1095
|
+
width: 'wide'
|
1096
|
+
});
|
1097
|
+
}
|
1098
|
+
},
|
1099
|
+
// Year
|
1100
|
+
y: function (date, token, localize) {
|
1101
|
+
// Ordinal number
|
1102
|
+
if (token === 'yo') {
|
1103
|
+
var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
1104
|
+
|
1105
|
+
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
1106
|
+
return localize.ordinalNumber(year, {
|
1107
|
+
unit: 'year'
|
1108
|
+
});
|
1109
|
+
}
|
1110
|
+
|
1111
|
+
return formatters$1.y(date, token);
|
1112
|
+
},
|
1113
|
+
// Local week-numbering year
|
1114
|
+
Y: function (date, token, localize, options) {
|
1115
|
+
var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
1116
|
+
|
1117
|
+
var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
|
1118
|
+
|
1119
|
+
if (token === 'YY') {
|
1120
|
+
var twoDigitYear = weekYear % 100;
|
1121
|
+
return addLeadingZeros(twoDigitYear, 2);
|
1122
|
+
} // Ordinal number
|
1123
|
+
|
1124
|
+
|
1125
|
+
if (token === 'Yo') {
|
1126
|
+
return localize.ordinalNumber(weekYear, {
|
1127
|
+
unit: 'year'
|
1128
|
+
});
|
1129
|
+
} // Padding
|
1130
|
+
|
1131
|
+
|
1132
|
+
return addLeadingZeros(weekYear, token.length);
|
1133
|
+
},
|
1134
|
+
// ISO week-numbering year
|
1135
|
+
R: function (date, token) {
|
1136
|
+
var isoWeekYear = getUTCISOWeekYear(date); // Padding
|
1137
|
+
|
1138
|
+
return addLeadingZeros(isoWeekYear, token.length);
|
1139
|
+
},
|
1140
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
1141
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
1142
|
+
// | Year | `y` | `u` |
|
1143
|
+
// |------|-----|-----|
|
1144
|
+
// | AC 1 | 1 | 1 |
|
1145
|
+
// | BC 1 | 1 | 0 |
|
1146
|
+
// | BC 2 | 2 | -1 |
|
1147
|
+
// Also `yy` always returns the last two digits of a year,
|
1148
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
1149
|
+
u: function (date, token) {
|
1150
|
+
var year = date.getUTCFullYear();
|
1151
|
+
return addLeadingZeros(year, token.length);
|
1152
|
+
},
|
1153
|
+
// Quarter
|
1154
|
+
Q: function (date, token, localize) {
|
1155
|
+
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
1156
|
+
|
1157
|
+
switch (token) {
|
1158
|
+
// 1, 2, 3, 4
|
1159
|
+
case 'Q':
|
1160
|
+
return String(quarter);
|
1161
|
+
// 01, 02, 03, 04
|
1162
|
+
|
1163
|
+
case 'QQ':
|
1164
|
+
return addLeadingZeros(quarter, 2);
|
1165
|
+
// 1st, 2nd, 3rd, 4th
|
1166
|
+
|
1167
|
+
case 'Qo':
|
1168
|
+
return localize.ordinalNumber(quarter, {
|
1169
|
+
unit: 'quarter'
|
1170
|
+
});
|
1171
|
+
// Q1, Q2, Q3, Q4
|
1172
|
+
|
1173
|
+
case 'QQQ':
|
1174
|
+
return localize.quarter(quarter, {
|
1175
|
+
width: 'abbreviated',
|
1176
|
+
context: 'formatting'
|
1177
|
+
});
|
1178
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
1179
|
+
|
1180
|
+
case 'QQQQQ':
|
1181
|
+
return localize.quarter(quarter, {
|
1182
|
+
width: 'narrow',
|
1183
|
+
context: 'formatting'
|
1184
|
+
});
|
1185
|
+
// 1st quarter, 2nd quarter, ...
|
1186
|
+
|
1187
|
+
case 'QQQQ':
|
1188
|
+
default:
|
1189
|
+
return localize.quarter(quarter, {
|
1190
|
+
width: 'wide',
|
1191
|
+
context: 'formatting'
|
1192
|
+
});
|
1193
|
+
}
|
1194
|
+
},
|
1195
|
+
// Stand-alone quarter
|
1196
|
+
q: function (date, token, localize) {
|
1197
|
+
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
1198
|
+
|
1199
|
+
switch (token) {
|
1200
|
+
// 1, 2, 3, 4
|
1201
|
+
case 'q':
|
1202
|
+
return String(quarter);
|
1203
|
+
// 01, 02, 03, 04
|
1204
|
+
|
1205
|
+
case 'qq':
|
1206
|
+
return addLeadingZeros(quarter, 2);
|
1207
|
+
// 1st, 2nd, 3rd, 4th
|
1208
|
+
|
1209
|
+
case 'qo':
|
1210
|
+
return localize.ordinalNumber(quarter, {
|
1211
|
+
unit: 'quarter'
|
1212
|
+
});
|
1213
|
+
// Q1, Q2, Q3, Q4
|
1214
|
+
|
1215
|
+
case 'qqq':
|
1216
|
+
return localize.quarter(quarter, {
|
1217
|
+
width: 'abbreviated',
|
1218
|
+
context: 'standalone'
|
1219
|
+
});
|
1220
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
1221
|
+
|
1222
|
+
case 'qqqqq':
|
1223
|
+
return localize.quarter(quarter, {
|
1224
|
+
width: 'narrow',
|
1225
|
+
context: 'standalone'
|
1226
|
+
});
|
1227
|
+
// 1st quarter, 2nd quarter, ...
|
1228
|
+
|
1229
|
+
case 'qqqq':
|
1230
|
+
default:
|
1231
|
+
return localize.quarter(quarter, {
|
1232
|
+
width: 'wide',
|
1233
|
+
context: 'standalone'
|
1234
|
+
});
|
1235
|
+
}
|
1236
|
+
},
|
1237
|
+
// Month
|
1238
|
+
M: function (date, token, localize) {
|
1239
|
+
var month = date.getUTCMonth();
|
1240
|
+
|
1241
|
+
switch (token) {
|
1242
|
+
case 'M':
|
1243
|
+
case 'MM':
|
1244
|
+
return formatters$1.M(date, token);
|
1245
|
+
// 1st, 2nd, ..., 12th
|
1246
|
+
|
1247
|
+
case 'Mo':
|
1248
|
+
return localize.ordinalNumber(month + 1, {
|
1249
|
+
unit: 'month'
|
1250
|
+
});
|
1251
|
+
// Jan, Feb, ..., Dec
|
1252
|
+
|
1253
|
+
case 'MMM':
|
1254
|
+
return localize.month(month, {
|
1255
|
+
width: 'abbreviated',
|
1256
|
+
context: 'formatting'
|
1257
|
+
});
|
1258
|
+
// J, F, ..., D
|
1259
|
+
|
1260
|
+
case 'MMMMM':
|
1261
|
+
return localize.month(month, {
|
1262
|
+
width: 'narrow',
|
1263
|
+
context: 'formatting'
|
1264
|
+
});
|
1265
|
+
// January, February, ..., December
|
1266
|
+
|
1267
|
+
case 'MMMM':
|
1268
|
+
default:
|
1269
|
+
return localize.month(month, {
|
1270
|
+
width: 'wide',
|
1271
|
+
context: 'formatting'
|
1272
|
+
});
|
1273
|
+
}
|
1274
|
+
},
|
1275
|
+
// Stand-alone month
|
1276
|
+
L: function (date, token, localize) {
|
1277
|
+
var month = date.getUTCMonth();
|
1278
|
+
|
1279
|
+
switch (token) {
|
1280
|
+
// 1, 2, ..., 12
|
1281
|
+
case 'L':
|
1282
|
+
return String(month + 1);
|
1283
|
+
// 01, 02, ..., 12
|
1284
|
+
|
1285
|
+
case 'LL':
|
1286
|
+
return addLeadingZeros(month + 1, 2);
|
1287
|
+
// 1st, 2nd, ..., 12th
|
1288
|
+
|
1289
|
+
case 'Lo':
|
1290
|
+
return localize.ordinalNumber(month + 1, {
|
1291
|
+
unit: 'month'
|
1292
|
+
});
|
1293
|
+
// Jan, Feb, ..., Dec
|
1294
|
+
|
1295
|
+
case 'LLL':
|
1296
|
+
return localize.month(month, {
|
1297
|
+
width: 'abbreviated',
|
1298
|
+
context: 'standalone'
|
1299
|
+
});
|
1300
|
+
// J, F, ..., D
|
1301
|
+
|
1302
|
+
case 'LLLLL':
|
1303
|
+
return localize.month(month, {
|
1304
|
+
width: 'narrow',
|
1305
|
+
context: 'standalone'
|
1306
|
+
});
|
1307
|
+
// January, February, ..., December
|
1308
|
+
|
1309
|
+
case 'LLLL':
|
1310
|
+
default:
|
1311
|
+
return localize.month(month, {
|
1312
|
+
width: 'wide',
|
1313
|
+
context: 'standalone'
|
1314
|
+
});
|
1315
|
+
}
|
1316
|
+
},
|
1317
|
+
// Local week of year
|
1318
|
+
w: function (date, token, localize, options) {
|
1319
|
+
var week = getUTCWeek(date, options);
|
1320
|
+
|
1321
|
+
if (token === 'wo') {
|
1322
|
+
return localize.ordinalNumber(week, {
|
1323
|
+
unit: 'week'
|
1324
|
+
});
|
1325
|
+
}
|
1326
|
+
|
1327
|
+
return addLeadingZeros(week, token.length);
|
1328
|
+
},
|
1329
|
+
// ISO week of year
|
1330
|
+
I: function (date, token, localize) {
|
1331
|
+
var isoWeek = getUTCISOWeek(date);
|
1332
|
+
|
1333
|
+
if (token === 'Io') {
|
1334
|
+
return localize.ordinalNumber(isoWeek, {
|
1335
|
+
unit: 'week'
|
1336
|
+
});
|
1337
|
+
}
|
1338
|
+
|
1339
|
+
return addLeadingZeros(isoWeek, token.length);
|
1340
|
+
},
|
1341
|
+
// Day of the month
|
1342
|
+
d: function (date, token, localize) {
|
1343
|
+
if (token === 'do') {
|
1344
|
+
return localize.ordinalNumber(date.getUTCDate(), {
|
1345
|
+
unit: 'date'
|
1346
|
+
});
|
1347
|
+
}
|
1348
|
+
|
1349
|
+
return formatters$1.d(date, token);
|
1350
|
+
},
|
1351
|
+
// Day of year
|
1352
|
+
D: function (date, token, localize) {
|
1353
|
+
var dayOfYear = getUTCDayOfYear(date);
|
1354
|
+
|
1355
|
+
if (token === 'Do') {
|
1356
|
+
return localize.ordinalNumber(dayOfYear, {
|
1357
|
+
unit: 'dayOfYear'
|
1358
|
+
});
|
1359
|
+
}
|
1360
|
+
|
1361
|
+
return addLeadingZeros(dayOfYear, token.length);
|
1362
|
+
},
|
1363
|
+
// Day of week
|
1364
|
+
E: function (date, token, localize) {
|
1365
|
+
var dayOfWeek = date.getUTCDay();
|
1366
|
+
|
1367
|
+
switch (token) {
|
1368
|
+
// Tue
|
1369
|
+
case 'E':
|
1370
|
+
case 'EE':
|
1371
|
+
case 'EEE':
|
1372
|
+
return localize.day(dayOfWeek, {
|
1373
|
+
width: 'abbreviated',
|
1374
|
+
context: 'formatting'
|
1375
|
+
});
|
1376
|
+
// T
|
1377
|
+
|
1378
|
+
case 'EEEEE':
|
1379
|
+
return localize.day(dayOfWeek, {
|
1380
|
+
width: 'narrow',
|
1381
|
+
context: 'formatting'
|
1382
|
+
});
|
1383
|
+
// Tu
|
1384
|
+
|
1385
|
+
case 'EEEEEE':
|
1386
|
+
return localize.day(dayOfWeek, {
|
1387
|
+
width: 'short',
|
1388
|
+
context: 'formatting'
|
1389
|
+
});
|
1390
|
+
// Tuesday
|
1391
|
+
|
1392
|
+
case 'EEEE':
|
1393
|
+
default:
|
1394
|
+
return localize.day(dayOfWeek, {
|
1395
|
+
width: 'wide',
|
1396
|
+
context: 'formatting'
|
1397
|
+
});
|
1398
|
+
}
|
1399
|
+
},
|
1400
|
+
// Local day of week
|
1401
|
+
e: function (date, token, localize, options) {
|
1402
|
+
var dayOfWeek = date.getUTCDay();
|
1403
|
+
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
1404
|
+
|
1405
|
+
switch (token) {
|
1406
|
+
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
1407
|
+
case 'e':
|
1408
|
+
return String(localDayOfWeek);
|
1409
|
+
// Padded numerical value
|
1410
|
+
|
1411
|
+
case 'ee':
|
1412
|
+
return addLeadingZeros(localDayOfWeek, 2);
|
1413
|
+
// 1st, 2nd, ..., 7th
|
1414
|
+
|
1415
|
+
case 'eo':
|
1416
|
+
return localize.ordinalNumber(localDayOfWeek, {
|
1417
|
+
unit: 'day'
|
1418
|
+
});
|
1419
|
+
|
1420
|
+
case 'eee':
|
1421
|
+
return localize.day(dayOfWeek, {
|
1422
|
+
width: 'abbreviated',
|
1423
|
+
context: 'formatting'
|
1424
|
+
});
|
1425
|
+
// T
|
1426
|
+
|
1427
|
+
case 'eeeee':
|
1428
|
+
return localize.day(dayOfWeek, {
|
1429
|
+
width: 'narrow',
|
1430
|
+
context: 'formatting'
|
1431
|
+
});
|
1432
|
+
// Tu
|
1433
|
+
|
1434
|
+
case 'eeeeee':
|
1435
|
+
return localize.day(dayOfWeek, {
|
1436
|
+
width: 'short',
|
1437
|
+
context: 'formatting'
|
1438
|
+
});
|
1439
|
+
// Tuesday
|
1440
|
+
|
1441
|
+
case 'eeee':
|
1442
|
+
default:
|
1443
|
+
return localize.day(dayOfWeek, {
|
1444
|
+
width: 'wide',
|
1445
|
+
context: 'formatting'
|
1446
|
+
});
|
1447
|
+
}
|
1448
|
+
},
|
1449
|
+
// Stand-alone local day of week
|
1450
|
+
c: function (date, token, localize, options) {
|
1451
|
+
var dayOfWeek = date.getUTCDay();
|
1452
|
+
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
1453
|
+
|
1454
|
+
switch (token) {
|
1455
|
+
// Numerical value (same as in `e`)
|
1456
|
+
case 'c':
|
1457
|
+
return String(localDayOfWeek);
|
1458
|
+
// Padded numerical value
|
1459
|
+
|
1460
|
+
case 'cc':
|
1461
|
+
return addLeadingZeros(localDayOfWeek, token.length);
|
1462
|
+
// 1st, 2nd, ..., 7th
|
1463
|
+
|
1464
|
+
case 'co':
|
1465
|
+
return localize.ordinalNumber(localDayOfWeek, {
|
1466
|
+
unit: 'day'
|
1467
|
+
});
|
1468
|
+
|
1469
|
+
case 'ccc':
|
1470
|
+
return localize.day(dayOfWeek, {
|
1471
|
+
width: 'abbreviated',
|
1472
|
+
context: 'standalone'
|
1473
|
+
});
|
1474
|
+
// T
|
1475
|
+
|
1476
|
+
case 'ccccc':
|
1477
|
+
return localize.day(dayOfWeek, {
|
1478
|
+
width: 'narrow',
|
1479
|
+
context: 'standalone'
|
1480
|
+
});
|
1481
|
+
// Tu
|
1482
|
+
|
1483
|
+
case 'cccccc':
|
1484
|
+
return localize.day(dayOfWeek, {
|
1485
|
+
width: 'short',
|
1486
|
+
context: 'standalone'
|
1487
|
+
});
|
1488
|
+
// Tuesday
|
1489
|
+
|
1490
|
+
case 'cccc':
|
1491
|
+
default:
|
1492
|
+
return localize.day(dayOfWeek, {
|
1493
|
+
width: 'wide',
|
1494
|
+
context: 'standalone'
|
1495
|
+
});
|
1496
|
+
}
|
1497
|
+
},
|
1498
|
+
// ISO day of week
|
1499
|
+
i: function (date, token, localize) {
|
1500
|
+
var dayOfWeek = date.getUTCDay();
|
1501
|
+
var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
1502
|
+
|
1503
|
+
switch (token) {
|
1504
|
+
// 2
|
1505
|
+
case 'i':
|
1506
|
+
return String(isoDayOfWeek);
|
1507
|
+
// 02
|
1508
|
+
|
1509
|
+
case 'ii':
|
1510
|
+
return addLeadingZeros(isoDayOfWeek, token.length);
|
1511
|
+
// 2nd
|
1512
|
+
|
1513
|
+
case 'io':
|
1514
|
+
return localize.ordinalNumber(isoDayOfWeek, {
|
1515
|
+
unit: 'day'
|
1516
|
+
});
|
1517
|
+
// Tue
|
1518
|
+
|
1519
|
+
case 'iii':
|
1520
|
+
return localize.day(dayOfWeek, {
|
1521
|
+
width: 'abbreviated',
|
1522
|
+
context: 'formatting'
|
1523
|
+
});
|
1524
|
+
// T
|
1525
|
+
|
1526
|
+
case 'iiiii':
|
1527
|
+
return localize.day(dayOfWeek, {
|
1528
|
+
width: 'narrow',
|
1529
|
+
context: 'formatting'
|
1530
|
+
});
|
1531
|
+
// Tu
|
1532
|
+
|
1533
|
+
case 'iiiiii':
|
1534
|
+
return localize.day(dayOfWeek, {
|
1535
|
+
width: 'short',
|
1536
|
+
context: 'formatting'
|
1537
|
+
});
|
1538
|
+
// Tuesday
|
1539
|
+
|
1540
|
+
case 'iiii':
|
1541
|
+
default:
|
1542
|
+
return localize.day(dayOfWeek, {
|
1543
|
+
width: 'wide',
|
1544
|
+
context: 'formatting'
|
1545
|
+
});
|
1546
|
+
}
|
1547
|
+
},
|
1548
|
+
// AM or PM
|
1549
|
+
a: function (date, token, localize) {
|
1550
|
+
var hours = date.getUTCHours();
|
1551
|
+
var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
|
1552
|
+
|
1553
|
+
switch (token) {
|
1554
|
+
case 'a':
|
1555
|
+
case 'aa':
|
1556
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
1557
|
+
width: 'abbreviated',
|
1558
|
+
context: 'formatting'
|
1559
|
+
});
|
1560
|
+
|
1561
|
+
case 'aaa':
|
1562
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
1563
|
+
width: 'abbreviated',
|
1564
|
+
context: 'formatting'
|
1565
|
+
}).toLowerCase();
|
1566
|
+
|
1567
|
+
case 'aaaaa':
|
1568
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
1569
|
+
width: 'narrow',
|
1570
|
+
context: 'formatting'
|
1571
|
+
});
|
1572
|
+
|
1573
|
+
case 'aaaa':
|
1574
|
+
default:
|
1575
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
1576
|
+
width: 'wide',
|
1577
|
+
context: 'formatting'
|
1578
|
+
});
|
1579
|
+
}
|
1580
|
+
},
|
1581
|
+
// AM, PM, midnight, noon
|
1582
|
+
b: function (date, token, localize) {
|
1583
|
+
var hours = date.getUTCHours();
|
1584
|
+
var dayPeriodEnumValue;
|
1585
|
+
|
1586
|
+
if (hours === 12) {
|
1587
|
+
dayPeriodEnumValue = dayPeriodEnum.noon;
|
1588
|
+
} else if (hours === 0) {
|
1589
|
+
dayPeriodEnumValue = dayPeriodEnum.midnight;
|
1590
|
+
} else {
|
1591
|
+
dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
|
1592
|
+
}
|
1593
|
+
|
1594
|
+
switch (token) {
|
1595
|
+
case 'b':
|
1596
|
+
case 'bb':
|
1597
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
1598
|
+
width: 'abbreviated',
|
1599
|
+
context: 'formatting'
|
1600
|
+
});
|
1601
|
+
|
1602
|
+
case 'bbb':
|
1603
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
1604
|
+
width: 'abbreviated',
|
1605
|
+
context: 'formatting'
|
1606
|
+
}).toLowerCase();
|
1607
|
+
|
1608
|
+
case 'bbbbb':
|
1609
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
1610
|
+
width: 'narrow',
|
1611
|
+
context: 'formatting'
|
1612
|
+
});
|
1613
|
+
|
1614
|
+
case 'bbbb':
|
1615
|
+
default:
|
1616
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
1617
|
+
width: 'wide',
|
1618
|
+
context: 'formatting'
|
1619
|
+
});
|
1620
|
+
}
|
1621
|
+
},
|
1622
|
+
// in the morning, in the afternoon, in the evening, at night
|
1623
|
+
B: function (date, token, localize) {
|
1624
|
+
var hours = date.getUTCHours();
|
1625
|
+
var dayPeriodEnumValue;
|
1626
|
+
|
1627
|
+
if (hours >= 17) {
|
1628
|
+
dayPeriodEnumValue = dayPeriodEnum.evening;
|
1629
|
+
} else if (hours >= 12) {
|
1630
|
+
dayPeriodEnumValue = dayPeriodEnum.afternoon;
|
1631
|
+
} else if (hours >= 4) {
|
1632
|
+
dayPeriodEnumValue = dayPeriodEnum.morning;
|
1633
|
+
} else {
|
1634
|
+
dayPeriodEnumValue = dayPeriodEnum.night;
|
1635
|
+
}
|
1636
|
+
|
1637
|
+
switch (token) {
|
1638
|
+
case 'B':
|
1639
|
+
case 'BB':
|
1640
|
+
case 'BBB':
|
1641
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
1642
|
+
width: 'abbreviated',
|
1643
|
+
context: 'formatting'
|
1644
|
+
});
|
1645
|
+
|
1646
|
+
case 'BBBBB':
|
1647
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
1648
|
+
width: 'narrow',
|
1649
|
+
context: 'formatting'
|
1650
|
+
});
|
1651
|
+
|
1652
|
+
case 'BBBB':
|
1653
|
+
default:
|
1654
|
+
return localize.dayPeriod(dayPeriodEnumValue, {
|
1655
|
+
width: 'wide',
|
1656
|
+
context: 'formatting'
|
1657
|
+
});
|
1658
|
+
}
|
1659
|
+
},
|
1660
|
+
// Hour [1-12]
|
1661
|
+
h: function (date, token, localize) {
|
1662
|
+
if (token === 'ho') {
|
1663
|
+
var hours = date.getUTCHours() % 12;
|
1664
|
+
if (hours === 0) hours = 12;
|
1665
|
+
return localize.ordinalNumber(hours, {
|
1666
|
+
unit: 'hour'
|
1667
|
+
});
|
1668
|
+
}
|
1669
|
+
|
1670
|
+
return formatters$1.h(date, token);
|
1671
|
+
},
|
1672
|
+
// Hour [0-23]
|
1673
|
+
H: function (date, token, localize) {
|
1674
|
+
if (token === 'Ho') {
|
1675
|
+
return localize.ordinalNumber(date.getUTCHours(), {
|
1676
|
+
unit: 'hour'
|
1677
|
+
});
|
1678
|
+
}
|
1679
|
+
|
1680
|
+
return formatters$1.H(date, token);
|
1681
|
+
},
|
1682
|
+
// Hour [0-11]
|
1683
|
+
K: function (date, token, localize) {
|
1684
|
+
var hours = date.getUTCHours() % 12;
|
1685
|
+
|
1686
|
+
if (token === 'Ko') {
|
1687
|
+
return localize.ordinalNumber(hours, {
|
1688
|
+
unit: 'hour'
|
1689
|
+
});
|
1690
|
+
}
|
1691
|
+
|
1692
|
+
return addLeadingZeros(hours, token.length);
|
1693
|
+
},
|
1694
|
+
// Hour [1-24]
|
1695
|
+
k: function (date, token, localize) {
|
1696
|
+
var hours = date.getUTCHours();
|
1697
|
+
if (hours === 0) hours = 24;
|
1698
|
+
|
1699
|
+
if (token === 'ko') {
|
1700
|
+
return localize.ordinalNumber(hours, {
|
1701
|
+
unit: 'hour'
|
1702
|
+
});
|
1703
|
+
}
|
1704
|
+
|
1705
|
+
return addLeadingZeros(hours, token.length);
|
1706
|
+
},
|
1707
|
+
// Minute
|
1708
|
+
m: function (date, token, localize) {
|
1709
|
+
if (token === 'mo') {
|
1710
|
+
return localize.ordinalNumber(date.getUTCMinutes(), {
|
1711
|
+
unit: 'minute'
|
1712
|
+
});
|
1713
|
+
}
|
1714
|
+
|
1715
|
+
return formatters$1.m(date, token);
|
1716
|
+
},
|
1717
|
+
// Second
|
1718
|
+
s: function (date, token, localize) {
|
1719
|
+
if (token === 'so') {
|
1720
|
+
return localize.ordinalNumber(date.getUTCSeconds(), {
|
1721
|
+
unit: 'second'
|
1722
|
+
});
|
1723
|
+
}
|
1724
|
+
|
1725
|
+
return formatters$1.s(date, token);
|
1726
|
+
},
|
1727
|
+
// Fraction of second
|
1728
|
+
S: function (date, token) {
|
1729
|
+
return formatters$1.S(date, token);
|
1730
|
+
},
|
1731
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
1732
|
+
X: function (date, token, _localize, options) {
|
1733
|
+
var originalDate = options._originalDate || date;
|
1734
|
+
var timezoneOffset = originalDate.getTimezoneOffset();
|
1735
|
+
|
1736
|
+
if (timezoneOffset === 0) {
|
1737
|
+
return 'Z';
|
1738
|
+
}
|
1739
|
+
|
1740
|
+
switch (token) {
|
1741
|
+
// Hours and optional minutes
|
1742
|
+
case 'X':
|
1743
|
+
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
1744
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
1745
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
1746
|
+
// so this token always has the same output as `XX`
|
1747
|
+
|
1748
|
+
case 'XXXX':
|
1749
|
+
case 'XX':
|
1750
|
+
// Hours and minutes without `:` delimiter
|
1751
|
+
return formatTimezone(timezoneOffset);
|
1752
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
1753
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
1754
|
+
// so this token always has the same output as `XXX`
|
1755
|
+
|
1756
|
+
case 'XXXXX':
|
1757
|
+
case 'XXX': // Hours and minutes with `:` delimiter
|
1758
|
+
|
1759
|
+
default:
|
1760
|
+
return formatTimezone(timezoneOffset, ':');
|
1761
|
+
}
|
1762
|
+
},
|
1763
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
1764
|
+
x: function (date, token, _localize, options) {
|
1765
|
+
var originalDate = options._originalDate || date;
|
1766
|
+
var timezoneOffset = originalDate.getTimezoneOffset();
|
1767
|
+
|
1768
|
+
switch (token) {
|
1769
|
+
// Hours and optional minutes
|
1770
|
+
case 'x':
|
1771
|
+
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
1772
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
1773
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
1774
|
+
// so this token always has the same output as `xx`
|
1775
|
+
|
1776
|
+
case 'xxxx':
|
1777
|
+
case 'xx':
|
1778
|
+
// Hours and minutes without `:` delimiter
|
1779
|
+
return formatTimezone(timezoneOffset);
|
1780
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
1781
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
1782
|
+
// so this token always has the same output as `xxx`
|
1783
|
+
|
1784
|
+
case 'xxxxx':
|
1785
|
+
case 'xxx': // Hours and minutes with `:` delimiter
|
1786
|
+
|
1787
|
+
default:
|
1788
|
+
return formatTimezone(timezoneOffset, ':');
|
1789
|
+
}
|
1790
|
+
},
|
1791
|
+
// Timezone (GMT)
|
1792
|
+
O: function (date, token, _localize, options) {
|
1793
|
+
var originalDate = options._originalDate || date;
|
1794
|
+
var timezoneOffset = originalDate.getTimezoneOffset();
|
1795
|
+
|
1796
|
+
switch (token) {
|
1797
|
+
// Short
|
1798
|
+
case 'O':
|
1799
|
+
case 'OO':
|
1800
|
+
case 'OOO':
|
1801
|
+
return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
|
1802
|
+
// Long
|
1803
|
+
|
1804
|
+
case 'OOOO':
|
1805
|
+
default:
|
1806
|
+
return 'GMT' + formatTimezone(timezoneOffset, ':');
|
1807
|
+
}
|
1808
|
+
},
|
1809
|
+
// Timezone (specific non-location)
|
1810
|
+
z: function (date, token, _localize, options) {
|
1811
|
+
var originalDate = options._originalDate || date;
|
1812
|
+
var timezoneOffset = originalDate.getTimezoneOffset();
|
1813
|
+
|
1814
|
+
switch (token) {
|
1815
|
+
// Short
|
1816
|
+
case 'z':
|
1817
|
+
case 'zz':
|
1818
|
+
case 'zzz':
|
1819
|
+
return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
|
1820
|
+
// Long
|
1821
|
+
|
1822
|
+
case 'zzzz':
|
1823
|
+
default:
|
1824
|
+
return 'GMT' + formatTimezone(timezoneOffset, ':');
|
1825
|
+
}
|
1826
|
+
},
|
1827
|
+
// Seconds timestamp
|
1828
|
+
t: function (date, token, _localize, options) {
|
1829
|
+
var originalDate = options._originalDate || date;
|
1830
|
+
var timestamp = Math.floor(originalDate.getTime() / 1000);
|
1831
|
+
return addLeadingZeros(timestamp, token.length);
|
1832
|
+
},
|
1833
|
+
// Milliseconds timestamp
|
1834
|
+
T: function (date, token, _localize, options) {
|
1835
|
+
var originalDate = options._originalDate || date;
|
1836
|
+
var timestamp = originalDate.getTime();
|
1837
|
+
return addLeadingZeros(timestamp, token.length);
|
1838
|
+
}
|
1839
|
+
};
|
1840
|
+
|
1841
|
+
function formatTimezoneShort(offset, dirtyDelimiter) {
|
1842
|
+
var sign = offset > 0 ? '-' : '+';
|
1843
|
+
var absOffset = Math.abs(offset);
|
1844
|
+
var hours = Math.floor(absOffset / 60);
|
1845
|
+
var minutes = absOffset % 60;
|
1846
|
+
|
1847
|
+
if (minutes === 0) {
|
1848
|
+
return sign + String(hours);
|
1849
|
+
}
|
1850
|
+
|
1851
|
+
var delimiter = dirtyDelimiter || '';
|
1852
|
+
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
|
1853
|
+
}
|
1854
|
+
|
1855
|
+
function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
|
1856
|
+
if (offset % 60 === 0) {
|
1857
|
+
var sign = offset > 0 ? '-' : '+';
|
1858
|
+
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
|
1859
|
+
}
|
1860
|
+
|
1861
|
+
return formatTimezone(offset, dirtyDelimiter);
|
1862
|
+
}
|
1863
|
+
|
1864
|
+
function formatTimezone(offset, dirtyDelimiter) {
|
1865
|
+
var delimiter = dirtyDelimiter || '';
|
1866
|
+
var sign = offset > 0 ? '-' : '+';
|
1867
|
+
var absOffset = Math.abs(offset);
|
1868
|
+
var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
|
1869
|
+
var minutes = addLeadingZeros(absOffset % 60, 2);
|
1870
|
+
return sign + hours + delimiter + minutes;
|
1871
|
+
}
|
1872
|
+
|
1873
|
+
function dateLongFormatter(pattern, formatLong) {
|
1874
|
+
switch (pattern) {
|
1875
|
+
case 'P':
|
1876
|
+
return formatLong.date({
|
1877
|
+
width: 'short'
|
1878
|
+
});
|
1879
|
+
|
1880
|
+
case 'PP':
|
1881
|
+
return formatLong.date({
|
1882
|
+
width: 'medium'
|
1883
|
+
});
|
1884
|
+
|
1885
|
+
case 'PPP':
|
1886
|
+
return formatLong.date({
|
1887
|
+
width: 'long'
|
1888
|
+
});
|
1889
|
+
|
1890
|
+
case 'PPPP':
|
1891
|
+
default:
|
1892
|
+
return formatLong.date({
|
1893
|
+
width: 'full'
|
1894
|
+
});
|
1895
|
+
}
|
1896
|
+
}
|
1897
|
+
|
1898
|
+
function timeLongFormatter(pattern, formatLong) {
|
1899
|
+
switch (pattern) {
|
1900
|
+
case 'p':
|
1901
|
+
return formatLong.time({
|
1902
|
+
width: 'short'
|
1903
|
+
});
|
1904
|
+
|
1905
|
+
case 'pp':
|
1906
|
+
return formatLong.time({
|
1907
|
+
width: 'medium'
|
1908
|
+
});
|
1909
|
+
|
1910
|
+
case 'ppp':
|
1911
|
+
return formatLong.time({
|
1912
|
+
width: 'long'
|
1913
|
+
});
|
1914
|
+
|
1915
|
+
case 'pppp':
|
1916
|
+
default:
|
1917
|
+
return formatLong.time({
|
1918
|
+
width: 'full'
|
1919
|
+
});
|
1920
|
+
}
|
1921
|
+
}
|
1922
|
+
|
1923
|
+
function dateTimeLongFormatter(pattern, formatLong) {
|
1924
|
+
var matchResult = pattern.match(/(P+)(p+)?/) || [];
|
1925
|
+
var datePattern = matchResult[1];
|
1926
|
+
var timePattern = matchResult[2];
|
1927
|
+
|
1928
|
+
if (!timePattern) {
|
1929
|
+
return dateLongFormatter(pattern, formatLong);
|
1930
|
+
}
|
1931
|
+
|
1932
|
+
var dateTimeFormat;
|
1933
|
+
|
1934
|
+
switch (datePattern) {
|
1935
|
+
case 'P':
|
1936
|
+
dateTimeFormat = formatLong.dateTime({
|
1937
|
+
width: 'short'
|
1938
|
+
});
|
1939
|
+
break;
|
1940
|
+
|
1941
|
+
case 'PP':
|
1942
|
+
dateTimeFormat = formatLong.dateTime({
|
1943
|
+
width: 'medium'
|
1944
|
+
});
|
1945
|
+
break;
|
1946
|
+
|
1947
|
+
case 'PPP':
|
1948
|
+
dateTimeFormat = formatLong.dateTime({
|
1949
|
+
width: 'long'
|
1950
|
+
});
|
1951
|
+
break;
|
1952
|
+
|
1953
|
+
case 'PPPP':
|
1954
|
+
default:
|
1955
|
+
dateTimeFormat = formatLong.dateTime({
|
1956
|
+
width: 'full'
|
1957
|
+
});
|
1958
|
+
break;
|
1959
|
+
}
|
1960
|
+
|
1961
|
+
return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
|
1962
|
+
}
|
1963
|
+
|
1964
|
+
var longFormatters = {
|
1965
|
+
p: timeLongFormatter,
|
1966
|
+
P: dateTimeLongFormatter
|
1967
|
+
};
|
1968
|
+
|
1969
|
+
var protectedDayOfYearTokens = ['D', 'DD'];
|
1970
|
+
var protectedWeekYearTokens = ['YY', 'YYYY'];
|
1971
|
+
function isProtectedDayOfYearToken(token) {
|
1972
|
+
return protectedDayOfYearTokens.indexOf(token) !== -1;
|
1973
|
+
}
|
1974
|
+
function isProtectedWeekYearToken(token) {
|
1975
|
+
return protectedWeekYearTokens.indexOf(token) !== -1;
|
1976
|
+
}
|
1977
|
+
function throwProtectedError(token, format, input) {
|
1978
|
+
if (token === 'YYYY') {
|
1979
|
+
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
1980
|
+
} else if (token === 'YY') {
|
1981
|
+
throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
1982
|
+
} else if (token === 'D') {
|
1983
|
+
throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
1984
|
+
} else if (token === 'DD') {
|
1985
|
+
throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
1986
|
+
}
|
1987
|
+
}
|
1988
|
+
|
1989
|
+
// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
|
1990
|
+
// (one of the certain letters followed by `o`)
|
1991
|
+
// - (\w)\1* matches any sequences of the same letter
|
1992
|
+
// - '' matches two quote characters in a row
|
1993
|
+
// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
|
1994
|
+
// except a single quote symbol, which ends the sequence.
|
1995
|
+
// Two quote characters do not end the sequence.
|
1996
|
+
// If there is no matching single quote
|
1997
|
+
// then the sequence will continue until the end of the string.
|
1998
|
+
// - . matches any single character unmatched by previous parts of the RegExps
|
1999
|
+
|
2000
|
+
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
|
2001
|
+
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
|
2002
|
+
|
2003
|
+
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
2004
|
+
var escapedStringRegExp = /^'([^]*?)'?$/;
|
2005
|
+
var doubleQuoteRegExp = /''/g;
|
2006
|
+
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
2007
|
+
/**
|
2008
|
+
* @name format
|
2009
|
+
* @category Common Helpers
|
2010
|
+
* @summary Format the date.
|
2011
|
+
*
|
2012
|
+
* @description
|
2013
|
+
* Return the formatted date string in the given format. The result may vary by locale.
|
2014
|
+
*
|
2015
|
+
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
|
2016
|
+
* > See: https://git.io/fxCyr
|
2017
|
+
*
|
2018
|
+
* The characters wrapped between two single quotes characters (') are escaped.
|
2019
|
+
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
|
2020
|
+
* (see the last example)
|
2021
|
+
*
|
2022
|
+
* Format of the string is based on Unicode Technical Standard #35:
|
2023
|
+
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
2024
|
+
* with a few additions (see note 7 below the table).
|
2025
|
+
*
|
2026
|
+
* Accepted patterns:
|
2027
|
+
* | Unit | Pattern | Result examples | Notes |
|
2028
|
+
* |---------------------------------|---------|-----------------------------------|-------|
|
2029
|
+
* | Era | G..GGG | AD, BC | |
|
2030
|
+
* | | GGGG | Anno Domini, Before Christ | 2 |
|
2031
|
+
* | | GGGGG | A, B | |
|
2032
|
+
* | Calendar year | y | 44, 1, 1900, 2017 | 5 |
|
2033
|
+
* | | yo | 44th, 1st, 0th, 17th | 5,7 |
|
2034
|
+
* | | yy | 44, 01, 00, 17 | 5 |
|
2035
|
+
* | | yyy | 044, 001, 1900, 2017 | 5 |
|
2036
|
+
* | | yyyy | 0044, 0001, 1900, 2017 | 5 |
|
2037
|
+
* | | yyyyy | ... | 3,5 |
|
2038
|
+
* | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
|
2039
|
+
* | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
|
2040
|
+
* | | YY | 44, 01, 00, 17 | 5,8 |
|
2041
|
+
* | | YYY | 044, 001, 1900, 2017 | 5 |
|
2042
|
+
* | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
|
2043
|
+
* | | YYYYY | ... | 3,5 |
|
2044
|
+
* | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
|
2045
|
+
* | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
|
2046
|
+
* | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
|
2047
|
+
* | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
|
2048
|
+
* | | RRRRR | ... | 3,5,7 |
|
2049
|
+
* | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
|
2050
|
+
* | | uu | -43, 01, 1900, 2017 | 5 |
|
2051
|
+
* | | uuu | -043, 001, 1900, 2017 | 5 |
|
2052
|
+
* | | uuuu | -0043, 0001, 1900, 2017 | 5 |
|
2053
|
+
* | | uuuuu | ... | 3,5 |
|
2054
|
+
* | Quarter (formatting) | Q | 1, 2, 3, 4 | |
|
2055
|
+
* | | Qo | 1st, 2nd, 3rd, 4th | 7 |
|
2056
|
+
* | | QQ | 01, 02, 03, 04 | |
|
2057
|
+
* | | QQQ | Q1, Q2, Q3, Q4 | |
|
2058
|
+
* | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
|
2059
|
+
* | | QQQQQ | 1, 2, 3, 4 | 4 |
|
2060
|
+
* | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
|
2061
|
+
* | | qo | 1st, 2nd, 3rd, 4th | 7 |
|
2062
|
+
* | | qq | 01, 02, 03, 04 | |
|
2063
|
+
* | | qqq | Q1, Q2, Q3, Q4 | |
|
2064
|
+
* | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
|
2065
|
+
* | | qqqqq | 1, 2, 3, 4 | 4 |
|
2066
|
+
* | Month (formatting) | M | 1, 2, ..., 12 | |
|
2067
|
+
* | | Mo | 1st, 2nd, ..., 12th | 7 |
|
2068
|
+
* | | MM | 01, 02, ..., 12 | |
|
2069
|
+
* | | MMM | Jan, Feb, ..., Dec | |
|
2070
|
+
* | | MMMM | January, February, ..., December | 2 |
|
2071
|
+
* | | MMMMM | J, F, ..., D | |
|
2072
|
+
* | Month (stand-alone) | L | 1, 2, ..., 12 | |
|
2073
|
+
* | | Lo | 1st, 2nd, ..., 12th | 7 |
|
2074
|
+
* | | LL | 01, 02, ..., 12 | |
|
2075
|
+
* | | LLL | Jan, Feb, ..., Dec | |
|
2076
|
+
* | | LLLL | January, February, ..., December | 2 |
|
2077
|
+
* | | LLLLL | J, F, ..., D | |
|
2078
|
+
* | Local week of year | w | 1, 2, ..., 53 | |
|
2079
|
+
* | | wo | 1st, 2nd, ..., 53th | 7 |
|
2080
|
+
* | | ww | 01, 02, ..., 53 | |
|
2081
|
+
* | ISO week of year | I | 1, 2, ..., 53 | 7 |
|
2082
|
+
* | | Io | 1st, 2nd, ..., 53th | 7 |
|
2083
|
+
* | | II | 01, 02, ..., 53 | 7 |
|
2084
|
+
* | Day of month | d | 1, 2, ..., 31 | |
|
2085
|
+
* | | do | 1st, 2nd, ..., 31st | 7 |
|
2086
|
+
* | | dd | 01, 02, ..., 31 | |
|
2087
|
+
* | Day of year | D | 1, 2, ..., 365, 366 | 9 |
|
2088
|
+
* | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
|
2089
|
+
* | | DD | 01, 02, ..., 365, 366 | 9 |
|
2090
|
+
* | | DDD | 001, 002, ..., 365, 366 | |
|
2091
|
+
* | | DDDD | ... | 3 |
|
2092
|
+
* | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
|
2093
|
+
* | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
|
2094
|
+
* | | EEEEE | M, T, W, T, F, S, S | |
|
2095
|
+
* | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
|
2096
|
+
* | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
|
2097
|
+
* | | io | 1st, 2nd, ..., 7th | 7 |
|
2098
|
+
* | | ii | 01, 02, ..., 07 | 7 |
|
2099
|
+
* | | iii | Mon, Tue, Wed, ..., Sun | 7 |
|
2100
|
+
* | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
|
2101
|
+
* | | iiiii | M, T, W, T, F, S, S | 7 |
|
2102
|
+
* | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
|
2103
|
+
* | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
|
2104
|
+
* | | eo | 2nd, 3rd, ..., 1st | 7 |
|
2105
|
+
* | | ee | 02, 03, ..., 01 | |
|
2106
|
+
* | | eee | Mon, Tue, Wed, ..., Sun | |
|
2107
|
+
* | | eeee | Monday, Tuesday, ..., Sunday | 2 |
|
2108
|
+
* | | eeeee | M, T, W, T, F, S, S | |
|
2109
|
+
* | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
|
2110
|
+
* | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
|
2111
|
+
* | | co | 2nd, 3rd, ..., 1st | 7 |
|
2112
|
+
* | | cc | 02, 03, ..., 01 | |
|
2113
|
+
* | | ccc | Mon, Tue, Wed, ..., Sun | |
|
2114
|
+
* | | cccc | Monday, Tuesday, ..., Sunday | 2 |
|
2115
|
+
* | | ccccc | M, T, W, T, F, S, S | |
|
2116
|
+
* | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
|
2117
|
+
* | AM, PM | a..aa | AM, PM | |
|
2118
|
+
* | | aaa | am, pm | |
|
2119
|
+
* | | aaaa | a.m., p.m. | 2 |
|
2120
|
+
* | | aaaaa | a, p | |
|
2121
|
+
* | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
|
2122
|
+
* | | bbb | am, pm, noon, midnight | |
|
2123
|
+
* | | bbbb | a.m., p.m., noon, midnight | 2 |
|
2124
|
+
* | | bbbbb | a, p, n, mi | |
|
2125
|
+
* | Flexible day period | B..BBB | at night, in the morning, ... | |
|
2126
|
+
* | | BBBB | at night, in the morning, ... | 2 |
|
2127
|
+
* | | BBBBB | at night, in the morning, ... | |
|
2128
|
+
* | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
|
2129
|
+
* | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
|
2130
|
+
* | | hh | 01, 02, ..., 11, 12 | |
|
2131
|
+
* | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
|
2132
|
+
* | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
|
2133
|
+
* | | HH | 00, 01, 02, ..., 23 | |
|
2134
|
+
* | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
|
2135
|
+
* | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
|
2136
|
+
* | | KK | 01, 02, ..., 11, 00 | |
|
2137
|
+
* | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
|
2138
|
+
* | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
|
2139
|
+
* | | kk | 24, 01, 02, ..., 23 | |
|
2140
|
+
* | Minute | m | 0, 1, ..., 59 | |
|
2141
|
+
* | | mo | 0th, 1st, ..., 59th | 7 |
|
2142
|
+
* | | mm | 00, 01, ..., 59 | |
|
2143
|
+
* | Second | s | 0, 1, ..., 59 | |
|
2144
|
+
* | | so | 0th, 1st, ..., 59th | 7 |
|
2145
|
+
* | | ss | 00, 01, ..., 59 | |
|
2146
|
+
* | Fraction of second | S | 0, 1, ..., 9 | |
|
2147
|
+
* | | SS | 00, 01, ..., 99 | |
|
2148
|
+
* | | SSS | 000, 001, ..., 999 | |
|
2149
|
+
* | | SSSS | ... | 3 |
|
2150
|
+
* | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
|
2151
|
+
* | | XX | -0800, +0530, Z | |
|
2152
|
+
* | | XXX | -08:00, +05:30, Z | |
|
2153
|
+
* | | XXXX | -0800, +0530, Z, +123456 | 2 |
|
2154
|
+
* | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
|
2155
|
+
* | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
|
2156
|
+
* | | xx | -0800, +0530, +0000 | |
|
2157
|
+
* | | xxx | -08:00, +05:30, +00:00 | 2 |
|
2158
|
+
* | | xxxx | -0800, +0530, +0000, +123456 | |
|
2159
|
+
* | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
|
2160
|
+
* | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
|
2161
|
+
* | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
|
2162
|
+
* | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
|
2163
|
+
* | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
|
2164
|
+
* | Seconds timestamp | t | 512969520 | 7 |
|
2165
|
+
* | | tt | ... | 3,7 |
|
2166
|
+
* | Milliseconds timestamp | T | 512969520900 | 7 |
|
2167
|
+
* | | TT | ... | 3,7 |
|
2168
|
+
* | Long localized date | P | 04/29/1453 | 7 |
|
2169
|
+
* | | PP | Apr 29, 1453 | 7 |
|
2170
|
+
* | | PPP | April 29th, 1453 | 7 |
|
2171
|
+
* | | PPPP | Friday, April 29th, 1453 | 2,7 |
|
2172
|
+
* | Long localized time | p | 12:00 AM | 7 |
|
2173
|
+
* | | pp | 12:00:00 AM | 7 |
|
2174
|
+
* | | ppp | 12:00:00 AM GMT+2 | 7 |
|
2175
|
+
* | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
|
2176
|
+
* | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
|
2177
|
+
* | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
|
2178
|
+
* | | PPPppp | April 29th, 1453 at ... | 7 |
|
2179
|
+
* | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
|
2180
|
+
* Notes:
|
2181
|
+
* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
|
2182
|
+
* are the same as "stand-alone" units, but are different in some languages.
|
2183
|
+
* "Formatting" units are declined according to the rules of the language
|
2184
|
+
* in the context of a date. "Stand-alone" units are always nominative singular:
|
2185
|
+
*
|
2186
|
+
* `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
|
2187
|
+
*
|
2188
|
+
* `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
|
2189
|
+
*
|
2190
|
+
* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
|
2191
|
+
* the single quote characters (see below).
|
2192
|
+
* If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
|
2193
|
+
* the output will be the same as default pattern for this unit, usually
|
2194
|
+
* the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
|
2195
|
+
* are marked with "2" in the last column of the table.
|
2196
|
+
*
|
2197
|
+
* `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
|
2198
|
+
*
|
2199
|
+
* `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
|
2200
|
+
*
|
2201
|
+
* `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
|
2202
|
+
*
|
2203
|
+
* `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
|
2204
|
+
*
|
2205
|
+
* `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
|
2206
|
+
*
|
2207
|
+
* 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
|
2208
|
+
* The output will be padded with zeros to match the length of the pattern.
|
2209
|
+
*
|
2210
|
+
* `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
|
2211
|
+
*
|
2212
|
+
* 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
|
2213
|
+
* These tokens represent the shortest form of the quarter.
|
2214
|
+
*
|
2215
|
+
* 5. The main difference between `y` and `u` patterns are B.C. years:
|
2216
|
+
*
|
2217
|
+
* | Year | `y` | `u` |
|
2218
|
+
* |------|-----|-----|
|
2219
|
+
* | AC 1 | 1 | 1 |
|
2220
|
+
* | BC 1 | 1 | 0 |
|
2221
|
+
* | BC 2 | 2 | -1 |
|
2222
|
+
*
|
2223
|
+
* Also `yy` always returns the last two digits of a year,
|
2224
|
+
* while `uu` pads single digit years to 2 characters and returns other years unchanged:
|
2225
|
+
*
|
2226
|
+
* | Year | `yy` | `uu` |
|
2227
|
+
* |------|------|------|
|
2228
|
+
* | 1 | 01 | 01 |
|
2229
|
+
* | 14 | 14 | 14 |
|
2230
|
+
* | 376 | 76 | 376 |
|
2231
|
+
* | 1453 | 53 | 1453 |
|
2232
|
+
*
|
2233
|
+
* The same difference is true for local and ISO week-numbering years (`Y` and `R`),
|
2234
|
+
* except local week-numbering years are dependent on `options.weekStartsOn`
|
2235
|
+
* and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
|
2236
|
+
* and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
|
2237
|
+
*
|
2238
|
+
* 6. Specific non-location timezones are currently unavailable in `date-fns`,
|
2239
|
+
* so right now these tokens fall back to GMT timezones.
|
2240
|
+
*
|
2241
|
+
* 7. These patterns are not in the Unicode Technical Standard #35:
|
2242
|
+
* - `i`: ISO day of week
|
2243
|
+
* - `I`: ISO week of year
|
2244
|
+
* - `R`: ISO week-numbering year
|
2245
|
+
* - `t`: seconds timestamp
|
2246
|
+
* - `T`: milliseconds timestamp
|
2247
|
+
* - `o`: ordinal number modifier
|
2248
|
+
* - `P`: long localized date
|
2249
|
+
* - `p`: long localized time
|
2250
|
+
*
|
2251
|
+
* 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
|
2252
|
+
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
|
2253
|
+
*
|
2254
|
+
* 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
|
2255
|
+
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
|
2256
|
+
*
|
2257
|
+
* ### v2.0.0 breaking changes:
|
2258
|
+
*
|
2259
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
2260
|
+
*
|
2261
|
+
* - The second argument is now required for the sake of explicitness.
|
2262
|
+
*
|
2263
|
+
* ```javascript
|
2264
|
+
* // Before v2.0.0
|
2265
|
+
* format(new Date(2016, 0, 1))
|
2266
|
+
*
|
2267
|
+
* // v2.0.0 onward
|
2268
|
+
* format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
|
2269
|
+
* ```
|
2270
|
+
*
|
2271
|
+
* - New format string API for `format` function
|
2272
|
+
* which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
|
2273
|
+
* See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
|
2274
|
+
*
|
2275
|
+
* - Characters are now escaped using single quote symbols (`'`) instead of square brackets.
|
2276
|
+
*
|
2277
|
+
* @param {Date|Number} date - the original date
|
2278
|
+
* @param {String} format - the string of tokens
|
2279
|
+
* @param {Object} [options] - an object with options.
|
2280
|
+
* @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
|
2281
|
+
* @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
|
2282
|
+
* @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
|
2283
|
+
* @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
|
2284
|
+
* see: https://git.io/fxCyr
|
2285
|
+
* @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
|
2286
|
+
* see: https://git.io/fxCyr
|
2287
|
+
* @returns {String} the formatted date string
|
2288
|
+
* @throws {TypeError} 2 arguments required
|
2289
|
+
* @throws {RangeError} `date` must not be Invalid Date
|
2290
|
+
* @throws {RangeError} `options.locale` must contain `localize` property
|
2291
|
+
* @throws {RangeError} `options.locale` must contain `formatLong` property
|
2292
|
+
* @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
|
2293
|
+
* @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
|
2294
|
+
* @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
|
2295
|
+
* @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
|
2296
|
+
* @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
|
2297
|
+
* @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
|
2298
|
+
* @throws {RangeError} format string contains an unescaped latin alphabet character
|
2299
|
+
*
|
2300
|
+
* @example
|
2301
|
+
* // Represent 11 February 2014 in middle-endian format:
|
2302
|
+
* var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
|
2303
|
+
* //=> '02/11/2014'
|
2304
|
+
*
|
2305
|
+
* @example
|
2306
|
+
* // Represent 2 July 2014 in Esperanto:
|
2307
|
+
* import { eoLocale } from 'date-fns/locale/eo'
|
2308
|
+
* var result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
|
2309
|
+
* locale: eoLocale
|
2310
|
+
* })
|
2311
|
+
* //=> '2-a de julio 2014'
|
2312
|
+
*
|
2313
|
+
* @example
|
2314
|
+
* // Escape string by single quote characters:
|
2315
|
+
* var result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
|
2316
|
+
* //=> "3 o'clock"
|
2317
|
+
*/
|
2318
|
+
|
2319
|
+
function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
2320
|
+
requiredArgs(2, arguments);
|
2321
|
+
var formatStr = String(dirtyFormatStr);
|
2322
|
+
var options = dirtyOptions || {};
|
2323
|
+
var locale$1 = options.locale || locale;
|
2324
|
+
var localeFirstWeekContainsDate = locale$1.options && locale$1.options.firstWeekContainsDate;
|
2325
|
+
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
|
2326
|
+
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
2327
|
+
|
2328
|
+
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
2329
|
+
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
2330
|
+
}
|
2331
|
+
|
2332
|
+
var localeWeekStartsOn = locale$1.options && locale$1.options.weekStartsOn;
|
2333
|
+
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
|
2334
|
+
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
2335
|
+
|
2336
|
+
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
2337
|
+
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
2338
|
+
}
|
2339
|
+
|
2340
|
+
if (!locale$1.localize) {
|
2341
|
+
throw new RangeError('locale must contain localize property');
|
2342
|
+
}
|
2343
|
+
|
2344
|
+
if (!locale$1.formatLong) {
|
2345
|
+
throw new RangeError('locale must contain formatLong property');
|
2346
|
+
}
|
2347
|
+
|
2348
|
+
var originalDate = toDate(dirtyDate);
|
2349
|
+
|
2350
|
+
if (!isValid(originalDate)) {
|
2351
|
+
throw new RangeError('Invalid time value');
|
2352
|
+
} // Convert the date in system timezone to the same date in UTC+00:00 timezone.
|
2353
|
+
// This ensures that when UTC functions will be implemented, locales will be compatible with them.
|
2354
|
+
// See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
|
2355
|
+
|
2356
|
+
|
2357
|
+
var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
|
2358
|
+
var utcDate = subMilliseconds(originalDate, timezoneOffset);
|
2359
|
+
var formatterOptions = {
|
2360
|
+
firstWeekContainsDate: firstWeekContainsDate,
|
2361
|
+
weekStartsOn: weekStartsOn,
|
2362
|
+
locale: locale$1,
|
2363
|
+
_originalDate: originalDate
|
2364
|
+
};
|
2365
|
+
var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
|
2366
|
+
var firstCharacter = substring[0];
|
2367
|
+
|
2368
|
+
if (firstCharacter === 'p' || firstCharacter === 'P') {
|
2369
|
+
var longFormatter = longFormatters[firstCharacter];
|
2370
|
+
return longFormatter(substring, locale$1.formatLong, formatterOptions);
|
2371
|
+
}
|
2372
|
+
|
2373
|
+
return substring;
|
2374
|
+
}).join('').match(formattingTokensRegExp).map(function (substring) {
|
2375
|
+
// Replace two single quote characters with one single quote character
|
2376
|
+
if (substring === "''") {
|
2377
|
+
return "'";
|
2378
|
+
}
|
2379
|
+
|
2380
|
+
var firstCharacter = substring[0];
|
2381
|
+
|
2382
|
+
if (firstCharacter === "'") {
|
2383
|
+
return cleanEscapedString(substring);
|
2384
|
+
}
|
2385
|
+
|
2386
|
+
var formatter = formatters[firstCharacter];
|
2387
|
+
|
2388
|
+
if (formatter) {
|
2389
|
+
if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
|
2390
|
+
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
|
2391
|
+
}
|
2392
|
+
|
2393
|
+
if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
|
2394
|
+
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
|
2395
|
+
}
|
2396
|
+
|
2397
|
+
return formatter(utcDate, substring, locale$1.localize, formatterOptions);
|
2398
|
+
}
|
2399
|
+
|
2400
|
+
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
2401
|
+
throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
|
2402
|
+
}
|
2403
|
+
|
2404
|
+
return substring;
|
2405
|
+
}).join('');
|
2406
|
+
return result;
|
2407
|
+
}
|
2408
|
+
|
2409
|
+
function cleanEscapedString(input) {
|
2410
|
+
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
|
2411
|
+
}
|
2412
|
+
|
2413
|
+
const sample = (array) => array[Math.floor(Math.random() * array.length)];
|
2414
|
+
function GetGoalAppData(title, description, category, percentage, goalText) {
|
2415
|
+
return {
|
2416
|
+
Name: title,
|
2417
|
+
Description: description,
|
2418
|
+
Category: category,
|
2419
|
+
Percentage: percentage,
|
2420
|
+
GoalText: goalText
|
2421
|
+
};
|
2422
|
+
}
|
2423
|
+
function MyMoodTemplate(feeling, intensity, location) {
|
2424
|
+
return `Mood : ${feeling} and Level: ${intensity} <img src="${location}" />`;
|
2425
|
+
}
|
2426
|
+
function MyMoodTemplateJSON(feeling, intensity, location) {
|
2427
|
+
return JSON.stringify({ Mood: feeling, Level: intensity, MoodImage: location });
|
2428
|
+
}
|
2429
|
+
function MyHealthTemplate(heartRate) {
|
2430
|
+
return `Heart rate ${heartRate} bpm`;
|
2431
|
+
}
|
2432
|
+
function MyHealthTemplateJSON(heartRate) {
|
2433
|
+
return JSON.stringify({ HearthRate: heartRate });
|
2434
|
+
}
|
2435
|
+
function MyGoalTemplate(goalName, text, progress) {
|
2436
|
+
return `Goal update: ${goalName} ${text} Progress: ${progress}`;
|
2437
|
+
}
|
2438
|
+
function MyGoalTemplateJSON(goalName, goalUpdateText, progress) {
|
2439
|
+
return JSON.stringify({ GoalTitle: goalName, GoalText: goalUpdateText, GoalProgress: progress });
|
2440
|
+
}
|
2441
|
+
class SparkleGlobal {
|
2442
|
+
}
|
2443
|
+
SparkleGlobal.MY_GOALS_APP_ID = 1;
|
2444
|
+
SparkleGlobal.MY_HEALTH_APP_ID = 2;
|
2445
|
+
SparkleGlobal.MY_MOOD_APP_ID = 3;
|
2446
|
+
SparkleGlobal.LOCALSTORAGE_CLASSROOM_MODE = "SPARKLE_CLASSROOM_MODE";
|
2447
|
+
function date(date) {
|
2448
|
+
return format(new Date(date), 'DD MMM YYYY');
|
2449
|
+
}
|
2450
|
+
|
2451
|
+
export { GetGoalAppData as G, MyHealthTemplate as M, SparkleGlobal as S, MyHealthTemplateJSON as a, MyMoodTemplate as b, MyMoodTemplateJSON as c, date as d, MyGoalTemplate as e, MyGoalTemplateJSON as f, sample as s };
|