react-day-picker 10.0.0-next.0 → 10.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +5 -5
- package/dist/cjs/components/Chevron.js +1 -3
- package/dist/cjs/formatters/formatWeekNumber.d.ts +1 -1
- package/dist/cjs/locale.d.ts +0 -2
- package/dist/cjs/locale.js +2 -6
- package/dist/cjs/useAnimation.js +1 -2
- package/dist/cjs/utils/rangeIncludesDate.d.ts +1 -1
- package/dist/cjs/utils/rangeOverlaps.d.ts +1 -1
- package/dist/esm/components/Chevron.js +1 -3
- package/dist/esm/formatters/formatWeekNumber.d.ts +1 -1
- package/dist/esm/locale.d.ts +0 -2
- package/dist/esm/locale.js +0 -2
- package/dist/esm/useAnimation.js +1 -2
- package/dist/esm/utils/rangeIncludesDate.d.ts +1 -1
- package/dist/esm/utils/rangeOverlaps.d.ts +1 -1
- package/package.json +7 -104
- package/buddhist.d.ts +0 -1
- package/buddhist.js +0 -2
- package/dist/cjs/buddhist/index.d.ts +0 -26
- package/dist/cjs/buddhist/index.js +0 -48
- package/dist/cjs/buddhist/lib/format.d.ts +0 -3
- package/dist/cjs/buddhist/lib/format.js +0 -30
- package/dist/cjs/ethiopic/index.d.ts +0 -44
- package/dist/cjs/ethiopic/index.js +0 -77
- package/dist/cjs/ethiopic/lib/addMonths.d.ts +0 -9
- package/dist/cjs/ethiopic/lib/addMonths.js +0 -27
- package/dist/cjs/ethiopic/lib/addYears.d.ts +0 -9
- package/dist/cjs/ethiopic/lib/addYears.js +0 -26
- package/dist/cjs/ethiopic/lib/differenceInCalendarMonths.d.ts +0 -8
- package/dist/cjs/ethiopic/lib/differenceInCalendarMonths.js +0 -17
- package/dist/cjs/ethiopic/lib/eachMonthOfInterval.d.ts +0 -11
- package/dist/cjs/ethiopic/lib/eachMonthOfInterval.js +0 -30
- package/dist/cjs/ethiopic/lib/eachYearOfInterval.d.ts +0 -7
- package/dist/cjs/ethiopic/lib/eachYearOfInterval.js +0 -21
- package/dist/cjs/ethiopic/lib/endOfMonth.d.ts +0 -8
- package/dist/cjs/ethiopic/lib/endOfMonth.js +0 -17
- package/dist/cjs/ethiopic/lib/endOfWeek.d.ts +0 -9
- package/dist/cjs/ethiopic/lib/endOfWeek.js +0 -16
- package/dist/cjs/ethiopic/lib/endOfYear.d.ts +0 -7
- package/dist/cjs/ethiopic/lib/endOfYear.js +0 -15
- package/dist/cjs/ethiopic/lib/format.d.ts +0 -22
- package/dist/cjs/ethiopic/lib/format.js +0 -135
- package/dist/cjs/ethiopic/lib/formatNumber.d.ts +0 -19
- package/dist/cjs/ethiopic/lib/formatNumber.js +0 -32
- package/dist/cjs/ethiopic/lib/getMonth.d.ts +0 -7
- package/dist/cjs/ethiopic/lib/getMonth.js +0 -14
- package/dist/cjs/ethiopic/lib/getWeek.d.ts +0 -9
- package/dist/cjs/ethiopic/lib/getWeek.js +0 -44
- package/dist/cjs/ethiopic/lib/getYear.d.ts +0 -7
- package/dist/cjs/ethiopic/lib/getYear.js +0 -14
- package/dist/cjs/ethiopic/lib/index.d.ts +0 -22
- package/dist/cjs/ethiopic/lib/index.js +0 -38
- package/dist/cjs/ethiopic/lib/isSameMonth.d.ts +0 -8
- package/dist/cjs/ethiopic/lib/isSameMonth.js +0 -16
- package/dist/cjs/ethiopic/lib/isSameYear.d.ts +0 -8
- package/dist/cjs/ethiopic/lib/isSameYear.js +0 -16
- package/dist/cjs/ethiopic/lib/newDate.d.ts +0 -9
- package/dist/cjs/ethiopic/lib/newDate.js +0 -25
- package/dist/cjs/ethiopic/lib/setMonth.d.ts +0 -8
- package/dist/cjs/ethiopic/lib/setMonth.js +0 -17
- package/dist/cjs/ethiopic/lib/setYear.d.ts +0 -8
- package/dist/cjs/ethiopic/lib/setYear.js +0 -19
- package/dist/cjs/ethiopic/lib/startOfDay.d.ts +0 -7
- package/dist/cjs/ethiopic/lib/startOfDay.js +0 -14
- package/dist/cjs/ethiopic/lib/startOfMonth.d.ts +0 -7
- package/dist/cjs/ethiopic/lib/startOfMonth.js +0 -14
- package/dist/cjs/ethiopic/lib/startOfWeek.d.ts +0 -9
- package/dist/cjs/ethiopic/lib/startOfWeek.js +0 -15
- package/dist/cjs/ethiopic/lib/startOfYear.d.ts +0 -7
- package/dist/cjs/ethiopic/lib/startOfYear.js +0 -14
- package/dist/cjs/ethiopic/utils/EthiopicDate.d.ts +0 -17
- package/dist/cjs/ethiopic/utils/EthiopicDate.js +0 -2
- package/dist/cjs/ethiopic/utils/daysInMonth.d.ts +0 -13
- package/dist/cjs/ethiopic/utils/daysInMonth.js +0 -22
- package/dist/cjs/ethiopic/utils/index.d.ts +0 -6
- package/dist/cjs/ethiopic/utils/index.js +0 -22
- package/dist/cjs/ethiopic/utils/isEthiopicDateValid.d.ts +0 -2
- package/dist/cjs/ethiopic/utils/isEthiopicDateValid.js +0 -15
- package/dist/cjs/ethiopic/utils/isEthiopicLeapYear.d.ts +0 -7
- package/dist/cjs/ethiopic/utils/isEthiopicLeapYear.js +0 -12
- package/dist/cjs/ethiopic/utils/toEthiopicDate.d.ts +0 -17
- package/dist/cjs/ethiopic/utils/toEthiopicDate.js +0 -54
- package/dist/cjs/ethiopic/utils/toGeezNumerals.d.ts +0 -8
- package/dist/cjs/ethiopic/utils/toGeezNumerals.js +0 -51
- package/dist/cjs/ethiopic/utils/toGregorianDate.d.ts +0 -9
- package/dist/cjs/ethiopic/utils/toGregorianDate.js +0 -59
- package/dist/cjs/hebrew/index.d.ts +0 -26
- package/dist/cjs/hebrew/index.js +0 -76
- package/dist/cjs/hebrew/lib/addMonths.d.ts +0 -1
- package/dist/cjs/hebrew/lib/addMonths.js +0 -15
- package/dist/cjs/hebrew/lib/addYears.d.ts +0 -1
- package/dist/cjs/hebrew/lib/addYears.js +0 -12
- package/dist/cjs/hebrew/lib/differenceInCalendarMonths.d.ts +0 -1
- package/dist/cjs/hebrew/lib/differenceInCalendarMonths.js +0 -10
- package/dist/cjs/hebrew/lib/eachMonthOfInterval.d.ts +0 -2
- package/dist/cjs/hebrew/lib/eachMonthOfInterval.js +0 -23
- package/dist/cjs/hebrew/lib/eachYearOfInterval.d.ts +0 -2
- package/dist/cjs/hebrew/lib/eachYearOfInterval.js +0 -19
- package/dist/cjs/hebrew/lib/endOfMonth.d.ts +0 -1
- package/dist/cjs/hebrew/lib/endOfMonth.js +0 -10
- package/dist/cjs/hebrew/lib/endOfYear.d.ts +0 -1
- package/dist/cjs/hebrew/lib/endOfYear.js +0 -11
- package/dist/cjs/hebrew/lib/findMonthIndexByCode.d.ts +0 -1
- package/dist/cjs/hebrew/lib/findMonthIndexByCode.js +0 -13
- package/dist/cjs/hebrew/lib/format.d.ts +0 -3
- package/dist/cjs/hebrew/lib/format.js +0 -152
- package/dist/cjs/hebrew/lib/getMonth.d.ts +0 -1
- package/dist/cjs/hebrew/lib/getMonth.js +0 -7
- package/dist/cjs/hebrew/lib/getYear.d.ts +0 -1
- package/dist/cjs/hebrew/lib/getYear.js +0 -7
- package/dist/cjs/hebrew/lib/index.d.ts +0 -17
- package/dist/cjs/hebrew/lib/index.js +0 -33
- package/dist/cjs/hebrew/lib/isSameMonth.d.ts +0 -1
- package/dist/cjs/hebrew/lib/isSameMonth.js +0 -9
- package/dist/cjs/hebrew/lib/isSameYear.d.ts +0 -1
- package/dist/cjs/hebrew/lib/isSameYear.js +0 -7
- package/dist/cjs/hebrew/lib/newDate.d.ts +0 -1
- package/dist/cjs/hebrew/lib/newDate.js +0 -7
- package/dist/cjs/hebrew/lib/setMonth.d.ts +0 -1
- package/dist/cjs/hebrew/lib/setMonth.js +0 -12
- package/dist/cjs/hebrew/lib/setYear.d.ts +0 -1
- package/dist/cjs/hebrew/lib/setYear.js +0 -31
- package/dist/cjs/hebrew/lib/startOfMonth.d.ts +0 -1
- package/dist/cjs/hebrew/lib/startOfMonth.js +0 -8
- package/dist/cjs/hebrew/lib/startOfYear.d.ts +0 -1
- package/dist/cjs/hebrew/lib/startOfYear.js +0 -8
- package/dist/cjs/hebrew/utils/calendarMath.d.ts +0 -17
- package/dist/cjs/hebrew/utils/calendarMath.js +0 -139
- package/dist/cjs/hebrew/utils/constants.d.ts +0 -13
- package/dist/cjs/hebrew/utils/constants.js +0 -36
- package/dist/cjs/hebrew/utils/dateConversion.d.ts +0 -5
- package/dist/cjs/hebrew/utils/dateConversion.js +0 -74
- package/dist/cjs/hebrew/utils/serial.d.ts +0 -9
- package/dist/cjs/hebrew/utils/serial.js +0 -76
- package/dist/cjs/hijri/index.d.ts +0 -28
- package/dist/cjs/hijri/index.js +0 -92
- package/dist/cjs/hijri/lib/addMonths.d.ts +0 -1
- package/dist/cjs/hijri/lib/addMonths.js +0 -9
- package/dist/cjs/hijri/lib/addYears.d.ts +0 -1
- package/dist/cjs/hijri/lib/addYears.js +0 -9
- package/dist/cjs/hijri/lib/differenceInCalendarMonths.d.ts +0 -1
- package/dist/cjs/hijri/lib/differenceInCalendarMonths.js +0 -10
- package/dist/cjs/hijri/lib/eachMonthOfInterval.d.ts +0 -2
- package/dist/cjs/hijri/lib/eachMonthOfInterval.js +0 -29
- package/dist/cjs/hijri/lib/eachYearOfInterval.d.ts +0 -2
- package/dist/cjs/hijri/lib/eachYearOfInterval.js +0 -19
- package/dist/cjs/hijri/lib/endOfMonth.d.ts +0 -1
- package/dist/cjs/hijri/lib/endOfMonth.js +0 -14
- package/dist/cjs/hijri/lib/endOfYear.d.ts +0 -1
- package/dist/cjs/hijri/lib/endOfYear.js +0 -14
- package/dist/cjs/hijri/lib/fallbackLocaleData.d.ts +0 -5
- package/dist/cjs/hijri/lib/fallbackLocaleData.js +0 -111
- package/dist/cjs/hijri/lib/format.d.ts +0 -3
- package/dist/cjs/hijri/lib/format.js +0 -149
- package/dist/cjs/hijri/lib/getMonth.d.ts +0 -1
- package/dist/cjs/hijri/lib/getMonth.js +0 -7
- package/dist/cjs/hijri/lib/getYear.d.ts +0 -1
- package/dist/cjs/hijri/lib/getYear.js +0 -7
- package/dist/cjs/hijri/lib/index.d.ts +0 -17
- package/dist/cjs/hijri/lib/index.js +0 -33
- package/dist/cjs/hijri/lib/isSameMonth.d.ts +0 -1
- package/dist/cjs/hijri/lib/isSameMonth.js +0 -10
- package/dist/cjs/hijri/lib/isSameYear.d.ts +0 -1
- package/dist/cjs/hijri/lib/isSameYear.js +0 -9
- package/dist/cjs/hijri/lib/newDate.d.ts +0 -1
- package/dist/cjs/hijri/lib/newDate.js +0 -7
- package/dist/cjs/hijri/lib/setMonth.d.ts +0 -1
- package/dist/cjs/hijri/lib/setMonth.js +0 -27
- package/dist/cjs/hijri/lib/setYear.d.ts +0 -1
- package/dist/cjs/hijri/lib/setYear.js +0 -15
- package/dist/cjs/hijri/lib/startOfMonth.d.ts +0 -1
- package/dist/cjs/hijri/lib/startOfMonth.js +0 -12
- package/dist/cjs/hijri/lib/startOfYear.d.ts +0 -1
- package/dist/cjs/hijri/lib/startOfYear.js +0 -12
- package/dist/cjs/hijri/utils/conversion.d.ts +0 -5
- package/dist/cjs/hijri/utils/conversion.js +0 -40
- package/dist/cjs/hijri/utils/daysInMonth.d.ts +0 -1
- package/dist/cjs/hijri/utils/daysInMonth.js +0 -24
- package/dist/cjs/hijri/utils/range.d.ts +0 -21
- package/dist/cjs/hijri/utils/range.js +0 -104
- package/dist/cjs/hijri/utils/types.d.ts +0 -5
- package/dist/cjs/hijri/utils/types.js +0 -2
- package/dist/cjs/locale/en-US-jalali.d.ts +0 -6
- package/dist/cjs/locale/en-US-jalali.js +0 -74
- package/dist/cjs/locale/fa-IR-jalali.d.ts +0 -6
- package/dist/cjs/locale/fa-IR-jalali.js +0 -74
- package/dist/cjs/noonJalaliDateLib.d.ts +0 -9
- package/dist/cjs/noonJalaliDateLib.js +0 -113
- package/dist/cjs/persian.d.ts +0 -71
- package/dist/cjs/persian.js +0 -106
- package/dist/esm/buddhist/index.d.ts +0 -26
- package/dist/esm/buddhist/index.js +0 -40
- package/dist/esm/buddhist/lib/format.d.ts +0 -3
- package/dist/esm/buddhist/lib/format.js +0 -27
- package/dist/esm/ethiopic/index.d.ts +0 -44
- package/dist/esm/ethiopic/index.js +0 -34
- package/dist/esm/ethiopic/lib/addMonths.d.ts +0 -9
- package/dist/esm/ethiopic/lib/addMonths.js +0 -24
- package/dist/esm/ethiopic/lib/addYears.d.ts +0 -9
- package/dist/esm/ethiopic/lib/addYears.js +0 -23
- package/dist/esm/ethiopic/lib/differenceInCalendarMonths.d.ts +0 -8
- package/dist/esm/ethiopic/lib/differenceInCalendarMonths.js +0 -14
- package/dist/esm/ethiopic/lib/eachMonthOfInterval.d.ts +0 -11
- package/dist/esm/ethiopic/lib/eachMonthOfInterval.js +0 -27
- package/dist/esm/ethiopic/lib/eachYearOfInterval.d.ts +0 -7
- package/dist/esm/ethiopic/lib/eachYearOfInterval.js +0 -18
- package/dist/esm/ethiopic/lib/endOfMonth.d.ts +0 -8
- package/dist/esm/ethiopic/lib/endOfMonth.js +0 -14
- package/dist/esm/ethiopic/lib/endOfWeek.d.ts +0 -9
- package/dist/esm/ethiopic/lib/endOfWeek.js +0 -13
- package/dist/esm/ethiopic/lib/endOfYear.d.ts +0 -7
- package/dist/esm/ethiopic/lib/endOfYear.js +0 -12
- package/dist/esm/ethiopic/lib/format.d.ts +0 -22
- package/dist/esm/ethiopic/lib/format.js +0 -131
- package/dist/esm/ethiopic/lib/formatNumber.d.ts +0 -19
- package/dist/esm/ethiopic/lib/formatNumber.js +0 -29
- package/dist/esm/ethiopic/lib/getMonth.d.ts +0 -7
- package/dist/esm/ethiopic/lib/getMonth.js +0 -11
- package/dist/esm/ethiopic/lib/getWeek.d.ts +0 -9
- package/dist/esm/ethiopic/lib/getWeek.js +0 -41
- package/dist/esm/ethiopic/lib/getYear.d.ts +0 -7
- package/dist/esm/ethiopic/lib/getYear.js +0 -11
- package/dist/esm/ethiopic/lib/index.d.ts +0 -22
- package/dist/esm/ethiopic/lib/index.js +0 -22
- package/dist/esm/ethiopic/lib/isSameMonth.d.ts +0 -8
- package/dist/esm/ethiopic/lib/isSameMonth.js +0 -13
- package/dist/esm/ethiopic/lib/isSameYear.d.ts +0 -8
- package/dist/esm/ethiopic/lib/isSameYear.js +0 -13
- package/dist/esm/ethiopic/lib/newDate.d.ts +0 -9
- package/dist/esm/ethiopic/lib/newDate.js +0 -22
- package/dist/esm/ethiopic/lib/setMonth.d.ts +0 -8
- package/dist/esm/ethiopic/lib/setMonth.js +0 -14
- package/dist/esm/ethiopic/lib/setYear.d.ts +0 -8
- package/dist/esm/ethiopic/lib/setYear.js +0 -16
- package/dist/esm/ethiopic/lib/startOfDay.d.ts +0 -7
- package/dist/esm/ethiopic/lib/startOfDay.js +0 -11
- package/dist/esm/ethiopic/lib/startOfMonth.d.ts +0 -7
- package/dist/esm/ethiopic/lib/startOfMonth.js +0 -11
- package/dist/esm/ethiopic/lib/startOfWeek.d.ts +0 -9
- package/dist/esm/ethiopic/lib/startOfWeek.js +0 -12
- package/dist/esm/ethiopic/lib/startOfYear.d.ts +0 -7
- package/dist/esm/ethiopic/lib/startOfYear.js +0 -11
- package/dist/esm/ethiopic/utils/EthiopicDate.d.ts +0 -17
- package/dist/esm/ethiopic/utils/EthiopicDate.js +0 -1
- package/dist/esm/ethiopic/utils/daysInMonth.d.ts +0 -13
- package/dist/esm/ethiopic/utils/daysInMonth.js +0 -19
- package/dist/esm/ethiopic/utils/index.d.ts +0 -6
- package/dist/esm/ethiopic/utils/index.js +0 -6
- package/dist/esm/ethiopic/utils/isEthiopicDateValid.d.ts +0 -2
- package/dist/esm/ethiopic/utils/isEthiopicDateValid.js +0 -12
- package/dist/esm/ethiopic/utils/isEthiopicLeapYear.d.ts +0 -7
- package/dist/esm/ethiopic/utils/isEthiopicLeapYear.js +0 -9
- package/dist/esm/ethiopic/utils/toEthiopicDate.d.ts +0 -17
- package/dist/esm/ethiopic/utils/toEthiopicDate.js +0 -50
- package/dist/esm/ethiopic/utils/toGeezNumerals.d.ts +0 -8
- package/dist/esm/ethiopic/utils/toGeezNumerals.js +0 -48
- package/dist/esm/ethiopic/utils/toGregorianDate.d.ts +0 -9
- package/dist/esm/ethiopic/utils/toGregorianDate.js +0 -55
- package/dist/esm/hebrew/index.d.ts +0 -26
- package/dist/esm/hebrew/index.js +0 -33
- package/dist/esm/hebrew/lib/addMonths.d.ts +0 -1
- package/dist/esm/hebrew/lib/addMonths.js +0 -12
- package/dist/esm/hebrew/lib/addYears.d.ts +0 -1
- package/dist/esm/hebrew/lib/addYears.js +0 -9
- package/dist/esm/hebrew/lib/differenceInCalendarMonths.d.ts +0 -1
- package/dist/esm/hebrew/lib/differenceInCalendarMonths.js +0 -7
- package/dist/esm/hebrew/lib/eachMonthOfInterval.d.ts +0 -2
- package/dist/esm/hebrew/lib/eachMonthOfInterval.js +0 -20
- package/dist/esm/hebrew/lib/eachYearOfInterval.d.ts +0 -2
- package/dist/esm/hebrew/lib/eachYearOfInterval.js +0 -16
- package/dist/esm/hebrew/lib/endOfMonth.d.ts +0 -1
- package/dist/esm/hebrew/lib/endOfMonth.js +0 -7
- package/dist/esm/hebrew/lib/endOfYear.d.ts +0 -1
- package/dist/esm/hebrew/lib/endOfYear.js +0 -8
- package/dist/esm/hebrew/lib/findMonthIndexByCode.d.ts +0 -1
- package/dist/esm/hebrew/lib/findMonthIndexByCode.js +0 -10
- package/dist/esm/hebrew/lib/format.d.ts +0 -3
- package/dist/esm/hebrew/lib/format.js +0 -149
- package/dist/esm/hebrew/lib/getMonth.d.ts +0 -1
- package/dist/esm/hebrew/lib/getMonth.js +0 -4
- package/dist/esm/hebrew/lib/getYear.d.ts +0 -1
- package/dist/esm/hebrew/lib/getYear.js +0 -4
- package/dist/esm/hebrew/lib/index.d.ts +0 -17
- package/dist/esm/hebrew/lib/index.js +0 -17
- package/dist/esm/hebrew/lib/isSameMonth.d.ts +0 -1
- package/dist/esm/hebrew/lib/isSameMonth.js +0 -6
- package/dist/esm/hebrew/lib/isSameYear.d.ts +0 -1
- package/dist/esm/hebrew/lib/isSameYear.js +0 -4
- package/dist/esm/hebrew/lib/newDate.d.ts +0 -1
- package/dist/esm/hebrew/lib/newDate.js +0 -4
- package/dist/esm/hebrew/lib/setMonth.d.ts +0 -1
- package/dist/esm/hebrew/lib/setMonth.js +0 -9
- package/dist/esm/hebrew/lib/setYear.d.ts +0 -1
- package/dist/esm/hebrew/lib/setYear.js +0 -28
- package/dist/esm/hebrew/lib/startOfMonth.d.ts +0 -1
- package/dist/esm/hebrew/lib/startOfMonth.js +0 -5
- package/dist/esm/hebrew/lib/startOfYear.d.ts +0 -1
- package/dist/esm/hebrew/lib/startOfYear.js +0 -5
- package/dist/esm/hebrew/utils/calendarMath.d.ts +0 -17
- package/dist/esm/hebrew/utils/calendarMath.js +0 -130
- package/dist/esm/hebrew/utils/constants.d.ts +0 -13
- package/dist/esm/hebrew/utils/constants.js +0 -33
- package/dist/esm/hebrew/utils/dateConversion.d.ts +0 -5
- package/dist/esm/hebrew/utils/dateConversion.js +0 -70
- package/dist/esm/hebrew/utils/serial.d.ts +0 -9
- package/dist/esm/hebrew/utils/serial.js +0 -70
- package/dist/esm/hijri/index.d.ts +0 -28
- package/dist/esm/hijri/index.js +0 -49
- package/dist/esm/hijri/lib/addMonths.d.ts +0 -1
- package/dist/esm/hijri/lib/addMonths.js +0 -6
- package/dist/esm/hijri/lib/addYears.d.ts +0 -1
- package/dist/esm/hijri/lib/addYears.js +0 -6
- package/dist/esm/hijri/lib/differenceInCalendarMonths.d.ts +0 -1
- package/dist/esm/hijri/lib/differenceInCalendarMonths.js +0 -7
- package/dist/esm/hijri/lib/eachMonthOfInterval.d.ts +0 -2
- package/dist/esm/hijri/lib/eachMonthOfInterval.js +0 -26
- package/dist/esm/hijri/lib/eachYearOfInterval.d.ts +0 -2
- package/dist/esm/hijri/lib/eachYearOfInterval.js +0 -16
- package/dist/esm/hijri/lib/endOfMonth.d.ts +0 -1
- package/dist/esm/hijri/lib/endOfMonth.js +0 -11
- package/dist/esm/hijri/lib/endOfYear.d.ts +0 -1
- package/dist/esm/hijri/lib/endOfYear.js +0 -11
- package/dist/esm/hijri/lib/fallbackLocaleData.d.ts +0 -5
- package/dist/esm/hijri/lib/fallbackLocaleData.js +0 -105
- package/dist/esm/hijri/lib/format.d.ts +0 -3
- package/dist/esm/hijri/lib/format.js +0 -146
- package/dist/esm/hijri/lib/getMonth.d.ts +0 -1
- package/dist/esm/hijri/lib/getMonth.js +0 -4
- package/dist/esm/hijri/lib/getYear.d.ts +0 -1
- package/dist/esm/hijri/lib/getYear.js +0 -4
- package/dist/esm/hijri/lib/index.d.ts +0 -17
- package/dist/esm/hijri/lib/index.js +0 -17
- package/dist/esm/hijri/lib/isSameMonth.d.ts +0 -1
- package/dist/esm/hijri/lib/isSameMonth.js +0 -7
- package/dist/esm/hijri/lib/isSameYear.d.ts +0 -1
- package/dist/esm/hijri/lib/isSameYear.js +0 -6
- package/dist/esm/hijri/lib/newDate.d.ts +0 -1
- package/dist/esm/hijri/lib/newDate.js +0 -4
- package/dist/esm/hijri/lib/setMonth.d.ts +0 -1
- package/dist/esm/hijri/lib/setMonth.js +0 -24
- package/dist/esm/hijri/lib/setYear.d.ts +0 -1
- package/dist/esm/hijri/lib/setYear.js +0 -12
- package/dist/esm/hijri/lib/startOfMonth.d.ts +0 -1
- package/dist/esm/hijri/lib/startOfMonth.js +0 -9
- package/dist/esm/hijri/lib/startOfYear.d.ts +0 -1
- package/dist/esm/hijri/lib/startOfYear.js +0 -9
- package/dist/esm/hijri/utils/conversion.d.ts +0 -5
- package/dist/esm/hijri/utils/conversion.js +0 -36
- package/dist/esm/hijri/utils/daysInMonth.d.ts +0 -1
- package/dist/esm/hijri/utils/daysInMonth.js +0 -21
- package/dist/esm/hijri/utils/range.d.ts +0 -21
- package/dist/esm/hijri/utils/range.js +0 -96
- package/dist/esm/hijri/utils/types.d.ts +0 -5
- package/dist/esm/hijri/utils/types.js +0 -1
- package/dist/esm/locale/en-US-jalali.d.ts +0 -6
- package/dist/esm/locale/en-US-jalali.js +0 -38
- package/dist/esm/locale/fa-IR-jalali.d.ts +0 -6
- package/dist/esm/locale/fa-IR-jalali.js +0 -38
- package/dist/esm/noonJalaliDateLib.d.ts +0 -9
- package/dist/esm/noonJalaliDateLib.js +0 -110
- package/dist/esm/persian.d.ts +0 -71
- package/dist/esm/persian.js +0 -65
- package/hebrew.d.ts +0 -1
- package/hebrew.js +0 -2
- package/hijri.d.ts +0 -1
- package/hijri.js +0 -2
- package/persian.d.ts +0 -1
- package/persian.js +0 -2
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addMonths = addMonths;
|
|
4
|
-
const daysInMonth_js_1 = require("../utils/daysInMonth.js");
|
|
5
|
-
const index_js_1 = require("../utils/index.js");
|
|
6
|
-
/**
|
|
7
|
-
* Adds the specified number of months to the given Ethiopian date. Handles
|
|
8
|
-
* month overflow and year boundaries correctly.
|
|
9
|
-
*
|
|
10
|
-
* @param date - The starting gregorian date
|
|
11
|
-
* @param amount - The number of months to add (can be negative)
|
|
12
|
-
* @returns A new gregorian date with the months added
|
|
13
|
-
*/
|
|
14
|
-
function addMonths(date, amount) {
|
|
15
|
-
const { year, month, day } = (0, index_js_1.toEthiopicDate)(date);
|
|
16
|
-
let newMonth = month + amount;
|
|
17
|
-
const yearAdjustment = Math.floor((newMonth - 1) / 13);
|
|
18
|
-
newMonth = ((newMonth - 1) % 13) + 1;
|
|
19
|
-
if (newMonth < 1) {
|
|
20
|
-
newMonth += 13;
|
|
21
|
-
}
|
|
22
|
-
const newYear = year + yearAdjustment;
|
|
23
|
-
// Adjust day if it exceeds the month length
|
|
24
|
-
const monthLength = (0, daysInMonth_js_1.daysInMonth)(newMonth, newYear);
|
|
25
|
-
const newDay = Math.min(day, monthLength);
|
|
26
|
-
return (0, index_js_1.toGregorianDate)({ year: newYear, month: newMonth, day: newDay });
|
|
27
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adds the specified number of years to the given Ethiopian date. Handles leap
|
|
3
|
-
* year transitions for Pagume month.
|
|
4
|
-
*
|
|
5
|
-
* @param date - The starting gregorian date
|
|
6
|
-
* @param amount - The number of years to add (can be negative)
|
|
7
|
-
* @returns A new gregorian date with the years added
|
|
8
|
-
*/
|
|
9
|
-
export declare function addYears(date: Date, amount: number): Date;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addYears = addYears;
|
|
4
|
-
const index_js_1 = require("../utils/index.js");
|
|
5
|
-
/**
|
|
6
|
-
* Adds the specified number of years to the given Ethiopian date. Handles leap
|
|
7
|
-
* year transitions for Pagume month.
|
|
8
|
-
*
|
|
9
|
-
* @param date - The starting gregorian date
|
|
10
|
-
* @param amount - The number of years to add (can be negative)
|
|
11
|
-
* @returns A new gregorian date with the years added
|
|
12
|
-
*/
|
|
13
|
-
function addYears(date, amount) {
|
|
14
|
-
const etDate = (0, index_js_1.toEthiopicDate)(date);
|
|
15
|
-
const day = (0, index_js_1.isEthiopicLeapYear)(etDate.year) &&
|
|
16
|
-
etDate.month === 13 &&
|
|
17
|
-
etDate.day === 6 &&
|
|
18
|
-
amount % 4 !== 0
|
|
19
|
-
? 5
|
|
20
|
-
: etDate.day;
|
|
21
|
-
return (0, index_js_1.toGregorianDate)({
|
|
22
|
-
month: etDate.month,
|
|
23
|
-
day: day,
|
|
24
|
-
year: etDate.year + amount,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Difference in calendar months
|
|
3
|
-
*
|
|
4
|
-
* @param {Date} dateLeft - The later date
|
|
5
|
-
* @param {Date} dateRight - The earlier date
|
|
6
|
-
* @returns {number} The number of calendar months between the two dates
|
|
7
|
-
*/
|
|
8
|
-
export declare function differenceInCalendarMonths(dateLeft: Date, dateRight: Date): number;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.differenceInCalendarMonths = differenceInCalendarMonths;
|
|
4
|
-
const index_js_1 = require("../utils/index.js");
|
|
5
|
-
/**
|
|
6
|
-
* Difference in calendar months
|
|
7
|
-
*
|
|
8
|
-
* @param {Date} dateLeft - The later date
|
|
9
|
-
* @param {Date} dateRight - The earlier date
|
|
10
|
-
* @returns {number} The number of calendar months between the two dates
|
|
11
|
-
*/
|
|
12
|
-
function differenceInCalendarMonths(dateLeft, dateRight) {
|
|
13
|
-
const ethiopicLeft = (0, index_js_1.toEthiopicDate)(dateLeft);
|
|
14
|
-
const ethiopicRight = (0, index_js_1.toEthiopicDate)(dateRight);
|
|
15
|
-
return ((ethiopicLeft.year - ethiopicRight.year) * 13 +
|
|
16
|
-
(ethiopicLeft.month - ethiopicRight.month));
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Interval } from "date-fns";
|
|
2
|
-
/**
|
|
3
|
-
* Each month of an interval
|
|
4
|
-
*
|
|
5
|
-
* @param {Object} interval - The interval object
|
|
6
|
-
* @param {Date} interval.start - The start date of the interval
|
|
7
|
-
* @param {Date} interval.end - The end date of the interval
|
|
8
|
-
* @returns {Date[]} An array of dates representing the start of each month in
|
|
9
|
-
* the interval
|
|
10
|
-
*/
|
|
11
|
-
export declare function eachMonthOfInterval(interval: Interval): Date[];
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.eachMonthOfInterval = eachMonthOfInterval;
|
|
4
|
-
const index_js_1 = require("../utils/index.js");
|
|
5
|
-
/**
|
|
6
|
-
* Each month of an interval
|
|
7
|
-
*
|
|
8
|
-
* @param {Object} interval - The interval object
|
|
9
|
-
* @param {Date} interval.start - The start date of the interval
|
|
10
|
-
* @param {Date} interval.end - The end date of the interval
|
|
11
|
-
* @returns {Date[]} An array of dates representing the start of each month in
|
|
12
|
-
* the interval
|
|
13
|
-
*/
|
|
14
|
-
function eachMonthOfInterval(interval) {
|
|
15
|
-
const start = (0, index_js_1.toEthiopicDate)(new Date(interval.start));
|
|
16
|
-
const end = (0, index_js_1.toEthiopicDate)(new Date(interval.end));
|
|
17
|
-
const dates = [];
|
|
18
|
-
let currentYear = start.year;
|
|
19
|
-
let currentMonth = start.month;
|
|
20
|
-
while (currentYear < end.year ||
|
|
21
|
-
(currentYear === end.year && currentMonth <= end.month)) {
|
|
22
|
-
dates.push((0, index_js_1.toGregorianDate)({ year: currentYear, month: currentMonth, day: 1 }));
|
|
23
|
-
currentMonth++;
|
|
24
|
-
if (currentMonth > 13) {
|
|
25
|
-
currentMonth = 1;
|
|
26
|
-
currentYear++;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return dates;
|
|
30
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Interval } from "date-fns";
|
|
2
|
-
/**
|
|
3
|
-
* Returns the start of each Ethiopic year included in the given interval.
|
|
4
|
-
*
|
|
5
|
-
* @param interval The interval whose years should be returned.
|
|
6
|
-
*/
|
|
7
|
-
export declare function eachYearOfInterval(interval: Interval): Date[];
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.eachYearOfInterval = eachYearOfInterval;
|
|
4
|
-
const index_js_1 = require("../utils/index.js");
|
|
5
|
-
/**
|
|
6
|
-
* Returns the start of each Ethiopic year included in the given interval.
|
|
7
|
-
*
|
|
8
|
-
* @param interval The interval whose years should be returned.
|
|
9
|
-
*/
|
|
10
|
-
function eachYearOfInterval(interval) {
|
|
11
|
-
const start = (0, index_js_1.toEthiopicDate)(new Date(interval.start));
|
|
12
|
-
const end = (0, index_js_1.toEthiopicDate)(new Date(interval.end));
|
|
13
|
-
if (end.year < start.year) {
|
|
14
|
-
return [];
|
|
15
|
-
}
|
|
16
|
-
const years = [];
|
|
17
|
-
for (let year = start.year; year <= end.year; year += 1) {
|
|
18
|
-
years.push((0, index_js_1.toGregorianDate)({ year, month: 1, day: 1 }));
|
|
19
|
-
}
|
|
20
|
-
return years;
|
|
21
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the last day of the Ethiopian month for the given date.
|
|
3
|
-
*
|
|
4
|
-
* @param date - The gregorian date to get the end of month for
|
|
5
|
-
* @returns A new gregorian date representing the last day of the Ethiopian
|
|
6
|
-
* month
|
|
7
|
-
*/
|
|
8
|
-
export declare function endOfMonth(date: Date): Date;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.endOfMonth = endOfMonth;
|
|
4
|
-
const daysInMonth_js_1 = require("../utils/daysInMonth.js");
|
|
5
|
-
const index_js_1 = require("../utils/index.js");
|
|
6
|
-
/**
|
|
7
|
-
* Returns the last day of the Ethiopian month for the given date.
|
|
8
|
-
*
|
|
9
|
-
* @param date - The gregorian date to get the end of month for
|
|
10
|
-
* @returns A new gregorian date representing the last day of the Ethiopian
|
|
11
|
-
* month
|
|
12
|
-
*/
|
|
13
|
-
function endOfMonth(date) {
|
|
14
|
-
const { year, month } = (0, index_js_1.toEthiopicDate)(date);
|
|
15
|
-
const day = (0, daysInMonth_js_1.daysInMonth)(month, year);
|
|
16
|
-
return (0, index_js_1.toGregorianDate)({ year, month, day: day });
|
|
17
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type EndOfWeekOptions } from "date-fns";
|
|
2
|
-
/**
|
|
3
|
-
* End of week
|
|
4
|
-
*
|
|
5
|
-
* @param {Date} date - The original date
|
|
6
|
-
* @param {EndOfWeekOptions} [options] - The options object
|
|
7
|
-
* @returns {Date} The end of the week
|
|
8
|
-
*/
|
|
9
|
-
export declare function endOfWeek(date: Date, options?: EndOfWeekOptions): Date;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.endOfWeek = endOfWeek;
|
|
4
|
-
const date_fns_1 = require("date-fns");
|
|
5
|
-
/**
|
|
6
|
-
* End of week
|
|
7
|
-
*
|
|
8
|
-
* @param {Date} date - The original date
|
|
9
|
-
* @param {EndOfWeekOptions} [options] - The options object
|
|
10
|
-
* @returns {Date} The end of the week
|
|
11
|
-
*/
|
|
12
|
-
function endOfWeek(date, options) {
|
|
13
|
-
const weekStartsOn = options?.weekStartsOn ?? 0; // Default to Monday (1)
|
|
14
|
-
const endOfWeek = (0, date_fns_1.endOfWeek)(date, { weekStartsOn });
|
|
15
|
-
return endOfWeek;
|
|
16
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.endOfYear = endOfYear;
|
|
4
|
-
const index_js_1 = require("../utils/index.js");
|
|
5
|
-
/**
|
|
6
|
-
* End of year
|
|
7
|
-
*
|
|
8
|
-
* @param {Date} date - The original date
|
|
9
|
-
* @returns {Date} The end of the year
|
|
10
|
-
*/
|
|
11
|
-
function endOfYear(date) {
|
|
12
|
-
const { year } = (0, index_js_1.toEthiopicDate)(date);
|
|
13
|
-
const day = (0, index_js_1.isEthiopicLeapYear)(year) ? 6 : 5;
|
|
14
|
-
return (0, index_js_1.toGregorianDate)({ year, month: 13, day });
|
|
15
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { FormatOptions as DateFnsFormatOptions } from "date-fns";
|
|
2
|
-
/** Options for formatting dates in the Ethiopian calendar */
|
|
3
|
-
export type FormatOptions = DateFnsFormatOptions;
|
|
4
|
-
/**
|
|
5
|
-
* Format an Ethiopic calendar date using a subset of date-fns tokens.
|
|
6
|
-
*
|
|
7
|
-
* Behavior specifics for Ethiopic mode:
|
|
8
|
-
*
|
|
9
|
-
* - Weekday names ("cccc", "cccccc") come from `Intl.DateTimeFormat` using
|
|
10
|
-
* `options.locale?.code` (default: `am-ET`). Narrow form is a single letter.
|
|
11
|
-
* - Month names ("LLLL") are Amharic by default and switch to Latin
|
|
12
|
-
* transliteration when the locale code starts with `en` or when
|
|
13
|
-
* `options.numerals === 'latn'`.
|
|
14
|
-
* - Time parts such as `hh:mm a` are delegated to `Intl.DateTimeFormat` with the
|
|
15
|
-
* given locale.
|
|
16
|
-
* - Digits are converted to Ethiopic (Geez) when `options.numerals === 'geez'`.
|
|
17
|
-
*/
|
|
18
|
-
export declare function format(date: Date, formatStr: string, options?: DateFnsFormatOptions): string;
|
|
19
|
-
export declare const ethMonths: string[];
|
|
20
|
-
export declare const ethMonthsLatin: string[];
|
|
21
|
-
export declare const shortDays: string[];
|
|
22
|
-
export declare const longDays: string[];
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.longDays = exports.shortDays = exports.ethMonthsLatin = exports.ethMonths = void 0;
|
|
4
|
-
exports.format = format;
|
|
5
|
-
const index_js_1 = require("../utils/index.js");
|
|
6
|
-
const formatNumber_js_1 = require("./formatNumber.js");
|
|
7
|
-
function getEtDayName(day, short = true, localeCode = "am-ET") {
|
|
8
|
-
try {
|
|
9
|
-
const dtf = new Intl.DateTimeFormat(localeCode, {
|
|
10
|
-
// Ethiopic calendar expects single-letter for "cccccc" -> use narrow
|
|
11
|
-
weekday: short ? "narrow" : "long",
|
|
12
|
-
});
|
|
13
|
-
return dtf.format(day);
|
|
14
|
-
}
|
|
15
|
-
catch {
|
|
16
|
-
const dayOfWeek = day.getDay();
|
|
17
|
-
return short ? exports.shortDays[dayOfWeek] : exports.longDays[dayOfWeek];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
function getEtMonthName(m, latin = false) {
|
|
21
|
-
if (m > 0 && m <= 13) {
|
|
22
|
-
return latin ? exports.ethMonthsLatin[m - 1] : exports.ethMonths[m - 1];
|
|
23
|
-
}
|
|
24
|
-
return "";
|
|
25
|
-
}
|
|
26
|
-
function formatEthiopianDate(dateObj, formatStr, numerals, localeCode) {
|
|
27
|
-
const etDate = dateObj ? (0, index_js_1.toEthiopicDate)(dateObj) : undefined;
|
|
28
|
-
if (!etDate)
|
|
29
|
-
return "";
|
|
30
|
-
const useLatin = (localeCode?.startsWith("en") ?? false) || numerals === "latn";
|
|
31
|
-
const yearTokenMatch = formatStr.match(/^(\s*)(y+)(\s*)$/);
|
|
32
|
-
if (yearTokenMatch) {
|
|
33
|
-
const [, leading = "", yearToken, trailing = ""] = yearTokenMatch;
|
|
34
|
-
const year = etDate.year.toString();
|
|
35
|
-
let formattedYear;
|
|
36
|
-
if (yearToken.length === 1) {
|
|
37
|
-
formattedYear = year;
|
|
38
|
-
}
|
|
39
|
-
else if (yearToken.length === 2) {
|
|
40
|
-
formattedYear = year.slice(-2).padStart(2, "0");
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
formattedYear = year.padStart(yearToken.length, "0");
|
|
44
|
-
}
|
|
45
|
-
return `${leading}${formattedYear}${trailing}`;
|
|
46
|
-
}
|
|
47
|
-
switch (formatStr) {
|
|
48
|
-
case "LLLL yyyy":
|
|
49
|
-
case "LLLL y":
|
|
50
|
-
return `${getEtMonthName(etDate.month, useLatin)} ${etDate.year}`;
|
|
51
|
-
case "LLLL":
|
|
52
|
-
return getEtMonthName(etDate.month, useLatin);
|
|
53
|
-
case "yyyy-MM-dd":
|
|
54
|
-
return `${etDate.year}-${etDate.month
|
|
55
|
-
.toString()
|
|
56
|
-
.padStart(2, "0")}-${etDate.day.toString().padStart(2, "0")}`;
|
|
57
|
-
case "yyyy-MM":
|
|
58
|
-
return `${etDate.year}-${etDate.month.toString().padStart(2, "0")}`;
|
|
59
|
-
case "d":
|
|
60
|
-
return etDate.day.toString();
|
|
61
|
-
case "PPP":
|
|
62
|
-
return ` ${getEtMonthName(etDate.month, useLatin)} ${etDate.day}, ${etDate.year}`;
|
|
63
|
-
case "PPPP":
|
|
64
|
-
if (!dateObj)
|
|
65
|
-
return "";
|
|
66
|
-
return `${getEtDayName(dateObj, false, localeCode)}, ${getEtMonthName(etDate.month, useLatin)} ${etDate.day}, ${etDate.year}`;
|
|
67
|
-
case "cccc":
|
|
68
|
-
return dateObj ? getEtDayName(dateObj, false, localeCode) : "";
|
|
69
|
-
case "cccccc":
|
|
70
|
-
return dateObj ? getEtDayName(dateObj, true, localeCode) : "";
|
|
71
|
-
default:
|
|
72
|
-
return `${etDate.day}/${etDate.month}/${etDate.year}`;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Format an Ethiopic calendar date using a subset of date-fns tokens.
|
|
77
|
-
*
|
|
78
|
-
* Behavior specifics for Ethiopic mode:
|
|
79
|
-
*
|
|
80
|
-
* - Weekday names ("cccc", "cccccc") come from `Intl.DateTimeFormat` using
|
|
81
|
-
* `options.locale?.code` (default: `am-ET`). Narrow form is a single letter.
|
|
82
|
-
* - Month names ("LLLL") are Amharic by default and switch to Latin
|
|
83
|
-
* transliteration when the locale code starts with `en` or when
|
|
84
|
-
* `options.numerals === 'latn'`.
|
|
85
|
-
* - Time parts such as `hh:mm a` are delegated to `Intl.DateTimeFormat` with the
|
|
86
|
-
* given locale.
|
|
87
|
-
* - Digits are converted to Ethiopic (Geez) when `options.numerals === 'geez'`.
|
|
88
|
-
*/
|
|
89
|
-
function format(date, formatStr, options) {
|
|
90
|
-
const extendedOptions = options;
|
|
91
|
-
if (formatStr.includes("hh:mm") || formatStr.includes("a")) {
|
|
92
|
-
return new Intl.DateTimeFormat(extendedOptions?.locale?.code ?? "en-US", {
|
|
93
|
-
hour: "numeric",
|
|
94
|
-
minute: "numeric",
|
|
95
|
-
hour12: formatStr.includes("a"),
|
|
96
|
-
}).format(date);
|
|
97
|
-
}
|
|
98
|
-
const formatted = formatEthiopianDate(date, formatStr, extendedOptions?.numerals, extendedOptions?.locale?.code ?? "am-ET");
|
|
99
|
-
if (extendedOptions?.numerals && extendedOptions.numerals === "geez") {
|
|
100
|
-
return formatted.replace(/\d+/g, (match) => (0, formatNumber_js_1.formatNumber)(parseInt(match, 10), "geez"));
|
|
101
|
-
}
|
|
102
|
-
return formatted;
|
|
103
|
-
}
|
|
104
|
-
exports.ethMonths = [
|
|
105
|
-
"መስከረም",
|
|
106
|
-
"ጥቅምት",
|
|
107
|
-
"ህዳር",
|
|
108
|
-
"ታህሳስ",
|
|
109
|
-
"ጥር",
|
|
110
|
-
"የካቲት",
|
|
111
|
-
"መጋቢት",
|
|
112
|
-
"ሚያዚያ",
|
|
113
|
-
"ግንቦት",
|
|
114
|
-
"ሰኔ",
|
|
115
|
-
"ሐምሌ",
|
|
116
|
-
"ነሀሴ",
|
|
117
|
-
"ጳጉሜ",
|
|
118
|
-
];
|
|
119
|
-
exports.ethMonthsLatin = [
|
|
120
|
-
"Meskerem",
|
|
121
|
-
"Tikimt",
|
|
122
|
-
"Hidar",
|
|
123
|
-
"Tahsas",
|
|
124
|
-
"Tir",
|
|
125
|
-
"Yekatit",
|
|
126
|
-
"Megabit",
|
|
127
|
-
"Miyazya",
|
|
128
|
-
"Ginbot",
|
|
129
|
-
"Sene",
|
|
130
|
-
"Hamle",
|
|
131
|
-
"Nehase",
|
|
132
|
-
"Pagumen",
|
|
133
|
-
];
|
|
134
|
-
exports.shortDays = ["እ", "ሰ", "ማ", "ረ", "ሐ", "ዓ", "ቅ"];
|
|
135
|
-
exports.longDays = ["እሁድ", "ሰኞ", "ማክሰኞ", "ረቡዕ", "ሐሙስ", "ዓርብ", "ቅዳሜ"];
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Formats a number using either Latin or Ethiopic (Geez) numerals
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```ts
|
|
6
|
-
* formatNumber(123) // '123'
|
|
7
|
-
* formatNumber(123, 'geez') // '፻፳፫'
|
|
8
|
-
* formatNumber(2023, 'geez') // '፳፻፳፫'
|
|
9
|
-
* ```;
|
|
10
|
-
*
|
|
11
|
-
* @param value - The number to format
|
|
12
|
-
* @param numerals - The numeral system to use:
|
|
13
|
-
*
|
|
14
|
-
* - 'latn': Latin numerals (1, 2, 3...)
|
|
15
|
-
* - 'geez': Ethiopic numerals (፩, ፪, ፫...)
|
|
16
|
-
*
|
|
17
|
-
* @returns The formatted number string
|
|
18
|
-
*/
|
|
19
|
-
export declare function formatNumber(value: number, numerals?: string): string;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatNumber = formatNumber;
|
|
4
|
-
const toGeezNumerals_js_1 = require("../utils/toGeezNumerals.js");
|
|
5
|
-
/**
|
|
6
|
-
* Formats a number using either Latin or Ethiopic (Geez) numerals
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* formatNumber(123) // '123'
|
|
11
|
-
* formatNumber(123, 'geez') // '፻፳፫'
|
|
12
|
-
* formatNumber(2023, 'geez') // '፳፻፳፫'
|
|
13
|
-
* ```;
|
|
14
|
-
*
|
|
15
|
-
* @param value - The number to format
|
|
16
|
-
* @param numerals - The numeral system to use:
|
|
17
|
-
*
|
|
18
|
-
* - 'latn': Latin numerals (1, 2, 3...)
|
|
19
|
-
* - 'geez': Ethiopic numerals (፩, ፪, ፫...)
|
|
20
|
-
*
|
|
21
|
-
* @returns The formatted number string
|
|
22
|
-
*/
|
|
23
|
-
function formatNumber(value, numerals = "latn") {
|
|
24
|
-
if (numerals === "geez") {
|
|
25
|
-
return (0, toGeezNumerals_js_1.toGeezNumerals)(value);
|
|
26
|
-
}
|
|
27
|
-
// Use Intl.NumberFormat for other numeral systems
|
|
28
|
-
const formatter = new Intl.NumberFormat("en-US", {
|
|
29
|
-
numberingSystem: numerals,
|
|
30
|
-
});
|
|
31
|
-
return formatter.format(value);
|
|
32
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMonth = getMonth;
|
|
4
|
-
const index_js_1 = require("../utils/index.js");
|
|
5
|
-
/**
|
|
6
|
-
* Get month
|
|
7
|
-
*
|
|
8
|
-
* @param {Date} date - The original date
|
|
9
|
-
* @returns {number} The zero-based month index
|
|
10
|
-
*/
|
|
11
|
-
function getMonth(date) {
|
|
12
|
-
const { month } = (0, index_js_1.toEthiopicDate)(date);
|
|
13
|
-
return month - 1; // Return zero-based month index
|
|
14
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type GetWeekOptions } from "date-fns";
|
|
2
|
-
/**
|
|
3
|
-
* Get week number for Ethiopian calendar
|
|
4
|
-
*
|
|
5
|
-
* @param {Date} date - The original date
|
|
6
|
-
* @param {GetWeekOptions} [options] - The options object
|
|
7
|
-
* @returns {number} The week number
|
|
8
|
-
*/
|
|
9
|
-
export declare function getWeek(date: Date, options?: GetWeekOptions): number;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getWeek = getWeek;
|
|
4
|
-
const date_fns_1 = require("date-fns");
|
|
5
|
-
const index_js_1 = require("../utils/index.js");
|
|
6
|
-
const startOfWeek_js_1 = require("./startOfWeek.js");
|
|
7
|
-
/**
|
|
8
|
-
* Get week number for Ethiopian calendar
|
|
9
|
-
*
|
|
10
|
-
* @param {Date} date - The original date
|
|
11
|
-
* @param {GetWeekOptions} [options] - The options object
|
|
12
|
-
* @returns {number} The week number
|
|
13
|
-
*/
|
|
14
|
-
function getWeek(date, options) {
|
|
15
|
-
const weekStartsOn = options?.weekStartsOn ?? 1; // Default to Monday (1)
|
|
16
|
-
const etDate = (0, index_js_1.toEthiopicDate)(date);
|
|
17
|
-
const currentWeekStart = (0, startOfWeek_js_1.startOfWeek)(date, { weekStartsOn });
|
|
18
|
-
// Get the first day of the current year
|
|
19
|
-
const firstDayOfYear = (0, index_js_1.toGregorianDate)({
|
|
20
|
-
year: etDate.year,
|
|
21
|
-
month: 1,
|
|
22
|
-
day: 1,
|
|
23
|
-
});
|
|
24
|
-
const firstWeekStart = (0, startOfWeek_js_1.startOfWeek)(firstDayOfYear, { weekStartsOn });
|
|
25
|
-
// If date is before the first week of its year
|
|
26
|
-
if (date < firstWeekStart) {
|
|
27
|
-
return (0, date_fns_1.getWeek)(date, { weekStartsOn, firstWeekContainsDate: 1 });
|
|
28
|
-
}
|
|
29
|
-
// If date falls into the first week of the NEXT Ethiopic year, return 1
|
|
30
|
-
const nextYearFirstDay = (0, index_js_1.toGregorianDate)({
|
|
31
|
-
year: etDate.year + 1,
|
|
32
|
-
month: 1,
|
|
33
|
-
day: 1,
|
|
34
|
-
});
|
|
35
|
-
const nextYearFirstWeekStart = (0, startOfWeek_js_1.startOfWeek)(nextYearFirstDay, {
|
|
36
|
-
weekStartsOn,
|
|
37
|
-
});
|
|
38
|
-
if (date >= nextYearFirstWeekStart) {
|
|
39
|
-
return 1;
|
|
40
|
-
}
|
|
41
|
-
// Calculate week number based on days since first week
|
|
42
|
-
const daysSinceFirstWeek = (0, date_fns_1.differenceInDays)(currentWeekStart, firstWeekStart);
|
|
43
|
-
return Math.floor(daysSinceFirstWeek / 7) + 1;
|
|
44
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getYear = getYear;
|
|
4
|
-
const index_js_1 = require("../utils/index.js");
|
|
5
|
-
/**
|
|
6
|
-
* Get year
|
|
7
|
-
*
|
|
8
|
-
* @param {Date} date - The original date
|
|
9
|
-
* @returns {number} The year
|
|
10
|
-
*/
|
|
11
|
-
function getYear(date) {
|
|
12
|
-
const { year } = (0, index_js_1.toEthiopicDate)(date);
|
|
13
|
-
return year;
|
|
14
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export * from "./addMonths.js";
|
|
2
|
-
export * from "./addYears.js";
|
|
3
|
-
export * from "./differenceInCalendarMonths.js";
|
|
4
|
-
export * from "./eachMonthOfInterval.js";
|
|
5
|
-
export * from "./eachYearOfInterval.js";
|
|
6
|
-
export * from "./endOfMonth.js";
|
|
7
|
-
export * from "./endOfWeek.js";
|
|
8
|
-
export * from "./endOfYear.js";
|
|
9
|
-
export * from "./format.js";
|
|
10
|
-
export * from "./formatNumber.js";
|
|
11
|
-
export * from "./getMonth.js";
|
|
12
|
-
export * from "./getWeek.js";
|
|
13
|
-
export * from "./getYear.js";
|
|
14
|
-
export * from "./isSameMonth.js";
|
|
15
|
-
export * from "./isSameYear.js";
|
|
16
|
-
export * from "./newDate.js";
|
|
17
|
-
export * from "./setMonth.js";
|
|
18
|
-
export * from "./setYear.js";
|
|
19
|
-
export * from "./startOfDay.js";
|
|
20
|
-
export * from "./startOfMonth.js";
|
|
21
|
-
export * from "./startOfWeek.js";
|
|
22
|
-
export * from "./startOfYear.js";
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./addMonths.js"), exports);
|
|
18
|
-
__exportStar(require("./addYears.js"), exports);
|
|
19
|
-
__exportStar(require("./differenceInCalendarMonths.js"), exports);
|
|
20
|
-
__exportStar(require("./eachMonthOfInterval.js"), exports);
|
|
21
|
-
__exportStar(require("./eachYearOfInterval.js"), exports);
|
|
22
|
-
__exportStar(require("./endOfMonth.js"), exports);
|
|
23
|
-
__exportStar(require("./endOfWeek.js"), exports);
|
|
24
|
-
__exportStar(require("./endOfYear.js"), exports);
|
|
25
|
-
__exportStar(require("./format.js"), exports);
|
|
26
|
-
__exportStar(require("./formatNumber.js"), exports);
|
|
27
|
-
__exportStar(require("./getMonth.js"), exports);
|
|
28
|
-
__exportStar(require("./getWeek.js"), exports);
|
|
29
|
-
__exportStar(require("./getYear.js"), exports);
|
|
30
|
-
__exportStar(require("./isSameMonth.js"), exports);
|
|
31
|
-
__exportStar(require("./isSameYear.js"), exports);
|
|
32
|
-
__exportStar(require("./newDate.js"), exports);
|
|
33
|
-
__exportStar(require("./setMonth.js"), exports);
|
|
34
|
-
__exportStar(require("./setYear.js"), exports);
|
|
35
|
-
__exportStar(require("./startOfDay.js"), exports);
|
|
36
|
-
__exportStar(require("./startOfMonth.js"), exports);
|
|
37
|
-
__exportStar(require("./startOfWeek.js"), exports);
|
|
38
|
-
__exportStar(require("./startOfYear.js"), exports);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Is same month
|
|
3
|
-
*
|
|
4
|
-
* @param {Date} dateLeft - The first date
|
|
5
|
-
* @param {Date} dateRight - The second date
|
|
6
|
-
* @returns {boolean} True if the two dates are in the same month
|
|
7
|
-
*/
|
|
8
|
-
export declare function isSameMonth(dateLeft: Date, dateRight: Date): boolean;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSameMonth = isSameMonth;
|
|
4
|
-
const index_js_1 = require("../utils/index.js");
|
|
5
|
-
/**
|
|
6
|
-
* Is same month
|
|
7
|
-
*
|
|
8
|
-
* @param {Date} dateLeft - The first date
|
|
9
|
-
* @param {Date} dateRight - The second date
|
|
10
|
-
* @returns {boolean} True if the two dates are in the same month
|
|
11
|
-
*/
|
|
12
|
-
function isSameMonth(dateLeft, dateRight) {
|
|
13
|
-
const left = (0, index_js_1.toEthiopicDate)(dateLeft);
|
|
14
|
-
const right = (0, index_js_1.toEthiopicDate)(dateRight);
|
|
15
|
-
return left.year === right.year && left.month === right.month;
|
|
16
|
-
}
|