@cdx-ui/formatters 0.0.1-beta.132
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 +108 -0
- package/lib/commonjs/dates/calendar/formatCalendarMonthYear.js +28 -0
- package/lib/commonjs/dates/calendar/formatCalendarMonthYear.js.map +1 -0
- package/lib/commonjs/dates/calendar/formatDateTimeListDateRow.js +40 -0
- package/lib/commonjs/dates/calendar/formatDateTimeListDateRow.js.map +1 -0
- package/lib/commonjs/dates/calendar/formatMonthCalendarMonth.js +28 -0
- package/lib/commonjs/dates/calendar/formatMonthCalendarMonth.js.map +1 -0
- package/lib/commonjs/dates/calendar/formatMonthCalendarYear.js +16 -0
- package/lib/commonjs/dates/calendar/formatMonthCalendarYear.js.map +1 -0
- package/lib/commonjs/dates/calendar/getCalendarWeekdayLabels.js +23 -0
- package/lib/commonjs/dates/calendar/getCalendarWeekdayLabels.js.map +1 -0
- package/lib/commonjs/dates/datetime/clampDateTimeId.js +27 -0
- package/lib/commonjs/dates/datetime/clampDateTimeId.js.map +1 -0
- package/lib/commonjs/dates/datetime/compareDateTimeIds.js +28 -0
- package/lib/commonjs/dates/datetime/compareDateTimeIds.js.map +1 -0
- package/lib/commonjs/dates/datetime/dateTimeId.js +38 -0
- package/lib/commonjs/dates/datetime/dateTimeId.js.map +1 -0
- package/lib/commonjs/dates/datetime/formatDateTimeId.js +27 -0
- package/lib/commonjs/dates/datetime/formatDateTimeId.js.map +1 -0
- package/lib/commonjs/dates/datetime/formatDateTimeListHour.js +21 -0
- package/lib/commonjs/dates/datetime/formatDateTimeListHour.js.map +1 -0
- package/lib/commonjs/dates/datetime/formatDateTimeListMinute.js +16 -0
- package/lib/commonjs/dates/datetime/formatDateTimeListMinute.js.map +1 -0
- package/lib/commonjs/dates/datetime/formatDateTimeListPeriod.js +17 -0
- package/lib/commonjs/dates/datetime/formatDateTimeListPeriod.js.map +1 -0
- package/lib/commonjs/dates/datetime/isLocaleHour12.js +30 -0
- package/lib/commonjs/dates/datetime/isLocaleHour12.js.map +1 -0
- package/lib/commonjs/dates/datetime/isValidDateTimeId.js +23 -0
- package/lib/commonjs/dates/datetime/isValidDateTimeId.js.map +1 -0
- package/lib/commonjs/dates/datetime/nowDateTimeId.js +57 -0
- package/lib/commonjs/dates/datetime/nowDateTimeId.js.map +1 -0
- package/lib/commonjs/dates/datetime/parseDateTimeId.js +29 -0
- package/lib/commonjs/dates/datetime/parseDateTimeId.js.map +1 -0
- package/lib/commonjs/dates/display/formatDateForDisplay.js +28 -0
- package/lib/commonjs/dates/display/formatDateForDisplay.js.map +1 -0
- package/lib/commonjs/dates/display/formatDateRangeForDisplay.js +25 -0
- package/lib/commonjs/dates/display/formatDateRangeForDisplay.js.map +1 -0
- package/lib/commonjs/dates/display/formatDateTimeForDisplay.js +34 -0
- package/lib/commonjs/dates/display/formatDateTimeForDisplay.js.map +1 -0
- package/lib/commonjs/dates/display/formatMonthForDisplay.js +33 -0
- package/lib/commonjs/dates/display/formatMonthForDisplay.js.map +1 -0
- package/lib/commonjs/dates/index.js +367 -0
- package/lib/commonjs/dates/index.js.map +1 -0
- package/lib/commonjs/dates/internal/brand.js +19 -0
- package/lib/commonjs/dates/internal/brand.js.map +1 -0
- package/lib/commonjs/dates/internal/calendarHelpers.js +22 -0
- package/lib/commonjs/dates/internal/calendarHelpers.js.map +1 -0
- package/lib/commonjs/dates/internal/clampHelpers.js +20 -0
- package/lib/commonjs/dates/internal/clampHelpers.js.map +1 -0
- package/lib/commonjs/dates/internal/dateIdToNativeDate.js +20 -0
- package/lib/commonjs/dates/internal/dateIdToNativeDate.js.map +1 -0
- package/lib/commonjs/dates/internal/intlCache.js +52 -0
- package/lib/commonjs/dates/internal/intlCache.js.map +1 -0
- package/lib/commonjs/dates/internal/intlCopy.js +72 -0
- package/lib/commonjs/dates/internal/intlCopy.js.map +1 -0
- package/lib/commonjs/dates/internal/segmentBuilders.js +98 -0
- package/lib/commonjs/dates/internal/segmentBuilders.js.map +1 -0
- package/lib/commonjs/dates/labels/dateComponentLabels.js +57 -0
- package/lib/commonjs/dates/labels/dateComponentLabels.js.map +1 -0
- package/lib/commonjs/dates/ranges/compareDateIds.js +26 -0
- package/lib/commonjs/dates/ranges/compareDateIds.js.map +1 -0
- package/lib/commonjs/dates/ranges/compareMonthIds.js +31 -0
- package/lib/commonjs/dates/ranges/compareMonthIds.js.map +1 -0
- package/lib/commonjs/dates/ranges/dateRangeAroundDay.js +25 -0
- package/lib/commonjs/dates/ranges/dateRangeAroundDay.js.map +1 -0
- package/lib/commonjs/dates/ranges/dateRangeFromLastNDays.js +28 -0
- package/lib/commonjs/dates/ranges/dateRangeFromLastNDays.js.map +1 -0
- package/lib/commonjs/dates/ranges/eachDateIdInRange.js +29 -0
- package/lib/commonjs/dates/ranges/eachDateIdInRange.js.map +1 -0
- package/lib/commonjs/dates/ranges/normalizeDateRange.js +23 -0
- package/lib/commonjs/dates/ranges/normalizeDateRange.js.map +1 -0
- package/lib/commonjs/dates/segments/applyDateSegmentChange.js +77 -0
- package/lib/commonjs/dates/segments/applyDateSegmentChange.js.map +1 -0
- package/lib/commonjs/dates/segments/formatDateSegment.js +19 -0
- package/lib/commonjs/dates/segments/formatDateSegment.js.map +1 -0
- package/lib/commonjs/dates/segments/getDateFieldSegments.js +44 -0
- package/lib/commonjs/dates/segments/getDateFieldSegments.js.map +1 -0
- package/lib/commonjs/dates/segments/getDateTimeFieldSegments.js +150 -0
- package/lib/commonjs/dates/segments/getDateTimeFieldSegments.js.map +1 -0
- package/lib/commonjs/dates/segments/getDateTimeSegmentVisibility.js +15 -0
- package/lib/commonjs/dates/segments/getDateTimeSegmentVisibility.js.map +1 -0
- package/lib/commonjs/dates/segments/getEmptyDateSegmentText.js +17 -0
- package/lib/commonjs/dates/segments/getEmptyDateSegmentText.js.map +1 -0
- package/lib/commonjs/dates/segments/parseDateSegment.js +26 -0
- package/lib/commonjs/dates/segments/parseDateSegment.js.map +1 -0
- package/lib/commonjs/dates/types.js +2 -0
- package/lib/commonjs/dates/types.js.map +1 -0
- package/lib/commonjs/dates/wire/clampDateParts.js +26 -0
- package/lib/commonjs/dates/wire/clampDateParts.js.map +1 -0
- package/lib/commonjs/dates/wire/clampMonthParts.js +23 -0
- package/lib/commonjs/dates/wire/clampMonthParts.js.map +1 -0
- package/lib/commonjs/dates/wire/dateId.js +50 -0
- package/lib/commonjs/dates/wire/dateId.js.map +1 -0
- package/lib/commonjs/dates/wire/formatDateId.js +25 -0
- package/lib/commonjs/dates/wire/formatDateId.js.map +1 -0
- package/lib/commonjs/dates/wire/formatMonthId.js +21 -0
- package/lib/commonjs/dates/wire/formatMonthId.js.map +1 -0
- package/lib/commonjs/dates/wire/isValidDateId.js +27 -0
- package/lib/commonjs/dates/wire/isValidDateId.js.map +1 -0
- package/lib/commonjs/dates/wire/isValidDateParts.js +18 -0
- package/lib/commonjs/dates/wire/isValidDateParts.js.map +1 -0
- package/lib/commonjs/dates/wire/isValidMonthId.js +27 -0
- package/lib/commonjs/dates/wire/isValidMonthId.js.map +1 -0
- package/lib/commonjs/dates/wire/isValidMonthParts.js +16 -0
- package/lib/commonjs/dates/wire/isValidMonthParts.js.map +1 -0
- package/lib/commonjs/dates/wire/monthId.js +47 -0
- package/lib/commonjs/dates/wire/monthId.js.map +1 -0
- package/lib/commonjs/dates/wire/parseDateId.js +29 -0
- package/lib/commonjs/dates/wire/parseDateId.js.map +1 -0
- package/lib/commonjs/dates/wire/parseMonthId.js +28 -0
- package/lib/commonjs/dates/wire/parseMonthId.js.map +1 -0
- package/lib/commonjs/dates/wire/toMonthId.js +22 -0
- package/lib/commonjs/dates/wire/toMonthId.js.map +1 -0
- package/lib/commonjs/dates/wire/todayDateId.js +17 -0
- package/lib/commonjs/dates/wire/todayDateId.js.map +1 -0
- package/lib/commonjs/dates/wire/todayMonthId.js +17 -0
- package/lib/commonjs/dates/wire/todayMonthId.js.map +1 -0
- package/lib/commonjs/formatNumber.js +50 -0
- package/lib/commonjs/formatNumber.js.map +1 -0
- package/lib/commonjs/index.js +326 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/types.js +2 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/utils.js +33 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/module/dates/calendar/formatCalendarMonthYear.js +24 -0
- package/lib/module/dates/calendar/formatCalendarMonthYear.js.map +1 -0
- package/lib/module/dates/calendar/formatDateTimeListDateRow.js +36 -0
- package/lib/module/dates/calendar/formatDateTimeListDateRow.js.map +1 -0
- package/lib/module/dates/calendar/formatMonthCalendarMonth.js +24 -0
- package/lib/module/dates/calendar/formatMonthCalendarMonth.js.map +1 -0
- package/lib/module/dates/calendar/formatMonthCalendarYear.js +12 -0
- package/lib/module/dates/calendar/formatMonthCalendarYear.js.map +1 -0
- package/lib/module/dates/calendar/getCalendarWeekdayLabels.js +19 -0
- package/lib/module/dates/calendar/getCalendarWeekdayLabels.js.map +1 -0
- package/lib/module/dates/datetime/clampDateTimeId.js +24 -0
- package/lib/module/dates/datetime/clampDateTimeId.js.map +1 -0
- package/lib/module/dates/datetime/compareDateTimeIds.js +24 -0
- package/lib/module/dates/datetime/compareDateTimeIds.js.map +1 -0
- package/lib/module/dates/datetime/dateTimeId.js +35 -0
- package/lib/module/dates/datetime/dateTimeId.js.map +1 -0
- package/lib/module/dates/datetime/formatDateTimeId.js +23 -0
- package/lib/module/dates/datetime/formatDateTimeId.js.map +1 -0
- package/lib/module/dates/datetime/formatDateTimeListHour.js +17 -0
- package/lib/module/dates/datetime/formatDateTimeListHour.js.map +1 -0
- package/lib/module/dates/datetime/formatDateTimeListMinute.js +12 -0
- package/lib/module/dates/datetime/formatDateTimeListMinute.js.map +1 -0
- package/lib/module/dates/datetime/formatDateTimeListPeriod.js +13 -0
- package/lib/module/dates/datetime/formatDateTimeListPeriod.js.map +1 -0
- package/lib/module/dates/datetime/isLocaleHour12.js +26 -0
- package/lib/module/dates/datetime/isLocaleHour12.js.map +1 -0
- package/lib/module/dates/datetime/isValidDateTimeId.js +19 -0
- package/lib/module/dates/datetime/isValidDateTimeId.js.map +1 -0
- package/lib/module/dates/datetime/nowDateTimeId.js +54 -0
- package/lib/module/dates/datetime/nowDateTimeId.js.map +1 -0
- package/lib/module/dates/datetime/parseDateTimeId.js +26 -0
- package/lib/module/dates/datetime/parseDateTimeId.js.map +1 -0
- package/lib/module/dates/display/formatDateForDisplay.js +24 -0
- package/lib/module/dates/display/formatDateForDisplay.js.map +1 -0
- package/lib/module/dates/display/formatDateRangeForDisplay.js +22 -0
- package/lib/module/dates/display/formatDateRangeForDisplay.js.map +1 -0
- package/lib/module/dates/display/formatDateTimeForDisplay.js +30 -0
- package/lib/module/dates/display/formatDateTimeForDisplay.js.map +1 -0
- package/lib/module/dates/display/formatMonthForDisplay.js +29 -0
- package/lib/module/dates/display/formatMonthForDisplay.js.map +1 -0
- package/lib/module/dates/index.js +59 -0
- package/lib/module/dates/index.js.map +1 -0
- package/lib/module/dates/internal/brand.js +12 -0
- package/lib/module/dates/internal/brand.js.map +1 -0
- package/lib/module/dates/internal/calendarHelpers.js +19 -0
- package/lib/module/dates/internal/calendarHelpers.js.map +1 -0
- package/lib/module/dates/internal/clampHelpers.js +14 -0
- package/lib/module/dates/internal/clampHelpers.js.map +1 -0
- package/lib/module/dates/internal/dateIdToNativeDate.js +16 -0
- package/lib/module/dates/internal/dateIdToNativeDate.js.map +1 -0
- package/lib/module/dates/internal/intlCache.js +47 -0
- package/lib/module/dates/internal/intlCache.js.map +1 -0
- package/lib/module/dates/internal/intlCopy.js +66 -0
- package/lib/module/dates/internal/intlCopy.js.map +1 -0
- package/lib/module/dates/internal/segmentBuilders.js +91 -0
- package/lib/module/dates/internal/segmentBuilders.js.map +1 -0
- package/lib/module/dates/labels/dateComponentLabels.js +50 -0
- package/lib/module/dates/labels/dateComponentLabels.js.map +1 -0
- package/lib/module/dates/ranges/compareDateIds.js +22 -0
- package/lib/module/dates/ranges/compareDateIds.js.map +1 -0
- package/lib/module/dates/ranges/compareMonthIds.js +27 -0
- package/lib/module/dates/ranges/compareMonthIds.js.map +1 -0
- package/lib/module/dates/ranges/dateRangeAroundDay.js +21 -0
- package/lib/module/dates/ranges/dateRangeAroundDay.js.map +1 -0
- package/lib/module/dates/ranges/dateRangeFromLastNDays.js +24 -0
- package/lib/module/dates/ranges/dateRangeFromLastNDays.js.map +1 -0
- package/lib/module/dates/ranges/eachDateIdInRange.js +26 -0
- package/lib/module/dates/ranges/eachDateIdInRange.js.map +1 -0
- package/lib/module/dates/ranges/normalizeDateRange.js +20 -0
- package/lib/module/dates/ranges/normalizeDateRange.js.map +1 -0
- package/lib/module/dates/segments/applyDateSegmentChange.js +73 -0
- package/lib/module/dates/segments/applyDateSegmentChange.js.map +1 -0
- package/lib/module/dates/segments/formatDateSegment.js +15 -0
- package/lib/module/dates/segments/formatDateSegment.js.map +1 -0
- package/lib/module/dates/segments/getDateFieldSegments.js +40 -0
- package/lib/module/dates/segments/getDateFieldSegments.js.map +1 -0
- package/lib/module/dates/segments/getDateTimeFieldSegments.js +147 -0
- package/lib/module/dates/segments/getDateTimeFieldSegments.js.map +1 -0
- package/lib/module/dates/segments/getDateTimeSegmentVisibility.js +11 -0
- package/lib/module/dates/segments/getDateTimeSegmentVisibility.js.map +1 -0
- package/lib/module/dates/segments/getEmptyDateSegmentText.js +13 -0
- package/lib/module/dates/segments/getEmptyDateSegmentText.js.map +1 -0
- package/lib/module/dates/segments/parseDateSegment.js +22 -0
- package/lib/module/dates/segments/parseDateSegment.js.map +1 -0
- package/lib/module/dates/types.js +2 -0
- package/lib/module/dates/types.js.map +1 -0
- package/lib/module/dates/wire/clampDateParts.js +22 -0
- package/lib/module/dates/wire/clampDateParts.js.map +1 -0
- package/lib/module/dates/wire/clampMonthParts.js +19 -0
- package/lib/module/dates/wire/clampMonthParts.js.map +1 -0
- package/lib/module/dates/wire/dateId.js +47 -0
- package/lib/module/dates/wire/dateId.js.map +1 -0
- package/lib/module/dates/wire/formatDateId.js +22 -0
- package/lib/module/dates/wire/formatDateId.js.map +1 -0
- package/lib/module/dates/wire/formatMonthId.js +17 -0
- package/lib/module/dates/wire/formatMonthId.js.map +1 -0
- package/lib/module/dates/wire/isValidDateId.js +23 -0
- package/lib/module/dates/wire/isValidDateId.js.map +1 -0
- package/lib/module/dates/wire/isValidDateParts.js +14 -0
- package/lib/module/dates/wire/isValidDateParts.js.map +1 -0
- package/lib/module/dates/wire/isValidMonthId.js +23 -0
- package/lib/module/dates/wire/isValidMonthId.js.map +1 -0
- package/lib/module/dates/wire/isValidMonthParts.js +12 -0
- package/lib/module/dates/wire/isValidMonthParts.js.map +1 -0
- package/lib/module/dates/wire/monthId.js +44 -0
- package/lib/module/dates/wire/monthId.js.map +1 -0
- package/lib/module/dates/wire/parseDateId.js +26 -0
- package/lib/module/dates/wire/parseDateId.js.map +1 -0
- package/lib/module/dates/wire/parseMonthId.js +25 -0
- package/lib/module/dates/wire/parseMonthId.js.map +1 -0
- package/lib/module/dates/wire/toMonthId.js +18 -0
- package/lib/module/dates/wire/toMonthId.js.map +1 -0
- package/lib/module/dates/wire/todayDateId.js +13 -0
- package/lib/module/dates/wire/todayDateId.js.map +1 -0
- package/lib/module/dates/wire/todayMonthId.js +13 -0
- package/lib/module/dates/wire/todayMonthId.js.map +1 -0
- package/lib/module/formatNumber.js +46 -0
- package/lib/module/formatNumber.js.map +1 -0
- package/lib/module/index.js +17 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils.js +29 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/typescript/dates/calendar/formatCalendarMonthYear.d.ts +12 -0
- package/lib/typescript/dates/calendar/formatCalendarMonthYear.d.ts.map +1 -0
- package/lib/typescript/dates/calendar/formatDateTimeListDateRow.d.ts +13 -0
- package/lib/typescript/dates/calendar/formatDateTimeListDateRow.d.ts.map +1 -0
- package/lib/typescript/dates/calendar/formatMonthCalendarMonth.d.ts +13 -0
- package/lib/typescript/dates/calendar/formatMonthCalendarMonth.d.ts.map +1 -0
- package/lib/typescript/dates/calendar/formatMonthCalendarYear.d.ts +8 -0
- package/lib/typescript/dates/calendar/formatMonthCalendarYear.d.ts.map +1 -0
- package/lib/typescript/dates/calendar/getCalendarWeekdayLabels.d.ts +12 -0
- package/lib/typescript/dates/calendar/getCalendarWeekdayLabels.d.ts.map +1 -0
- package/lib/typescript/dates/datetime/clampDateTimeId.d.ts +16 -0
- package/lib/typescript/dates/datetime/clampDateTimeId.d.ts.map +1 -0
- package/lib/typescript/dates/datetime/compareDateTimeIds.d.ts +13 -0
- package/lib/typescript/dates/datetime/compareDateTimeIds.d.ts.map +1 -0
- package/lib/typescript/dates/datetime/dateTimeId.d.ts +18 -0
- package/lib/typescript/dates/datetime/dateTimeId.d.ts.map +1 -0
- package/lib/typescript/dates/datetime/formatDateTimeId.d.ts +12 -0
- package/lib/typescript/dates/datetime/formatDateTimeId.d.ts.map +1 -0
- package/lib/typescript/dates/datetime/formatDateTimeListHour.d.ts +11 -0
- package/lib/typescript/dates/datetime/formatDateTimeListHour.d.ts.map +1 -0
- package/lib/typescript/dates/datetime/formatDateTimeListMinute.d.ts +8 -0
- package/lib/typescript/dates/datetime/formatDateTimeListMinute.d.ts.map +1 -0
- package/lib/typescript/dates/datetime/formatDateTimeListPeriod.d.ts +9 -0
- package/lib/typescript/dates/datetime/formatDateTimeListPeriod.d.ts.map +1 -0
- package/lib/typescript/dates/datetime/isLocaleHour12.d.ts +12 -0
- package/lib/typescript/dates/datetime/isLocaleHour12.d.ts.map +1 -0
- package/lib/typescript/dates/datetime/isValidDateTimeId.d.ts +9 -0
- package/lib/typescript/dates/datetime/isValidDateTimeId.d.ts.map +1 -0
- package/lib/typescript/dates/datetime/nowDateTimeId.d.ts +14 -0
- package/lib/typescript/dates/datetime/nowDateTimeId.d.ts.map +1 -0
- package/lib/typescript/dates/datetime/parseDateTimeId.d.ts +9 -0
- package/lib/typescript/dates/datetime/parseDateTimeId.d.ts.map +1 -0
- package/lib/typescript/dates/display/formatDateForDisplay.d.ts +13 -0
- package/lib/typescript/dates/display/formatDateForDisplay.d.ts.map +1 -0
- package/lib/typescript/dates/display/formatDateRangeForDisplay.d.ts +16 -0
- package/lib/typescript/dates/display/formatDateRangeForDisplay.d.ts.map +1 -0
- package/lib/typescript/dates/display/formatDateTimeForDisplay.d.ts +13 -0
- package/lib/typescript/dates/display/formatDateTimeForDisplay.d.ts.map +1 -0
- package/lib/typescript/dates/display/formatMonthForDisplay.d.ts +13 -0
- package/lib/typescript/dates/display/formatMonthForDisplay.d.ts.map +1 -0
- package/lib/typescript/dates/index.d.ts +58 -0
- package/lib/typescript/dates/index.d.ts.map +1 -0
- package/lib/typescript/dates/internal/brand.d.ts +11 -0
- package/lib/typescript/dates/internal/brand.d.ts.map +1 -0
- package/lib/typescript/dates/internal/calendarHelpers.d.ts +8 -0
- package/lib/typescript/dates/internal/calendarHelpers.d.ts.map +1 -0
- package/lib/typescript/dates/internal/clampHelpers.d.ts +5 -0
- package/lib/typescript/dates/internal/clampHelpers.d.ts.map +1 -0
- package/lib/typescript/dates/internal/dateIdToNativeDate.d.ts +12 -0
- package/lib/typescript/dates/internal/dateIdToNativeDate.d.ts.map +1 -0
- package/lib/typescript/dates/internal/intlCache.d.ts +12 -0
- package/lib/typescript/dates/internal/intlCache.d.ts.map +1 -0
- package/lib/typescript/dates/internal/intlCopy.d.ts +10 -0
- package/lib/typescript/dates/internal/intlCopy.d.ts.map +1 -0
- package/lib/typescript/dates/internal/segmentBuilders.d.ts +12 -0
- package/lib/typescript/dates/internal/segmentBuilders.d.ts.map +1 -0
- package/lib/typescript/dates/labels/dateComponentLabels.d.ts +31 -0
- package/lib/typescript/dates/labels/dateComponentLabels.d.ts.map +1 -0
- package/lib/typescript/dates/ranges/compareDateIds.d.ts +10 -0
- package/lib/typescript/dates/ranges/compareDateIds.d.ts.map +1 -0
- package/lib/typescript/dates/ranges/compareMonthIds.d.ts +10 -0
- package/lib/typescript/dates/ranges/compareMonthIds.d.ts.map +1 -0
- package/lib/typescript/dates/ranges/dateRangeAroundDay.d.ts +14 -0
- package/lib/typescript/dates/ranges/dateRangeAroundDay.d.ts.map +1 -0
- package/lib/typescript/dates/ranges/dateRangeFromLastNDays.d.ts +16 -0
- package/lib/typescript/dates/ranges/dateRangeFromLastNDays.d.ts.map +1 -0
- package/lib/typescript/dates/ranges/eachDateIdInRange.d.ts +10 -0
- package/lib/typescript/dates/ranges/eachDateIdInRange.d.ts.map +1 -0
- package/lib/typescript/dates/ranges/normalizeDateRange.d.ts +15 -0
- package/lib/typescript/dates/ranges/normalizeDateRange.d.ts.map +1 -0
- package/lib/typescript/dates/segments/applyDateSegmentChange.d.ts +21 -0
- package/lib/typescript/dates/segments/applyDateSegmentChange.d.ts.map +1 -0
- package/lib/typescript/dates/segments/formatDateSegment.d.ts +13 -0
- package/lib/typescript/dates/segments/formatDateSegment.d.ts.map +1 -0
- package/lib/typescript/dates/segments/getDateFieldSegments.d.ts +13 -0
- package/lib/typescript/dates/segments/getDateFieldSegments.d.ts.map +1 -0
- package/lib/typescript/dates/segments/getDateTimeFieldSegments.d.ts +14 -0
- package/lib/typescript/dates/segments/getDateTimeFieldSegments.d.ts.map +1 -0
- package/lib/typescript/dates/segments/getDateTimeSegmentVisibility.d.ts +8 -0
- package/lib/typescript/dates/segments/getDateTimeSegmentVisibility.d.ts.map +1 -0
- package/lib/typescript/dates/segments/getEmptyDateSegmentText.d.ts +9 -0
- package/lib/typescript/dates/segments/getEmptyDateSegmentText.d.ts.map +1 -0
- package/lib/typescript/dates/segments/parseDateSegment.d.ts +13 -0
- package/lib/typescript/dates/segments/parseDateSegment.d.ts.map +1 -0
- package/lib/typescript/dates/types.d.ts +66 -0
- package/lib/typescript/dates/types.d.ts.map +1 -0
- package/lib/typescript/dates/wire/clampDateParts.d.ts +12 -0
- package/lib/typescript/dates/wire/clampDateParts.d.ts.map +1 -0
- package/lib/typescript/dates/wire/clampMonthParts.d.ts +12 -0
- package/lib/typescript/dates/wire/clampMonthParts.d.ts.map +1 -0
- package/lib/typescript/dates/wire/dateId.d.ts +24 -0
- package/lib/typescript/dates/wire/dateId.d.ts.map +1 -0
- package/lib/typescript/dates/wire/formatDateId.d.ts +12 -0
- package/lib/typescript/dates/wire/formatDateId.d.ts.map +1 -0
- package/lib/typescript/dates/wire/formatMonthId.d.ts +12 -0
- package/lib/typescript/dates/wire/formatMonthId.d.ts.map +1 -0
- package/lib/typescript/dates/wire/isValidDateId.d.ts +13 -0
- package/lib/typescript/dates/wire/isValidDateId.d.ts.map +1 -0
- package/lib/typescript/dates/wire/isValidDateParts.d.ts +9 -0
- package/lib/typescript/dates/wire/isValidDateParts.d.ts.map +1 -0
- package/lib/typescript/dates/wire/isValidMonthId.d.ts +13 -0
- package/lib/typescript/dates/wire/isValidMonthId.d.ts.map +1 -0
- package/lib/typescript/dates/wire/isValidMonthParts.d.ts +9 -0
- package/lib/typescript/dates/wire/isValidMonthParts.d.ts.map +1 -0
- package/lib/typescript/dates/wire/monthId.d.ts +22 -0
- package/lib/typescript/dates/wire/monthId.d.ts.map +1 -0
- package/lib/typescript/dates/wire/parseDateId.d.ts +12 -0
- package/lib/typescript/dates/wire/parseDateId.d.ts.map +1 -0
- package/lib/typescript/dates/wire/parseMonthId.d.ts +12 -0
- package/lib/typescript/dates/wire/parseMonthId.d.ts.map +1 -0
- package/lib/typescript/dates/wire/toMonthId.d.ts +12 -0
- package/lib/typescript/dates/wire/toMonthId.d.ts.map +1 -0
- package/lib/typescript/dates/wire/todayDateId.d.ts +8 -0
- package/lib/typescript/dates/wire/todayDateId.d.ts.map +1 -0
- package/lib/typescript/dates/wire/todayMonthId.d.ts +8 -0
- package/lib/typescript/dates/wire/todayMonthId.d.ts.map +1 -0
- package/lib/typescript/formatNumber.d.ts +19 -0
- package/lib/typescript/formatNumber.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +5 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/types.d.ts +2 -0
- package/lib/typescript/types.d.ts.map +1 -0
- package/lib/typescript/utils.d.ts +10 -0
- package/lib/typescript/utils.d.ts.map +1 -0
- package/package.json +50 -0
- package/src/__tests__/applyDateSegmentChange.test.ts +26 -0
- package/src/__tests__/calendarFormatters.test.ts +35 -0
- package/src/__tests__/clampDateParts.test.ts +16 -0
- package/src/__tests__/compareDateIds.test.ts +7 -0
- package/src/__tests__/compareMonthIds.test.ts +19 -0
- package/src/__tests__/dateComponentLabels.test.ts +25 -0
- package/src/__tests__/dateRangeAroundDay.test.ts +10 -0
- package/src/__tests__/dateRangeFromLastNDays.test.ts +8 -0
- package/src/__tests__/dateSegmentHelpers.test.ts +24 -0
- package/src/__tests__/datetimeHelpers.test.ts +65 -0
- package/src/__tests__/displayFormatters.test.ts +34 -0
- package/src/__tests__/eachDateIdInRange.test.ts +11 -0
- package/src/__tests__/formatCalendarMonthYear.test.ts +9 -0
- package/src/__tests__/formatDateForDisplay.test.ts +11 -0
- package/src/__tests__/formatDateId.test.ts +15 -0
- package/src/__tests__/formatMonthId.test.ts +7 -0
- package/src/__tests__/formatNumber.test.ts +35 -0
- package/src/__tests__/getDateFieldSegments.test.ts +35 -0
- package/src/__tests__/getDateTimeFieldSegments.test.ts +140 -0
- package/src/__tests__/getDateTimeSegmentVisibility.test.ts +12 -0
- package/src/__tests__/intlCopy.test.ts +64 -0
- package/src/__tests__/isValidDateId.test.ts +8 -0
- package/src/__tests__/isValidMonthId.test.ts +8 -0
- package/src/__tests__/normalizeDateRange.test.ts +10 -0
- package/src/__tests__/toMonthId.test.ts +7 -0
- package/src/__tests__/todayDateId.test.ts +7 -0
- package/src/__tests__/wireConstructors.test.ts +74 -0
- package/src/dates/calendar/formatCalendarMonthYear.ts +21 -0
- package/src/dates/calendar/formatDateTimeListDateRow.ts +41 -0
- package/src/dates/calendar/formatMonthCalendarMonth.ts +21 -0
- package/src/dates/calendar/formatMonthCalendarYear.ts +9 -0
- package/src/dates/calendar/getCalendarWeekdayLabels.ts +23 -0
- package/src/dates/datetime/clampDateTimeId.ts +25 -0
- package/src/dates/datetime/compareDateTimeIds.ts +23 -0
- package/src/dates/datetime/dateTimeId.ts +36 -0
- package/src/dates/datetime/formatDateTimeId.ts +35 -0
- package/src/dates/datetime/formatDateTimeListHour.ts +14 -0
- package/src/dates/datetime/formatDateTimeListMinute.ts +9 -0
- package/src/dates/datetime/formatDateTimeListPeriod.ts +12 -0
- package/src/dates/datetime/isLocaleHour12.ts +23 -0
- package/src/dates/datetime/isValidDateTimeId.ts +18 -0
- package/src/dates/datetime/nowDateTimeId.ts +53 -0
- package/src/dates/datetime/parseDateTimeId.ts +24 -0
- package/src/dates/display/formatDateForDisplay.ts +21 -0
- package/src/dates/display/formatDateRangeForDisplay.ts +23 -0
- package/src/dates/display/formatDateTimeForDisplay.ts +37 -0
- package/src/dates/display/formatMonthForDisplay.ts +26 -0
- package/src/dates/index.ts +86 -0
- package/src/dates/internal/brand.ts +11 -0
- package/src/dates/internal/calendarHelpers.ts +18 -0
- package/src/dates/internal/clampHelpers.ts +15 -0
- package/src/dates/internal/dateIdToNativeDate.ts +15 -0
- package/src/dates/internal/intlCache.ts +40 -0
- package/src/dates/internal/intlCopy.ts +75 -0
- package/src/dates/internal/segmentBuilders.ts +94 -0
- package/src/dates/labels/dateComponentLabels.ts +79 -0
- package/src/dates/ranges/compareDateIds.ts +21 -0
- package/src/dates/ranges/compareMonthIds.ts +26 -0
- package/src/dates/ranges/dateRangeAroundDay.ts +24 -0
- package/src/dates/ranges/dateRangeFromLastNDays.ts +26 -0
- package/src/dates/ranges/eachDateIdInRange.ts +21 -0
- package/src/dates/ranges/normalizeDateRange.ts +18 -0
- package/src/dates/segments/applyDateSegmentChange.ts +57 -0
- package/src/dates/segments/formatDateSegment.ts +18 -0
- package/src/dates/segments/getDateFieldSegments.ts +45 -0
- package/src/dates/segments/getDateTimeFieldSegments.ts +126 -0
- package/src/dates/segments/getDateTimeSegmentVisibility.ts +14 -0
- package/src/dates/segments/getEmptyDateSegmentText.ts +12 -0
- package/src/dates/segments/parseDateSegment.ts +25 -0
- package/src/dates/types.ts +80 -0
- package/src/dates/wire/clampDateParts.ts +17 -0
- package/src/dates/wire/clampMonthParts.ts +15 -0
- package/src/dates/wire/dateId.ts +44 -0
- package/src/dates/wire/formatDateId.ts +20 -0
- package/src/dates/wire/formatMonthId.ts +16 -0
- package/src/dates/wire/isValidDateId.ts +22 -0
- package/src/dates/wire/isValidDateParts.ts +17 -0
- package/src/dates/wire/isValidMonthId.ts +22 -0
- package/src/dates/wire/isValidMonthParts.ts +11 -0
- package/src/dates/wire/monthId.ts +42 -0
- package/src/dates/wire/parseDateId.ts +20 -0
- package/src/dates/wire/parseMonthId.ts +20 -0
- package/src/dates/wire/toMonthId.ts +17 -0
- package/src/dates/wire/todayDateId.ts +12 -0
- package/src/dates/wire/todayMonthId.ts +12 -0
- package/src/formatNumber.ts +56 -0
- package/src/index.ts +82 -0
- package/src/types.ts +1 -0
- package/src/utils.ts +29 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["format","startOfMonth","asMonthId","todayMonthId","Date"],"sourceRoot":"../../../../src","sources":["dates/wire/todayMonthId.ts"],"mappings":";;AAAA,SAASA,MAAM,EAAEC,YAAY,QAAQ,UAAU;AAC/C,SAASC,SAAS,QAAQ,mBAAmB;AAG7C;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAA,EAAY;EACtC,OAAOD,SAAS,CAACF,MAAM,CAACC,YAAY,CAAC,IAAIG,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;AAClE","ignoreList":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { toFiniteNumber } from './utils';
|
|
4
|
+
const formatterCache = new Map();
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Cache NumberFormat by locale/fraction digits.
|
|
8
|
+
* Constructing Intl formatters is expensive on RN/Hermes; reuse the instance and only call `.format`.
|
|
9
|
+
*/
|
|
10
|
+
function getDecimalFormatter(locale, decimalPlaces) {
|
|
11
|
+
const key = `${String(locale)}|${String(decimalPlaces)}`;
|
|
12
|
+
let formatter = formatterCache.get(key);
|
|
13
|
+
if (!formatter) {
|
|
14
|
+
formatter = new Intl.NumberFormat(locale, {
|
|
15
|
+
style: 'decimal',
|
|
16
|
+
notation: 'standard',
|
|
17
|
+
minimumFractionDigits: decimalPlaces,
|
|
18
|
+
maximumFractionDigits: decimalPlaces
|
|
19
|
+
});
|
|
20
|
+
formatterCache.set(key, formatter);
|
|
21
|
+
}
|
|
22
|
+
return formatter;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Formats a value as a number with decimal places for display.
|
|
27
|
+
*
|
|
28
|
+
* @param value - Value to format (`number`, plain numeric `string` like `'1234.56'`, `null`, or `undefined`).
|
|
29
|
+
* @param options - Formatting options.
|
|
30
|
+
* @param options.locale - BCP 47 locale; defaults to `en-US`.
|
|
31
|
+
* @param options.decimalPlaces - Fraction digits; defaults to `2`.
|
|
32
|
+
* @returns Locale-formatted decimal string, or `''` for nullish, blank, or non-numeric values.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* formatNumber(3247.19) // '3,247.19'
|
|
36
|
+
*/
|
|
37
|
+
export function formatNumber(value, options) {
|
|
38
|
+
const locale = options?.locale ?? 'en-US';
|
|
39
|
+
const decimalPlaces = options?.decimalPlaces ?? 2;
|
|
40
|
+
const number = toFiniteNumber(value);
|
|
41
|
+
if (number == null) {
|
|
42
|
+
return '';
|
|
43
|
+
}
|
|
44
|
+
return getDecimalFormatter(locale, decimalPlaces).format(number);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=formatNumber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["toFiniteNumber","formatterCache","Map","getDecimalFormatter","locale","decimalPlaces","key","String","formatter","get","Intl","NumberFormat","style","notation","minimumFractionDigits","maximumFractionDigits","set","formatNumber","value","options","number","format"],"sourceRoot":"../../src","sources":["formatNumber.ts"],"mappings":";;AACA,SAASA,cAAc,QAAQ,SAAS;AAOxC,MAAMC,cAAc,GAAG,IAAIC,GAAG,CAA4B,CAAC;;AAE3D;AACA;AACA;AACA;AACA,SAASC,mBAAmBA,CAC1BC,MAA4B,EAC5BC,aAAqB,EACF;EACnB,MAAMC,GAAG,GAAG,GAAGC,MAAM,CAACH,MAAM,CAAC,IAAIG,MAAM,CAACF,aAAa,CAAC,EAAE;EACxD,IAAIG,SAAS,GAAGP,cAAc,CAACQ,GAAG,CAACH,GAAG,CAAC;EACvC,IAAI,CAACE,SAAS,EAAE;IACdA,SAAS,GAAG,IAAIE,IAAI,CAACC,YAAY,CAACP,MAAM,EAAE;MACxCQ,KAAK,EAAE,SAAS;MAChBC,QAAQ,EAAE,UAAU;MACpBC,qBAAqB,EAAET,aAAa;MACpCU,qBAAqB,EAAEV;IACzB,CAAC,CAAC;IACFJ,cAAc,CAACe,GAAG,CAACV,GAAG,EAAEE,SAAS,CAAC;EACpC;EACA,OAAOA,SAAS;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASS,YAAYA,CAC1BC,KAAgC,EAChCC,OAAuC,EAC/B;EACR,MAAMf,MAAM,GAAGe,OAAO,EAAEf,MAAM,IAAI,OAAO;EACzC,MAAMC,aAAa,GAAGc,OAAO,EAAEd,aAAa,IAAI,CAAC;EACjD,MAAMe,MAAM,GAAGpB,cAAc,CAACkB,KAAK,CAAC;EACpC,IAAIE,MAAM,IAAI,IAAI,EAAE;IAClB,OAAO,EAAE;EACX;EACA,OAAOjB,mBAAmB,CAACC,MAAM,EAAEC,aAAa,CAAC,CAACgB,MAAM,CAACD,MAAM,CAAC;AAClE","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export { formatNumber } from './formatNumber';
|
|
4
|
+
export {
|
|
5
|
+
// Wire values
|
|
6
|
+
clampDateParts, clampMonthParts, dateId, monthId, formatDateId, formatMonthId, isValidDateId, isValidDateParts, isValidMonthId, isValidMonthParts, parseDateId, parseMonthId, toMonthId, todayDateId, todayMonthId,
|
|
7
|
+
// Date-time wire
|
|
8
|
+
clampDateTimeId, compareDateTimeIds, dateTimeId, formatDateTimeId, isLocaleHour12, isValidDateTimeId, nowDateTimeId, parseDateTimeId,
|
|
9
|
+
// Display (locale-aware)
|
|
10
|
+
formatDateForDisplay, formatDateRangeForDisplay, formatDateTimeForDisplay, formatMonthForDisplay,
|
|
11
|
+
// Ranges
|
|
12
|
+
compareDateIds, compareMonthIds, dateRangeAroundDay, dateRangeFromLastNDays, eachDateIdInRange, normalizeDateRange,
|
|
13
|
+
// Segmented field helpers
|
|
14
|
+
applyDateSegmentChange, formatDateSegment, getDateFieldSegments, getDateTimeFieldSegments, getDateTimeSegmentVisibility, getEmptyDateSegmentText, parseDateSegment,
|
|
15
|
+
// Calendar / list copy
|
|
16
|
+
formatCalendarMonthYear, formatDateTimeListDateRow, formatDateTimeListHour, formatDateTimeListMinute, formatDateTimeListPeriod, formatMonthCalendarMonth, formatMonthCalendarYear, getCalendarWeekdayLabels, DEFAULT_DATE_COMPONENT_LABELS, formatSelectYear, getDateSegmentAccessibilityLabel, resolveDateComponentLabels } from './dates';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["formatNumber","clampDateParts","clampMonthParts","dateId","monthId","formatDateId","formatMonthId","isValidDateId","isValidDateParts","isValidMonthId","isValidMonthParts","parseDateId","parseMonthId","toMonthId","todayDateId","todayMonthId","clampDateTimeId","compareDateTimeIds","dateTimeId","formatDateTimeId","isLocaleHour12","isValidDateTimeId","nowDateTimeId","parseDateTimeId","formatDateForDisplay","formatDateRangeForDisplay","formatDateTimeForDisplay","formatMonthForDisplay","compareDateIds","compareMonthIds","dateRangeAroundDay","dateRangeFromLastNDays","eachDateIdInRange","normalizeDateRange","applyDateSegmentChange","formatDateSegment","getDateFieldSegments","getDateTimeFieldSegments","getDateTimeSegmentVisibility","getEmptyDateSegmentText","parseDateSegment","formatCalendarMonthYear","formatDateTimeListDateRow","formatDateTimeListHour","formatDateTimeListMinute","formatDateTimeListPeriod","formatMonthCalendarMonth","formatMonthCalendarYear","getCalendarWeekdayLabels","DEFAULT_DATE_COMPONENT_LABELS","formatSelectYear","getDateSegmentAccessibilityLabel","resolveDateComponentLabels"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAkC,gBAAgB;AAoBvE;AACE;AACAC,cAAc,EACdC,eAAe,EACfC,MAAM,EACNC,OAAO,EACPC,YAAY,EACZC,aAAa,EACbC,aAAa,EACbC,gBAAgB,EAChBC,cAAc,EACdC,iBAAiB,EACjBC,WAAW,EACXC,YAAY,EACZC,SAAS,EACTC,WAAW,EACXC,YAAY;AACZ;AACAC,eAAe,EACfC,kBAAkB,EAClBC,UAAU,EACVC,gBAAgB,EAChBC,cAAc,EACdC,iBAAiB,EACjBC,aAAa,EACbC,eAAe;AACf;AACAC,oBAAoB,EACpBC,yBAAyB,EACzBC,wBAAwB,EACxBC,qBAAqB;AACrB;AACAC,cAAc,EACdC,eAAe,EACfC,kBAAkB,EAClBC,sBAAsB,EACtBC,iBAAiB,EACjBC,kBAAkB;AAClB;AACAC,sBAAsB,EACtBC,iBAAiB,EACjBC,oBAAoB,EACpBC,wBAAwB,EACxBC,4BAA4B,EAC5BC,uBAAuB,EACvBC,gBAAgB;AAChB;AACAC,uBAAuB,EACvBC,yBAAyB,EACzBC,sBAAsB,EACtBC,wBAAwB,EACxBC,wBAAwB,EACxBC,wBAAwB,EACxBC,uBAAuB,EACvBC,wBAAwB,EACxBC,6BAA6B,EAC7BC,gBAAgB,EAChBC,gCAAgC,EAChCC,0BAA0B,QACrB,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Coerce a nullable number/string to a finite number for display formatters.
|
|
5
|
+
*
|
|
6
|
+
* Hermes does not support the `signDisplay` property on iOS (and is unreliable on Android 11),
|
|
7
|
+
* so `-0` can still format as `"-0.00"`. Normalize before Intl to avoid this issue.
|
|
8
|
+
* @see https://github.com/facebook/hermes/blob/main/doc/IntlAPIs.md#limited-ios-property-support
|
|
9
|
+
*/
|
|
10
|
+
export function toFiniteNumber(value) {
|
|
11
|
+
if (value == null) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
let number;
|
|
15
|
+
if (typeof value === 'string') {
|
|
16
|
+
const trimmed = value.trim();
|
|
17
|
+
if (!trimmed) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
number = Number(trimmed);
|
|
21
|
+
} else {
|
|
22
|
+
number = value;
|
|
23
|
+
}
|
|
24
|
+
if (Number.isNaN(number)) {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
return Object.is(number, -0) ? 0 : number;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["toFiniteNumber","value","undefined","number","trimmed","trim","Number","isNaN","Object","is"],"sourceRoot":"../../src","sources":["utils.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,cAAcA,CAACC,KAAgC,EAAsB;EACnF,IAAIA,KAAK,IAAI,IAAI,EAAE;IACjB,OAAOC,SAAS;EAClB;EACA,IAAIC,MAAc;EAClB,IAAI,OAAOF,KAAK,KAAK,QAAQ,EAAE;IAC7B,MAAMG,OAAO,GAAGH,KAAK,CAACI,IAAI,CAAC,CAAC;IAC5B,IAAI,CAACD,OAAO,EAAE;MACZ,OAAOF,SAAS;IAClB;IACAC,MAAM,GAAGG,MAAM,CAACF,OAAO,CAAC;EAC1B,CAAC,MAAM;IACLD,MAAM,GAAGF,KAAK;EAChB;EACA,IAAIK,MAAM,CAACC,KAAK,CAACJ,MAAM,CAAC,EAAE;IACxB,OAAOD,SAAS;EAClB;EAEA,OAAOM,MAAM,CAACC,EAAE,CAACN,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAGA,MAAM;AAC3C","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DateFormatOptions, MonthId } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Formats a calendar header label, e.g. `July 2026`.
|
|
4
|
+
*
|
|
5
|
+
* Uses `Intl` so `options.locale` is respected (same pattern as display formatters).
|
|
6
|
+
*
|
|
7
|
+
* @param monthId - Wire month string (`YYYY-MM-01`).
|
|
8
|
+
* @param options - Locale and optional time zone.
|
|
9
|
+
* @returns Long month and year label.
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatCalendarMonthYear(monthId: MonthId, options?: DateFormatOptions): string;
|
|
12
|
+
//# sourceMappingURL=formatCalendarMonthYear.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatCalendarMonthYear.d.ts","sourceRoot":"","sources":["../../../../src/dates/calendar/formatCalendarMonthYear.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAE3D;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAO7F"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DateFormatOptions, DateId } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Formats a row label for a scrollable date list. Returns a locale-aware "today" label when the
|
|
4
|
+
* id matches today (pass a precomputed `todayDateId` when comparing wire ids).
|
|
5
|
+
*
|
|
6
|
+
* @param dateId - Wire date string.
|
|
7
|
+
* @param options - Locale, optional `todayDateId` override, and time zone.
|
|
8
|
+
* @returns Relative today label or a short weekday/month/day label.
|
|
9
|
+
*/
|
|
10
|
+
export declare function formatDateTimeListDateRow(dateId: DateId, options?: DateFormatOptions & {
|
|
11
|
+
todayDateId?: DateId;
|
|
12
|
+
}): string;
|
|
13
|
+
//# sourceMappingURL=formatDateTimeListDateRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatDateTimeListDateRow.d.ts","sourceRoot":"","sources":["../../../../src/dates/calendar/formatDateTimeListDateRow.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAE1D;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,iBAAiB,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACrD,MAAM,CAwBR"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DateFormatOptions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Formats a short month name for month-grid cells (1–12).
|
|
4
|
+
*
|
|
5
|
+
* @param month - Month number (1–12).
|
|
6
|
+
* @param options - Locale and optional time zone.
|
|
7
|
+
* @returns Short month name.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* formatMonthCalendarMonth(7, { locale: 'en-US' }) // 'Jul'
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatMonthCalendarMonth(month: number, options?: DateFormatOptions): string;
|
|
13
|
+
//# sourceMappingURL=formatMonthCalendarMonth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatMonthCalendarMonth.d.ts","sourceRoot":"","sources":["../../../../src/dates/calendar/formatMonthCalendarMonth.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAO3F"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a year label for month-calendar decade/year pickers.
|
|
3
|
+
*
|
|
4
|
+
* @param year - Four-digit year.
|
|
5
|
+
* @returns Year as a string.
|
|
6
|
+
*/
|
|
7
|
+
export declare function formatMonthCalendarYear(year: number): string;
|
|
8
|
+
//# sourceMappingURL=formatMonthCalendarYear.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatMonthCalendarYear.d.ts","sourceRoot":"","sources":["../../../../src/dates/calendar/formatMonthCalendarYear.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DateFormatOptions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns ordered weekday labels for a calendar week header.
|
|
4
|
+
*
|
|
5
|
+
* @param options - Locale, first day of week, and weekday width.
|
|
6
|
+
* @returns Array of seven weekday label strings.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getCalendarWeekdayLabels(options?: DateFormatOptions & {
|
|
9
|
+
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
10
|
+
weekday?: 'short' | 'narrow' | 'long';
|
|
11
|
+
}): string[];
|
|
12
|
+
//# sourceMappingURL=getCalendarWeekdayLabels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCalendarWeekdayLabels.d.ts","sourceRoot":"","sources":["../../../../src/dates/calendar/getCalendarWeekdayLabels.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,CAAC,EAAE,iBAAiB,GAAG;IAC5B,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC3C,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;CACvC,GACA,MAAM,EAAE,CAQV"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DateTimeId } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Clamps a wire date-time into the inclusive `[min, max]` range.
|
|
4
|
+
*
|
|
5
|
+
* Returns `min` when `value` is earlier than `min`, `max` when later than `max`,
|
|
6
|
+
* otherwise `value` unchanged. Omitted bounds are ignored.
|
|
7
|
+
*
|
|
8
|
+
* @param value - Wire date-time to clamp.
|
|
9
|
+
* @param bounds - Optional inclusive `min` / `max` wire date-times.
|
|
10
|
+
* @returns The clamped `DateTimeId`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function clampDateTimeId(value: DateTimeId, bounds: {
|
|
13
|
+
min?: DateTimeId;
|
|
14
|
+
max?: DateTimeId;
|
|
15
|
+
}): DateTimeId;
|
|
16
|
+
//# sourceMappingURL=clampDateTimeId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clampDateTimeId.d.ts","sourceRoot":"","sources":["../../../../src/dates/datetime/clampDateTimeId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE;IAAE,GAAG,CAAC,EAAE,UAAU,CAAC;IAAC,GAAG,CAAC,EAAE,UAAU,CAAA;CAAE,GAC7C,UAAU,CAQZ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DateTimeId } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Compares two wire date-times chronologically.
|
|
4
|
+
*
|
|
5
|
+
* Handles local (`YYYY-MM-DDTHH:MM`) and UTC (`…Z`) forms alike by parsing each
|
|
6
|
+
* to an absolute instant before comparing.
|
|
7
|
+
*
|
|
8
|
+
* @param a - First wire date-time.
|
|
9
|
+
* @param b - Second wire date-time.
|
|
10
|
+
* @returns `-1` if `a` is earlier, `1` if later, `0` if equal.
|
|
11
|
+
*/
|
|
12
|
+
export declare function compareDateTimeIds(a: DateTimeId, b: DateTimeId): -1 | 0 | 1;
|
|
13
|
+
//# sourceMappingURL=compareDateTimeIds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compareDateTimeIds.d.ts","sourceRoot":"","sources":["../../../../src/dates/datetime/compareDateTimeIds.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAS3E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DateTimeId, DateTimeParts } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Validating smart constructor for a wire {@link DateTimeId} (local ISO-like,
|
|
4
|
+
* e.g. `YYYY-MM-DDTHH:mm`).
|
|
5
|
+
*
|
|
6
|
+
* Accepts either a wire string or {@link DateTimeParts}. Throws `RangeError` on
|
|
7
|
+
* input that does not parse to a valid date-time.
|
|
8
|
+
*
|
|
9
|
+
* @param input - A wire date-time string or {@link DateTimeParts}.
|
|
10
|
+
* @returns The branded `DateTimeId`.
|
|
11
|
+
* @throws RangeError when the input is not a valid `DateTimeId`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* dateTimeId('2026-08-07T14:30'); // DateTimeId
|
|
15
|
+
* dateTimeId({ year: 2026, month: 8, day: 7, hour: 14, minute: 30 }); // DateTimeId
|
|
16
|
+
*/
|
|
17
|
+
export declare function dateTimeId(input: string | DateTimeParts): DateTimeId;
|
|
18
|
+
//# sourceMappingURL=dateTimeId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateTimeId.d.ts","sourceRoot":"","sources":["../../../../src/dates/datetime/dateTimeId.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAI1D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,UAAU,CAepE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DateTimeId, DateTimeParts } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a wire `DateTimeId` from parts. Local by default; pass `{ utc: true }` for ISO UTC.
|
|
4
|
+
*
|
|
5
|
+
* @param parts - Date and time parts.
|
|
6
|
+
* @param options - When `utc` is true, returns an ISO UTC string ending in `Z`.
|
|
7
|
+
* @returns Wire `DateTimeId` string.
|
|
8
|
+
*/
|
|
9
|
+
export declare function formatDateTimeId(parts: DateTimeParts, options?: {
|
|
10
|
+
utc?: boolean;
|
|
11
|
+
}): DateTimeId;
|
|
12
|
+
//# sourceMappingURL=formatDateTimeId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatDateTimeId.d.ts","sourceRoot":"","sources":["../../../../src/dates/datetime/formatDateTimeId.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE1D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,UAAU,CAuB9F"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats the hour label for a date-time list column.
|
|
3
|
+
*
|
|
4
|
+
* @param hour - Hour value (0–23).
|
|
5
|
+
* @param options - When `hour12` is true, returns 1–12 without leading zero.
|
|
6
|
+
* @returns Hour label string.
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatDateTimeListHour(hour: number, options?: {
|
|
9
|
+
hour12?: boolean;
|
|
10
|
+
}): string;
|
|
11
|
+
//# sourceMappingURL=formatDateTimeListHour.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatDateTimeListHour.d.ts","sourceRoot":"","sources":["../../../../src/dates/datetime/formatDateTimeListHour.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAM3F"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a zero-padded minute label for a date-time list column.
|
|
3
|
+
*
|
|
4
|
+
* @param minute - Minute value (0–59).
|
|
5
|
+
* @returns Two-digit minute string.
|
|
6
|
+
*/
|
|
7
|
+
export declare function formatDateTimeListMinute(minute: number): string;
|
|
8
|
+
//# sourceMappingURL=formatDateTimeListMinute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatDateTimeListMinute.d.ts","sourceRoot":"","sources":["../../../../src/dates/datetime/formatDateTimeListMinute.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE/D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DateFormatOptions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the day-period label (AM/PM or locale equivalent) derived from a 0–23 hour value.
|
|
4
|
+
*
|
|
5
|
+
* @param hour - Hour value (0–23).
|
|
6
|
+
* @param options - Locale for the day-period label.
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatDateTimeListPeriod(hour: number, options?: DateFormatOptions): string;
|
|
9
|
+
//# sourceMappingURL=formatDateTimeListPeriod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatDateTimeListPeriod.d.ts","sourceRoot":"","sources":["../../../../src/dates/datetime/formatDateTimeListPeriod.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAE1F"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the given locale conventionally uses a 12-hour clock (AM/PM).
|
|
3
|
+
*
|
|
4
|
+
* Derived from the locale's resolved hour cycle so date-time components can
|
|
5
|
+
* default their clock to the locale instead of hardcoding 12-hour. Pass an
|
|
6
|
+
* explicit `hour12` to override.
|
|
7
|
+
*
|
|
8
|
+
* @param locale - BCP-47 locale. Defaults to `en-US`.
|
|
9
|
+
* @returns `true` when the locale uses a 12-hour clock.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isLocaleHour12(locale?: string): boolean;
|
|
12
|
+
//# sourceMappingURL=isLocaleHour12.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isLocaleHour12.d.ts","sourceRoot":"","sources":["../../../../src/dates/datetime/isLocaleHour12.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAYvD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DateTimeId } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Type guard for local `DateTimeId` (`YYYY-MM-DDTHH:mm` or with seconds) and UTC `…Z` strings.
|
|
4
|
+
*
|
|
5
|
+
* @param dateTimeId - Candidate wire date-time string.
|
|
6
|
+
* @returns `true` when `dateTimeId` is a valid `DateTimeId`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isValidDateTimeId(dateTimeId: string): dateTimeId is DateTimeId;
|
|
9
|
+
//# sourceMappingURL=isValidDateTimeId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isValidDateTimeId.d.ts","sourceRoot":"","sources":["../../../../src/dates/datetime/isValidDateTimeId.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAI3C;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,IAAI,UAAU,CAM9E"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DateTimeGranularity, DateTimeId } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the local device date/time as a `DateTimeId`, truncated to the requested granularity.
|
|
4
|
+
*
|
|
5
|
+
* @param options - Optional granularity; defaults to `'minute'`.
|
|
6
|
+
* @returns Wire `DateTimeId` for the current local time.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* nowDateTimeId({ granularity: 'minute' }) // '2026-07-28T14:30'
|
|
10
|
+
*/
|
|
11
|
+
export declare function nowDateTimeId(options?: {
|
|
12
|
+
granularity?: DateTimeGranularity;
|
|
13
|
+
}): DateTimeId;
|
|
14
|
+
//# sourceMappingURL=nowDateTimeId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nowDateTimeId.d.ts","sourceRoot":"","sources":["../../../../src/dates/datetime/nowDateTimeId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAiB,MAAM,UAAU,CAAC;AAG/E;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,mBAAmB,CAAA;CAAE,GAAG,UAAU,CAwCzF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DateTimeId, DateTimeParts } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Parses a wire `DateTimeId` into numeric parts, or `null` when invalid.
|
|
4
|
+
*
|
|
5
|
+
* @param dateTimeId - Wire date-time string.
|
|
6
|
+
* @returns Parsed parts, or `null` when `dateTimeId` is invalid.
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseDateTimeId(dateTimeId: DateTimeId): DateTimeParts | null;
|
|
9
|
+
//# sourceMappingURL=parseDateTimeId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseDateTimeId.d.ts","sourceRoot":"","sources":["../../../../src/dates/datetime/parseDateTimeId.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG1D;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,aAAa,GAAG,IAAI,CAa5E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DateId, FormatDateDisplayOptions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Formats a locale-aware date string for UI labels (never store the result in form state).
|
|
4
|
+
*
|
|
5
|
+
* @param dateId - Wire date string (`YYYY-MM-DD`).
|
|
6
|
+
* @param options - Locale, date style, and optional time zone.
|
|
7
|
+
* @returns Locale-formatted date string.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* formatDateForDisplay('2026-07-28', { locale: 'en-US' }) // e.g. '7/28/26'
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatDateForDisplay(dateId: DateId, options?: FormatDateDisplayOptions): string;
|
|
13
|
+
//# sourceMappingURL=formatDateForDisplay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatDateForDisplay.d.ts","sourceRoot":"","sources":["../../../../src/dates/display/formatDateForDisplay.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEjE;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,wBAAwB,GAAG,MAAM,CAM/F"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DateId, DateRangeDisplayOptions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Formats an inclusive date range for display.
|
|
4
|
+
*
|
|
5
|
+
* @param range - Start and end wire date ids.
|
|
6
|
+
* @param options - Locale, separator, and display options passed to `formatDateForDisplay`.
|
|
7
|
+
* @returns Formatted range string.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* formatDateRangeForDisplay({ startId: '2026-07-01', endId: '2026-07-28' })
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatDateRangeForDisplay(range: {
|
|
13
|
+
startId: DateId;
|
|
14
|
+
endId: DateId;
|
|
15
|
+
}, options?: DateRangeDisplayOptions): string;
|
|
16
|
+
//# sourceMappingURL=formatDateRangeForDisplay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatDateRangeForDisplay.d.ts","sourceRoot":"","sources":["../../../../src/dates/display/formatDateRangeForDisplay.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAGhE;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EACzC,OAAO,CAAC,EAAE,uBAAuB,GAChC,MAAM,CAKR"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DateTimeId, FormatDateTimeDisplayOptions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Formats a locale-aware date-time string for UI labels.
|
|
4
|
+
*
|
|
5
|
+
* @param dateTimeId - Wire date-time string.
|
|
6
|
+
* @param options - Locale, date/time styles, and optional time zone.
|
|
7
|
+
* @returns Locale-formatted date-time string, or `''` when invalid.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* formatDateTimeForDisplay('2026-07-28T10:01', { locale: 'en-US' })
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatDateTimeForDisplay(dateTimeId: DateTimeId, options?: FormatDateTimeDisplayOptions): string;
|
|
13
|
+
//# sourceMappingURL=formatDateTimeForDisplay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatDateTimeForDisplay.d.ts","sourceRoot":"","sources":["../../../../src/dates/display/formatDateTimeForDisplay.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEzE;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,UAAU,EACtB,OAAO,CAAC,EAAE,4BAA4B,GACrC,MAAM,CAmBR"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FormatDateDisplayOptions, MonthId } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Formats a locale-aware month/year string for UI labels.
|
|
4
|
+
*
|
|
5
|
+
* @param monthId - Wire month string (`YYYY-MM-01`).
|
|
6
|
+
* @param options - Locale, date style, and optional time zone.
|
|
7
|
+
* @returns Locale-formatted month/year string.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* formatMonthForDisplay('2026-07-01', { locale: 'en-US' }) // e.g. '07/2026'
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatMonthForDisplay(monthId: MonthId, options?: FormatDateDisplayOptions): string;
|
|
13
|
+
//# sourceMappingURL=formatMonthForDisplay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatMonthForDisplay.d.ts","sourceRoot":"","sources":["../../../../src/dates/display/formatMonthForDisplay.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAElE;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,wBAAwB,GACjC,MAAM,CAQR"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Date / date-time formatters.
|
|
3
|
+
*
|
|
4
|
+
* Wire ids (`DateId`, `MonthId`, `DateTimeId`) are fixed-format strings for state and APIs.
|
|
5
|
+
* Display helpers return locale-dependent strings for UI labels — never store those in form state.
|
|
6
|
+
*/
|
|
7
|
+
export type { DateFieldMode, DateFormatOptions, DateId, DateParts, DateRangeDisplayOptions, DateSegment, DateSegmentType, DateTimeGranularity, DateTimeId, DateTimeParts, FormatDateDisplayOptions, FormatDateTimeDisplayOptions, MonthId, MonthParts, TimeParts, } from './types';
|
|
8
|
+
export { clampDateParts } from './wire/clampDateParts';
|
|
9
|
+
export { clampMonthParts } from './wire/clampMonthParts';
|
|
10
|
+
export { dateId } from './wire/dateId';
|
|
11
|
+
export { monthId } from './wire/monthId';
|
|
12
|
+
export { formatDateId } from './wire/formatDateId';
|
|
13
|
+
export { formatMonthId } from './wire/formatMonthId';
|
|
14
|
+
export { isValidDateId } from './wire/isValidDateId';
|
|
15
|
+
export { isValidDateParts } from './wire/isValidDateParts';
|
|
16
|
+
export { isValidMonthId } from './wire/isValidMonthId';
|
|
17
|
+
export { isValidMonthParts } from './wire/isValidMonthParts';
|
|
18
|
+
export { parseDateId } from './wire/parseDateId';
|
|
19
|
+
export { parseMonthId } from './wire/parseMonthId';
|
|
20
|
+
export { toMonthId } from './wire/toMonthId';
|
|
21
|
+
export { todayDateId } from './wire/todayDateId';
|
|
22
|
+
export { todayMonthId } from './wire/todayMonthId';
|
|
23
|
+
export { clampDateTimeId } from './datetime/clampDateTimeId';
|
|
24
|
+
export { compareDateTimeIds } from './datetime/compareDateTimeIds';
|
|
25
|
+
export { dateTimeId } from './datetime/dateTimeId';
|
|
26
|
+
export { formatDateTimeId } from './datetime/formatDateTimeId';
|
|
27
|
+
export { isLocaleHour12 } from './datetime/isLocaleHour12';
|
|
28
|
+
export { formatDateTimeListHour } from './datetime/formatDateTimeListHour';
|
|
29
|
+
export { formatDateTimeListMinute } from './datetime/formatDateTimeListMinute';
|
|
30
|
+
export { formatDateTimeListPeriod } from './datetime/formatDateTimeListPeriod';
|
|
31
|
+
export { isValidDateTimeId } from './datetime/isValidDateTimeId';
|
|
32
|
+
export { nowDateTimeId } from './datetime/nowDateTimeId';
|
|
33
|
+
export { parseDateTimeId } from './datetime/parseDateTimeId';
|
|
34
|
+
export { formatDateForDisplay } from './display/formatDateForDisplay';
|
|
35
|
+
export { formatDateRangeForDisplay } from './display/formatDateRangeForDisplay';
|
|
36
|
+
export { formatDateTimeForDisplay } from './display/formatDateTimeForDisplay';
|
|
37
|
+
export { formatMonthForDisplay } from './display/formatMonthForDisplay';
|
|
38
|
+
export { compareDateIds } from './ranges/compareDateIds';
|
|
39
|
+
export { compareMonthIds } from './ranges/compareMonthIds';
|
|
40
|
+
export { dateRangeAroundDay } from './ranges/dateRangeAroundDay';
|
|
41
|
+
export { dateRangeFromLastNDays } from './ranges/dateRangeFromLastNDays';
|
|
42
|
+
export { eachDateIdInRange } from './ranges/eachDateIdInRange';
|
|
43
|
+
export { normalizeDateRange } from './ranges/normalizeDateRange';
|
|
44
|
+
export { applyDateSegmentChange } from './segments/applyDateSegmentChange';
|
|
45
|
+
export { formatDateSegment } from './segments/formatDateSegment';
|
|
46
|
+
export { getDateFieldSegments } from './segments/getDateFieldSegments';
|
|
47
|
+
export { getDateTimeFieldSegments } from './segments/getDateTimeFieldSegments';
|
|
48
|
+
export { getDateTimeSegmentVisibility } from './segments/getDateTimeSegmentVisibility';
|
|
49
|
+
export { getEmptyDateSegmentText } from './segments/getEmptyDateSegmentText';
|
|
50
|
+
export { parseDateSegment } from './segments/parseDateSegment';
|
|
51
|
+
export { formatCalendarMonthYear } from './calendar/formatCalendarMonthYear';
|
|
52
|
+
export { formatDateTimeListDateRow } from './calendar/formatDateTimeListDateRow';
|
|
53
|
+
export { formatMonthCalendarMonth } from './calendar/formatMonthCalendarMonth';
|
|
54
|
+
export { formatMonthCalendarYear } from './calendar/formatMonthCalendarYear';
|
|
55
|
+
export { getCalendarWeekdayLabels } from './calendar/getCalendarWeekdayLabels';
|
|
56
|
+
export type { DateComponentLabels } from './labels/dateComponentLabels';
|
|
57
|
+
export { DEFAULT_DATE_COMPONENT_LABELS, formatSelectYear, getDateSegmentAccessibilityLabel, resolveDateComponentLabels, } from './labels/dateComponentLabels';
|
|
58
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dates/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,MAAM,EACN,SAAS,EACT,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,wBAAwB,EACxB,4BAA4B,EAC5B,OAAO,EACP,UAAU,EACV,SAAS,GACV,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,4BAA4B,EAAE,MAAM,yCAAyC,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EACL,6BAA6B,EAC7B,gBAAgB,EAChB,gCAAgC,EAChC,0BAA0B,GAC3B,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DateId, DateTimeId, MonthId } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* Unchecked brand casts for wire producers that have already guaranteed a
|
|
5
|
+
* well-formed wire string. Callers outside `@cdx-ui/formatters` must go through
|
|
6
|
+
* the validating smart constructors (`dateId`, `monthId`, `dateTimeId`) instead.
|
|
7
|
+
*/
|
|
8
|
+
export declare const asDateId: (value: string) => DateId;
|
|
9
|
+
export declare const asMonthId: (value: string) => MonthId;
|
|
10
|
+
export declare const asDateTimeId: (value: string) => DateTimeId;
|
|
11
|
+
//# sourceMappingURL=brand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand.d.ts","sourceRoot":"","sources":["../../../../src/dates/internal/brand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAE5D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,MAAM,KAAG,MAAyB,CAAC;AACnE,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,KAAG,OAA2B,CAAC;AACtE,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,UAAiC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DateFormatOptions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatCalendarWeekday(weekdayIndex: number, options?: DateFormatOptions & {
|
|
6
|
+
weekday?: 'short' | 'narrow' | 'long';
|
|
7
|
+
}): string;
|
|
8
|
+
//# sourceMappingURL=calendarHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendarHelpers.d.ts","sourceRoot":"","sources":["../../../../src/dates/internal/calendarHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGlD;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,iBAAiB,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;CAAE,GACtE,MAAM,CAQR"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DateParts } from '../types';
|
|
2
|
+
export declare function partsToDate(parts: DateParts): Date;
|
|
3
|
+
export declare function clampMonth(month: number): number;
|
|
4
|
+
export declare function clampDay(year: number, month: number, day: number): number;
|
|
5
|
+
//# sourceMappingURL=clampHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clampHelpers.d.ts","sourceRoot":"","sources":["../../../../src/dates/internal/clampHelpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAElD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGzE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DateId, MonthId } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Local calendar `Date` from a wire id. Never use `parseISO` for date-only ids
|
|
4
|
+
* (UTC midnight shifts the calendar day in western time zones).
|
|
5
|
+
*
|
|
6
|
+
* Accepts either a `DateId` or `MonthId` — both share the `YYYY-MM-DD` wire
|
|
7
|
+
* shape and only the date portion is parsed.
|
|
8
|
+
*
|
|
9
|
+
* @internal Not part of the public package API.
|
|
10
|
+
*/
|
|
11
|
+
export declare function dateIdToNativeDate(dateId: DateId | MonthId): Date;
|
|
12
|
+
//# sourceMappingURL=dateIdToNativeDate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateIdToNativeDate.d.ts","sourceRoot":"","sources":["../../../../src/dates/internal/dateIdToNativeDate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEhD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAEjE"}
|