@betterinternship/components 1.5.27 → 1.6.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 +26 -0
- package/dist/components/Accordion.d.ts +7 -0
- package/dist/components/Avatar.d.ts +6 -0
- package/dist/components/Badge.d.ts +21 -0
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Calendar.d.ts +7 -0
- package/dist/components/Input.d.ts +3 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/accordion.js +20 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +6 -0
- package/dist/components/ui/avatar.js +16 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +22 -0
- package/dist/components/ui/badge.js +113 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/button.d.ts +13 -0
- package/dist/components/ui/button.js +88 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +7 -0
- package/dist/components/ui/calendar.js +51 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.js +27 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox.js +11 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +18 -0
- package/dist/components/ui/dialog.js +41 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/icons.d.ts +10 -0
- package/dist/components/ui/icons.js +39 -0
- package/dist/components/ui/icons.js.map +1 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/input.js +17 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.js +10 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/popover.d.ts +7 -0
- package/dist/components/ui/popover.js +17 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.js +10 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/skeleton.js +9 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/switch.js +10 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/table.js +30 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/textarea.js +9 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +9 -0
- package/dist/components/ui/tooltip.js +19 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/hooks/useClientProcess.js +0 -1
- package/dist/hooks/useClientProcess.js.map +1 -1
- package/dist/index.css.js +1 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.esm.js +3761 -3761
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/node_modules/@date-fns/tz/date/index.js +84 -0
- package/dist/node_modules/@date-fns/tz/date/index.js.map +1 -0
- package/dist/node_modules/@date-fns/tz/date/mini.js +451 -0
- package/dist/node_modules/@date-fns/tz/date/mini.js.map +1 -0
- package/dist/node_modules/@date-fns/tz/tzName/index.js +40 -0
- package/dist/node_modules/@date-fns/tz/tzName/index.js.map +1 -0
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js +57 -0
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js.map +1 -0
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +8 -0
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js.map +1 -0
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +8 -0
- package/dist/node_modules/date-fns/_lib/defaultOptions.js.map +1 -0
- package/dist/node_modules/date-fns/_lib/format/formatters.js +776 -0
- package/dist/node_modules/date-fns/_lib/format/formatters.js.map +1 -0
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +95 -0
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js.map +1 -0
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +67 -0
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js.map +1 -0
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +32 -0
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js.map +1 -0
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +12 -0
- package/dist/node_modules/date-fns/_lib/normalizeDates.js.map +1 -0
- package/dist/node_modules/date-fns/_lib/normalizeInterval.js +9 -0
- package/dist/node_modules/date-fns/_lib/normalizeInterval.js.map +1 -0
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +26 -0
- package/dist/node_modules/date-fns/_lib/protectedTokens.js.map +1 -0
- package/dist/node_modules/date-fns/addDays.js +61 -0
- package/dist/node_modules/date-fns/addDays.js.map +1 -0
- package/dist/node_modules/date-fns/addMonths.js +76 -0
- package/dist/node_modules/date-fns/addMonths.js.map +1 -0
- package/dist/node_modules/date-fns/addWeeks.js +34 -0
- package/dist/node_modules/date-fns/addWeeks.js.map +1 -0
- package/dist/node_modules/date-fns/addYears.js +34 -0
- package/dist/node_modules/date-fns/addYears.js.map +1 -0
- package/dist/node_modules/date-fns/constants.js +47 -0
- package/dist/node_modules/date-fns/constants.js.map +1 -0
- package/dist/node_modules/date-fns/constructFrom.js +50 -0
- package/dist/node_modules/date-fns/constructFrom.js.map +1 -0
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +63 -0
- package/dist/node_modules/date-fns/differenceInCalendarDays.js.map +1 -0
- package/dist/node_modules/date-fns/differenceInCalendarMonths.js +43 -0
- package/dist/node_modules/date-fns/differenceInCalendarMonths.js.map +1 -0
- package/dist/node_modules/date-fns/eachMonthOfInterval.js +66 -0
- package/dist/node_modules/date-fns/eachMonthOfInterval.js.map +1 -0
- package/dist/node_modules/date-fns/eachYearOfInterval.js +66 -0
- package/dist/node_modules/date-fns/eachYearOfInterval.js.map +1 -0
- package/dist/node_modules/date-fns/endOfISOWeek.js +36 -0
- package/dist/node_modules/date-fns/endOfISOWeek.js.map +1 -0
- package/dist/node_modules/date-fns/endOfMonth.js +38 -0
- package/dist/node_modules/date-fns/endOfMonth.js.map +1 -0
- package/dist/node_modules/date-fns/endOfWeek.js +54 -0
- package/dist/node_modules/date-fns/endOfWeek.js.map +1 -0
- package/dist/node_modules/date-fns/endOfYear.js +38 -0
- package/dist/node_modules/date-fns/endOfYear.js.map +1 -0
- package/dist/node_modules/date-fns/format.js +424 -0
- package/dist/node_modules/date-fns/format.js.map +1 -0
- package/dist/node_modules/date-fns/getDayOfYear.js +35 -0
- package/dist/node_modules/date-fns/getDayOfYear.js.map +1 -0
- package/dist/node_modules/date-fns/getDaysInMonth.js +37 -0
- package/dist/node_modules/date-fns/getDaysInMonth.js.map +1 -0
- package/dist/node_modules/date-fns/getISOWeek.js +41 -0
- package/dist/node_modules/date-fns/getISOWeek.js.map +1 -0
- package/dist/node_modules/date-fns/getISOWeekYear.js +53 -0
- package/dist/node_modules/date-fns/getISOWeekYear.js.map +1 -0
- package/dist/node_modules/date-fns/getMonth.js +30 -0
- package/dist/node_modules/date-fns/getMonth.js.map +1 -0
- package/dist/node_modules/date-fns/getWeek.js +55 -0
- package/dist/node_modules/date-fns/getWeek.js.map +1 -0
- package/dist/node_modules/date-fns/getWeekYear.js +76 -0
- package/dist/node_modules/date-fns/getWeekYear.js.map +1 -0
- package/dist/node_modules/date-fns/getYear.js +30 -0
- package/dist/node_modules/date-fns/getYear.js.map +1 -0
- package/dist/node_modules/date-fns/isAfter.js +26 -0
- package/dist/node_modules/date-fns/isAfter.js.map +1 -0
- package/dist/node_modules/date-fns/isBefore.js +26 -0
- package/dist/node_modules/date-fns/isBefore.js.map +1 -0
- package/dist/node_modules/date-fns/isDate.js +42 -0
- package/dist/node_modules/date-fns/isDate.js.map +1 -0
- package/dist/node_modules/date-fns/isSameDay.js +47 -0
- package/dist/node_modules/date-fns/isSameDay.js.map +1 -0
- package/dist/node_modules/date-fns/isSameMonth.js +44 -0
- package/dist/node_modules/date-fns/isSameMonth.js.map +1 -0
- package/dist/node_modules/date-fns/isSameYear.js +36 -0
- package/dist/node_modules/date-fns/isSameYear.js.map +1 -0
- package/dist/node_modules/date-fns/isValid.js +40 -0
- package/dist/node_modules/date-fns/isValid.js.map +1 -0
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +11 -0
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js.map +1 -0
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +65 -0
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js.map +1 -0
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +60 -0
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js.map +1 -0
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +23 -0
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js.map +1 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +104 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js.map +1 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +42 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js.map +1 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +14 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js.map +1 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +190 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js.map +1 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +135 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js.map +1 -0
- package/dist/node_modules/date-fns/locale/en-US.js +29 -0
- package/dist/node_modules/date-fns/locale/en-US.js.map +1 -0
- package/dist/node_modules/date-fns/max.js +50 -0
- package/dist/node_modules/date-fns/max.js.map +1 -0
- package/dist/node_modules/date-fns/min.js +50 -0
- package/dist/node_modules/date-fns/min.js.map +1 -0
- package/dist/node_modules/date-fns/setMonth.js +47 -0
- package/dist/node_modules/date-fns/setMonth.js.map +1 -0
- package/dist/node_modules/date-fns/setYear.js +41 -0
- package/dist/node_modules/date-fns/setYear.js.map +1 -0
- package/dist/node_modules/date-fns/startOfDay.js +36 -0
- package/dist/node_modules/date-fns/startOfDay.js.map +1 -0
- package/dist/node_modules/date-fns/startOfISOWeek.js +36 -0
- package/dist/node_modules/date-fns/startOfISOWeek.js.map +1 -0
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +43 -0
- package/dist/node_modules/date-fns/startOfISOWeekYear.js.map +1 -0
- package/dist/node_modules/date-fns/startOfMonth.js +38 -0
- package/dist/node_modules/date-fns/startOfMonth.js.map +1 -0
- package/dist/node_modules/date-fns/startOfWeek.js +54 -0
- package/dist/node_modules/date-fns/startOfWeek.js.map +1 -0
- package/dist/node_modules/date-fns/startOfWeekYear.js +65 -0
- package/dist/node_modules/date-fns/startOfWeekYear.js.map +1 -0
- package/dist/node_modules/date-fns/startOfYear.js +37 -0
- package/dist/node_modules/date-fns/startOfYear.js.map +1 -0
- package/dist/node_modules/date-fns/toDate.js +47 -0
- package/dist/node_modules/date-fns/toDate.js.map +1 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +2 -2
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +347 -0
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/UI.js +123 -0
- package/dist/node_modules/react-day-picker/dist/esm/UI.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js +34 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +600 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Day.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Day.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js +20 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Dropdown.js +24 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Dropdown.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/DropdownNav.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/DropdownNav.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Footer.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Footer.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Month.js +16 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Month.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthCaption.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthCaption.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthGrid.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthGrid.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Months.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Months.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js +16 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js +32 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Option.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Option.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Root.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Root.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Select.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Select.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Week.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Week.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumber.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumber.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekday.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekday.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekdays.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekdays.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weeks.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weeks.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js +16 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/custom-components.js +26 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/custom-components.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +21 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatDay.js +20 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatDay.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js +22 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js +20 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js +18 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js +74 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +96 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js +23 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +29 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js +34 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getComponents.js +21 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getComponents.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js +28 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js +60 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js +20 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js +34 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js +25 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js +47 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js +18 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +28 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getLabels.js +54 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getLabels.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js +34 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js +70 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js +32 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js +41 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js +37 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js +38 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js +28 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js +27 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +37 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +28 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js +32 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/index.js +12 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/index.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js +28 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +21 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js +23 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNav.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNav.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNext.js +17 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNext.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +16 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +16 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/locale/en-US.js +68 -0
- package/dist/node_modules/react-day-picker/dist/esm/locale/en-US.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/noonDateLib.js +164 -0
- package/dist/node_modules/react-day-picker/dist/esm/noonDateLib.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js +58 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js +64 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js +45 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js +174 -0
- package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +114 -0
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js +26 -0
- package/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/useFocus.js +57 -0
- package/dist/node_modules/react-day-picker/dist/esm/useFocus.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/useSelection.js +32 -0
- package/dist/node_modules/react-day-picker/dist/esm/useSelection.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js +96 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js +62 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js +63 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js +31 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js +75 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js +36 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js +22 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/toTimeZone.js +17 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/toTimeZone.js.map +1 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/typeguards.js +67 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/typeguards.js.map +1 -0
- package/dist/utilities/Icons.d.ts +33 -0
- package/dist/utils.js.map +1 -1
- package/package.json +87 -9
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { addMonths } from './addMonths.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The {@link addYears} function options.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @name addYears
|
|
9
|
+
* @category Year Helpers
|
|
10
|
+
* @summary Add the specified number of years to the given date.
|
|
11
|
+
*
|
|
12
|
+
* @description
|
|
13
|
+
* Add the specified number of years to the given date.
|
|
14
|
+
*
|
|
15
|
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
16
|
+
* @typeParam ResultDate - The result `Date` type.
|
|
17
|
+
*
|
|
18
|
+
* @param date - The date to be changed
|
|
19
|
+
* @param amount - The amount of years to be added.
|
|
20
|
+
* @param options - The options
|
|
21
|
+
*
|
|
22
|
+
* @returns The new date with the years added
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Add 5 years to 1 September 2014:
|
|
26
|
+
* const result = addYears(new Date(2014, 8, 1), 5)
|
|
27
|
+
* //=> Sun Sep 01 2019 00:00:00
|
|
28
|
+
*/
|
|
29
|
+
function addYears(date, amount, options) {
|
|
30
|
+
return addMonths(date, amount * 12, options);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { addYears, addYears as default };
|
|
34
|
+
//# sourceMappingURL=addYears.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addYears.js","sources":["../../../node_modules/date-fns/addYears.js"],"sourcesContent":["import { addMonths } from \"./addMonths.js\";\n\n/**\n * The {@link addYears} function options.\n */\n\n/**\n * @name addYears\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type.\n *\n * @param date - The date to be changed\n * @param amount - The amount of years to be added.\n * @param options - The options\n *\n * @returns The new date with the years added\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * const result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\nexport function addYears(date, amount, options) {\n return addMonths(date, amount * 12, options);\n}\n\n// Fallback for modularized imports:\nexport default addYears;\n"],"names":[],"mappings":";;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;AAChD,EAAE,OAAO,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,EAAE,EAAE,OAAO,CAAC;AAC9C;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module constants
|
|
3
|
+
* @summary Useful constants
|
|
4
|
+
* @description
|
|
5
|
+
* Collection of useful date constants.
|
|
6
|
+
*
|
|
7
|
+
* The constants could be imported from `date-fns/constants`:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { maxTime, minTime } from "./constants/date-fns/constants";
|
|
11
|
+
*
|
|
12
|
+
* function isAllowedTime(time) {
|
|
13
|
+
* return time <= maxTime && time >= minTime;
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @constant
|
|
21
|
+
* @name millisecondsInWeek
|
|
22
|
+
* @summary Milliseconds in 1 week.
|
|
23
|
+
*/
|
|
24
|
+
const millisecondsInWeek = 604800000;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @constant
|
|
28
|
+
* @name millisecondsInDay
|
|
29
|
+
* @summary Milliseconds in 1 day.
|
|
30
|
+
*/
|
|
31
|
+
const millisecondsInDay = 86400000;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @constant
|
|
35
|
+
* @name constructFromSymbol
|
|
36
|
+
* @summary Symbol enabling Date extensions to inherit properties from the reference date.
|
|
37
|
+
*
|
|
38
|
+
* The symbol is used to enable the `constructFrom` function to construct a date
|
|
39
|
+
* using a reference date and a value. It allows to transfer extra properties
|
|
40
|
+
* from the reference date to the new date. It's useful for extensions like
|
|
41
|
+
* [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
|
|
42
|
+
* a constructor argument.
|
|
43
|
+
*/
|
|
44
|
+
const constructFromSymbol = Symbol.for("constructDateFrom");
|
|
45
|
+
|
|
46
|
+
export { constructFromSymbol, millisecondsInDay, millisecondsInWeek };
|
|
47
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../node_modules/date-fns/constants.js"],"sourcesContent":["/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n\n/**\n * @constant\n * @name constructFromSymbol\n * @summary Symbol enabling Date extensions to inherit properties from the reference date.\n *\n * The symbol is used to enable the `constructFrom` function to construct a date\n * using a reference date and a value. It allows to transfer extra properties\n * from the reference date to the new date. It's useful for extensions like\n * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as\n * a constructor argument.\n */\nexport const constructFromSymbol = Symbol.for(\"constructDateFrom\");\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAwDA;AACA;AACA;AACA;AACA;AACY,MAAC,kBAAkB,GAAG;;AAElC;AACA;AACA;AACA;AACA;AACY,MAAC,iBAAiB,GAAG;;AAyHjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,mBAAmB;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { constructFromSymbol } from './constants.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @name constructFrom
|
|
5
|
+
* @category Generic Helpers
|
|
6
|
+
* @summary Constructs a date using the reference date and the value
|
|
7
|
+
*
|
|
8
|
+
* @description
|
|
9
|
+
* The function constructs a new date using the constructor from the reference
|
|
10
|
+
* date and the given value. It helps to build generic functions that accept
|
|
11
|
+
* date extensions.
|
|
12
|
+
*
|
|
13
|
+
* It defaults to `Date` if the passed reference date is a number or a string.
|
|
14
|
+
*
|
|
15
|
+
* Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
|
|
16
|
+
* enabling to transfer extra properties from the reference date to the new date.
|
|
17
|
+
* It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
|
|
18
|
+
* that accept a time zone as a constructor argument.
|
|
19
|
+
*
|
|
20
|
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
21
|
+
*
|
|
22
|
+
* @param date - The reference date to take constructor from
|
|
23
|
+
* @param value - The value to create the date
|
|
24
|
+
*
|
|
25
|
+
* @returns Date initialized using the given date and value
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* import { constructFrom } from "./constructFrom/date-fns";
|
|
29
|
+
*
|
|
30
|
+
* // A function that clones a date preserving the original type
|
|
31
|
+
* function cloneDate<DateType extends Date>(date: DateType): DateType {
|
|
32
|
+
* return constructFrom(
|
|
33
|
+
* date, // Use constructor from the given date
|
|
34
|
+
* date.getTime() // Use the date value to create a new date
|
|
35
|
+
* );
|
|
36
|
+
* }
|
|
37
|
+
*/
|
|
38
|
+
function constructFrom(date, value) {
|
|
39
|
+
if (typeof date === "function") return date(value);
|
|
40
|
+
|
|
41
|
+
if (date && typeof date === "object" && constructFromSymbol in date)
|
|
42
|
+
return date[constructFromSymbol](value);
|
|
43
|
+
|
|
44
|
+
if (date instanceof Date) return new date.constructor(value);
|
|
45
|
+
|
|
46
|
+
return new Date(value);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { constructFrom, constructFrom as default };
|
|
50
|
+
//# sourceMappingURL=constructFrom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constructFrom.js","sources":["../../../node_modules/date-fns/constructFrom.js"],"sourcesContent":["import { constructFromSymbol } from \"./constants.js\";\n\n/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * Starting from v3.7.0, it allows to construct a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from \"./constructFrom/date-fns\";\n *\n * // A function that clones a date preserving the original type\n * function cloneDate<DateType extends Date>(date: DateType): DateType {\n * return constructFrom(\n * date, // Use constructor from the given date\n * date.getTime() // Use the date value to create a new date\n * );\n * }\n */\nexport function constructFrom(date, value) {\n if (typeof date === \"function\") return date(value);\n\n if (date && typeof date === \"object\" && constructFromSymbol in date)\n return date[constructFromSymbol](value);\n\n if (date instanceof Date) return new date.constructor(value);\n\n return new Date(value);\n}\n\n// Fallback for modularized imports:\nexport default constructFrom;\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE;AAC3C,EAAE,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC;;AAEpD,EAAE,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,mBAAmB,IAAI,IAAI;AACrE,IAAI,OAAO,IAAI,CAAC,mBAAmB,CAAC,CAAC,KAAK,CAAC;;AAE3C,EAAE,IAAI,IAAI,YAAY,IAAI,EAAE,OAAO,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;;AAE9D,EAAE,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC;AACxB;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { getTimezoneOffsetInMilliseconds } from './_lib/getTimezoneOffsetInMilliseconds.js';
|
|
2
|
+
import { normalizeDates } from './_lib/normalizeDates.js';
|
|
3
|
+
import { millisecondsInDay } from './constants.js';
|
|
4
|
+
import { startOfDay } from './startOfDay.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The {@link differenceInCalendarDays} function options.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @name differenceInCalendarDays
|
|
12
|
+
* @category Day Helpers
|
|
13
|
+
* @summary Get the number of calendar days between the given dates.
|
|
14
|
+
*
|
|
15
|
+
* @description
|
|
16
|
+
* Get the number of calendar days between the given dates. This means that the times are removed
|
|
17
|
+
* from the dates and then the difference in days is calculated.
|
|
18
|
+
*
|
|
19
|
+
* @param laterDate - The later date
|
|
20
|
+
* @param earlierDate - The earlier date
|
|
21
|
+
* @param options - The options object
|
|
22
|
+
*
|
|
23
|
+
* @returns The number of calendar days
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // How many calendar days are between
|
|
27
|
+
* // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
|
|
28
|
+
* const result = differenceInCalendarDays(
|
|
29
|
+
* new Date(2012, 6, 2, 0, 0),
|
|
30
|
+
* new Date(2011, 6, 2, 23, 0)
|
|
31
|
+
* )
|
|
32
|
+
* //=> 366
|
|
33
|
+
* // How many calendar days are between
|
|
34
|
+
* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
|
|
35
|
+
* const result = differenceInCalendarDays(
|
|
36
|
+
* new Date(2011, 6, 3, 0, 1),
|
|
37
|
+
* new Date(2011, 6, 2, 23, 59)
|
|
38
|
+
* )
|
|
39
|
+
* //=> 1
|
|
40
|
+
*/
|
|
41
|
+
function differenceInCalendarDays(laterDate, earlierDate, options) {
|
|
42
|
+
const [laterDate_, earlierDate_] = normalizeDates(
|
|
43
|
+
options?.in,
|
|
44
|
+
laterDate,
|
|
45
|
+
earlierDate,
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
const laterStartOfDay = startOfDay(laterDate_);
|
|
49
|
+
const earlierStartOfDay = startOfDay(earlierDate_);
|
|
50
|
+
|
|
51
|
+
const laterTimestamp =
|
|
52
|
+
+laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
|
|
53
|
+
const earlierTimestamp =
|
|
54
|
+
+earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
|
|
55
|
+
|
|
56
|
+
// Round the number of days to the nearest integer because the number of
|
|
57
|
+
// milliseconds in a day is not constant (e.g. it's different in the week of
|
|
58
|
+
// the daylight saving time clock shift).
|
|
59
|
+
return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { differenceInCalendarDays as default, differenceInCalendarDays };
|
|
63
|
+
//# sourceMappingURL=differenceInCalendarDays.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"differenceInCalendarDays.js","sources":["../../../node_modules/date-fns/differenceInCalendarDays.js"],"sourcesContent":["import { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInDay } from \"./constants.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link differenceInCalendarDays} function options.\n */\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - The options object\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const laterStartOfDay = startOfDay(laterDate_);\n const earlierStartOfDay = startOfDay(earlierDate_);\n\n const laterTimestamp =\n +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);\n const earlierTimestamp =\n +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n"],"names":[],"mappings":";;;;;AAKA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,wBAAwB,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE;AAC1E,EAAE,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,GAAG,cAAc;AACnD,IAAI,OAAO,EAAE,EAAE;AACf,IAAI,SAAS;AACb,IAAI,WAAW;AACf,GAAG;;AAEH,EAAE,MAAM,eAAe,GAAG,UAAU,CAAC,UAAU,CAAC;AAChD,EAAE,MAAM,iBAAiB,GAAG,UAAU,CAAC,YAAY,CAAC;;AAEpD,EAAE,MAAM,cAAc;AACtB,IAAI,CAAC,eAAe,GAAG,+BAA+B,CAAC,eAAe,CAAC;AACvE,EAAE,MAAM,gBAAgB;AACxB,IAAI,CAAC,iBAAiB,GAAG,+BAA+B,CAAC,iBAAiB,CAAC;;AAE3E;AACA;AACA;AACA,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,cAAc,GAAG,gBAAgB,IAAI,iBAAiB,CAAC;AAC5E;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { normalizeDates } from './_lib/normalizeDates.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The {@link differenceInCalendarMonths} function options.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @name differenceInCalendarMonths
|
|
9
|
+
* @category Month Helpers
|
|
10
|
+
* @summary Get the number of calendar months between the given dates.
|
|
11
|
+
*
|
|
12
|
+
* @description
|
|
13
|
+
* Get the number of calendar months between the given dates.
|
|
14
|
+
*
|
|
15
|
+
* @param laterDate - The later date
|
|
16
|
+
* @param earlierDate - The earlier date
|
|
17
|
+
* @param options - An object with options
|
|
18
|
+
*
|
|
19
|
+
* @returns The number of calendar months
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // How many calendar months are between 31 January 2014 and 1 September 2014?
|
|
23
|
+
* const result = differenceInCalendarMonths(
|
|
24
|
+
* new Date(2014, 8, 1),
|
|
25
|
+
* new Date(2014, 0, 31)
|
|
26
|
+
* )
|
|
27
|
+
* //=> 8
|
|
28
|
+
*/
|
|
29
|
+
function differenceInCalendarMonths(laterDate, earlierDate, options) {
|
|
30
|
+
const [laterDate_, earlierDate_] = normalizeDates(
|
|
31
|
+
options?.in,
|
|
32
|
+
laterDate,
|
|
33
|
+
earlierDate,
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
|
|
37
|
+
const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
|
|
38
|
+
|
|
39
|
+
return yearsDiff * 12 + monthsDiff;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { differenceInCalendarMonths as default, differenceInCalendarMonths };
|
|
43
|
+
//# sourceMappingURL=differenceInCalendarMonths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"differenceInCalendarMonths.js","sources":["../../../node_modules/date-fns/differenceInCalendarMonths.js"],"sourcesContent":["import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link differenceInCalendarMonths} function options.\n */\n\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of calendar months\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport function differenceInCalendarMonths(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();\n const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();\n\n return yearsDiff * 12 + monthsDiff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarMonths;\n"],"names":[],"mappings":";;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,0BAA0B,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE;AAC5E,EAAE,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,GAAG,cAAc;AACnD,IAAI,OAAO,EAAE,EAAE;AACf,IAAI,SAAS;AACb,IAAI,WAAW;AACf,GAAG;;AAEH,EAAE,MAAM,SAAS,GAAG,UAAU,CAAC,WAAW,EAAE,GAAG,YAAY,CAAC,WAAW,EAAE;AACzE,EAAE,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,EAAE,GAAG,YAAY,CAAC,QAAQ,EAAE;;AAEpE,EAAE,OAAO,SAAS,GAAG,EAAE,GAAG,UAAU;AACpC;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { normalizeInterval } from './_lib/normalizeInterval.js';
|
|
2
|
+
import { constructFrom } from './constructFrom.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The {@link eachMonthOfInterval} function options.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The {@link eachMonthOfInterval} function result type. It resolves the proper data type.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @name eachMonthOfInterval
|
|
14
|
+
* @category Interval Helpers
|
|
15
|
+
* @summary Return the array of months within the specified time interval.
|
|
16
|
+
*
|
|
17
|
+
* @description
|
|
18
|
+
* Return the array of months within the specified time interval.
|
|
19
|
+
*
|
|
20
|
+
* @typeParam IntervalType - Interval type.
|
|
21
|
+
* @typeParam Options - Options type.
|
|
22
|
+
*
|
|
23
|
+
* @param interval - The interval.
|
|
24
|
+
* @param options - An object with options.
|
|
25
|
+
*
|
|
26
|
+
* @returns The array with starts of months from the month of the interval start to the month of the interval end
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // Each month between 6 February 2014 and 10 August 2014:
|
|
30
|
+
* const result = eachMonthOfInterval({
|
|
31
|
+
* start: new Date(2014, 1, 6),
|
|
32
|
+
* end: new Date(2014, 7, 10)
|
|
33
|
+
* })
|
|
34
|
+
* //=> [
|
|
35
|
+
* // Sat Feb 01 2014 00:00:00,
|
|
36
|
+
* // Sat Mar 01 2014 00:00:00,
|
|
37
|
+
* // Tue Apr 01 2014 00:00:00,
|
|
38
|
+
* // Thu May 01 2014 00:00:00,
|
|
39
|
+
* // Sun Jun 01 2014 00:00:00,
|
|
40
|
+
* // Tue Jul 01 2014 00:00:00,
|
|
41
|
+
* // Fri Aug 01 2014 00:00:00
|
|
42
|
+
* // ]
|
|
43
|
+
*/
|
|
44
|
+
function eachMonthOfInterval(interval, options) {
|
|
45
|
+
const { start, end } = normalizeInterval(options?.in, interval);
|
|
46
|
+
|
|
47
|
+
let reversed = +start > +end;
|
|
48
|
+
const endTime = reversed ? +start : +end;
|
|
49
|
+
const date = reversed ? end : start;
|
|
50
|
+
date.setHours(0, 0, 0, 0);
|
|
51
|
+
date.setDate(1);
|
|
52
|
+
|
|
53
|
+
let step = 1;
|
|
54
|
+
|
|
55
|
+
const dates = [];
|
|
56
|
+
|
|
57
|
+
while (+date <= endTime) {
|
|
58
|
+
dates.push(constructFrom(start, date));
|
|
59
|
+
date.setMonth(date.getMonth() + step);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return reversed ? dates.reverse() : dates;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { eachMonthOfInterval as default, eachMonthOfInterval };
|
|
66
|
+
//# sourceMappingURL=eachMonthOfInterval.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eachMonthOfInterval.js","sources":["../../../node_modules/date-fns/eachMonthOfInterval.js"],"sourcesContent":["import { normalizeInterval } from \"./_lib/normalizeInterval.js\";\nimport { constructFrom } from \"./constructFrom.js\";\n\n/**\n * The {@link eachMonthOfInterval} function options.\n */\n\n/**\n * The {@link eachMonthOfInterval} function result type. It resolves the proper data type.\n */\n\n/**\n * @name eachMonthOfInterval\n * @category Interval Helpers\n * @summary Return the array of months within the specified time interval.\n *\n * @description\n * Return the array of months within the specified time interval.\n *\n * @typeParam IntervalType - Interval type.\n * @typeParam Options - Options type.\n *\n * @param interval - The interval.\n * @param options - An object with options.\n *\n * @returns The array with starts of months from the month of the interval start to the month of the interval end\n *\n * @example\n * // Each month between 6 February 2014 and 10 August 2014:\n * const result = eachMonthOfInterval({\n * start: new Date(2014, 1, 6),\n * end: new Date(2014, 7, 10)\n * })\n * //=> [\n * // Sat Feb 01 2014 00:00:00,\n * // Sat Mar 01 2014 00:00:00,\n * // Tue Apr 01 2014 00:00:00,\n * // Thu May 01 2014 00:00:00,\n * // Sun Jun 01 2014 00:00:00,\n * // Tue Jul 01 2014 00:00:00,\n * // Fri Aug 01 2014 00:00:00\n * // ]\n */\nexport function eachMonthOfInterval(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n\n let reversed = +start > +end;\n const endTime = reversed ? +start : +end;\n const date = reversed ? end : start;\n date.setHours(0, 0, 0, 0);\n date.setDate(1);\n\n let step = options?.step ?? 1;\n if (!step) return [];\n if (step < 0) {\n step = -step;\n reversed = !reversed;\n }\n\n const dates = [];\n\n while (+date <= endTime) {\n dates.push(constructFrom(start, date));\n date.setMonth(date.getMonth() + step);\n }\n\n return reversed ? dates.reverse() : dates;\n}\n\n// Fallback for modularized imports:\nexport default eachMonthOfInterval;\n"],"names":[],"mappings":";;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE;AACvD,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,EAAE,EAAE,EAAE,QAAQ,CAAC;;AAEjE,EAAE,IAAI,QAAQ,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG;AAC9B,EAAE,MAAM,OAAO,GAAG,QAAQ,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG;AAC1C,EAAE,MAAM,IAAI,GAAG,QAAQ,GAAG,GAAG,GAAG,KAAK;AACrC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAC3B,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;;AAEjB,EAAE,IAAI,IAAI,GAAoB,CAAC;;AAO/B,EAAE,MAAM,KAAK,GAAG,EAAE;;AAElB,EAAE,OAAO,CAAC,IAAI,IAAI,OAAO,EAAE;AAC3B,IAAI,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAC1C,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC;AACzC,EAAE;;AAEF,EAAE,OAAO,QAAQ,GAAG,KAAK,CAAC,OAAO,EAAE,GAAG,KAAK;AAC3C;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { normalizeInterval } from './_lib/normalizeInterval.js';
|
|
2
|
+
import { constructFrom } from './constructFrom.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The {@link eachYearOfInterval} function options.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The {@link eachYearOfInterval} function result type. It resolves the proper data type.
|
|
10
|
+
* It uses the first argument date object type, starting from the date argument,
|
|
11
|
+
* then the start interval date, and finally the end interval date. If
|
|
12
|
+
* a context function is passed, it uses the context function return type.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @name eachYearOfInterval
|
|
17
|
+
* @category Interval Helpers
|
|
18
|
+
* @summary Return the array of yearly timestamps within the specified time interval.
|
|
19
|
+
*
|
|
20
|
+
* @description
|
|
21
|
+
* Return the array of yearly timestamps within the specified time interval.
|
|
22
|
+
*
|
|
23
|
+
* @typeParam IntervalType - Interval type.
|
|
24
|
+
* @typeParam Options - Options type.
|
|
25
|
+
*
|
|
26
|
+
* @param interval - The interval.
|
|
27
|
+
* @param options - An object with options.
|
|
28
|
+
*
|
|
29
|
+
* @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* // Each year between 6 February 2014 and 10 August 2017:
|
|
33
|
+
* const result = eachYearOfInterval({
|
|
34
|
+
* start: new Date(2014, 1, 6),
|
|
35
|
+
* end: new Date(2017, 7, 10)
|
|
36
|
+
* })
|
|
37
|
+
* //=> [
|
|
38
|
+
* // Wed Jan 01 2014 00:00:00,
|
|
39
|
+
* // Thu Jan 01 2015 00:00:00,
|
|
40
|
+
* // Fri Jan 01 2016 00:00:00,
|
|
41
|
+
* // Sun Jan 01 2017 00:00:00
|
|
42
|
+
* // ]
|
|
43
|
+
*/
|
|
44
|
+
function eachYearOfInterval(interval, options) {
|
|
45
|
+
const { start, end } = normalizeInterval(options?.in, interval);
|
|
46
|
+
|
|
47
|
+
let reversed = +start > +end;
|
|
48
|
+
const endTime = reversed ? +start : +end;
|
|
49
|
+
const date = reversed ? end : start;
|
|
50
|
+
date.setHours(0, 0, 0, 0);
|
|
51
|
+
date.setMonth(0, 1);
|
|
52
|
+
|
|
53
|
+
let step = 1;
|
|
54
|
+
|
|
55
|
+
const dates = [];
|
|
56
|
+
|
|
57
|
+
while (+date <= endTime) {
|
|
58
|
+
dates.push(constructFrom(start, date));
|
|
59
|
+
date.setFullYear(date.getFullYear() + step);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return reversed ? dates.reverse() : dates;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { eachYearOfInterval as default, eachYearOfInterval };
|
|
66
|
+
//# sourceMappingURL=eachYearOfInterval.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eachYearOfInterval.js","sources":["../../../node_modules/date-fns/eachYearOfInterval.js"],"sourcesContent":["import { normalizeInterval } from \"./_lib/normalizeInterval.js\";\nimport { constructFrom } from \"./constructFrom.js\";\n\n/**\n * The {@link eachYearOfInterval} function options.\n */\n\n/**\n * The {@link eachYearOfInterval} function result type. It resolves the proper data type.\n * It uses the first argument date object type, starting from the date argument,\n * then the start interval date, and finally the end interval date. If\n * a context function is passed, it uses the context function return type.\n */\n\n/**\n * @name eachYearOfInterval\n * @category Interval Helpers\n * @summary Return the array of yearly timestamps within the specified time interval.\n *\n * @description\n * Return the array of yearly timestamps within the specified time interval.\n *\n * @typeParam IntervalType - Interval type.\n * @typeParam Options - Options type.\n *\n * @param interval - The interval.\n * @param options - An object with options.\n *\n * @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end\n *\n * @example\n * // Each year between 6 February 2014 and 10 August 2017:\n * const result = eachYearOfInterval({\n * start: new Date(2014, 1, 6),\n * end: new Date(2017, 7, 10)\n * })\n * //=> [\n * // Wed Jan 01 2014 00:00:00,\n * // Thu Jan 01 2015 00:00:00,\n * // Fri Jan 01 2016 00:00:00,\n * // Sun Jan 01 2017 00:00:00\n * // ]\n */\nexport function eachYearOfInterval(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n\n let reversed = +start > +end;\n const endTime = reversed ? +start : +end;\n const date = reversed ? end : start;\n date.setHours(0, 0, 0, 0);\n date.setMonth(0, 1);\n\n let step = options?.step ?? 1;\n if (!step) return [];\n if (step < 0) {\n step = -step;\n reversed = !reversed;\n }\n\n const dates = [];\n\n while (+date <= endTime) {\n dates.push(constructFrom(start, date));\n date.setFullYear(date.getFullYear() + step);\n }\n\n return reversed ? dates.reverse() : dates;\n}\n\n// Fallback for modularized imports:\nexport default eachYearOfInterval;\n"],"names":[],"mappings":";;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,QAAQ,EAAE,OAAO,EAAE;AACtD,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,EAAE,EAAE,EAAE,QAAQ,CAAC;;AAEjE,EAAE,IAAI,QAAQ,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG;AAC9B,EAAE,MAAM,OAAO,GAAG,QAAQ,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG;AAC1C,EAAE,MAAM,IAAI,GAAG,QAAQ,GAAG,GAAG,GAAG,KAAK;AACrC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAC3B,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;;AAErB,EAAE,IAAI,IAAI,GAAoB,CAAC;;AAO/B,EAAE,MAAM,KAAK,GAAG,EAAE;;AAElB,EAAE,OAAO,CAAC,IAAI,IAAI,OAAO,EAAE;AAC3B,IAAI,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAC1C,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC;AAC/C,EAAE;;AAEF,EAAE,OAAO,QAAQ,GAAG,KAAK,CAAC,OAAO,EAAE,GAAG,KAAK;AAC3C;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { endOfWeek } from './endOfWeek.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The {@link endOfISOWeek} function options.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @name endOfISOWeek
|
|
9
|
+
* @category ISO Week Helpers
|
|
10
|
+
* @summary Return the end of an ISO week for the given date.
|
|
11
|
+
*
|
|
12
|
+
* @description
|
|
13
|
+
* Return the end of an ISO week for the given date.
|
|
14
|
+
* The result will be in the local timezone.
|
|
15
|
+
*
|
|
16
|
+
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
|
17
|
+
*
|
|
18
|
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
19
|
+
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
20
|
+
*
|
|
21
|
+
* @param date - The original date
|
|
22
|
+
* @param options - An object with options
|
|
23
|
+
*
|
|
24
|
+
* @returns The end of an ISO week
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // The end of an ISO week for 2 September 2014 11:55:00:
|
|
28
|
+
* const result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
|
|
29
|
+
* //=> Sun Sep 07 2014 23:59:59.999
|
|
30
|
+
*/
|
|
31
|
+
function endOfISOWeek(date, options) {
|
|
32
|
+
return endOfWeek(date, { ...options, weekStartsOn: 1 });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { endOfISOWeek as default, endOfISOWeek };
|
|
36
|
+
//# sourceMappingURL=endOfISOWeek.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endOfISOWeek.js","sources":["../../../node_modules/date-fns/endOfISOWeek.js"],"sourcesContent":["import { endOfWeek } from \"./endOfWeek.js\";\n\n/**\n * The {@link endOfISOWeek} function options.\n */\n\n/**\n * @name endOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the end of an ISO week for the given date.\n *\n * @description\n * Return the end of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The end of an ISO week\n *\n * @example\n * // The end of an ISO week for 2 September 2014 11:55:00:\n * const result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Sep 07 2014 23:59:59.999\n */\nexport function endOfISOWeek(date, options) {\n return endOfWeek(date, { ...options, weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default endOfISOWeek;\n"],"names":[],"mappings":";;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE;AAC5C,EAAE,OAAO,SAAS,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;AACzD;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { toDate } from './toDate.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The {@link endOfMonth} function options.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @name endOfMonth
|
|
9
|
+
* @category Month Helpers
|
|
10
|
+
* @summary Return the end of a month for the given date.
|
|
11
|
+
*
|
|
12
|
+
* @description
|
|
13
|
+
* Return the end of a month for the given date.
|
|
14
|
+
* The result will be in the local timezone.
|
|
15
|
+
*
|
|
16
|
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
17
|
+
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
18
|
+
*
|
|
19
|
+
* @param date - The original date
|
|
20
|
+
* @param options - An object with options
|
|
21
|
+
*
|
|
22
|
+
* @returns The end of a month
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // The end of a month for 2 September 2014 11:55:00:
|
|
26
|
+
* const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
|
|
27
|
+
* //=> Tue Sep 30 2014 23:59:59.999
|
|
28
|
+
*/
|
|
29
|
+
function endOfMonth(date, options) {
|
|
30
|
+
const _date = toDate(date, options?.in);
|
|
31
|
+
const month = _date.getMonth();
|
|
32
|
+
_date.setFullYear(_date.getFullYear(), month + 1, 0);
|
|
33
|
+
_date.setHours(23, 59, 59, 999);
|
|
34
|
+
return _date;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { endOfMonth as default, endOfMonth };
|
|
38
|
+
//# sourceMappingURL=endOfMonth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endOfMonth.js","sources":["../../../node_modules/date-fns/endOfMonth.js"],"sourcesContent":["import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link endOfMonth} function options.\n */\n\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The end of a month\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nexport function endOfMonth(date, options) {\n const _date = toDate(date, options?.in);\n const month = _date.getMonth();\n _date.setFullYear(_date.getFullYear(), month + 1, 0);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfMonth;\n"],"names":[],"mappings":";;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE;AAC1C,EAAE,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC;AACzC,EAAE,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAE;AAChC,EAAE,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC;AACtD,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;AACjC,EAAE,OAAO,KAAK;AACd;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { getDefaultOptions } from './_lib/defaultOptions.js';
|
|
2
|
+
import { toDate } from './toDate.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The {@link endOfWeek} function options.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @name endOfWeek
|
|
10
|
+
* @category Week Helpers
|
|
11
|
+
* @summary Return the end of a week for the given date.
|
|
12
|
+
*
|
|
13
|
+
* @description
|
|
14
|
+
* Return the end of a week for the given date.
|
|
15
|
+
* The result will be in the local timezone.
|
|
16
|
+
*
|
|
17
|
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
18
|
+
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
19
|
+
*
|
|
20
|
+
* @param date - The original date
|
|
21
|
+
* @param options - An object with options
|
|
22
|
+
*
|
|
23
|
+
* @returns The end of a week
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // The end of a week for 2 September 2014 11:55:00:
|
|
27
|
+
* const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))
|
|
28
|
+
* //=> Sat Sep 06 2014 23:59:59.999
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:
|
|
32
|
+
* const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
|
|
33
|
+
* //=> Sun Sep 07 2014 23:59:59.999
|
|
34
|
+
*/
|
|
35
|
+
function endOfWeek(date, options) {
|
|
36
|
+
const defaultOptions = getDefaultOptions();
|
|
37
|
+
const weekStartsOn =
|
|
38
|
+
options?.weekStartsOn ??
|
|
39
|
+
options?.locale?.options?.weekStartsOn ??
|
|
40
|
+
defaultOptions.weekStartsOn ??
|
|
41
|
+
defaultOptions.locale?.options?.weekStartsOn ??
|
|
42
|
+
0;
|
|
43
|
+
|
|
44
|
+
const _date = toDate(date, options?.in);
|
|
45
|
+
const day = _date.getDay();
|
|
46
|
+
const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
|
|
47
|
+
|
|
48
|
+
_date.setDate(_date.getDate() + diff);
|
|
49
|
+
_date.setHours(23, 59, 59, 999);
|
|
50
|
+
return _date;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { endOfWeek as default, endOfWeek };
|
|
54
|
+
//# sourceMappingURL=endOfWeek.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endOfWeek.js","sources":["../../../node_modules/date-fns/endOfWeek.js"],"sourcesContent":["import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link endOfWeek} function options.\n */\n\n/**\n * @name endOfWeek\n * @category Week Helpers\n * @summary Return the end of a week for the given date.\n *\n * @description\n * Return the end of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The end of a week\n *\n * @example\n * // The end of a week for 2 September 2014 11:55:00:\n * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sat Sep 06 2014 23:59:59.999\n *\n * @example\n * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:\n * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 23:59:59.999\n */\nexport function endOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date, options?.in);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);\n\n _date.setDate(_date.getDate() + diff);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfWeek;\n"],"names":[],"mappings":";;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE;AACzC,EAAE,MAAM,cAAc,GAAG,iBAAiB,EAAE;AAC5C,EAAE,MAAM,YAAY;AACpB,IAAI,OAAO,EAAE,YAAY;AACzB,IAAI,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;AAC1C,IAAI,cAAc,CAAC,YAAY;AAC/B,IAAI,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY;AAChD,IAAI,CAAC;;AAEL,EAAE,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC;AACzC,EAAE,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE;AAC5B,EAAE,MAAM,IAAI,GAAG,CAAC,GAAG,GAAG,YAAY,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,YAAY,CAAC;;AAEvE,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;AACvC,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;AACjC,EAAE,OAAO,KAAK;AACd;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { toDate } from './toDate.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The {@link endOfYear} function options.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @name endOfYear
|
|
9
|
+
* @category Year Helpers
|
|
10
|
+
* @summary Return the end of a year for the given date.
|
|
11
|
+
*
|
|
12
|
+
* @description
|
|
13
|
+
* Return the end of a year for the given date.
|
|
14
|
+
* The result will be in the local timezone.
|
|
15
|
+
*
|
|
16
|
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
17
|
+
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
18
|
+
*
|
|
19
|
+
* @param date - The original date
|
|
20
|
+
* @param options - The options
|
|
21
|
+
*
|
|
22
|
+
* @returns The end of a year
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // The end of a year for 2 September 2014 11:55:00:
|
|
26
|
+
* const result = endOfYear(new Date(2014, 8, 2, 11, 55, 0))
|
|
27
|
+
* //=> Wed Dec 31 2014 23:59:59.999
|
|
28
|
+
*/
|
|
29
|
+
function endOfYear(date, options) {
|
|
30
|
+
const _date = toDate(date, options?.in);
|
|
31
|
+
const year = _date.getFullYear();
|
|
32
|
+
_date.setFullYear(year + 1, 0, 0);
|
|
33
|
+
_date.setHours(23, 59, 59, 999);
|
|
34
|
+
return _date;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { endOfYear as default, endOfYear };
|
|
38
|
+
//# sourceMappingURL=endOfYear.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endOfYear.js","sources":["../../../node_modules/date-fns/endOfYear.js"],"sourcesContent":["import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link endOfYear} function options.\n */\n\n/**\n * @name endOfYear\n * @category Year Helpers\n * @summary Return the end of a year for the given date.\n *\n * @description\n * Return the end of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The end of a year\n *\n * @example\n * // The end of a year for 2 September 2014 11:55:00:\n * const result = endOfYear(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Wed Dec 31 2014 23:59:59.999\n */\nexport function endOfYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n _date.setFullYear(year + 1, 0, 0);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfYear;\n"],"names":[],"mappings":";;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE;AACzC,EAAE,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC;AACzC,EAAE,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,EAAE;AAClC,EAAE,KAAK,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACnC,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;AACjC,EAAE,OAAO,KAAK;AACd;;;;","x_google_ignoreList":[0]}
|