@coopdigital/react 0.54.0 → 0.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Card/Card.js +4 -4
- package/dist/components/DatePicker/DatePicker.d.ts +2 -1
- package/dist/components/DatePicker/DatePicker.js +7 -6
- package/dist/components/DatePicker/datepicker-utils.js +1 -5
- package/dist/components/Expandable/Expandable.js +1 -1
- package/dist/components/Field/Field.d.ts +7 -24
- package/dist/components/Field/Field.js +11 -18
- package/dist/components/Field/index.js +0 -1
- package/dist/components/Fieldset/Fieldset.d.ts +12 -17
- package/dist/components/Fieldset/Fieldset.js +6 -8
- package/dist/components/Pill/Pill.js +2 -2
- package/dist/components/Popover/Popover.js +6 -6
- package/dist/components/Searchbox/Searchbox.d.ts +1 -1
- package/dist/components/Searchbox/Searchbox.js +5 -5
- package/dist/components/Signpost/Signpost.js +2 -2
- package/dist/components/Tag/Tag.js +2 -2
- package/dist/components/TextInput/TextInput.d.ts +5 -1
- package/dist/components/TextInput/TextInput.js +8 -2
- package/dist/components/Textarea/Textarea.js +2 -0
- package/dist/components/icons/AccountCircleFilledIcon.d.ts +6 -0
- package/dist/components/icons/AccountCircleFilledIcon.js +20 -0
- package/dist/components/icons/AccountCircleIcon.d.ts +6 -0
- package/dist/components/icons/AccountCircleIcon.js +20 -0
- package/dist/components/icons/AccountFilledIcon.d.ts +6 -0
- package/dist/components/icons/AccountFilledIcon.js +20 -0
- package/dist/components/icons/AccountIcon.d.ts +6 -0
- package/dist/components/icons/AccountIcon.js +20 -0
- package/dist/components/icons/AddIcon.js +2 -2
- package/dist/components/icons/AppsFilledIcon.d.ts +6 -0
- package/dist/components/icons/AppsFilledIcon.js +20 -0
- package/dist/components/icons/{CoopIcon.d.ts → AppsIcon.d.ts} +1 -1
- package/dist/components/icons/AppsIcon.js +20 -0
- package/dist/components/icons/ArrowDownIcon.js +2 -2
- package/dist/components/icons/ArrowLeftIcon.js +2 -2
- package/dist/components/icons/ArrowRightIcon.js +2 -2
- package/dist/components/icons/ArrowUpIcon.js +2 -2
- package/dist/components/icons/BackspaceFilledIcon.d.ts +6 -0
- package/dist/components/icons/BackspaceFilledIcon.js +20 -0
- package/dist/components/icons/{AvatarAltIcon.d.ts → BackspaceIcon.d.ts} +1 -1
- package/dist/components/icons/BackspaceIcon.js +20 -0
- package/dist/components/icons/{CoopLocationIcon.d.ts → BasketFilledIcon.d.ts} +1 -1
- package/dist/components/icons/BasketFilledIcon.js +20 -0
- package/dist/components/icons/BasketIcon.js +2 -2
- package/dist/components/icons/BellFilledIcon.d.ts +6 -0
- package/dist/components/icons/BellFilledIcon.js +20 -0
- package/dist/components/icons/BellIcon.d.ts +6 -0
- package/dist/components/icons/BellIcon.js +20 -0
- package/dist/components/icons/{CloseIcon.d.ts → BroomIcon.d.ts} +1 -1
- package/dist/components/icons/BroomIcon.js +20 -0
- package/dist/components/icons/CalendarFilledIcon.d.ts +6 -0
- package/dist/components/icons/CalendarFilledIcon.js +20 -0
- package/dist/components/icons/CalendarIcon.js +2 -2
- package/dist/components/icons/CashFilledIcon.d.ts +6 -0
- package/dist/components/icons/CashFilledIcon.js +20 -0
- package/dist/components/icons/CashIcon.d.ts +6 -0
- package/dist/components/icons/CashIcon.js +20 -0
- package/dist/components/icons/ChevronDownIcon.js +2 -2
- package/dist/components/icons/ChevronLeftIcon.js +2 -2
- package/dist/components/icons/ChevronRightIcon.js +2 -2
- package/dist/components/icons/ChevronUpIcon.js +2 -2
- package/dist/components/icons/CircleBurgerFilledIcon.d.ts +6 -0
- package/dist/components/icons/CircleBurgerFilledIcon.js +20 -0
- package/dist/components/icons/CircleBurgerIcon.d.ts +6 -0
- package/dist/components/icons/CircleBurgerIcon.js +20 -0
- package/dist/components/icons/ClipboardFilledIcon.d.ts +6 -0
- package/dist/components/icons/ClipboardFilledIcon.js +20 -0
- package/dist/components/icons/ClipboardIcon.d.ts +6 -0
- package/dist/components/icons/ClipboardIcon.js +20 -0
- package/dist/components/icons/{InformationIcon.d.ts → ClockFilledIcon.d.ts} +1 -1
- package/dist/components/icons/ClockFilledIcon.js +20 -0
- package/dist/components/icons/ClockIcon.js +2 -2
- package/dist/components/icons/CloseAltFilledIcon.d.ts +6 -0
- package/dist/components/icons/CloseAltFilledIcon.js +20 -0
- package/dist/components/icons/CloseAltIcon.js +2 -2
- package/dist/components/icons/{VanIcon.d.ts → CogIcon.d.ts} +1 -1
- package/dist/components/icons/CogIcon.js +20 -0
- package/dist/components/icons/CommunityFilledIcon.d.ts +6 -0
- package/dist/components/icons/CommunityFilledIcon.js +20 -0
- package/dist/components/icons/CommunityIcon.d.ts +6 -0
- package/dist/components/icons/CommunityIcon.js +20 -0
- package/dist/components/icons/{QuestionIcon.d.ts → ComputerIcon.d.ts} +1 -1
- package/dist/components/icons/ComputerIcon.js +20 -0
- package/dist/components/icons/ContactFilledIcon.d.ts +6 -0
- package/dist/components/icons/ContactFilledIcon.js +20 -0
- package/dist/components/icons/ContactIcon.d.ts +6 -0
- package/dist/components/icons/ContactIcon.js +20 -0
- package/dist/components/icons/ContactlessFilledIcon.d.ts +6 -0
- package/dist/components/icons/ContactlessFilledIcon.js +20 -0
- package/dist/components/icons/ContactlessIcon.d.ts +6 -0
- package/dist/components/icons/ContactlessIcon.js +20 -0
- package/dist/components/icons/{SettingsIcon.d.ts → CoopLiveIcon.d.ts} +1 -1
- package/dist/components/icons/CoopLiveIcon.js +20 -0
- package/dist/components/icons/CoopLocationFilledIcon.d.ts +6 -0
- package/dist/components/icons/{CoopLocationIcon.js → CoopLocationFilledIcon.js} +5 -5
- package/dist/components/icons/{CoopCardIcon.d.ts → CoopLogoIcon.d.ts} +1 -1
- package/dist/components/icons/CoopLogoIcon.js +20 -0
- package/dist/components/icons/CoopMembershipCardFilledIcon.d.ts +6 -0
- package/dist/components/icons/CoopMembershipCardFilledIcon.js +20 -0
- package/dist/components/icons/CreditCardFilledIcon.d.ts +6 -0
- package/dist/components/icons/CreditCardFilledIcon.js +20 -0
- package/dist/components/icons/CreditCardIcon.d.ts +6 -0
- package/dist/components/icons/CreditCardIcon.js +20 -0
- package/dist/components/icons/CrossIcon.d.ts +6 -0
- package/dist/components/icons/CrossIcon.js +20 -0
- package/dist/components/icons/DocumentIcon.d.ts +6 -0
- package/dist/components/icons/DocumentIcon.js +20 -0
- package/dist/components/icons/DownloadIcon.js +2 -2
- package/dist/components/icons/EnterStoreIcon.d.ts +6 -0
- package/dist/components/icons/EnterStoreIcon.js +20 -0
- package/dist/components/icons/ExitStoreIcon.d.ts +6 -0
- package/dist/components/icons/ExitStoreIcon.js +20 -0
- package/dist/components/icons/EyeFilledIcon.d.ts +6 -0
- package/dist/components/icons/EyeFilledIcon.js +20 -0
- package/dist/components/icons/EyeIcon.d.ts +6 -0
- package/dist/components/icons/EyeIcon.js +20 -0
- package/dist/components/icons/EyeStrikeFilledIcon.d.ts +6 -0
- package/dist/components/icons/EyeStrikeFilledIcon.js +20 -0
- package/dist/components/icons/EyeStrikeIcon.d.ts +6 -0
- package/dist/components/icons/EyeStrikeIcon.js +20 -0
- package/dist/components/icons/FeedbackFilledIcon.d.ts +6 -0
- package/dist/components/icons/FeedbackFilledIcon.js +20 -0
- package/dist/components/icons/FeedbackIcon.d.ts +6 -0
- package/dist/components/icons/FeedbackIcon.js +20 -0
- package/dist/components/icons/{AvatarIcon.d.ts → FilterIcon.d.ts} +1 -1
- package/dist/components/icons/FilterIcon.js +20 -0
- package/dist/components/icons/GiftCardFilledIcon.d.ts +6 -0
- package/dist/components/icons/GiftCardFilledIcon.js +20 -0
- package/dist/components/icons/GiftCardIcon.d.ts +6 -0
- package/dist/components/icons/GiftCardIcon.js +20 -0
- package/dist/components/icons/GiftFilledIcon.d.ts +6 -0
- package/dist/components/icons/GiftFilledIcon.js +20 -0
- package/dist/components/icons/GiftIcon.d.ts +6 -0
- package/dist/components/icons/GiftIcon.js +20 -0
- package/dist/components/icons/HelpFilledIcon.d.ts +6 -0
- package/dist/components/icons/HelpFilledIcon.js +20 -0
- package/dist/components/icons/HelpIcon.d.ts +6 -0
- package/dist/components/icons/HelpIcon.js +20 -0
- package/dist/components/icons/HomeFilledIcon.d.ts +6 -0
- package/dist/components/icons/HomeFilledIcon.js +20 -0
- package/dist/components/icons/HomeIcon.js +2 -2
- package/dist/components/icons/HowDoIAssistantIcon.d.ts +6 -0
- package/dist/components/icons/HowDoIAssistantIcon.js +20 -0
- package/dist/components/icons/InfoIcon.d.ts +6 -0
- package/dist/components/icons/InfoIcon.js +20 -0
- package/dist/components/icons/KebabIcon.d.ts +6 -0
- package/dist/components/icons/KebabIcon.js +20 -0
- package/dist/components/icons/LoadingIcon.js +3 -3
- package/dist/components/icons/LocationFilledIcon.d.ts +6 -0
- package/dist/components/icons/LocationFilledIcon.js +20 -0
- package/dist/components/icons/LocationIcon.js +2 -2
- package/dist/components/icons/LogoutIcon.d.ts +6 -0
- package/dist/components/icons/LogoutIcon.js +20 -0
- package/dist/components/icons/MailIcon.js +2 -2
- package/dist/components/icons/MenuIcon.js +2 -2
- package/dist/components/icons/MessageIcon.js +2 -2
- package/dist/components/icons/MinusIcon.js +2 -2
- package/dist/components/icons/NotesFilledIcon.d.ts +6 -0
- package/dist/components/icons/NotesFilledIcon.js +20 -0
- package/dist/components/icons/NotesIcon.d.ts +6 -0
- package/dist/components/icons/NotesIcon.js +20 -0
- package/dist/components/icons/OpenNewIcon.js +2 -2
- package/dist/components/icons/OwnBagIcon.d.ts +6 -0
- package/dist/components/icons/OwnBagIcon.js +20 -0
- package/dist/components/icons/PadlockIcon.d.ts +6 -0
- package/dist/components/icons/PadlockIcon.js +20 -0
- package/dist/components/icons/PencilIcon.js +2 -2
- package/dist/components/icons/PhoneIcon.js +2 -2
- package/dist/components/icons/PowerIcon.d.ts +6 -0
- package/dist/components/icons/PowerIcon.js +20 -0
- package/dist/components/icons/SaveFilledIcon.d.ts +6 -0
- package/dist/components/icons/SaveFilledIcon.js +20 -0
- package/dist/components/icons/SaveIcon.d.ts +6 -0
- package/dist/components/icons/SaveIcon.js +20 -0
- package/dist/components/icons/ScooterIcon.js +3 -3
- package/dist/components/icons/SearchFilledIcon.d.ts +6 -0
- package/dist/components/icons/SearchFilledIcon.js +20 -0
- package/dist/components/icons/SearchIcon.js +2 -2
- package/dist/components/icons/SendIcon.d.ts +6 -0
- package/dist/components/icons/SendIcon.js +20 -0
- package/dist/components/icons/SpannerIcon.d.ts +6 -0
- package/dist/components/icons/SpannerIcon.js +20 -0
- package/dist/components/icons/StarFilledIcon.d.ts +6 -0
- package/dist/components/icons/StarFilledIcon.js +20 -0
- package/dist/components/icons/StarIcon.d.ts +6 -0
- package/dist/components/icons/StarIcon.js +20 -0
- package/dist/components/icons/TickAltFilledIcon.d.ts +6 -0
- package/dist/components/icons/TickAltFilledIcon.js +20 -0
- package/dist/components/icons/TickAltIcon.js +2 -2
- package/dist/components/icons/TickIcon.js +2 -2
- package/dist/components/icons/TruckIcon.d.ts +6 -0
- package/dist/components/icons/TruckIcon.js +20 -0
- package/dist/components/icons/UserWipeIcon.d.ts +6 -0
- package/dist/components/icons/UserWipeIcon.js +20 -0
- package/dist/components/icons/VoucherFilledIcon.d.ts +6 -0
- package/dist/components/icons/VoucherFilledIcon.js +20 -0
- package/dist/components/icons/VoucherIcon.d.ts +6 -0
- package/dist/components/icons/VoucherIcon.js +20 -0
- package/dist/components/icons/WarningFilledIcon.d.ts +6 -0
- package/dist/components/icons/WarningFilledIcon.js +20 -0
- package/dist/components/icons/WarningIcon.js +2 -2
- package/dist/components/icons/WifiIcon.d.ts +6 -0
- package/dist/components/icons/WifiIcon.js +20 -0
- package/dist/components/icons/WriteIcon.js +2 -2
- package/dist/components/icons/index.d.ts +77 -10
- package/dist/components/icons/index.js +77 -10
- package/dist/hooks/useSlots.js +3 -3
- package/dist/index.js +2 -2
- package/package.json +11 -11
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/DatePicker/DatePicker.tsx +13 -12
- package/src/components/Expandable/Expandable.tsx +1 -6
- package/src/components/Field/Field.tsx +5 -29
- package/src/components/Fieldset/Fieldset.tsx +6 -8
- package/src/components/Searchbox/Searchbox.tsx +2 -2
- package/src/components/TextInput/TextInput.tsx +18 -2
- package/src/components/Textarea/Textarea.tsx +2 -0
- package/src/components/icons/AccountCircleFilledIcon.tsx +28 -0
- package/src/components/icons/AccountCircleIcon.tsx +28 -0
- package/src/components/icons/AccountFilledIcon.tsx +28 -0
- package/src/components/icons/AccountIcon.tsx +28 -0
- package/src/components/icons/AddIcon.tsx +2 -9
- package/src/components/icons/AppsFilledIcon.tsx +28 -0
- package/src/components/icons/AppsIcon.tsx +28 -0
- package/src/components/icons/ArrowDownIcon.tsx +2 -6
- package/src/components/icons/ArrowLeftIcon.tsx +2 -6
- package/src/components/icons/ArrowRightIcon.tsx +2 -6
- package/src/components/icons/ArrowUpIcon.tsx +2 -6
- package/src/components/icons/BackspaceFilledIcon.tsx +28 -0
- package/src/components/icons/BackspaceIcon.tsx +28 -0
- package/src/components/icons/BasketFilledIcon.tsx +28 -0
- package/src/components/icons/BasketIcon.tsx +2 -9
- package/src/components/icons/BellFilledIcon.tsx +29 -0
- package/src/components/icons/BellIcon.tsx +28 -0
- package/src/components/icons/BroomIcon.tsx +28 -0
- package/src/components/icons/CalendarFilledIcon.tsx +28 -0
- package/src/components/icons/CalendarIcon.tsx +2 -9
- package/src/components/icons/CashFilledIcon.tsx +28 -0
- package/src/components/icons/CashIcon.tsx +33 -0
- package/src/components/icons/ChevronDownIcon.tsx +2 -5
- package/src/components/icons/ChevronLeftIcon.tsx +2 -5
- package/src/components/icons/ChevronRightIcon.tsx +2 -5
- package/src/components/icons/ChevronUpIcon.tsx +2 -5
- package/src/components/icons/CircleBurgerFilledIcon.tsx +28 -0
- package/src/components/icons/CircleBurgerIcon.tsx +28 -0
- package/src/components/icons/ClipboardFilledIcon.tsx +28 -0
- package/src/components/icons/ClipboardIcon.tsx +28 -0
- package/src/components/icons/{InformationIcon.tsx → ClockFilledIcon.tsx} +6 -9
- package/src/components/icons/ClockIcon.tsx +2 -9
- package/src/components/icons/CloseAltFilledIcon.tsx +32 -0
- package/src/components/icons/CloseAltIcon.tsx +2 -13
- package/src/components/icons/CogIcon.tsx +28 -0
- package/src/components/icons/CommunityFilledIcon.tsx +28 -0
- package/src/components/icons/CommunityIcon.tsx +28 -0
- package/src/components/icons/ComputerIcon.tsx +28 -0
- package/src/components/icons/ContactFilledIcon.tsx +28 -0
- package/src/components/icons/ContactIcon.tsx +28 -0
- package/src/components/icons/ContactlessFilledIcon.tsx +28 -0
- package/src/components/icons/ContactlessIcon.tsx +28 -0
- package/src/components/icons/CoopLiveIcon.tsx +29 -0
- package/src/components/icons/CoopLocationFilledIcon.tsx +30 -0
- package/src/components/icons/CoopLogoIcon.tsx +28 -0
- package/src/components/icons/CoopMembershipCardFilledIcon.tsx +40 -0
- package/src/components/icons/CreditCardFilledIcon.tsx +42 -0
- package/src/components/icons/CreditCardIcon.tsx +28 -0
- package/src/components/icons/{CloseIcon.tsx → CrossIcon.tsx} +4 -11
- package/src/components/icons/DocumentIcon.tsx +28 -0
- package/src/components/icons/DownloadIcon.tsx +2 -13
- package/src/components/icons/EnterStoreIcon.tsx +28 -0
- package/src/components/icons/ExitStoreIcon.tsx +28 -0
- package/src/components/icons/EyeFilledIcon.tsx +28 -0
- package/src/components/icons/EyeIcon.tsx +28 -0
- package/src/components/icons/EyeStrikeFilledIcon.tsx +28 -0
- package/src/components/icons/EyeStrikeIcon.tsx +28 -0
- package/src/components/icons/FeedbackFilledIcon.tsx +35 -0
- package/src/components/icons/FeedbackIcon.tsx +28 -0
- package/src/components/icons/FilterIcon.tsx +28 -0
- package/src/components/icons/GiftCardFilledIcon.tsx +28 -0
- package/src/components/icons/GiftCardIcon.tsx +28 -0
- package/src/components/icons/GiftFilledIcon.tsx +28 -0
- package/src/components/icons/GiftIcon.tsx +28 -0
- package/src/components/icons/HelpFilledIcon.tsx +28 -0
- package/src/components/icons/HelpIcon.tsx +28 -0
- package/src/components/icons/HomeFilledIcon.tsx +28 -0
- package/src/components/icons/HomeIcon.tsx +2 -13
- package/src/components/icons/HowDoIAssistantIcon.tsx +28 -0
- package/src/components/icons/InfoIcon.tsx +28 -0
- package/src/components/icons/KebabIcon.tsx +28 -0
- package/src/components/icons/LoadingIcon.tsx +3 -6
- package/src/components/icons/LocationFilledIcon.tsx +28 -0
- package/src/components/icons/LocationIcon.tsx +2 -9
- package/src/components/icons/LogoutIcon.tsx +28 -0
- package/src/components/icons/MailIcon.tsx +2 -5
- package/src/components/icons/MenuIcon.tsx +2 -5
- package/src/components/icons/MessageIcon.tsx +2 -5
- package/src/components/icons/MinusIcon.tsx +2 -5
- package/src/components/icons/NotesFilledIcon.tsx +28 -0
- package/src/components/icons/NotesIcon.tsx +28 -0
- package/src/components/icons/OpenNewIcon.tsx +3 -9
- package/src/components/icons/OwnBagIcon.tsx +28 -0
- package/src/components/icons/PadlockIcon.tsx +28 -0
- package/src/components/icons/PencilIcon.tsx +2 -5
- package/src/components/icons/PhoneIcon.tsx +2 -5
- package/src/components/icons/PowerIcon.tsx +28 -0
- package/src/components/icons/SaveFilledIcon.tsx +28 -0
- package/src/components/icons/SaveIcon.tsx +28 -0
- package/src/components/icons/ScooterIcon.tsx +3 -22
- package/src/components/icons/SearchFilledIcon.tsx +28 -0
- package/src/components/icons/SearchIcon.tsx +9 -9
- package/src/components/icons/SendIcon.tsx +28 -0
- package/src/components/icons/SpannerIcon.tsx +28 -0
- package/src/components/icons/StarFilledIcon.tsx +31 -0
- package/src/components/icons/StarIcon.tsx +28 -0
- package/src/components/icons/TickAltFilledIcon.tsx +32 -0
- package/src/components/icons/TickAltIcon.tsx +2 -9
- package/src/components/icons/TickIcon.tsx +2 -5
- package/src/components/icons/TruckIcon.tsx +28 -0
- package/src/components/icons/UserWipeIcon.tsx +28 -0
- package/src/components/icons/VoucherFilledIcon.tsx +28 -0
- package/src/components/icons/VoucherIcon.tsx +28 -0
- package/src/components/icons/WarningFilledIcon.tsx +28 -0
- package/src/components/icons/WarningIcon.tsx +2 -9
- package/src/components/icons/WifiIcon.tsx +28 -0
- package/src/components/icons/WriteIcon.tsx +5 -17
- package/src/components/icons/index.ts +77 -10
- package/dist/components/icons/AvatarAltIcon.js +0 -20
- package/dist/components/icons/AvatarIcon.js +0 -20
- package/dist/components/icons/CloseIcon.js +0 -20
- package/dist/components/icons/CoopCardIcon.js +0 -20
- package/dist/components/icons/CoopIcon.js +0 -20
- package/dist/components/icons/InformationIcon.js +0 -20
- package/dist/components/icons/QuestionIcon.js +0 -20
- package/dist/components/icons/SettingsIcon.js +0 -20
- package/dist/components/icons/VanIcon.js +0 -20
- package/dist/node_modules/@date-fns/tz/date/index.js +0 -83
- package/dist/node_modules/@date-fns/tz/date/mini.js +0 -235
- package/dist/node_modules/@date-fns/tz/tzName/index.js +0 -39
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js +0 -44
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -814
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -751
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -350
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -161
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -137
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +0 -11
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -39
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +0 -63
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -213
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +0 -31
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -209
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +0 -15
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +0 -303
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +0 -285
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +0 -19
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +0 -132
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +0 -43
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +0 -89
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -12
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -70
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +0 -18
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -7
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +0 -40
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -137
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +0 -7
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +0 -7
- package/dist/node_modules/date-fns/_lib/format/formatters.js +0 -775
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +0 -94
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +0 -66
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +0 -31
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +0 -11
- package/dist/node_modules/date-fns/_lib/normalizeInterval.js +0 -8
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +0 -25
- package/dist/node_modules/date-fns/addDays.js +0 -41
- package/dist/node_modules/date-fns/addMonths.js +0 -75
- package/dist/node_modules/date-fns/addWeeks.js +0 -33
- package/dist/node_modules/date-fns/addYears.js +0 -33
- package/dist/node_modules/date-fns/constants.js +0 -67
- package/dist/node_modules/date-fns/constructFrom.js +0 -49
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +0 -62
- package/dist/node_modules/date-fns/differenceInCalendarMonths.js +0 -42
- package/dist/node_modules/date-fns/eachMonthOfInterval.js +0 -65
- package/dist/node_modules/date-fns/eachYearOfInterval.js +0 -65
- package/dist/node_modules/date-fns/endOfISOWeek.js +0 -35
- package/dist/node_modules/date-fns/endOfMonth.js +0 -37
- package/dist/node_modules/date-fns/endOfWeek.js +0 -53
- package/dist/node_modules/date-fns/endOfYear.js +0 -37
- package/dist/node_modules/date-fns/format.js +0 -423
- package/dist/node_modules/date-fns/getDayOfYear.js +0 -34
- package/dist/node_modules/date-fns/getDaysInMonth.js +0 -36
- package/dist/node_modules/date-fns/getDefaultOptions.js +0 -31
- package/dist/node_modules/date-fns/getISODay.js +0 -33
- package/dist/node_modules/date-fns/getISOWeek.js +0 -40
- package/dist/node_modules/date-fns/getISOWeekYear.js +0 -52
- package/dist/node_modules/date-fns/getMonth.js +0 -29
- package/dist/node_modules/date-fns/getWeek.js +0 -54
- package/dist/node_modules/date-fns/getWeekYear.js +0 -75
- package/dist/node_modules/date-fns/getYear.js +0 -29
- package/dist/node_modules/date-fns/isAfter.js +0 -25
- package/dist/node_modules/date-fns/isBefore.js +0 -25
- package/dist/node_modules/date-fns/isDate.js +0 -41
- package/dist/node_modules/date-fns/isSameDay.js +0 -46
- package/dist/node_modules/date-fns/isSameMonth.js +0 -43
- package/dist/node_modules/date-fns/isSameYear.js +0 -35
- package/dist/node_modules/date-fns/isValid.js +0 -39
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -10
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -64
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -59
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -22
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +0 -103
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -41
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +0 -13
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -189
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +0 -134
- package/dist/node_modules/date-fns/locale/en-US.js +0 -28
- package/dist/node_modules/date-fns/max.js +0 -49
- package/dist/node_modules/date-fns/min.js +0 -49
- package/dist/node_modules/date-fns/parse/_lib/Parser.js +0 -27
- package/dist/node_modules/date-fns/parse/_lib/Setter.js +0 -59
- package/dist/node_modules/date-fns/parse/_lib/constants.js +0 -33
- package/dist/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js +0 -55
- package/dist/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js +0 -55
- package/dist/node_modules/date-fns/parse/_lib/parsers/DateParser.js +0 -59
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js +0 -57
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayParser.js +0 -64
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js +0 -56
- package/dist/node_modules/date-fns/parse/_lib/parsers/EraParser.js +0 -41
- package/dist/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js +0 -24
- package/dist/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js +0 -21
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js +0 -36
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js +0 -31
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js +0 -32
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js +0 -38
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js +0 -118
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js +0 -47
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js +0 -47
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js +0 -48
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js +0 -44
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js +0 -96
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js +0 -47
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js +0 -76
- package/dist/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js +0 -31
- package/dist/node_modules/date-fns/parse/_lib/parsers/MonthParser.js +0 -86
- package/dist/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js +0 -83
- package/dist/node_modules/date-fns/parse/_lib/parsers/SecondParser.js +0 -31
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js +0 -97
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js +0 -86
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js +0 -83
- package/dist/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js +0 -19
- package/dist/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js +0 -19
- package/dist/node_modules/date-fns/parse/_lib/parsers/YearParser.js +0 -62
- package/dist/node_modules/date-fns/parse/_lib/parsers.js +0 -110
- package/dist/node_modules/date-fns/parse/_lib/utils.js +0 -135
- package/dist/node_modules/date-fns/parse.js +0 -497
- package/dist/node_modules/date-fns/setDay.js +0 -59
- package/dist/node_modules/date-fns/setISODay.js +0 -40
- package/dist/node_modules/date-fns/setISOWeek.js +0 -39
- package/dist/node_modules/date-fns/setMonth.js +0 -46
- package/dist/node_modules/date-fns/setWeek.js +0 -53
- package/dist/node_modules/date-fns/setYear.js +0 -40
- package/dist/node_modules/date-fns/startOfDay.js +0 -35
- package/dist/node_modules/date-fns/startOfISOWeek.js +0 -35
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +0 -42
- package/dist/node_modules/date-fns/startOfMonth.js +0 -37
- package/dist/node_modules/date-fns/startOfWeek.js +0 -53
- package/dist/node_modules/date-fns/startOfWeekYear.js +0 -64
- package/dist/node_modules/date-fns/startOfYear.js +0 -36
- package/dist/node_modules/date-fns/toDate.js +0 -46
- package/dist/node_modules/date-fns/transpose.js +0 -52
- package/dist/node_modules/get-nonce/dist/es2015/index.js +0 -8
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +0 -320
- package/dist/node_modules/react-day-picker/dist/esm/UI.js +0 -122
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js +0 -33
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +0 -604
- package/dist/node_modules/react-day-picker/dist/esm/components/Button.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js +0 -20
- package/dist/node_modules/react-day-picker/dist/esm/components/Day.js +0 -18
- package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js +0 -19
- package/dist/node_modules/react-day-picker/dist/esm/components/Dropdown.js +0 -21
- package/dist/node_modules/react-day-picker/dist/esm/components/DropdownNav.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/Footer.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/Month.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthCaption.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthGrid.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/Months.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js +0 -31
- package/dist/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/components/Option.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/components/Root.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/Select.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/Week.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumber.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekday.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekdays.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/Weeks.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/components/custom-components.js +0 -26
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +0 -26
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatDay.js +0 -19
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js +0 -18
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js +0 -21
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js +0 -19
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js +0 -23
- package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js +0 -73
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +0 -95
- package/dist/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js +0 -22
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +0 -28
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js +0 -33
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getComponents.js +0 -20
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js +0 -27
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js +0 -59
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js +0 -19
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js +0 -33
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js +0 -24
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js +0 -46
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js +0 -24
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +0 -27
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getLabels.js +0 -53
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js +0 -33
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js +0 -69
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js +0 -51
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js +0 -40
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js +0 -36
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js +0 -37
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js +0 -27
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js +0 -26
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +0 -36
- package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +0 -27
- package/dist/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js +0 -31
- package/dist/node_modules/react-day-picker/dist/esm/labels/index.js +0 -11
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js +0 -32
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +0 -25
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js +0 -22
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNav.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNext.js +0 -16
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js +0 -18
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/locale/en-US.js +0 -67
- package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js +0 -57
- package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js +0 -45
- package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js +0 -44
- package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js +0 -174
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +0 -113
- package/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js +0 -25
- package/dist/node_modules/react-day-picker/dist/esm/useFocus.js +0 -56
- package/dist/node_modules/react-day-picker/dist/esm/useSelection.js +0 -31
- package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js +0 -95
- package/dist/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js +0 -57
- package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js +0 -62
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js +0 -30
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js +0 -74
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js +0 -35
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js +0 -21
- package/dist/node_modules/react-day-picker/dist/esm/utils/toTimeZone.js +0 -16
- package/dist/node_modules/react-day-picker/dist/esm/utils/typeguards.js +0 -66
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -9
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +0 -167
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -38
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -21
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -110
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -5
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -7
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +0 -56
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +0 -10
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +0 -31
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +0 -19
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +0 -25
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +0 -51
- package/dist/node_modules/tslib/tslib.es6.js +0 -56
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +0 -24
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +0 -48
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +0 -42
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +0 -21
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +0 -77
- package/src/components/icons/AvatarAltIcon.tsx +0 -39
- package/src/components/icons/AvatarIcon.tsx +0 -35
- package/src/components/icons/CoopCardIcon.tsx +0 -32
- package/src/components/icons/CoopIcon.tsx +0 -32
- package/src/components/icons/CoopLocationIcon.tsx +0 -39
- package/src/components/icons/QuestionIcon.tsx +0 -35
- package/src/components/icons/SettingsIcon.tsx +0 -31
- package/src/components/icons/VanIcon.tsx +0 -31
|
@@ -1,775 +0,0 @@
|
|
|
1
|
-
import { getDayOfYear } from '../../getDayOfYear.js';
|
|
2
|
-
import { getISOWeek } from '../../getISOWeek.js';
|
|
3
|
-
import { getISOWeekYear } from '../../getISOWeekYear.js';
|
|
4
|
-
import { getWeek } from '../../getWeek.js';
|
|
5
|
-
import { getWeekYear } from '../../getWeekYear.js';
|
|
6
|
-
import { addLeadingZeros } from '../addLeadingZeros.js';
|
|
7
|
-
import { lightFormatters } from './lightFormatters.js';
|
|
8
|
-
|
|
9
|
-
const dayPeriodEnum = {
|
|
10
|
-
midnight: "midnight",
|
|
11
|
-
noon: "noon",
|
|
12
|
-
morning: "morning",
|
|
13
|
-
afternoon: "afternoon",
|
|
14
|
-
evening: "evening",
|
|
15
|
-
night: "night",
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/*
|
|
19
|
-
* | | Unit | | Unit |
|
|
20
|
-
* |-----|--------------------------------|-----|--------------------------------|
|
|
21
|
-
* | a | AM, PM | A* | Milliseconds in day |
|
|
22
|
-
* | b | AM, PM, noon, midnight | B | Flexible day period |
|
|
23
|
-
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
|
|
24
|
-
* | d | Day of month | D | Day of year |
|
|
25
|
-
* | e | Local day of week | E | Day of week |
|
|
26
|
-
* | f | | F* | Day of week in month |
|
|
27
|
-
* | g* | Modified Julian day | G | Era |
|
|
28
|
-
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
29
|
-
* | i! | ISO day of week | I! | ISO week of year |
|
|
30
|
-
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
|
|
31
|
-
* | k | Hour [1-24] | K | Hour [0-11] |
|
|
32
|
-
* | l* | (deprecated) | L | Stand-alone month |
|
|
33
|
-
* | m | Minute | M | Month |
|
|
34
|
-
* | n | | N | |
|
|
35
|
-
* | o! | Ordinal number modifier | O | Timezone (GMT) |
|
|
36
|
-
* | p! | Long localized time | P! | Long localized date |
|
|
37
|
-
* | q | Stand-alone quarter | Q | Quarter |
|
|
38
|
-
* | r* | Related Gregorian year | R! | ISO week-numbering year |
|
|
39
|
-
* | s | Second | S | Fraction of second |
|
|
40
|
-
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
|
|
41
|
-
* | u | Extended year | U* | Cyclic year |
|
|
42
|
-
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
|
|
43
|
-
* | w | Local week of year | W* | Week of month |
|
|
44
|
-
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
|
|
45
|
-
* | y | Year (abs) | Y | Local week-numbering year |
|
|
46
|
-
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
|
|
47
|
-
*
|
|
48
|
-
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
49
|
-
*
|
|
50
|
-
* Letters marked by ! are non-standard, but implemented by date-fns:
|
|
51
|
-
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
|
|
52
|
-
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
|
|
53
|
-
* i.e. 7 for Sunday, 1 for Monday, etc.
|
|
54
|
-
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
|
|
55
|
-
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
|
|
56
|
-
* `R` is supposed to be used in conjunction with `I` and `i`
|
|
57
|
-
* for universal ISO week-numbering date, whereas
|
|
58
|
-
* `Y` is supposed to be used in conjunction with `w` and `e`
|
|
59
|
-
* for week-numbering date specific to the locale.
|
|
60
|
-
* - `P` is long localized date format
|
|
61
|
-
* - `p` is long localized time format
|
|
62
|
-
*/
|
|
63
|
-
|
|
64
|
-
const formatters = {
|
|
65
|
-
// Era
|
|
66
|
-
G: function (date, token, localize) {
|
|
67
|
-
const era = date.getFullYear() > 0 ? 1 : 0;
|
|
68
|
-
switch (token) {
|
|
69
|
-
// AD, BC
|
|
70
|
-
case "G":
|
|
71
|
-
case "GG":
|
|
72
|
-
case "GGG":
|
|
73
|
-
return localize.era(era, { width: "abbreviated" });
|
|
74
|
-
// A, B
|
|
75
|
-
case "GGGGG":
|
|
76
|
-
return localize.era(era, { width: "narrow" });
|
|
77
|
-
// Anno Domini, Before Christ
|
|
78
|
-
case "GGGG":
|
|
79
|
-
default:
|
|
80
|
-
return localize.era(era, { width: "wide" });
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
// Year
|
|
85
|
-
y: function (date, token, localize) {
|
|
86
|
-
// Ordinal number
|
|
87
|
-
if (token === "yo") {
|
|
88
|
-
const signedYear = date.getFullYear();
|
|
89
|
-
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
90
|
-
const year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
91
|
-
return localize.ordinalNumber(year, { unit: "year" });
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return lightFormatters.y(date, token);
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
// Local week-numbering year
|
|
98
|
-
Y: function (date, token, localize, options) {
|
|
99
|
-
const signedWeekYear = getWeekYear(date, options);
|
|
100
|
-
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
101
|
-
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
|
102
|
-
|
|
103
|
-
// Two digit year
|
|
104
|
-
if (token === "YY") {
|
|
105
|
-
const twoDigitYear = weekYear % 100;
|
|
106
|
-
return addLeadingZeros(twoDigitYear, 2);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// Ordinal number
|
|
110
|
-
if (token === "Yo") {
|
|
111
|
-
return localize.ordinalNumber(weekYear, { unit: "year" });
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// Padding
|
|
115
|
-
return addLeadingZeros(weekYear, token.length);
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
// ISO week-numbering year
|
|
119
|
-
R: function (date, token) {
|
|
120
|
-
const isoWeekYear = getISOWeekYear(date);
|
|
121
|
-
|
|
122
|
-
// Padding
|
|
123
|
-
return addLeadingZeros(isoWeekYear, token.length);
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
// Extended year. This is a single number designating the year of this calendar system.
|
|
127
|
-
// The main difference between `y` and `u` localizers are B.C. years:
|
|
128
|
-
// | Year | `y` | `u` |
|
|
129
|
-
// |------|-----|-----|
|
|
130
|
-
// | AC 1 | 1 | 1 |
|
|
131
|
-
// | BC 1 | 1 | 0 |
|
|
132
|
-
// | BC 2 | 2 | -1 |
|
|
133
|
-
// Also `yy` always returns the last two digits of a year,
|
|
134
|
-
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
135
|
-
u: function (date, token) {
|
|
136
|
-
const year = date.getFullYear();
|
|
137
|
-
return addLeadingZeros(year, token.length);
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
// Quarter
|
|
141
|
-
Q: function (date, token, localize) {
|
|
142
|
-
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
|
143
|
-
switch (token) {
|
|
144
|
-
// 1, 2, 3, 4
|
|
145
|
-
case "Q":
|
|
146
|
-
return String(quarter);
|
|
147
|
-
// 01, 02, 03, 04
|
|
148
|
-
case "QQ":
|
|
149
|
-
return addLeadingZeros(quarter, 2);
|
|
150
|
-
// 1st, 2nd, 3rd, 4th
|
|
151
|
-
case "Qo":
|
|
152
|
-
return localize.ordinalNumber(quarter, { unit: "quarter" });
|
|
153
|
-
// Q1, Q2, Q3, Q4
|
|
154
|
-
case "QQQ":
|
|
155
|
-
return localize.quarter(quarter, {
|
|
156
|
-
width: "abbreviated",
|
|
157
|
-
context: "formatting",
|
|
158
|
-
});
|
|
159
|
-
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
160
|
-
case "QQQQQ":
|
|
161
|
-
return localize.quarter(quarter, {
|
|
162
|
-
width: "narrow",
|
|
163
|
-
context: "formatting",
|
|
164
|
-
});
|
|
165
|
-
// 1st quarter, 2nd quarter, ...
|
|
166
|
-
case "QQQQ":
|
|
167
|
-
default:
|
|
168
|
-
return localize.quarter(quarter, {
|
|
169
|
-
width: "wide",
|
|
170
|
-
context: "formatting",
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
// Stand-alone quarter
|
|
176
|
-
q: function (date, token, localize) {
|
|
177
|
-
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
|
178
|
-
switch (token) {
|
|
179
|
-
// 1, 2, 3, 4
|
|
180
|
-
case "q":
|
|
181
|
-
return String(quarter);
|
|
182
|
-
// 01, 02, 03, 04
|
|
183
|
-
case "qq":
|
|
184
|
-
return addLeadingZeros(quarter, 2);
|
|
185
|
-
// 1st, 2nd, 3rd, 4th
|
|
186
|
-
case "qo":
|
|
187
|
-
return localize.ordinalNumber(quarter, { unit: "quarter" });
|
|
188
|
-
// Q1, Q2, Q3, Q4
|
|
189
|
-
case "qqq":
|
|
190
|
-
return localize.quarter(quarter, {
|
|
191
|
-
width: "abbreviated",
|
|
192
|
-
context: "standalone",
|
|
193
|
-
});
|
|
194
|
-
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
195
|
-
case "qqqqq":
|
|
196
|
-
return localize.quarter(quarter, {
|
|
197
|
-
width: "narrow",
|
|
198
|
-
context: "standalone",
|
|
199
|
-
});
|
|
200
|
-
// 1st quarter, 2nd quarter, ...
|
|
201
|
-
case "qqqq":
|
|
202
|
-
default:
|
|
203
|
-
return localize.quarter(quarter, {
|
|
204
|
-
width: "wide",
|
|
205
|
-
context: "standalone",
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
|
|
210
|
-
// Month
|
|
211
|
-
M: function (date, token, localize) {
|
|
212
|
-
const month = date.getMonth();
|
|
213
|
-
switch (token) {
|
|
214
|
-
case "M":
|
|
215
|
-
case "MM":
|
|
216
|
-
return lightFormatters.M(date, token);
|
|
217
|
-
// 1st, 2nd, ..., 12th
|
|
218
|
-
case "Mo":
|
|
219
|
-
return localize.ordinalNumber(month + 1, { unit: "month" });
|
|
220
|
-
// Jan, Feb, ..., Dec
|
|
221
|
-
case "MMM":
|
|
222
|
-
return localize.month(month, {
|
|
223
|
-
width: "abbreviated",
|
|
224
|
-
context: "formatting",
|
|
225
|
-
});
|
|
226
|
-
// J, F, ..., D
|
|
227
|
-
case "MMMMM":
|
|
228
|
-
return localize.month(month, {
|
|
229
|
-
width: "narrow",
|
|
230
|
-
context: "formatting",
|
|
231
|
-
});
|
|
232
|
-
// January, February, ..., December
|
|
233
|
-
case "MMMM":
|
|
234
|
-
default:
|
|
235
|
-
return localize.month(month, { width: "wide", context: "formatting" });
|
|
236
|
-
}
|
|
237
|
-
},
|
|
238
|
-
|
|
239
|
-
// Stand-alone month
|
|
240
|
-
L: function (date, token, localize) {
|
|
241
|
-
const month = date.getMonth();
|
|
242
|
-
switch (token) {
|
|
243
|
-
// 1, 2, ..., 12
|
|
244
|
-
case "L":
|
|
245
|
-
return String(month + 1);
|
|
246
|
-
// 01, 02, ..., 12
|
|
247
|
-
case "LL":
|
|
248
|
-
return addLeadingZeros(month + 1, 2);
|
|
249
|
-
// 1st, 2nd, ..., 12th
|
|
250
|
-
case "Lo":
|
|
251
|
-
return localize.ordinalNumber(month + 1, { unit: "month" });
|
|
252
|
-
// Jan, Feb, ..., Dec
|
|
253
|
-
case "LLL":
|
|
254
|
-
return localize.month(month, {
|
|
255
|
-
width: "abbreviated",
|
|
256
|
-
context: "standalone",
|
|
257
|
-
});
|
|
258
|
-
// J, F, ..., D
|
|
259
|
-
case "LLLLL":
|
|
260
|
-
return localize.month(month, {
|
|
261
|
-
width: "narrow",
|
|
262
|
-
context: "standalone",
|
|
263
|
-
});
|
|
264
|
-
// January, February, ..., December
|
|
265
|
-
case "LLLL":
|
|
266
|
-
default:
|
|
267
|
-
return localize.month(month, { width: "wide", context: "standalone" });
|
|
268
|
-
}
|
|
269
|
-
},
|
|
270
|
-
|
|
271
|
-
// Local week of year
|
|
272
|
-
w: function (date, token, localize, options) {
|
|
273
|
-
const week = getWeek(date, options);
|
|
274
|
-
|
|
275
|
-
if (token === "wo") {
|
|
276
|
-
return localize.ordinalNumber(week, { unit: "week" });
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
return addLeadingZeros(week, token.length);
|
|
280
|
-
},
|
|
281
|
-
|
|
282
|
-
// ISO week of year
|
|
283
|
-
I: function (date, token, localize) {
|
|
284
|
-
const isoWeek = getISOWeek(date);
|
|
285
|
-
|
|
286
|
-
if (token === "Io") {
|
|
287
|
-
return localize.ordinalNumber(isoWeek, { unit: "week" });
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
return addLeadingZeros(isoWeek, token.length);
|
|
291
|
-
},
|
|
292
|
-
|
|
293
|
-
// Day of the month
|
|
294
|
-
d: function (date, token, localize) {
|
|
295
|
-
if (token === "do") {
|
|
296
|
-
return localize.ordinalNumber(date.getDate(), { unit: "date" });
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
return lightFormatters.d(date, token);
|
|
300
|
-
},
|
|
301
|
-
|
|
302
|
-
// Day of year
|
|
303
|
-
D: function (date, token, localize) {
|
|
304
|
-
const dayOfYear = getDayOfYear(date);
|
|
305
|
-
|
|
306
|
-
if (token === "Do") {
|
|
307
|
-
return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
return addLeadingZeros(dayOfYear, token.length);
|
|
311
|
-
},
|
|
312
|
-
|
|
313
|
-
// Day of week
|
|
314
|
-
E: function (date, token, localize) {
|
|
315
|
-
const dayOfWeek = date.getDay();
|
|
316
|
-
switch (token) {
|
|
317
|
-
// Tue
|
|
318
|
-
case "E":
|
|
319
|
-
case "EE":
|
|
320
|
-
case "EEE":
|
|
321
|
-
return localize.day(dayOfWeek, {
|
|
322
|
-
width: "abbreviated",
|
|
323
|
-
context: "formatting",
|
|
324
|
-
});
|
|
325
|
-
// T
|
|
326
|
-
case "EEEEE":
|
|
327
|
-
return localize.day(dayOfWeek, {
|
|
328
|
-
width: "narrow",
|
|
329
|
-
context: "formatting",
|
|
330
|
-
});
|
|
331
|
-
// Tu
|
|
332
|
-
case "EEEEEE":
|
|
333
|
-
return localize.day(dayOfWeek, {
|
|
334
|
-
width: "short",
|
|
335
|
-
context: "formatting",
|
|
336
|
-
});
|
|
337
|
-
// Tuesday
|
|
338
|
-
case "EEEE":
|
|
339
|
-
default:
|
|
340
|
-
return localize.day(dayOfWeek, {
|
|
341
|
-
width: "wide",
|
|
342
|
-
context: "formatting",
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
},
|
|
346
|
-
|
|
347
|
-
// Local day of week
|
|
348
|
-
e: function (date, token, localize, options) {
|
|
349
|
-
const dayOfWeek = date.getDay();
|
|
350
|
-
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
351
|
-
switch (token) {
|
|
352
|
-
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
353
|
-
case "e":
|
|
354
|
-
return String(localDayOfWeek);
|
|
355
|
-
// Padded numerical value
|
|
356
|
-
case "ee":
|
|
357
|
-
return addLeadingZeros(localDayOfWeek, 2);
|
|
358
|
-
// 1st, 2nd, ..., 7th
|
|
359
|
-
case "eo":
|
|
360
|
-
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
|
|
361
|
-
case "eee":
|
|
362
|
-
return localize.day(dayOfWeek, {
|
|
363
|
-
width: "abbreviated",
|
|
364
|
-
context: "formatting",
|
|
365
|
-
});
|
|
366
|
-
// T
|
|
367
|
-
case "eeeee":
|
|
368
|
-
return localize.day(dayOfWeek, {
|
|
369
|
-
width: "narrow",
|
|
370
|
-
context: "formatting",
|
|
371
|
-
});
|
|
372
|
-
// Tu
|
|
373
|
-
case "eeeeee":
|
|
374
|
-
return localize.day(dayOfWeek, {
|
|
375
|
-
width: "short",
|
|
376
|
-
context: "formatting",
|
|
377
|
-
});
|
|
378
|
-
// Tuesday
|
|
379
|
-
case "eeee":
|
|
380
|
-
default:
|
|
381
|
-
return localize.day(dayOfWeek, {
|
|
382
|
-
width: "wide",
|
|
383
|
-
context: "formatting",
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
},
|
|
387
|
-
|
|
388
|
-
// Stand-alone local day of week
|
|
389
|
-
c: function (date, token, localize, options) {
|
|
390
|
-
const dayOfWeek = date.getDay();
|
|
391
|
-
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
392
|
-
switch (token) {
|
|
393
|
-
// Numerical value (same as in `e`)
|
|
394
|
-
case "c":
|
|
395
|
-
return String(localDayOfWeek);
|
|
396
|
-
// Padded numerical value
|
|
397
|
-
case "cc":
|
|
398
|
-
return addLeadingZeros(localDayOfWeek, token.length);
|
|
399
|
-
// 1st, 2nd, ..., 7th
|
|
400
|
-
case "co":
|
|
401
|
-
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
|
|
402
|
-
case "ccc":
|
|
403
|
-
return localize.day(dayOfWeek, {
|
|
404
|
-
width: "abbreviated",
|
|
405
|
-
context: "standalone",
|
|
406
|
-
});
|
|
407
|
-
// T
|
|
408
|
-
case "ccccc":
|
|
409
|
-
return localize.day(dayOfWeek, {
|
|
410
|
-
width: "narrow",
|
|
411
|
-
context: "standalone",
|
|
412
|
-
});
|
|
413
|
-
// Tu
|
|
414
|
-
case "cccccc":
|
|
415
|
-
return localize.day(dayOfWeek, {
|
|
416
|
-
width: "short",
|
|
417
|
-
context: "standalone",
|
|
418
|
-
});
|
|
419
|
-
// Tuesday
|
|
420
|
-
case "cccc":
|
|
421
|
-
default:
|
|
422
|
-
return localize.day(dayOfWeek, {
|
|
423
|
-
width: "wide",
|
|
424
|
-
context: "standalone",
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
},
|
|
428
|
-
|
|
429
|
-
// ISO day of week
|
|
430
|
-
i: function (date, token, localize) {
|
|
431
|
-
const dayOfWeek = date.getDay();
|
|
432
|
-
const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
|
433
|
-
switch (token) {
|
|
434
|
-
// 2
|
|
435
|
-
case "i":
|
|
436
|
-
return String(isoDayOfWeek);
|
|
437
|
-
// 02
|
|
438
|
-
case "ii":
|
|
439
|
-
return addLeadingZeros(isoDayOfWeek, token.length);
|
|
440
|
-
// 2nd
|
|
441
|
-
case "io":
|
|
442
|
-
return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
|
|
443
|
-
// Tue
|
|
444
|
-
case "iii":
|
|
445
|
-
return localize.day(dayOfWeek, {
|
|
446
|
-
width: "abbreviated",
|
|
447
|
-
context: "formatting",
|
|
448
|
-
});
|
|
449
|
-
// T
|
|
450
|
-
case "iiiii":
|
|
451
|
-
return localize.day(dayOfWeek, {
|
|
452
|
-
width: "narrow",
|
|
453
|
-
context: "formatting",
|
|
454
|
-
});
|
|
455
|
-
// Tu
|
|
456
|
-
case "iiiiii":
|
|
457
|
-
return localize.day(dayOfWeek, {
|
|
458
|
-
width: "short",
|
|
459
|
-
context: "formatting",
|
|
460
|
-
});
|
|
461
|
-
// Tuesday
|
|
462
|
-
case "iiii":
|
|
463
|
-
default:
|
|
464
|
-
return localize.day(dayOfWeek, {
|
|
465
|
-
width: "wide",
|
|
466
|
-
context: "formatting",
|
|
467
|
-
});
|
|
468
|
-
}
|
|
469
|
-
},
|
|
470
|
-
|
|
471
|
-
// AM or PM
|
|
472
|
-
a: function (date, token, localize) {
|
|
473
|
-
const hours = date.getHours();
|
|
474
|
-
const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
475
|
-
|
|
476
|
-
switch (token) {
|
|
477
|
-
case "a":
|
|
478
|
-
case "aa":
|
|
479
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
480
|
-
width: "abbreviated",
|
|
481
|
-
context: "formatting",
|
|
482
|
-
});
|
|
483
|
-
case "aaa":
|
|
484
|
-
return localize
|
|
485
|
-
.dayPeriod(dayPeriodEnumValue, {
|
|
486
|
-
width: "abbreviated",
|
|
487
|
-
context: "formatting",
|
|
488
|
-
})
|
|
489
|
-
.toLowerCase();
|
|
490
|
-
case "aaaaa":
|
|
491
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
492
|
-
width: "narrow",
|
|
493
|
-
context: "formatting",
|
|
494
|
-
});
|
|
495
|
-
case "aaaa":
|
|
496
|
-
default:
|
|
497
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
498
|
-
width: "wide",
|
|
499
|
-
context: "formatting",
|
|
500
|
-
});
|
|
501
|
-
}
|
|
502
|
-
},
|
|
503
|
-
|
|
504
|
-
// AM, PM, midnight, noon
|
|
505
|
-
b: function (date, token, localize) {
|
|
506
|
-
const hours = date.getHours();
|
|
507
|
-
let dayPeriodEnumValue;
|
|
508
|
-
if (hours === 12) {
|
|
509
|
-
dayPeriodEnumValue = dayPeriodEnum.noon;
|
|
510
|
-
} else if (hours === 0) {
|
|
511
|
-
dayPeriodEnumValue = dayPeriodEnum.midnight;
|
|
512
|
-
} else {
|
|
513
|
-
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
switch (token) {
|
|
517
|
-
case "b":
|
|
518
|
-
case "bb":
|
|
519
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
520
|
-
width: "abbreviated",
|
|
521
|
-
context: "formatting",
|
|
522
|
-
});
|
|
523
|
-
case "bbb":
|
|
524
|
-
return localize
|
|
525
|
-
.dayPeriod(dayPeriodEnumValue, {
|
|
526
|
-
width: "abbreviated",
|
|
527
|
-
context: "formatting",
|
|
528
|
-
})
|
|
529
|
-
.toLowerCase();
|
|
530
|
-
case "bbbbb":
|
|
531
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
532
|
-
width: "narrow",
|
|
533
|
-
context: "formatting",
|
|
534
|
-
});
|
|
535
|
-
case "bbbb":
|
|
536
|
-
default:
|
|
537
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
538
|
-
width: "wide",
|
|
539
|
-
context: "formatting",
|
|
540
|
-
});
|
|
541
|
-
}
|
|
542
|
-
},
|
|
543
|
-
|
|
544
|
-
// in the morning, in the afternoon, in the evening, at night
|
|
545
|
-
B: function (date, token, localize) {
|
|
546
|
-
const hours = date.getHours();
|
|
547
|
-
let dayPeriodEnumValue;
|
|
548
|
-
if (hours >= 17) {
|
|
549
|
-
dayPeriodEnumValue = dayPeriodEnum.evening;
|
|
550
|
-
} else if (hours >= 12) {
|
|
551
|
-
dayPeriodEnumValue = dayPeriodEnum.afternoon;
|
|
552
|
-
} else if (hours >= 4) {
|
|
553
|
-
dayPeriodEnumValue = dayPeriodEnum.morning;
|
|
554
|
-
} else {
|
|
555
|
-
dayPeriodEnumValue = dayPeriodEnum.night;
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
switch (token) {
|
|
559
|
-
case "B":
|
|
560
|
-
case "BB":
|
|
561
|
-
case "BBB":
|
|
562
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
563
|
-
width: "abbreviated",
|
|
564
|
-
context: "formatting",
|
|
565
|
-
});
|
|
566
|
-
case "BBBBB":
|
|
567
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
568
|
-
width: "narrow",
|
|
569
|
-
context: "formatting",
|
|
570
|
-
});
|
|
571
|
-
case "BBBB":
|
|
572
|
-
default:
|
|
573
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
574
|
-
width: "wide",
|
|
575
|
-
context: "formatting",
|
|
576
|
-
});
|
|
577
|
-
}
|
|
578
|
-
},
|
|
579
|
-
|
|
580
|
-
// Hour [1-12]
|
|
581
|
-
h: function (date, token, localize) {
|
|
582
|
-
if (token === "ho") {
|
|
583
|
-
let hours = date.getHours() % 12;
|
|
584
|
-
if (hours === 0) hours = 12;
|
|
585
|
-
return localize.ordinalNumber(hours, { unit: "hour" });
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
return lightFormatters.h(date, token);
|
|
589
|
-
},
|
|
590
|
-
|
|
591
|
-
// Hour [0-23]
|
|
592
|
-
H: function (date, token, localize) {
|
|
593
|
-
if (token === "Ho") {
|
|
594
|
-
return localize.ordinalNumber(date.getHours(), { unit: "hour" });
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
return lightFormatters.H(date, token);
|
|
598
|
-
},
|
|
599
|
-
|
|
600
|
-
// Hour [0-11]
|
|
601
|
-
K: function (date, token, localize) {
|
|
602
|
-
const hours = date.getHours() % 12;
|
|
603
|
-
|
|
604
|
-
if (token === "Ko") {
|
|
605
|
-
return localize.ordinalNumber(hours, { unit: "hour" });
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
return addLeadingZeros(hours, token.length);
|
|
609
|
-
},
|
|
610
|
-
|
|
611
|
-
// Hour [1-24]
|
|
612
|
-
k: function (date, token, localize) {
|
|
613
|
-
let hours = date.getHours();
|
|
614
|
-
if (hours === 0) hours = 24;
|
|
615
|
-
|
|
616
|
-
if (token === "ko") {
|
|
617
|
-
return localize.ordinalNumber(hours, { unit: "hour" });
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
return addLeadingZeros(hours, token.length);
|
|
621
|
-
},
|
|
622
|
-
|
|
623
|
-
// Minute
|
|
624
|
-
m: function (date, token, localize) {
|
|
625
|
-
if (token === "mo") {
|
|
626
|
-
return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
return lightFormatters.m(date, token);
|
|
630
|
-
},
|
|
631
|
-
|
|
632
|
-
// Second
|
|
633
|
-
s: function (date, token, localize) {
|
|
634
|
-
if (token === "so") {
|
|
635
|
-
return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
return lightFormatters.s(date, token);
|
|
639
|
-
},
|
|
640
|
-
|
|
641
|
-
// Fraction of second
|
|
642
|
-
S: function (date, token) {
|
|
643
|
-
return lightFormatters.S(date, token);
|
|
644
|
-
},
|
|
645
|
-
|
|
646
|
-
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
647
|
-
X: function (date, token, _localize) {
|
|
648
|
-
const timezoneOffset = date.getTimezoneOffset();
|
|
649
|
-
|
|
650
|
-
if (timezoneOffset === 0) {
|
|
651
|
-
return "Z";
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
switch (token) {
|
|
655
|
-
// Hours and optional minutes
|
|
656
|
-
case "X":
|
|
657
|
-
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
658
|
-
|
|
659
|
-
// Hours, minutes and optional seconds without `:` delimiter
|
|
660
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
661
|
-
// so this token always has the same output as `XX`
|
|
662
|
-
case "XXXX":
|
|
663
|
-
case "XX": // Hours and minutes without `:` delimiter
|
|
664
|
-
return formatTimezone(timezoneOffset);
|
|
665
|
-
|
|
666
|
-
// Hours, minutes and optional seconds with `:` delimiter
|
|
667
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
668
|
-
// so this token always has the same output as `XXX`
|
|
669
|
-
case "XXXXX":
|
|
670
|
-
case "XXX": // Hours and minutes with `:` delimiter
|
|
671
|
-
default:
|
|
672
|
-
return formatTimezone(timezoneOffset, ":");
|
|
673
|
-
}
|
|
674
|
-
},
|
|
675
|
-
|
|
676
|
-
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
677
|
-
x: function (date, token, _localize) {
|
|
678
|
-
const timezoneOffset = date.getTimezoneOffset();
|
|
679
|
-
|
|
680
|
-
switch (token) {
|
|
681
|
-
// Hours and optional minutes
|
|
682
|
-
case "x":
|
|
683
|
-
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
684
|
-
|
|
685
|
-
// Hours, minutes and optional seconds without `:` delimiter
|
|
686
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
687
|
-
// so this token always has the same output as `xx`
|
|
688
|
-
case "xxxx":
|
|
689
|
-
case "xx": // Hours and minutes without `:` delimiter
|
|
690
|
-
return formatTimezone(timezoneOffset);
|
|
691
|
-
|
|
692
|
-
// Hours, minutes and optional seconds with `:` delimiter
|
|
693
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
694
|
-
// so this token always has the same output as `xxx`
|
|
695
|
-
case "xxxxx":
|
|
696
|
-
case "xxx": // Hours and minutes with `:` delimiter
|
|
697
|
-
default:
|
|
698
|
-
return formatTimezone(timezoneOffset, ":");
|
|
699
|
-
}
|
|
700
|
-
},
|
|
701
|
-
|
|
702
|
-
// Timezone (GMT)
|
|
703
|
-
O: function (date, token, _localize) {
|
|
704
|
-
const timezoneOffset = date.getTimezoneOffset();
|
|
705
|
-
|
|
706
|
-
switch (token) {
|
|
707
|
-
// Short
|
|
708
|
-
case "O":
|
|
709
|
-
case "OO":
|
|
710
|
-
case "OOO":
|
|
711
|
-
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
712
|
-
// Long
|
|
713
|
-
case "OOOO":
|
|
714
|
-
default:
|
|
715
|
-
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
716
|
-
}
|
|
717
|
-
},
|
|
718
|
-
|
|
719
|
-
// Timezone (specific non-location)
|
|
720
|
-
z: function (date, token, _localize) {
|
|
721
|
-
const timezoneOffset = date.getTimezoneOffset();
|
|
722
|
-
|
|
723
|
-
switch (token) {
|
|
724
|
-
// Short
|
|
725
|
-
case "z":
|
|
726
|
-
case "zz":
|
|
727
|
-
case "zzz":
|
|
728
|
-
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
729
|
-
// Long
|
|
730
|
-
case "zzzz":
|
|
731
|
-
default:
|
|
732
|
-
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
733
|
-
}
|
|
734
|
-
},
|
|
735
|
-
|
|
736
|
-
// Seconds timestamp
|
|
737
|
-
t: function (date, token, _localize) {
|
|
738
|
-
const timestamp = Math.trunc(+date / 1000);
|
|
739
|
-
return addLeadingZeros(timestamp, token.length);
|
|
740
|
-
},
|
|
741
|
-
|
|
742
|
-
// Milliseconds timestamp
|
|
743
|
-
T: function (date, token, _localize) {
|
|
744
|
-
return addLeadingZeros(+date, token.length);
|
|
745
|
-
},
|
|
746
|
-
};
|
|
747
|
-
|
|
748
|
-
function formatTimezoneShort(offset, delimiter = "") {
|
|
749
|
-
const sign = offset > 0 ? "-" : "+";
|
|
750
|
-
const absOffset = Math.abs(offset);
|
|
751
|
-
const hours = Math.trunc(absOffset / 60);
|
|
752
|
-
const minutes = absOffset % 60;
|
|
753
|
-
if (minutes === 0) {
|
|
754
|
-
return sign + String(hours);
|
|
755
|
-
}
|
|
756
|
-
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
|
|
760
|
-
if (offset % 60 === 0) {
|
|
761
|
-
const sign = offset > 0 ? "-" : "+";
|
|
762
|
-
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
|
|
763
|
-
}
|
|
764
|
-
return formatTimezone(offset, delimiter);
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
function formatTimezone(offset, delimiter = "") {
|
|
768
|
-
const sign = offset > 0 ? "-" : "+";
|
|
769
|
-
const absOffset = Math.abs(offset);
|
|
770
|
-
const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
|
|
771
|
-
const minutes = addLeadingZeros(absOffset % 60, 2);
|
|
772
|
-
return sign + hours + delimiter + minutes;
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
export { formatters };
|