react-day-picker 10.0.0-next.1 → 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/locale.d.ts +0 -2
- package/dist/cjs/locale.js +2 -6
- package/dist/esm/locale.d.ts +0 -2
- package/dist/esm/locale.js +0 -2
- 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
|
-
import { toEthiopicDate, toGregorianDate } from "../utils/index.js";
|
|
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 function eachMonthOfInterval(interval) {
|
|
12
|
-
const start = toEthiopicDate(new Date(interval.start));
|
|
13
|
-
const end = toEthiopicDate(new Date(interval.end));
|
|
14
|
-
const dates = [];
|
|
15
|
-
let currentYear = start.year;
|
|
16
|
-
let currentMonth = start.month;
|
|
17
|
-
while (currentYear < end.year ||
|
|
18
|
-
(currentYear === end.year && currentMonth <= end.month)) {
|
|
19
|
-
dates.push(toGregorianDate({ year: currentYear, month: currentMonth, day: 1 }));
|
|
20
|
-
currentMonth++;
|
|
21
|
-
if (currentMonth > 13) {
|
|
22
|
-
currentMonth = 1;
|
|
23
|
-
currentYear++;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return dates;
|
|
27
|
-
}
|
|
@@ -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,18 +0,0 @@
|
|
|
1
|
-
import { toEthiopicDate, toGregorianDate } from "../utils/index.js";
|
|
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 function eachYearOfInterval(interval) {
|
|
8
|
-
const start = toEthiopicDate(new Date(interval.start));
|
|
9
|
-
const end = toEthiopicDate(new Date(interval.end));
|
|
10
|
-
if (end.year < start.year) {
|
|
11
|
-
return [];
|
|
12
|
-
}
|
|
13
|
-
const years = [];
|
|
14
|
-
for (let year = start.year; year <= end.year; year += 1) {
|
|
15
|
-
years.push(toGregorianDate({ year, month: 1, day: 1 }));
|
|
16
|
-
}
|
|
17
|
-
return years;
|
|
18
|
-
}
|
|
@@ -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,14 +0,0 @@
|
|
|
1
|
-
import { daysInMonth } from "../utils/daysInMonth.js";
|
|
2
|
-
import { toEthiopicDate, toGregorianDate } from "../utils/index.js";
|
|
3
|
-
/**
|
|
4
|
-
* Returns the last day of the Ethiopian month for the given date.
|
|
5
|
-
*
|
|
6
|
-
* @param date - The gregorian date to get the end of month for
|
|
7
|
-
* @returns A new gregorian date representing the last day of the Ethiopian
|
|
8
|
-
* month
|
|
9
|
-
*/
|
|
10
|
-
export function endOfMonth(date) {
|
|
11
|
-
const { year, month } = toEthiopicDate(date);
|
|
12
|
-
const day = daysInMonth(month, year);
|
|
13
|
-
return toGregorianDate({ year, month, day: day });
|
|
14
|
-
}
|
|
@@ -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,13 +0,0 @@
|
|
|
1
|
-
import { endOfWeek as endOfWeekFns } 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 function endOfWeek(date, options) {
|
|
10
|
-
const weekStartsOn = options?.weekStartsOn ?? 0; // Default to Monday (1)
|
|
11
|
-
const endOfWeek = endOfWeekFns(date, { weekStartsOn });
|
|
12
|
-
return endOfWeek;
|
|
13
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { isEthiopicLeapYear, toEthiopicDate, toGregorianDate, } from "../utils/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* End of year
|
|
4
|
-
*
|
|
5
|
-
* @param {Date} date - The original date
|
|
6
|
-
* @returns {Date} The end of the year
|
|
7
|
-
*/
|
|
8
|
-
export function endOfYear(date) {
|
|
9
|
-
const { year } = toEthiopicDate(date);
|
|
10
|
-
const day = isEthiopicLeapYear(year) ? 6 : 5;
|
|
11
|
-
return toGregorianDate({ year, month: 13, day });
|
|
12
|
-
}
|
|
@@ -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,131 +0,0 @@
|
|
|
1
|
-
import { toEthiopicDate } from "../utils/index.js";
|
|
2
|
-
import { formatNumber } from "./formatNumber.js";
|
|
3
|
-
function getEtDayName(day, short = true, localeCode = "am-ET") {
|
|
4
|
-
try {
|
|
5
|
-
const dtf = new Intl.DateTimeFormat(localeCode, {
|
|
6
|
-
// Ethiopic calendar expects single-letter for "cccccc" -> use narrow
|
|
7
|
-
weekday: short ? "narrow" : "long",
|
|
8
|
-
});
|
|
9
|
-
return dtf.format(day);
|
|
10
|
-
}
|
|
11
|
-
catch {
|
|
12
|
-
const dayOfWeek = day.getDay();
|
|
13
|
-
return short ? shortDays[dayOfWeek] : longDays[dayOfWeek];
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function getEtMonthName(m, latin = false) {
|
|
17
|
-
if (m > 0 && m <= 13) {
|
|
18
|
-
return latin ? ethMonthsLatin[m - 1] : ethMonths[m - 1];
|
|
19
|
-
}
|
|
20
|
-
return "";
|
|
21
|
-
}
|
|
22
|
-
function formatEthiopianDate(dateObj, formatStr, numerals, localeCode) {
|
|
23
|
-
const etDate = dateObj ? toEthiopicDate(dateObj) : undefined;
|
|
24
|
-
if (!etDate)
|
|
25
|
-
return "";
|
|
26
|
-
const useLatin = (localeCode?.startsWith("en") ?? false) || numerals === "latn";
|
|
27
|
-
const yearTokenMatch = formatStr.match(/^(\s*)(y+)(\s*)$/);
|
|
28
|
-
if (yearTokenMatch) {
|
|
29
|
-
const [, leading = "", yearToken, trailing = ""] = yearTokenMatch;
|
|
30
|
-
const year = etDate.year.toString();
|
|
31
|
-
let formattedYear;
|
|
32
|
-
if (yearToken.length === 1) {
|
|
33
|
-
formattedYear = year;
|
|
34
|
-
}
|
|
35
|
-
else if (yearToken.length === 2) {
|
|
36
|
-
formattedYear = year.slice(-2).padStart(2, "0");
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
formattedYear = year.padStart(yearToken.length, "0");
|
|
40
|
-
}
|
|
41
|
-
return `${leading}${formattedYear}${trailing}`;
|
|
42
|
-
}
|
|
43
|
-
switch (formatStr) {
|
|
44
|
-
case "LLLL yyyy":
|
|
45
|
-
case "LLLL y":
|
|
46
|
-
return `${getEtMonthName(etDate.month, useLatin)} ${etDate.year}`;
|
|
47
|
-
case "LLLL":
|
|
48
|
-
return getEtMonthName(etDate.month, useLatin);
|
|
49
|
-
case "yyyy-MM-dd":
|
|
50
|
-
return `${etDate.year}-${etDate.month
|
|
51
|
-
.toString()
|
|
52
|
-
.padStart(2, "0")}-${etDate.day.toString().padStart(2, "0")}`;
|
|
53
|
-
case "yyyy-MM":
|
|
54
|
-
return `${etDate.year}-${etDate.month.toString().padStart(2, "0")}`;
|
|
55
|
-
case "d":
|
|
56
|
-
return etDate.day.toString();
|
|
57
|
-
case "PPP":
|
|
58
|
-
return ` ${getEtMonthName(etDate.month, useLatin)} ${etDate.day}, ${etDate.year}`;
|
|
59
|
-
case "PPPP":
|
|
60
|
-
if (!dateObj)
|
|
61
|
-
return "";
|
|
62
|
-
return `${getEtDayName(dateObj, false, localeCode)}, ${getEtMonthName(etDate.month, useLatin)} ${etDate.day}, ${etDate.year}`;
|
|
63
|
-
case "cccc":
|
|
64
|
-
return dateObj ? getEtDayName(dateObj, false, localeCode) : "";
|
|
65
|
-
case "cccccc":
|
|
66
|
-
return dateObj ? getEtDayName(dateObj, true, localeCode) : "";
|
|
67
|
-
default:
|
|
68
|
-
return `${etDate.day}/${etDate.month}/${etDate.year}`;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Format an Ethiopic calendar date using a subset of date-fns tokens.
|
|
73
|
-
*
|
|
74
|
-
* Behavior specifics for Ethiopic mode:
|
|
75
|
-
*
|
|
76
|
-
* - Weekday names ("cccc", "cccccc") come from `Intl.DateTimeFormat` using
|
|
77
|
-
* `options.locale?.code` (default: `am-ET`). Narrow form is a single letter.
|
|
78
|
-
* - Month names ("LLLL") are Amharic by default and switch to Latin
|
|
79
|
-
* transliteration when the locale code starts with `en` or when
|
|
80
|
-
* `options.numerals === 'latn'`.
|
|
81
|
-
* - Time parts such as `hh:mm a` are delegated to `Intl.DateTimeFormat` with the
|
|
82
|
-
* given locale.
|
|
83
|
-
* - Digits are converted to Ethiopic (Geez) when `options.numerals === 'geez'`.
|
|
84
|
-
*/
|
|
85
|
-
export function format(date, formatStr, options) {
|
|
86
|
-
const extendedOptions = options;
|
|
87
|
-
if (formatStr.includes("hh:mm") || formatStr.includes("a")) {
|
|
88
|
-
return new Intl.DateTimeFormat(extendedOptions?.locale?.code ?? "en-US", {
|
|
89
|
-
hour: "numeric",
|
|
90
|
-
minute: "numeric",
|
|
91
|
-
hour12: formatStr.includes("a"),
|
|
92
|
-
}).format(date);
|
|
93
|
-
}
|
|
94
|
-
const formatted = formatEthiopianDate(date, formatStr, extendedOptions?.numerals, extendedOptions?.locale?.code ?? "am-ET");
|
|
95
|
-
if (extendedOptions?.numerals && extendedOptions.numerals === "geez") {
|
|
96
|
-
return formatted.replace(/\d+/g, (match) => formatNumber(parseInt(match, 10), "geez"));
|
|
97
|
-
}
|
|
98
|
-
return formatted;
|
|
99
|
-
}
|
|
100
|
-
export const ethMonths = [
|
|
101
|
-
"መስከረም",
|
|
102
|
-
"ጥቅምት",
|
|
103
|
-
"ህዳር",
|
|
104
|
-
"ታህሳስ",
|
|
105
|
-
"ጥር",
|
|
106
|
-
"የካቲት",
|
|
107
|
-
"መጋቢት",
|
|
108
|
-
"ሚያዚያ",
|
|
109
|
-
"ግንቦት",
|
|
110
|
-
"ሰኔ",
|
|
111
|
-
"ሐምሌ",
|
|
112
|
-
"ነሀሴ",
|
|
113
|
-
"ጳጉሜ",
|
|
114
|
-
];
|
|
115
|
-
export const ethMonthsLatin = [
|
|
116
|
-
"Meskerem",
|
|
117
|
-
"Tikimt",
|
|
118
|
-
"Hidar",
|
|
119
|
-
"Tahsas",
|
|
120
|
-
"Tir",
|
|
121
|
-
"Yekatit",
|
|
122
|
-
"Megabit",
|
|
123
|
-
"Miyazya",
|
|
124
|
-
"Ginbot",
|
|
125
|
-
"Sene",
|
|
126
|
-
"Hamle",
|
|
127
|
-
"Nehase",
|
|
128
|
-
"Pagumen",
|
|
129
|
-
];
|
|
130
|
-
export const shortDays = ["እ", "ሰ", "ማ", "ረ", "ሐ", "ዓ", "ቅ"];
|
|
131
|
-
export const 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,29 +0,0 @@
|
|
|
1
|
-
import { toGeezNumerals } from "../utils/toGeezNumerals.js";
|
|
2
|
-
/**
|
|
3
|
-
* Formats a number using either Latin or Ethiopic (Geez) numerals
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```ts
|
|
7
|
-
* formatNumber(123) // '123'
|
|
8
|
-
* formatNumber(123, 'geez') // '፻፳፫'
|
|
9
|
-
* formatNumber(2023, 'geez') // '፳፻፳፫'
|
|
10
|
-
* ```;
|
|
11
|
-
*
|
|
12
|
-
* @param value - The number to format
|
|
13
|
-
* @param numerals - The numeral system to use:
|
|
14
|
-
*
|
|
15
|
-
* - 'latn': Latin numerals (1, 2, 3...)
|
|
16
|
-
* - 'geez': Ethiopic numerals (፩, ፪, ፫...)
|
|
17
|
-
*
|
|
18
|
-
* @returns The formatted number string
|
|
19
|
-
*/
|
|
20
|
-
export function formatNumber(value, numerals = "latn") {
|
|
21
|
-
if (numerals === "geez") {
|
|
22
|
-
return toGeezNumerals(value);
|
|
23
|
-
}
|
|
24
|
-
// Use Intl.NumberFormat for other numeral systems
|
|
25
|
-
const formatter = new Intl.NumberFormat("en-US", {
|
|
26
|
-
numberingSystem: numerals,
|
|
27
|
-
});
|
|
28
|
-
return formatter.format(value);
|
|
29
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { toEthiopicDate } from "../utils/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* Get month
|
|
4
|
-
*
|
|
5
|
-
* @param {Date} date - The original date
|
|
6
|
-
* @returns {number} The zero-based month index
|
|
7
|
-
*/
|
|
8
|
-
export function getMonth(date) {
|
|
9
|
-
const { month } = toEthiopicDate(date);
|
|
10
|
-
return month - 1; // Return zero-based month index
|
|
11
|
-
}
|
|
@@ -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,41 +0,0 @@
|
|
|
1
|
-
import { differenceInDays, getWeek as getWeekFns, } from "date-fns";
|
|
2
|
-
import { toEthiopicDate, toGregorianDate } from "../utils/index.js";
|
|
3
|
-
import { startOfWeek } from "./startOfWeek.js";
|
|
4
|
-
/**
|
|
5
|
-
* Get week number for Ethiopian calendar
|
|
6
|
-
*
|
|
7
|
-
* @param {Date} date - The original date
|
|
8
|
-
* @param {GetWeekOptions} [options] - The options object
|
|
9
|
-
* @returns {number} The week number
|
|
10
|
-
*/
|
|
11
|
-
export function getWeek(date, options) {
|
|
12
|
-
const weekStartsOn = options?.weekStartsOn ?? 1; // Default to Monday (1)
|
|
13
|
-
const etDate = toEthiopicDate(date);
|
|
14
|
-
const currentWeekStart = startOfWeek(date, { weekStartsOn });
|
|
15
|
-
// Get the first day of the current year
|
|
16
|
-
const firstDayOfYear = toGregorianDate({
|
|
17
|
-
year: etDate.year,
|
|
18
|
-
month: 1,
|
|
19
|
-
day: 1,
|
|
20
|
-
});
|
|
21
|
-
const firstWeekStart = startOfWeek(firstDayOfYear, { weekStartsOn });
|
|
22
|
-
// If date is before the first week of its year
|
|
23
|
-
if (date < firstWeekStart) {
|
|
24
|
-
return getWeekFns(date, { weekStartsOn, firstWeekContainsDate: 1 });
|
|
25
|
-
}
|
|
26
|
-
// If date falls into the first week of the NEXT Ethiopic year, return 1
|
|
27
|
-
const nextYearFirstDay = toGregorianDate({
|
|
28
|
-
year: etDate.year + 1,
|
|
29
|
-
month: 1,
|
|
30
|
-
day: 1,
|
|
31
|
-
});
|
|
32
|
-
const nextYearFirstWeekStart = startOfWeek(nextYearFirstDay, {
|
|
33
|
-
weekStartsOn,
|
|
34
|
-
});
|
|
35
|
-
if (date >= nextYearFirstWeekStart) {
|
|
36
|
-
return 1;
|
|
37
|
-
}
|
|
38
|
-
// Calculate week number based on days since first week
|
|
39
|
-
const daysSinceFirstWeek = differenceInDays(currentWeekStart, firstWeekStart);
|
|
40
|
-
return Math.floor(daysSinceFirstWeek / 7) + 1;
|
|
41
|
-
}
|
|
@@ -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,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,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,13 +0,0 @@
|
|
|
1
|
-
import { toEthiopicDate } from "../utils/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* Is same month
|
|
4
|
-
*
|
|
5
|
-
* @param {Date} dateLeft - The first date
|
|
6
|
-
* @param {Date} dateRight - The second date
|
|
7
|
-
* @returns {boolean} True if the two dates are in the same month
|
|
8
|
-
*/
|
|
9
|
-
export function isSameMonth(dateLeft, dateRight) {
|
|
10
|
-
const left = toEthiopicDate(dateLeft);
|
|
11
|
-
const right = toEthiopicDate(dateRight);
|
|
12
|
-
return left.year === right.year && left.month === right.month;
|
|
13
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if two dates fall in the same Ethiopian year.
|
|
3
|
-
*
|
|
4
|
-
* @param dateLeft - The first gregorian date to compare
|
|
5
|
-
* @param dateRight - The second gregorian date to compare
|
|
6
|
-
* @returns True if the dates are in the same Ethiopian year
|
|
7
|
-
*/
|
|
8
|
-
export declare function isSameYear(dateLeft: Date, dateRight: Date): boolean;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { toEthiopicDate } from "../utils/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* Checks if two dates fall in the same Ethiopian year.
|
|
4
|
-
*
|
|
5
|
-
* @param dateLeft - The first gregorian date to compare
|
|
6
|
-
* @param dateRight - The second gregorian date to compare
|
|
7
|
-
* @returns True if the dates are in the same Ethiopian year
|
|
8
|
-
*/
|
|
9
|
-
export function isSameYear(dateLeft, dateRight) {
|
|
10
|
-
const left = toEthiopicDate(dateLeft);
|
|
11
|
-
const right = toEthiopicDate(dateRight);
|
|
12
|
-
return left.year === right.year;
|
|
13
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a new Ethiopic date
|
|
3
|
-
*
|
|
4
|
-
* @param {number} year - The year of the Ethiopic date
|
|
5
|
-
* @param {number} monthIndex - The zero-based month index of the Ethiopic date
|
|
6
|
-
* @param {number} date - The day of the month of the Ethiopic date
|
|
7
|
-
* @returns {Date} The corresponding Gregorian date
|
|
8
|
-
*/
|
|
9
|
-
export declare function newDate(year: number, monthIndex: number, date: number): Date;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { toGregorianDate } from "../utils/index.js";
|
|
2
|
-
import { isEthiopicDateValid } from "../utils/isEthiopicDateValid.js";
|
|
3
|
-
/**
|
|
4
|
-
* Creates a new Ethiopic date
|
|
5
|
-
*
|
|
6
|
-
* @param {number} year - The year of the Ethiopic date
|
|
7
|
-
* @param {number} monthIndex - The zero-based month index of the Ethiopic date
|
|
8
|
-
* @param {number} date - The day of the month of the Ethiopic date
|
|
9
|
-
* @returns {Date} The corresponding Gregorian date
|
|
10
|
-
*/
|
|
11
|
-
export function newDate(year, monthIndex, date) {
|
|
12
|
-
// Convert from 0-based month index to 1-based Ethiopic month
|
|
13
|
-
const month = monthIndex + 1;
|
|
14
|
-
if (!isEthiopicDateValid({ year, month, day: date })) {
|
|
15
|
-
throw new Error("Invalid Ethiopic date");
|
|
16
|
-
}
|
|
17
|
-
return toGregorianDate({
|
|
18
|
-
year: year,
|
|
19
|
-
month: month,
|
|
20
|
-
day: date,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { daysInMonth, toEthiopicDate, toGregorianDate, } from "../utils/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* Set month
|
|
4
|
-
*
|
|
5
|
-
* @param {Date} date - The original date
|
|
6
|
-
* @param {number} month - The zero-based month index
|
|
7
|
-
* @returns {Date} The new date with the month set
|
|
8
|
-
*/
|
|
9
|
-
export function setMonth(date, month) {
|
|
10
|
-
const { year, day } = toEthiopicDate(date);
|
|
11
|
-
const targetMonth = month + 1; // Convert from zero-based index
|
|
12
|
-
const safeDay = Math.min(day, daysInMonth(targetMonth, year));
|
|
13
|
-
return toGregorianDate({ year, month: targetMonth, day: safeDay });
|
|
14
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { daysInMonth } from "../utils/daysInMonth.js";
|
|
2
|
-
import { toEthiopicDate, toGregorianDate } from "../utils/index.js";
|
|
3
|
-
/**
|
|
4
|
-
* Set year
|
|
5
|
-
*
|
|
6
|
-
* @param {Date} date - The original date
|
|
7
|
-
* @param {number} year - The year to set
|
|
8
|
-
* @returns {Date} The new date with the year set
|
|
9
|
-
*/
|
|
10
|
-
export function setYear(date, year) {
|
|
11
|
-
const { month, day } = toEthiopicDate(date);
|
|
12
|
-
// Check if the day is valid in the new year (handles leap year changes)
|
|
13
|
-
const maxDays = daysInMonth(month, year);
|
|
14
|
-
const newDay = Math.min(day, maxDays);
|
|
15
|
-
return toGregorianDate({ year, month, day: newDay });
|
|
16
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { toEthiopicDate, toGregorianDate } from "../utils/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* Start of day
|
|
4
|
-
*
|
|
5
|
-
* @param {Date} date - The original date
|
|
6
|
-
* @returns {Date} The start of the day
|
|
7
|
-
*/
|
|
8
|
-
export function startOfDay(date) {
|
|
9
|
-
const { year, month, day } = toEthiopicDate(date);
|
|
10
|
-
return toGregorianDate({ year, month, day });
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { toEthiopicDate, toGregorianDate } from "../utils/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* Start of month
|
|
4
|
-
*
|
|
5
|
-
* @param {Date} date - The original date
|
|
6
|
-
* @returns {Date} The start of the month
|
|
7
|
-
*/
|
|
8
|
-
export function startOfMonth(date) {
|
|
9
|
-
const { year, month } = toEthiopicDate(date);
|
|
10
|
-
return toGregorianDate({ year, month, day: 1 });
|
|
11
|
-
}
|