@gobrand/tiempo 3.1.2 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addBusinessDays.d.ts +14 -4
- package/dist/addBusinessDays.d.ts.map +1 -1
- package/dist/addBusinessDays.js +3 -3
- package/dist/addDays.d.ts +2 -2
- package/dist/addDays.js +2 -2
- package/dist/addHours.d.ts +2 -2
- package/dist/addHours.js +2 -2
- package/dist/addMicroseconds.d.ts +2 -2
- package/dist/addMicroseconds.js +2 -2
- package/dist/addMilliseconds.d.ts +2 -2
- package/dist/addMilliseconds.js +2 -2
- package/dist/addMinutes.d.ts +2 -2
- package/dist/addMinutes.js +2 -2
- package/dist/addMonths.d.ts +2 -2
- package/dist/addMonths.js +2 -2
- package/dist/addNanoseconds.d.ts +2 -2
- package/dist/addNanoseconds.js +2 -2
- package/dist/addQuarters.d.ts +1 -1
- package/dist/addQuarters.js +2 -2
- package/dist/addSeconds.d.ts +2 -2
- package/dist/addSeconds.js +2 -2
- package/dist/addWeeks.d.ts +2 -2
- package/dist/addWeeks.js +2 -2
- package/dist/addYears.d.ts +2 -2
- package/dist/addYears.js +2 -2
- package/dist/areIntervalsOverlapping.d.ts +60 -0
- package/dist/areIntervalsOverlapping.d.ts.map +1 -0
- package/dist/areIntervalsOverlapping.js +9 -0
- package/dist/areIntervalsOverlapping.js.map +1 -0
- package/dist/chunk-2JXI3CAL.js +22 -0
- package/dist/chunk-2JXI3CAL.js.map +1 -0
- package/dist/{chunk-22IDWEHQ.js → chunk-2LT2XOAL.js} +5 -83
- package/dist/chunk-2LT2XOAL.js.map +1 -0
- package/dist/{chunk-ETO77GIW.js → chunk-32AWWYBF.js} +2 -2
- package/dist/chunk-32AWWYBF.js.map +1 -0
- package/dist/{chunk-HQ3YMKQ5.js → chunk-3D4YR2SR.js} +2 -2
- package/dist/chunk-3D4YR2SR.js.map +1 -0
- package/dist/{chunk-ASIYAAQV.js → chunk-3HD7HEN4.js} +3 -3
- package/dist/chunk-3HD7HEN4.js.map +1 -0
- package/dist/{chunk-TEL44S5A.js → chunk-3HF4F36S.js} +2 -2
- package/dist/{chunk-TEL44S5A.js.map → chunk-3HF4F36S.js.map} +1 -1
- package/dist/chunk-3OOGJRXH.js +247 -0
- package/dist/chunk-3OOGJRXH.js.map +1 -0
- package/dist/{chunk-426MJGNT.js → chunk-3X2U6I44.js} +2 -2
- package/dist/chunk-3X2U6I44.js.map +1 -0
- package/dist/{chunk-EBQ25TEY.js → chunk-3XGUCQ2A.js} +2 -2
- package/dist/chunk-3XGUCQ2A.js.map +1 -0
- package/dist/chunk-42IFQS4W.js +16 -0
- package/dist/chunk-42IFQS4W.js.map +1 -0
- package/dist/{chunk-R3PZ56AD.js → chunk-4FQCY75E.js} +5 -5
- package/dist/chunk-4FQCY75E.js.map +1 -0
- package/dist/{chunk-TWRJEIBO.js → chunk-4GEF7B7W.js} +2 -2
- package/dist/{chunk-V36MCE25.js → chunk-4KAIF44F.js} +2 -2
- package/dist/chunk-4KAIF44F.js.map +1 -0
- package/dist/{chunk-YHQSI4WC.js → chunk-4VWUTQKP.js} +2 -2
- package/dist/chunk-4VWUTQKP.js.map +1 -0
- package/dist/chunk-4YCEFGZA.js +61 -0
- package/dist/chunk-4YCEFGZA.js.map +1 -0
- package/dist/{chunk-SUONQGAH.js → chunk-525OLFRD.js} +2 -2
- package/dist/{chunk-PYV7MWJJ.js → chunk-5WHGX2J3.js} +2 -2
- package/dist/chunk-5WHGX2J3.js.map +1 -0
- package/dist/{chunk-NKXMLC6T.js → chunk-67XABEBT.js} +2 -2
- package/dist/chunk-67XABEBT.js.map +1 -0
- package/dist/{chunk-TUZHOWSN.js → chunk-6QH4NCPA.js} +2 -2
- package/dist/{chunk-TUZHOWSN.js.map → chunk-6QH4NCPA.js.map} +1 -1
- package/dist/{chunk-5XJEKPO5.js → chunk-6QOLNYFY.js} +2 -2
- package/dist/chunk-6UBFKQIJ.js +20 -0
- package/dist/chunk-6UBFKQIJ.js.map +1 -0
- package/dist/{chunk-WY5I452J.js → chunk-7IKCDOCT.js} +2 -2
- package/dist/chunk-7IKCDOCT.js.map +1 -0
- package/dist/{chunk-5MB7UZCJ.js → chunk-7NGP7SAD.js} +2 -2
- package/dist/chunk-7NGP7SAD.js.map +1 -0
- package/dist/chunk-7PH5BPMS.js +14 -0
- package/dist/chunk-7PH5BPMS.js.map +1 -0
- package/dist/{chunk-NYM3EW3M.js → chunk-AUOZACFS.js} +2 -2
- package/dist/chunk-AUOZACFS.js.map +1 -0
- package/dist/{chunk-XXB6HJ2R.js → chunk-BI42E23Z.js} +3 -3
- package/dist/{chunk-5WPQUOM4.js → chunk-BPMS34GV.js} +2 -2
- package/dist/chunk-BPMS34GV.js.map +1 -0
- package/dist/chunk-C7QA4J6V.js +14 -0
- package/dist/chunk-C7QA4J6V.js.map +1 -0
- package/dist/{chunk-W5FFJSCD.js → chunk-DBOIK3XA.js} +2 -2
- package/dist/chunk-DBOIK3XA.js.map +1 -0
- package/dist/{chunk-FLVULRGY.js → chunk-DGUAV5XN.js} +2 -2
- package/dist/{chunk-23APOESH.js → chunk-DRBZDI52.js} +2 -2
- package/dist/{chunk-23APOESH.js.map → chunk-DRBZDI52.js.map} +1 -1
- package/dist/chunk-DVZDJ5LM.js +33 -0
- package/dist/chunk-DVZDJ5LM.js.map +1 -0
- package/dist/{chunk-JWYRXPR4.js → chunk-DYIISNVW.js} +15 -13
- package/dist/chunk-DYIISNVW.js.map +1 -0
- package/dist/{chunk-HSJMG5T7.js → chunk-DZ3647ZK.js} +2 -2
- package/dist/{chunk-HSJMG5T7.js.map → chunk-DZ3647ZK.js.map} +1 -1
- package/dist/{chunk-LKF7U4O4.js → chunk-EAO2SO4N.js} +2 -2
- package/dist/{chunk-LKF7U4O4.js.map → chunk-EAO2SO4N.js.map} +1 -1
- package/dist/{chunk-2OSJHJV5.js → chunk-EBOLL4LY.js} +2 -2
- package/dist/{chunk-AVPV4BA5.js → chunk-F3UZDWOQ.js} +2 -2
- package/dist/chunk-F3UZDWOQ.js.map +1 -0
- package/dist/{chunk-QD3ROUIT.js → chunk-GOJ45AG7.js} +3 -3
- package/dist/{chunk-SLBDEPBP.js → chunk-GU3CZAIN.js} +2 -2
- package/dist/{chunk-5ST6IOPN.js → chunk-GXSVYUCG.js} +2 -2
- package/dist/chunk-GXSVYUCG.js.map +1 -0
- package/dist/chunk-H43LMOCK.js +26 -0
- package/dist/chunk-H43LMOCK.js.map +1 -0
- package/dist/{chunk-B6VZ2AKN.js → chunk-HCORON7B.js} +2 -2
- package/dist/chunk-HCORON7B.js.map +1 -0
- package/dist/chunk-HH2HTC44.js +87 -0
- package/dist/chunk-HH2HTC44.js.map +1 -0
- package/dist/{chunk-FL33IWLY.js → chunk-HRCTWTP3.js} +2 -2
- package/dist/chunk-HRCTWTP3.js.map +1 -0
- package/dist/{chunk-FUVG6A7U.js → chunk-HYSGJJUR.js} +2 -2
- package/dist/chunk-HYSGJJUR.js.map +1 -0
- package/dist/chunk-IDB3R3G5.js +21 -0
- package/dist/chunk-IDB3R3G5.js.map +1 -0
- package/dist/chunk-IIEHQPKE.js +36 -0
- package/dist/chunk-IIEHQPKE.js.map +1 -0
- package/dist/{chunk-C5OJIIJP.js → chunk-IWVSM77B.js} +2 -2
- package/dist/{chunk-C5OJIIJP.js.map → chunk-IWVSM77B.js.map} +1 -1
- package/dist/{chunk-XIVWFVVX.js → chunk-IXNGK5OF.js} +2 -2
- package/dist/{chunk-XIVWFVVX.js.map → chunk-IXNGK5OF.js.map} +1 -1
- package/dist/{chunk-XR7Q6IP6.js → chunk-JA5ER27P.js} +2 -2
- package/dist/{chunk-E5HJJFUI.js → chunk-JGPTGV5X.js} +2 -2
- package/dist/{chunk-4E5OJUMN.js → chunk-K3L6MJJB.js} +2 -2
- package/dist/{chunk-4E5OJUMN.js.map → chunk-K3L6MJJB.js.map} +1 -1
- package/dist/{chunk-MCPKXTX7.js → chunk-K6NQZIAW.js} +2 -2
- package/dist/chunk-K6NQZIAW.js.map +1 -0
- package/dist/{chunk-RQ5CX67T.js → chunk-K7SY2MAX.js} +10 -4
- package/dist/chunk-K7SY2MAX.js.map +1 -0
- package/dist/{chunk-XZS6J4LM.js → chunk-KYS54PLJ.js} +2 -2
- package/dist/chunk-KYS54PLJ.js.map +1 -0
- package/dist/{chunk-2LN57UVR.js → chunk-KZCSP3DU.js} +2 -2
- package/dist/chunk-KZYWHHAQ.js +19 -0
- package/dist/chunk-KZYWHHAQ.js.map +1 -0
- package/dist/{chunk-35IJG3T2.js → chunk-LMOAA73F.js} +2 -2
- package/dist/chunk-M2XB72L5.js +17 -0
- package/dist/chunk-M2XB72L5.js.map +1 -0
- package/dist/{chunk-NNUATTN7.js → chunk-MVGBYHG5.js} +2 -2
- package/dist/{chunk-NNUATTN7.js.map → chunk-MVGBYHG5.js.map} +1 -1
- package/dist/{chunk-FAVYJIRM.js → chunk-NOWUJERX.js} +2 -2
- package/dist/chunk-NOWUJERX.js.map +1 -0
- package/dist/{chunk-O4YU4N6Q.js → chunk-NVFFQJEW.js} +3 -3
- package/dist/{chunk-OYTQWJ2O.js → chunk-OEPVYNB6.js} +2 -2
- package/dist/{chunk-T775UWIV.js → chunk-OF5YEVUT.js} +2 -2
- package/dist/chunk-OF5YEVUT.js.map +1 -0
- package/dist/chunk-OMUK2MOH.js +19 -0
- package/dist/chunk-OMUK2MOH.js.map +1 -0
- package/dist/{chunk-5FCHKIGV.js → chunk-PAM6VJQM.js} +2 -2
- package/dist/chunk-PLPGYCQQ.js +28 -0
- package/dist/chunk-PLPGYCQQ.js.map +1 -0
- package/dist/chunk-Q6QLOUXJ.js +18 -0
- package/dist/chunk-Q6QLOUXJ.js.map +1 -0
- package/dist/{chunk-YR26F7OA.js → chunk-QDY2KMYX.js} +2 -2
- package/dist/chunk-QDY2KMYX.js.map +1 -0
- package/dist/{chunk-NRYKSDVP.js → chunk-QNZJR53W.js} +2 -2
- package/dist/chunk-QNZJR53W.js.map +1 -0
- package/dist/{chunk-44EIUFJB.js → chunk-QZ6WXAUO.js} +2 -2
- package/dist/chunk-QZ6WXAUO.js.map +1 -0
- package/dist/{chunk-ZO2MTD2E.js → chunk-R2DCUSBY.js} +2 -2
- package/dist/chunk-R2DCUSBY.js.map +1 -0
- package/dist/{chunk-DXSRRBJO.js → chunk-R5XRTUWH.js} +2 -2
- package/dist/chunk-R5XRTUWH.js.map +1 -0
- package/dist/chunk-R6D3Y5NV.js +17 -0
- package/dist/chunk-R6D3Y5NV.js.map +1 -0
- package/dist/{chunk-AA56LFMF.js → chunk-SHKSAHJO.js} +2 -2
- package/dist/chunk-SHKSAHJO.js.map +1 -0
- package/dist/{chunk-33MHEBQR.js → chunk-SLH6TKGN.js} +2 -2
- package/dist/{chunk-33MHEBQR.js.map → chunk-SLH6TKGN.js.map} +1 -1
- package/dist/{chunk-2MFBXSTL.js → chunk-TCB3IDJM.js} +2 -2
- package/dist/{chunk-DHVGDIIO.js → chunk-TD6MVGV2.js} +2 -2
- package/dist/{chunk-PU6PU2JM.js → chunk-TI6WBLCB.js} +2 -2
- package/dist/chunk-TI6WBLCB.js.map +1 -0
- package/dist/{chunk-SXR2SO42.js → chunk-TIZJRCAA.js} +2 -2
- package/dist/chunk-TIZJRCAA.js.map +1 -0
- package/dist/{chunk-MXUGDXSG.js → chunk-TU3LNQKW.js} +2 -2
- package/dist/chunk-U6VFT2A5.js +14 -0
- package/dist/chunk-U6VFT2A5.js.map +1 -0
- package/dist/{chunk-NST7NM5Q.js → chunk-X27XGVCT.js} +2 -2
- package/dist/chunk-XMEPH226.js +21 -0
- package/dist/chunk-XMEPH226.js.map +1 -0
- package/dist/{chunk-D3BJEYTR.js → chunk-XSHFR2SX.js} +2 -2
- package/dist/{chunk-DCZDGS5G.js → chunk-Y24VUXMX.js} +2 -2
- package/dist/chunk-Y24VUXMX.js.map +1 -0
- package/dist/{chunk-XTS6LZBP.js → chunk-YKXRVQ4S.js} +2 -2
- package/dist/chunk-YKXRVQ4S.js.map +1 -0
- package/dist/{chunk-5KVFPVBT.js → chunk-ZNRTNR2Q.js} +4 -4
- package/dist/chunk-ZNRTNR2Q.js.map +1 -0
- package/dist/{chunk-3IYGWL34.js → chunk-ZW32E6EJ.js} +9 -9
- package/dist/{chunk-WJZHUNF5.js → chunk-ZXKU4SKR.js} +2 -2
- package/dist/chunk-ZXKU4SKR.js.map +1 -0
- package/dist/differenceInBusinessDays.d.ts +7 -5
- package/dist/differenceInBusinessDays.d.ts.map +1 -1
- package/dist/differenceInBusinessDays.js +3 -3
- package/dist/differenceInCalendarDays.d.ts +35 -0
- package/dist/differenceInCalendarDays.d.ts.map +1 -0
- package/dist/differenceInCalendarDays.js +10 -0
- package/dist/differenceInCalendarDays.js.map +1 -0
- package/dist/differenceInCalendarMonths.d.ts +27 -0
- package/dist/differenceInCalendarMonths.d.ts.map +1 -0
- package/dist/differenceInCalendarMonths.js +10 -0
- package/dist/differenceInCalendarMonths.js.map +1 -0
- package/dist/differenceInCalendarQuarters.d.ts +26 -0
- package/dist/differenceInCalendarQuarters.d.ts.map +1 -0
- package/dist/differenceInCalendarQuarters.js +11 -0
- package/dist/differenceInCalendarQuarters.js.map +1 -0
- package/dist/differenceInCalendarWeeks.d.ts +29 -0
- package/dist/differenceInCalendarWeeks.d.ts.map +1 -0
- package/dist/differenceInCalendarWeeks.js +11 -0
- package/dist/differenceInCalendarWeeks.js.map +1 -0
- package/dist/differenceInCalendarYears.d.ts +27 -0
- package/dist/differenceInCalendarYears.d.ts.map +1 -0
- package/dist/differenceInCalendarYears.js +10 -0
- package/dist/differenceInCalendarYears.js.map +1 -0
- package/dist/differenceInDays.js +2 -2
- package/dist/differenceInHours.js +2 -2
- package/dist/differenceInMicroseconds.js +2 -2
- package/dist/differenceInMilliseconds.js +2 -2
- package/dist/differenceInMinutes.js +2 -2
- package/dist/differenceInMonths.js +2 -2
- package/dist/differenceInNanoseconds.js +2 -2
- package/dist/differenceInQuarters.js +3 -3
- package/dist/differenceInSeconds.js +2 -2
- package/dist/differenceInWeeks.js +2 -2
- package/dist/differenceInYears.js +2 -2
- package/dist/eachDayOfInterval.d.ts +12 -12
- package/dist/eachDayOfInterval.js +3 -3
- package/dist/eachHourOfInterval.d.ts +14 -14
- package/dist/eachHourOfInterval.js +2 -2
- package/dist/eachMinuteOfInterval.d.ts +13 -13
- package/dist/eachMinuteOfInterval.js +2 -2
- package/dist/eachMonthOfInterval.d.ts +12 -12
- package/dist/eachMonthOfInterval.js +2 -2
- package/dist/eachQuarterOfInterval.d.ts +2 -2
- package/dist/eachQuarterOfInterval.js +2 -2
- package/dist/eachWeekOfInterval.d.ts +21 -19
- package/dist/eachWeekOfInterval.d.ts.map +1 -1
- package/dist/eachWeekOfInterval.js +3 -2
- package/dist/eachYearOfInterval.d.ts +9 -9
- package/dist/eachYearOfInterval.js +2 -2
- package/dist/endOfDay.d.ts +1 -1
- package/dist/endOfDay.js +3 -3
- package/dist/endOfMonth.d.ts +1 -1
- package/dist/endOfMonth.js +3 -3
- package/dist/endOfQuarter.d.ts +2 -2
- package/dist/endOfQuarter.js +4 -4
- package/dist/endOfWeek.d.ts +18 -8
- package/dist/endOfWeek.d.ts.map +1 -1
- package/dist/endOfWeek.js +3 -2
- package/dist/endOfYear.d.ts +1 -1
- package/dist/endOfYear.js +3 -3
- package/dist/format.d.ts.map +1 -1
- package/dist/format.js +3 -2
- package/dist/getQuarter.js +2 -2
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +169 -130
- package/dist/intlFormatDistance.js +9 -9
- package/dist/isFuture.js +3 -3
- package/dist/isPast.js +3 -3
- package/dist/isSameDay.d.ts +4 -4
- package/dist/isSameDay.js +2 -2
- package/dist/isSameHour.d.ts +4 -4
- package/dist/isSameHour.js +2 -2
- package/dist/isSameMicrosecond.d.ts +4 -4
- package/dist/isSameMicrosecond.js +2 -2
- package/dist/isSameMillisecond.d.ts +4 -4
- package/dist/isSameMillisecond.js +2 -2
- package/dist/isSameMinute.d.ts +4 -4
- package/dist/isSameMinute.js +2 -2
- package/dist/isSameMonth.d.ts +4 -4
- package/dist/isSameMonth.js +2 -2
- package/dist/isSameNanosecond.d.ts +4 -4
- package/dist/isSameNanosecond.js +2 -2
- package/dist/isSameQuarter.d.ts +2 -2
- package/dist/isSameQuarter.js +2 -2
- package/dist/isSameSecond.d.ts +4 -4
- package/dist/isSameSecond.js +2 -2
- package/dist/isSameWeek.d.ts +22 -13
- package/dist/isSameWeek.d.ts.map +1 -1
- package/dist/isSameWeek.js +3 -2
- package/dist/isSameYear.d.ts +4 -4
- package/dist/isSameYear.js +2 -2
- package/dist/isWeekend.js +3 -3
- package/dist/isWithinInterval.d.ts +52 -17
- package/dist/isWithinInterval.d.ts.map +1 -1
- package/dist/isWithinInterval.js +4 -3
- package/dist/nextDay.d.ts +33 -0
- package/dist/nextDay.d.ts.map +1 -0
- package/dist/nextDay.js +10 -0
- package/dist/nextDay.js.map +1 -0
- package/dist/parse.d.ts +57 -0
- package/dist/parse.d.ts.map +1 -0
- package/dist/parse.js +9 -0
- package/dist/parse.js.map +1 -0
- package/dist/previousDay.d.ts +26 -0
- package/dist/previousDay.d.ts.map +1 -0
- package/dist/previousDay.js +10 -0
- package/dist/previousDay.js.map +1 -0
- package/dist/roundToNearestHour.js +2 -2
- package/dist/roundToNearestMinute.js +2 -2
- package/dist/roundToNearestSecond.js +2 -2
- package/dist/shared/businessDays.d.ts +15 -0
- package/dist/shared/businessDays.d.ts.map +1 -1
- package/dist/shared/businessDays.js +8 -4
- package/dist/shared/calendarDates.d.ts +9 -0
- package/dist/shared/calendarDates.d.ts.map +1 -0
- package/dist/shared/calendarDates.js +9 -0
- package/dist/shared/calendarDates.js.map +1 -0
- package/dist/shared/formatTokens.d.ts +8 -0
- package/dist/shared/formatTokens.d.ts.map +1 -0
- package/dist/shared/formatTokens.js +7 -0
- package/dist/shared/formatTokens.js.map +1 -0
- package/dist/shared/normalizeTemporalInput.d.ts +2 -0
- package/dist/shared/normalizeTemporalInput.d.ts.map +1 -1
- package/dist/shared/normalizeTemporalInput.js +1 -1
- package/dist/shared/normalizeWithPlainDate.js +2 -2
- package/dist/shared/nowZoned.js +2 -2
- package/dist/shared/week.d.ts +26 -0
- package/dist/shared/week.d.ts.map +1 -0
- package/dist/shared/week.js +9 -0
- package/dist/shared/week.js.map +1 -0
- package/dist/startOfDay.d.ts +1 -1
- package/dist/startOfDay.js +3 -3
- package/dist/startOfMonth.d.ts +1 -1
- package/dist/startOfMonth.js +3 -3
- package/dist/startOfQuarter.d.ts +2 -2
- package/dist/startOfQuarter.js +4 -4
- package/dist/startOfWeek.d.ts +18 -8
- package/dist/startOfWeek.d.ts.map +1 -1
- package/dist/startOfWeek.js +3 -2
- package/dist/startOfYear.d.ts +1 -1
- package/dist/startOfYear.js +3 -3
- package/dist/subBusinessDays.d.ts +6 -4
- package/dist/subBusinessDays.d.ts.map +1 -1
- package/dist/subBusinessDays.js +4 -4
- package/dist/subDays.d.ts +1 -1
- package/dist/subDays.js +3 -3
- package/dist/subHours.d.ts +1 -1
- package/dist/subHours.js +3 -3
- package/dist/subMicroseconds.d.ts +1 -1
- package/dist/subMicroseconds.js +3 -3
- package/dist/subMilliseconds.d.ts +1 -1
- package/dist/subMilliseconds.js +3 -3
- package/dist/subMinutes.d.ts +1 -1
- package/dist/subMinutes.js +3 -3
- package/dist/subMonths.d.ts +1 -1
- package/dist/subMonths.js +3 -3
- package/dist/subNanoseconds.d.ts +1 -1
- package/dist/subNanoseconds.js +3 -3
- package/dist/subQuarters.d.ts +1 -1
- package/dist/subQuarters.js +3 -3
- package/dist/subSeconds.d.ts +1 -1
- package/dist/subSeconds.js +3 -3
- package/dist/subWeeks.d.ts +1 -1
- package/dist/subWeeks.js +3 -3
- package/dist/subYears.d.ts +1 -1
- package/dist/subYears.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-22IDWEHQ.js.map +0 -1
- package/dist/chunk-426MJGNT.js.map +0 -1
- package/dist/chunk-44EIUFJB.js.map +0 -1
- package/dist/chunk-5KVFPVBT.js.map +0 -1
- package/dist/chunk-5MB7UZCJ.js.map +0 -1
- package/dist/chunk-5ST6IOPN.js.map +0 -1
- package/dist/chunk-5WPQUOM4.js.map +0 -1
- package/dist/chunk-AA56LFMF.js.map +0 -1
- package/dist/chunk-ASIYAAQV.js.map +0 -1
- package/dist/chunk-AVPV4BA5.js.map +0 -1
- package/dist/chunk-B6VZ2AKN.js.map +0 -1
- package/dist/chunk-DCZDGS5G.js.map +0 -1
- package/dist/chunk-DXSRRBJO.js.map +0 -1
- package/dist/chunk-EBQ25TEY.js.map +0 -1
- package/dist/chunk-ETO77GIW.js.map +0 -1
- package/dist/chunk-FAVYJIRM.js.map +0 -1
- package/dist/chunk-FL33IWLY.js.map +0 -1
- package/dist/chunk-FUVG6A7U.js.map +0 -1
- package/dist/chunk-H544BC2X.js +0 -16
- package/dist/chunk-H544BC2X.js.map +0 -1
- package/dist/chunk-HQ3YMKQ5.js.map +0 -1
- package/dist/chunk-ITQ6OJAL.js +0 -26
- package/dist/chunk-ITQ6OJAL.js.map +0 -1
- package/dist/chunk-JNAWZ4RN.js +0 -13
- package/dist/chunk-JNAWZ4RN.js.map +0 -1
- package/dist/chunk-JWYRXPR4.js.map +0 -1
- package/dist/chunk-MCPKXTX7.js.map +0 -1
- package/dist/chunk-NKXMLC6T.js.map +0 -1
- package/dist/chunk-NRYKSDVP.js.map +0 -1
- package/dist/chunk-NYM3EW3M.js.map +0 -1
- package/dist/chunk-PU6PU2JM.js.map +0 -1
- package/dist/chunk-PYV7MWJJ.js.map +0 -1
- package/dist/chunk-R3PZ56AD.js.map +0 -1
- package/dist/chunk-RQ5CX67T.js.map +0 -1
- package/dist/chunk-SATEE2TL.js +0 -15
- package/dist/chunk-SATEE2TL.js.map +0 -1
- package/dist/chunk-SMMVTXL4.js +0 -22
- package/dist/chunk-SMMVTXL4.js.map +0 -1
- package/dist/chunk-SXR2SO42.js.map +0 -1
- package/dist/chunk-T775UWIV.js.map +0 -1
- package/dist/chunk-V36MCE25.js.map +0 -1
- package/dist/chunk-W27GPK6Q.js +0 -29
- package/dist/chunk-W27GPK6Q.js.map +0 -1
- package/dist/chunk-W5FFJSCD.js.map +0 -1
- package/dist/chunk-WJZHUNF5.js.map +0 -1
- package/dist/chunk-WY5I452J.js.map +0 -1
- package/dist/chunk-XTS6LZBP.js.map +0 -1
- package/dist/chunk-XZS6J4LM.js.map +0 -1
- package/dist/chunk-YHQSI4WC.js.map +0 -1
- package/dist/chunk-YR26F7OA.js.map +0 -1
- package/dist/chunk-Z7I7YCKN.js +0 -36
- package/dist/chunk-Z7I7YCKN.js.map +0 -1
- package/dist/chunk-ZO2MTD2E.js.map +0 -1
- package/dist/chunk-ZYRUL5E7.js +0 -22
- package/dist/chunk-ZYRUL5E7.js.map +0 -1
- /package/dist/{chunk-TWRJEIBO.js.map → chunk-4GEF7B7W.js.map} +0 -0
- /package/dist/{chunk-SUONQGAH.js.map → chunk-525OLFRD.js.map} +0 -0
- /package/dist/{chunk-5XJEKPO5.js.map → chunk-6QOLNYFY.js.map} +0 -0
- /package/dist/{chunk-XXB6HJ2R.js.map → chunk-BI42E23Z.js.map} +0 -0
- /package/dist/{chunk-FLVULRGY.js.map → chunk-DGUAV5XN.js.map} +0 -0
- /package/dist/{chunk-2OSJHJV5.js.map → chunk-EBOLL4LY.js.map} +0 -0
- /package/dist/{chunk-QD3ROUIT.js.map → chunk-GOJ45AG7.js.map} +0 -0
- /package/dist/{chunk-SLBDEPBP.js.map → chunk-GU3CZAIN.js.map} +0 -0
- /package/dist/{chunk-XR7Q6IP6.js.map → chunk-JA5ER27P.js.map} +0 -0
- /package/dist/{chunk-E5HJJFUI.js.map → chunk-JGPTGV5X.js.map} +0 -0
- /package/dist/{chunk-2LN57UVR.js.map → chunk-KZCSP3DU.js.map} +0 -0
- /package/dist/{chunk-35IJG3T2.js.map → chunk-LMOAA73F.js.map} +0 -0
- /package/dist/{chunk-O4YU4N6Q.js.map → chunk-NVFFQJEW.js.map} +0 -0
- /package/dist/{chunk-OYTQWJ2O.js.map → chunk-OEPVYNB6.js.map} +0 -0
- /package/dist/{chunk-5FCHKIGV.js.map → chunk-PAM6VJQM.js.map} +0 -0
- /package/dist/{chunk-2MFBXSTL.js.map → chunk-TCB3IDJM.js.map} +0 -0
- /package/dist/{chunk-DHVGDIIO.js.map → chunk-TD6MVGV2.js.map} +0 -0
- /package/dist/{chunk-MXUGDXSG.js.map → chunk-TU3LNQKW.js.map} +0 -0
- /package/dist/{chunk-NST7NM5Q.js.map → chunk-X27XGVCT.js.map} +0 -0
- /package/dist/{chunk-D3BJEYTR.js.map → chunk-XSHFR2SX.js.map} +0 -0
- /package/dist/{chunk-3IYGWL34.js.map → chunk-ZW32E6EJ.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
|
|
5
5
|
// src/addMinutes.ts
|
|
6
6
|
function addMinutes(input, minutes) {
|
|
@@ -11,4 +11,4 @@ function addMinutes(input, minutes) {
|
|
|
11
11
|
export {
|
|
12
12
|
addMinutes
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-GXSVYUCG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/addMinutes.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * Adds the specified number of minutes to a datetime.\n *\n * Instant inputs are converted to UTC. For ZonedDateTime inputs, their timezone is preserved.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @param minutes - Number of minutes to add (can be negative to subtract)\n * @returns ZonedDateTime with minutes added, in the same timezone as input\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00Z');\n * const result = addMinutes(instant, 30);\n * // 2025-01-20T12:30:00+00:00[UTC] (30 minutes later)\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (preserves timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-01-20T15:30:00-05:00[America/New_York]');\n * const result = addMinutes(zoned, 90);\n * // 2025-01-20T17:00:00-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // Negative values subtract minutes\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00Z');\n * const result = addMinutes(instant, -15);\n * // 2025-01-20T11:45:00+00:00[UTC] (15 minutes earlier)\n * ```\n */\nexport function addMinutes(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n minutes: number\n): Temporal.ZonedDateTime {\n const zonedDateTime = normalizeTemporalInput(input);\n return zonedDateTime.add({ minutes });\n}\n"],"mappings":";;;;;AAoCO,SAAS,WACd,OACA,SACwB;AACxB,QAAM,gBAAgB,uBAAuB,KAAK;AAClD,SAAO,cAAc,IAAI,EAAE,QAAQ,CAAC;AACtC;","names":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizeTemporalInput
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
|
+
import {
|
|
5
|
+
Temporal,
|
|
6
|
+
isPlainDate
|
|
7
|
+
} from "./chunk-BSVOJYJ7.js";
|
|
8
|
+
|
|
9
|
+
// src/shared/calendarDates.ts
|
|
10
|
+
function calendarDates(laterDate, earlierDate) {
|
|
11
|
+
if (isPlainDate(laterDate) !== isPlainDate(earlierDate)) {
|
|
12
|
+
throw new TypeError("PlainDate differences require two PlainDate values");
|
|
13
|
+
}
|
|
14
|
+
const later = dateOf(laterDate);
|
|
15
|
+
const earlier = dateOf(earlierDate);
|
|
16
|
+
return [later.withCalendar(earlier.calendarId), earlier];
|
|
17
|
+
}
|
|
18
|
+
function dateOf(input) {
|
|
19
|
+
const date = isPlainDate(input) ? input : normalizeTemporalInput(input).toPlainDate();
|
|
20
|
+
return Temporal.PlainDate.from(date.toString());
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
calendarDates
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=chunk-H43LMOCK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/calendarDates.ts"],"sourcesContent":["import { Temporal, isPlainDate } from './temporal';\nimport { normalizeTemporalInput } from './normalizeTemporalInput';\n\n/**\n * @internal\n * The calendar dates behind a differenceInCalendar* pair: PlainDates as given,\n * Instants by their UTC date, ZonedDateTimes by the date in their own timezone.\n * Both come back in this implementation and in the earlier date's calendar.\n */\nexport function calendarDates(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate\n): [later: Temporal.PlainDate, earlier: Temporal.PlainDate] {\n if (isPlainDate(laterDate) !== isPlainDate(earlierDate)) {\n throw new TypeError('PlainDate differences require two PlainDate values');\n }\n const later = dateOf(laterDate);\n const earlier = dateOf(earlierDate);\n return [later.withCalendar(earlier.calendarId), earlier];\n}\n\nfunction dateOf(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate\n): Temporal.PlainDate {\n const date = isPlainDate(input) ? input : normalizeTemporalInput(input).toPlainDate();\n // A canonical string brings dates from another Temporal implementation across.\n return Temporal.PlainDate.from(date.toString());\n}\n"],"mappings":";;;;;;;;;AASO,SAAS,cACd,WACA,aAC0D;AAC1D,MAAI,YAAY,SAAS,MAAM,YAAY,WAAW,GAAG;AACvD,UAAM,IAAI,UAAU,oDAAoD;AAAA,EAC1E;AACA,QAAM,QAAQ,OAAO,SAAS;AAC9B,QAAM,UAAU,OAAO,WAAW;AAClC,SAAO,CAAC,MAAM,aAAa,QAAQ,UAAU,GAAG,OAAO;AACzD;AAEA,SAAS,OACP,OACoB;AACpB,QAAM,OAAO,YAAY,KAAK,IAAI,QAAQ,uBAAuB,KAAK,EAAE,YAAY;AAEpF,SAAO,SAAS,UAAU,KAAK,KAAK,SAAS,CAAC;AAChD;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeWithPlainDate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TCB3IDJM.js";
|
|
4
4
|
import {
|
|
5
5
|
getEndOfDay
|
|
6
6
|
} from "./chunk-NMMMAMKP.js";
|
|
@@ -21,4 +21,4 @@ function endOfMonth(input, timezone) {
|
|
|
21
21
|
export {
|
|
22
22
|
endOfMonth
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
24
|
+
//# sourceMappingURL=chunk-HCORON7B.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/endOfMonth.ts"],"sourcesContent":["import { isPlainDate, Temporal } from './shared/temporal';\nimport type { Timezone } from './types';\nimport { getEndOfDay } from './shared/endOfDay';\nimport { normalizeWithPlainDate } from './shared/normalizeWithPlainDate';\n\n/**\n * Returns the last boundary of the month.\n * PlainDate inputs stay in calendar space unless a timezone is provided.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at the last day of the month at 23:59:59.999999999\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-01-15T12:00:00Z');\n * const end = endOfMonth(instant);\n * // 2025-01-31T23:59:59.999999999+00:00[UTC]\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-02-15T15:30:00-05:00[America/New_York]');\n * const end = endOfMonth(zoned);\n * // 2025-02-28T23:59:59.999999999-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (stays a date)\n * const date = Temporal.PlainDate.from('2025-02-15');\n * const end = endOfMonth(date);\n * // 2025-02-28\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate with a timezone (returns a ZonedDateTime)\n * const date = Temporal.PlainDate.from('2025-02-15');\n * const end = endOfMonth(date, 'America/New_York');\n * // 2025-02-28T23:59:59.999999999-05:00[America/New_York]\n * ```\n */\nexport function endOfMonth(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function endOfMonth(input: Temporal.PlainDate): Temporal.PlainDate;\nexport function endOfMonth(\n input: Temporal.PlainDate,\n timezone: Timezone\n): Temporal.ZonedDateTime;\nexport function endOfMonth(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n if (isPlainDate(input) && timezone === undefined) {\n return input.with({ day: input.daysInMonth });\n }\n\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n const lastDay = zonedDateTime.with({ day: zonedDateTime.daysInMonth });\n return getEndOfDay(lastDay);\n}\n"],"mappings":";;;;;;;;;;;AAoDO,SAAS,WACd,OACA,UAC6C;AAC7C,MAAI,YAAY,KAAK,KAAK,aAAa,QAAW;AAChD,WAAO,MAAM,KAAK,EAAE,KAAK,MAAM,YAAY,CAAC;AAAA,EAC9C;AAEA,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,QAAM,UAAU,cAAc,KAAK,EAAE,KAAK,cAAc,YAAY,CAAC;AACrE,SAAO,YAAY,OAAO;AAC5B;","names":[]}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// src/shared/formatTokens.ts
|
|
2
|
+
function consumeToken(formatStr, start, char) {
|
|
3
|
+
if (char === "M" && start + 1 < formatStr.length && formatStr[start + 1] === "o") {
|
|
4
|
+
return "Mo";
|
|
5
|
+
}
|
|
6
|
+
if (char === "d" && start + 1 < formatStr.length && formatStr[start + 1] === "o") {
|
|
7
|
+
return "do";
|
|
8
|
+
}
|
|
9
|
+
let end = start;
|
|
10
|
+
while (end < formatStr.length && formatStr[end] === char) {
|
|
11
|
+
end++;
|
|
12
|
+
}
|
|
13
|
+
const count = end - start;
|
|
14
|
+
const validTokens = [
|
|
15
|
+
"GGGGG",
|
|
16
|
+
"GGGG",
|
|
17
|
+
"GGG",
|
|
18
|
+
"GG",
|
|
19
|
+
"G",
|
|
20
|
+
"yyyy",
|
|
21
|
+
"yyy",
|
|
22
|
+
"yy",
|
|
23
|
+
"y",
|
|
24
|
+
"QQQQQ",
|
|
25
|
+
"QQQQ",
|
|
26
|
+
"QQQ",
|
|
27
|
+
"QQ",
|
|
28
|
+
"Q",
|
|
29
|
+
"MMMMM",
|
|
30
|
+
"MMMM",
|
|
31
|
+
"MMM",
|
|
32
|
+
"MM",
|
|
33
|
+
"M",
|
|
34
|
+
"dd",
|
|
35
|
+
"d",
|
|
36
|
+
"EEEEEE",
|
|
37
|
+
"EEEEE",
|
|
38
|
+
"EEEE",
|
|
39
|
+
"EEE",
|
|
40
|
+
"EE",
|
|
41
|
+
"E",
|
|
42
|
+
"aaaaa",
|
|
43
|
+
"aaaa",
|
|
44
|
+
"aaa",
|
|
45
|
+
"aa",
|
|
46
|
+
"a",
|
|
47
|
+
"HH",
|
|
48
|
+
"H",
|
|
49
|
+
"hh",
|
|
50
|
+
"h",
|
|
51
|
+
"mm",
|
|
52
|
+
"m",
|
|
53
|
+
"ss",
|
|
54
|
+
"s",
|
|
55
|
+
"SSS",
|
|
56
|
+
"SS",
|
|
57
|
+
"S",
|
|
58
|
+
"XXXXX",
|
|
59
|
+
"XXXX",
|
|
60
|
+
"XXX",
|
|
61
|
+
"XX",
|
|
62
|
+
"X",
|
|
63
|
+
"xxxxx",
|
|
64
|
+
"xxxx",
|
|
65
|
+
"xxx",
|
|
66
|
+
"xx",
|
|
67
|
+
"x",
|
|
68
|
+
"zzzz",
|
|
69
|
+
"zzz",
|
|
70
|
+
"zz",
|
|
71
|
+
"z",
|
|
72
|
+
"T",
|
|
73
|
+
"t"
|
|
74
|
+
];
|
|
75
|
+
for (let len = Math.min(count, 6); len > 0; len--) {
|
|
76
|
+
const candidate = char.repeat(len);
|
|
77
|
+
if (validTokens.includes(candidate)) {
|
|
78
|
+
return candidate;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
consumeToken
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=chunk-HH2HTC44.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/formatTokens.ts"],"sourcesContent":["/**\n * @internal\n * Reads the format token that starts at `start`, or null if `char` does not\n * start one. A run of one letter longer than any token splits into several,\n * longest first. Shared by format and parse so both read a pattern the same way.\n */\nexport function consumeToken(formatStr: string, start: number, char: string): string | null {\n // Special case for 'Mo' and 'do' - these end with 'o'\n if (char === 'M' && start + 1 < formatStr.length && formatStr[start + 1] === 'o') {\n return 'Mo';\n }\n if (char === 'd' && start + 1 < formatStr.length && formatStr[start + 1] === 'o') {\n return 'do';\n }\n\n // Count how many consecutive identical characters\n let end = start;\n while (end < formatStr.length && formatStr[end] === char) {\n end++;\n }\n const count = end - start;\n\n // Check if this is a valid token pattern\n const validTokens = [\n 'GGGGG',\n 'GGGG',\n 'GGG',\n 'GG',\n 'G',\n 'yyyy',\n 'yyy',\n 'yy',\n 'y',\n 'QQQQQ',\n 'QQQQ',\n 'QQQ',\n 'QQ',\n 'Q',\n 'MMMMM',\n 'MMMM',\n 'MMM',\n 'MM',\n 'M',\n 'dd',\n 'd',\n 'EEEEEE',\n 'EEEEE',\n 'EEEE',\n 'EEE',\n 'EE',\n 'E',\n 'aaaaa',\n 'aaaa',\n 'aaa',\n 'aa',\n 'a',\n 'HH',\n 'H',\n 'hh',\n 'h',\n 'mm',\n 'm',\n 'ss',\n 's',\n 'SSS',\n 'SS',\n 'S',\n 'XXXXX',\n 'XXXX',\n 'XXX',\n 'XX',\n 'X',\n 'xxxxx',\n 'xxxx',\n 'xxx',\n 'xx',\n 'x',\n 'zzzz',\n 'zzz',\n 'zz',\n 'z',\n 'T',\n 't'\n ];\n\n // Try to match from longest to shortest\n for (let len = Math.min(count, 6); len > 0; len--) {\n const candidate = char.repeat(len);\n if (validTokens.includes(candidate)) {\n return candidate;\n }\n }\n\n return null;\n}\n"],"mappings":";AAMO,SAAS,aAAa,WAAmB,OAAe,MAA6B;AAE1F,MAAI,SAAS,OAAO,QAAQ,IAAI,UAAU,UAAU,UAAU,QAAQ,CAAC,MAAM,KAAK;AAChF,WAAO;AAAA,EACT;AACA,MAAI,SAAS,OAAO,QAAQ,IAAI,UAAU,UAAU,UAAU,QAAQ,CAAC,MAAM,KAAK;AAChF,WAAO;AAAA,EACT;AAGA,MAAI,MAAM;AACV,SAAO,MAAM,UAAU,UAAU,UAAU,GAAG,MAAM,MAAM;AACxD;AAAA,EACF;AACA,QAAM,QAAQ,MAAM;AAGpB,QAAM,cAAc;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAGA,WAAS,MAAM,KAAK,IAAI,OAAO,CAAC,GAAG,MAAM,GAAG,OAAO;AACjD,UAAM,YAAY,KAAK,OAAO,GAAG;AACjC,QAAI,YAAY,SAAS,SAAS,GAAG;AACnC,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
6
|
} from "./chunk-BSVOJYJ7.js";
|
|
@@ -16,4 +16,4 @@ function addYears(input, years) {
|
|
|
16
16
|
export {
|
|
17
17
|
addYears
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
19
|
+
//# sourceMappingURL=chunk-HRCTWTP3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/addYears.ts"],"sourcesContent":["import { type Temporal, isPlainDate } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * Adds the specified number of years to a datetime or date.\n *\n * Properly handles leap years and calendar edge cases through Temporal API.\n * Instant inputs are converted to UTC. For ZonedDateTime inputs, their timezone is preserved.\n *\n * PlainDate inputs stay in calendar space, preserving their calendar without a timezone.\n *\n * @param input - A Temporal.Instant (UTC), Temporal.ZonedDateTime, or Temporal.PlainDate\n * @param years - Number of years to add (can be negative to subtract)\n * @returns PlainDate for a date input; otherwise ZonedDateTime with years added\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00Z');\n * const result = addYears(instant, 2);\n * // 2027-01-20T12:00:00+00:00[UTC] (2 years later)\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (preserves timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-01-20T15:30:00-05:00[America/New_York]');\n * const result = addYears(zoned, 1);\n * // 2026-01-20T15:30:00-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // Leap year handling\n * const instant = Temporal.Instant.from('2024-02-29T12:00:00Z');\n * const result = addYears(instant, 1);\n * // 2025-02-28T12:00:00+00:00[UTC] (Feb 29 → Feb 28)\n * ```\n */\nexport function addYears(input: Temporal.PlainDate, years: number): Temporal.PlainDate;\nexport function addYears(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n years: number\n): Temporal.ZonedDateTime;\nexport function addYears(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n years: number\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n if (isPlainDate(input)) {\n return input.add({ years });\n }\n return normalizeTemporalInput(input).add({ years });\n}\n"],"mappings":";;;;;;;;AA4CO,SAAS,SACd,OACA,OAC6C;AAC7C,MAAI,YAAY,KAAK,GAAG;AACtB,WAAO,MAAM,IAAI,EAAE,MAAM,CAAC;AAAA,EAC5B;AACA,SAAO,uBAAuB,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC;AACpD;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
|
|
5
5
|
// src/isSameMonth.ts
|
|
6
6
|
function isSameMonth(date1, date2) {
|
|
@@ -12,4 +12,4 @@ function isSameMonth(date1, date2) {
|
|
|
12
12
|
export {
|
|
13
13
|
isSameMonth
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-HYSGJJUR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isSameMonth.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * Returns true if both datetimes fall in the same calendar month and year.\n * Compares the year and month fields directly.\n *\n * Instant inputs are converted to UTC. For ZonedDateTime inputs, their\n * timezone is preserved. Convert to a common timezone before calling if\n * you need to compare from a specific perspective.\n *\n * @param date1 - First datetime (Instant or ZonedDateTime)\n * @param date2 - Second datetime (Instant or ZonedDateTime)\n * @returns true if both dates are in the same calendar month, false otherwise\n *\n * @example\n * ```ts\n * // Same timezone, same month\n * const start = Temporal.ZonedDateTime.from('2025-01-01T08:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-31T23:59:59+00:00[UTC]');\n *\n * isSameMonth(start, end); // true\n * ```\n *\n * @example\n * ```ts\n * // Same timezone, different months\n * const jan = Temporal.ZonedDateTime.from('2025-01-31T23:59:59+00:00[UTC]');\n * const feb = Temporal.ZonedDateTime.from('2025-02-01T00:00:00+00:00[UTC]');\n *\n * isSameMonth(jan, feb); // false\n * ```\n *\n * @example\n * ```ts\n * // Different timezones - compares their local calendar months\n * const ny = Temporal.ZonedDateTime.from('2025-01-31T23:00:00-05:00[America/New_York]');\n * const tokyo = Temporal.ZonedDateTime.from('2025-02-01T13:00:00+09:00[Asia/Tokyo]');\n *\n * // Same instant, different calendar months from each person's perspective\n * isSameMonth(ny, tokyo); // false (Jan in NY, Feb in Tokyo)\n *\n * // Convert to UTC to compare in UTC timezone\n * isSameMonth(ny.withTimeZone('UTC'), tokyo.withTimeZone('UTC')); // true (both Feb in UTC)\n *\n * // Convert to NY timezone to compare from NY perspective\n * isSameMonth(ny, tokyo.withTimeZone('America/New_York')); // true (both Jan in NY)\n * ```\n *\n * @example\n * ```ts\n * // Instant inputs are converted to UTC\n * const instant1 = Temporal.Instant.from('2025-01-01T00:00:00Z');\n * const instant2 = Temporal.Instant.from('2025-01-31T23:59:59Z');\n *\n * isSameMonth(instant1, instant2); // true (both Jan 2025 in UTC)\n * ```\n */\nexport function isSameMonth(\n date1: Temporal.Instant | Temporal.ZonedDateTime,\n date2: Temporal.Instant | Temporal.ZonedDateTime\n): boolean {\n const zoned1 = normalizeTemporalInput(date1);\n const zoned2 = normalizeTemporalInput(date2);\n\n return zoned1.year === zoned2.year && zoned1.month === zoned2.month;\n}\n"],"mappings":";;;;;AA0DO,SAAS,YACd,OACA,OACS;AACT,QAAM,SAAS,uBAAuB,KAAK;AAC3C,QAAM,SAAS,uBAAuB,KAAK;AAE3C,SAAO,OAAO,SAAS,OAAO,QAAQ,OAAO,UAAU,OAAO;AAChE;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assertDayOfWeek
|
|
3
|
+
} from "./chunk-M2XB72L5.js";
|
|
4
|
+
import {
|
|
5
|
+
normalizeTemporalInput
|
|
6
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
7
|
+
import {
|
|
8
|
+
isPlainDate
|
|
9
|
+
} from "./chunk-BSVOJYJ7.js";
|
|
10
|
+
|
|
11
|
+
// src/nextDay.ts
|
|
12
|
+
function nextDay(input, day) {
|
|
13
|
+
assertDayOfWeek(day, "day");
|
|
14
|
+
const value = isPlainDate(input) ? input : normalizeTemporalInput(input);
|
|
15
|
+
return value.add({ days: (day - value.dayOfWeek + 6) % 7 + 1 });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
nextDay
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=chunk-IDB3R3G5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/nextDay.ts"],"sourcesContent":["import { type Temporal, isPlainDate } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport { assertDayOfWeek, type DayOfWeek } from './shared/week';\n\n/**\n * Returns the next date that falls on the given day of the week, always after\n * the input: next Friday from a Friday is a week later.\n *\n * Days are numbered as Temporal numbers them: 1 = Monday … 7 = Sunday.\n * PlainDate inputs stay dates. Instant inputs are read in UTC and ZonedDateTime\n * inputs keep their timezone; both keep their wall-clock time.\n *\n * @param input - A Temporal.Instant (UTC), Temporal.ZonedDateTime, or Temporal.PlainDate\n * @param day - The day of the week to find, 1 = Monday … 7 = Sunday\n * @returns The next date on that day of the week\n *\n * @example\n * ```ts\n * const wednesday = Temporal.PlainDate.from('2025-01-22');\n *\n * nextDay(wednesday, 5).toString(); // \"2025-01-24\"\n * nextDay(wednesday, 3).toString(); // \"2025-01-29\"\n * ```\n *\n * @example\n * ```ts\n * // Keeps the wall-clock time across a DST change\n * const fridayEvening = Temporal.ZonedDateTime.from('2025-03-07T18:00:00-05:00[America/New_York]');\n *\n * nextDay(fridayEvening, 1).toString(); // \"2025-03-10T18:00:00-04:00[America/New_York]\"\n * ```\n */\nexport function nextDay(input: Temporal.PlainDate, day: DayOfWeek): Temporal.PlainDate;\nexport function nextDay(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n day: DayOfWeek\n): Temporal.ZonedDateTime;\nexport function nextDay(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n day: DayOfWeek\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n assertDayOfWeek(day, 'day');\n const value = isPlainDate(input) ? input : normalizeTemporalInput(input);\n return value.add({ days: ((day - value.dayOfWeek + 6) % 7) + 1 });\n}\n"],"mappings":";;;;;;;;;;;AAqCO,SAAS,QACd,OACA,KAC6C;AAC7C,kBAAgB,KAAK,KAAK;AAC1B,QAAM,QAAQ,YAAY,KAAK,IAAI,QAAQ,uBAAuB,KAAK;AACvE,SAAO,MAAM,IAAI,EAAE,OAAQ,MAAM,MAAM,YAAY,KAAK,IAAK,EAAE,CAAC;AAClE;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isBefore
|
|
3
|
+
} from "./chunk-BMX7CIRD.js";
|
|
4
|
+
import {
|
|
5
|
+
isAfter
|
|
6
|
+
} from "./chunk-CDKIT7D3.js";
|
|
7
|
+
import {
|
|
8
|
+
compare
|
|
9
|
+
} from "./chunk-OMYVTYHI.js";
|
|
10
|
+
import {
|
|
11
|
+
normalizeTemporalInput
|
|
12
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
13
|
+
import {
|
|
14
|
+
isPlainDate,
|
|
15
|
+
isPlainTime
|
|
16
|
+
} from "./chunk-BSVOJYJ7.js";
|
|
17
|
+
|
|
18
|
+
// src/isWithinInterval.ts
|
|
19
|
+
function isWithinInterval(date, interval) {
|
|
20
|
+
const { start, end } = interval;
|
|
21
|
+
if ([date, start, end].some((value) => isPlainDate(value) || isPlainTime(value))) {
|
|
22
|
+
const afterStart = compare(date, start) >= 0;
|
|
23
|
+
const beforeEnd = compare(date, end) <= 0;
|
|
24
|
+
if (isPlainTime(start) && compare(start, end) > 0) return afterStart || beforeEnd;
|
|
25
|
+
return afterStart && beforeEnd;
|
|
26
|
+
}
|
|
27
|
+
const normalizedDate = normalizeTemporalInput(date);
|
|
28
|
+
const normalizedStart = normalizeTemporalInput(start);
|
|
29
|
+
const normalizedEnd = normalizeTemporalInput(end);
|
|
30
|
+
return !isBefore(normalizedDate, normalizedStart) && !isAfter(normalizedDate, normalizedEnd);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
isWithinInterval
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-IIEHQPKE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isWithinInterval.ts"],"sourcesContent":["import { type Temporal, isPlainDate, isPlainTime } from './shared/temporal';\nimport { compare, type Comparable, type Timeline } from './shared/compare';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport { isBefore } from './shared/isBefore';\nimport { isAfter } from './shared/isAfter';\n\n/**\n * Returns true if the given value is within the interval (inclusive of start and end).\n *\n * Instants and ZonedDateTimes compare by the moment they represent, not by\n * calendar date/time. PlainDates compare by date. PlainTimes compare by\n * wall-clock time, and an interval whose start is later than its end wraps\n * past midnight: 22:00 to 02:00 contains 23:30 and 01:00. A reversed timeline\n * or PlainDate interval contains nothing.\n *\n * Mixing PlainDate, PlainTime, and timeline values throws a TypeError.\n *\n * @param date - The value to check\n * @param interval - The interval with start and end values of the same kind\n * @returns true if the value is within the interval, false otherwise\n *\n * @example\n * ```ts\n * const start = Temporal.ZonedDateTime.from('2025-01-01T00:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-07T00:00:00+00:00[UTC]');\n * const date = Temporal.ZonedDateTime.from('2025-01-03T00:00:00+00:00[UTC]');\n *\n * isWithinInterval(date, { start, end }); // true\n * ```\n *\n * @example\n * ```ts\n * // Date outside the interval\n * const start = Temporal.ZonedDateTime.from('2025-01-01T00:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-07T00:00:00+00:00[UTC]');\n * const date = Temporal.ZonedDateTime.from('2025-01-10T00:00:00+00:00[UTC]');\n *\n * isWithinInterval(date, { start, end }); // false\n * ```\n *\n * @example\n * ```ts\n * // Date equal to interval start (inclusive)\n * const start = Temporal.ZonedDateTime.from('2025-01-01T00:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-07T00:00:00+00:00[UTC]');\n *\n * isWithinInterval(start, { start, end }); // true\n * ```\n *\n * @example\n * ```ts\n * // Date equal to interval end (inclusive)\n * const start = Temporal.ZonedDateTime.from('2025-01-01T00:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-07T00:00:00+00:00[UTC]');\n *\n * isWithinInterval(end, { start, end }); // true\n * ```\n *\n * @example\n * ```ts\n * // Works with Instant too\n * const start = Temporal.Instant.from('2025-01-01T00:00:00Z');\n * const end = Temporal.Instant.from('2025-01-07T00:00:00Z');\n * const date = Temporal.Instant.from('2025-01-03T00:00:00Z');\n *\n * isWithinInterval(date, { start, end }); // true\n * ```\n *\n * @example\n * ```ts\n * // Different timezones - compares by instant\n * const start = Temporal.ZonedDateTime.from('2025-01-01T00:00:00-05:00[America/New_York]');\n * const end = Temporal.ZonedDateTime.from('2025-01-07T00:00:00+09:00[Asia/Tokyo]');\n * const date = Temporal.ZonedDateTime.from('2025-01-03T12:00:00+00:00[UTC]');\n *\n * isWithinInterval(date, { start, end }); // true\n * ```\n *\n * @example\n * ```ts\n * // Dates\n * const start = Temporal.PlainDate.from('2025-07-01');\n * const end = Temporal.PlainDate.from('2025-07-15');\n *\n * isWithinInterval(Temporal.PlainDate.from('2025-07-15'), { start, end }); // true\n * ```\n *\n * @example\n * ```ts\n * // Opening hours that run past midnight\n * const start = Temporal.PlainTime.from('22:00');\n * const end = Temporal.PlainTime.from('02:00');\n *\n * isWithinInterval(Temporal.PlainTime.from('23:30'), { start, end }); // true\n * isWithinInterval(Temporal.PlainTime.from('01:00'), { start, end }); // true\n * isWithinInterval(Temporal.PlainTime.from('12:00'), { start, end }); // false\n * ```\n */\nexport function isWithinInterval(\n date: Temporal.PlainDate,\n interval: { start: Temporal.PlainDate; end: Temporal.PlainDate }\n): boolean;\nexport function isWithinInterval(\n date: Temporal.PlainTime,\n interval: { start: Temporal.PlainTime; end: Temporal.PlainTime }\n): boolean;\nexport function isWithinInterval(\n date: Temporal.Instant | Temporal.ZonedDateTime,\n interval: {\n start: Temporal.Instant | Temporal.ZonedDateTime;\n end: Temporal.Instant | Temporal.ZonedDateTime;\n }\n): boolean;\nexport function isWithinInterval(\n date: Comparable,\n interval: { start: Comparable; end: Comparable }\n): boolean {\n const { start, end } = interval;\n if ([date, start, end].some((value) => isPlainDate(value) || isPlainTime(value))) {\n const afterStart = compare(date, start) >= 0;\n const beforeEnd = compare(date, end) <= 0;\n if (isPlainTime(start) && compare(start, end) > 0) return afterStart || beforeEnd;\n return afterStart && beforeEnd;\n }\n\n const normalizedDate = normalizeTemporalInput(date as Timeline);\n const normalizedStart = normalizeTemporalInput(start as Timeline);\n const normalizedEnd = normalizeTemporalInput(end as Timeline);\n\n return !isBefore(normalizedDate, normalizedStart) && !isAfter(normalizedDate, normalizedEnd);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiHO,SAAS,iBACd,MACA,UACS;AACT,QAAM,EAAE,OAAO,IAAI,IAAI;AACvB,MAAI,CAAC,MAAM,OAAO,GAAG,EAAE,KAAK,CAAC,UAAU,YAAY,KAAK,KAAK,YAAY,KAAK,CAAC,GAAG;AAChF,UAAM,aAAa,QAAQ,MAAM,KAAK,KAAK;AAC3C,UAAM,YAAY,QAAQ,MAAM,GAAG,KAAK;AACxC,QAAI,YAAY,KAAK,KAAK,QAAQ,OAAO,GAAG,IAAI,EAAG,QAAO,cAAc;AACxE,WAAO,cAAc;AAAA,EACvB;AAEA,QAAM,iBAAiB,uBAAuB,IAAgB;AAC9D,QAAM,kBAAkB,uBAAuB,KAAiB;AAChE,QAAM,gBAAgB,uBAAuB,GAAe;AAE5D,SAAO,CAAC,SAAS,gBAAgB,eAAe,KAAK,CAAC,QAAQ,gBAAgB,aAAa;AAC7F;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addNanoseconds
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-32AWWYBF.js";
|
|
4
4
|
|
|
5
5
|
// src/subNanoseconds.ts
|
|
6
6
|
function subNanoseconds(input, nanoseconds) {
|
|
@@ -10,4 +10,4 @@ function subNanoseconds(input, nanoseconds) {
|
|
|
10
10
|
export {
|
|
11
11
|
subNanoseconds
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-IWVSM77B.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/subNanoseconds.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { addNanoseconds } from './addNanoseconds';\n\n/**\n * Subtracts the specified number of nanoseconds from a datetime.\n *\n * This is a convenience wrapper around addNanoseconds with negated value.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @param nanoseconds - Number of nanoseconds to subtract\n * @returns ZonedDateTime with nanoseconds subtracted, in the same timezone as input\n *\n * @example\n * ```ts\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00.000001Z');\n * const result = subNanoseconds(instant, 500);\n * // 2025-01-20T12:00:00.
|
|
1
|
+
{"version":3,"sources":["../src/subNanoseconds.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { addNanoseconds } from './addNanoseconds';\n\n/**\n * Subtracts the specified number of nanoseconds from a datetime.\n *\n * This is a convenience wrapper around addNanoseconds with negated value.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @param nanoseconds - Number of nanoseconds to subtract\n * @returns ZonedDateTime with nanoseconds subtracted, in the same timezone as input\n *\n * @example\n * ```ts\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00.000001Z');\n * const result = subNanoseconds(instant, 500);\n * // 2025-01-20T12:00:00.000000500+00:00[UTC] (500 nanoseconds earlier)\n * ```\n */\nexport function subNanoseconds(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n nanoseconds: number\n): Temporal.ZonedDateTime {\n return addNanoseconds(input, -nanoseconds);\n}\n"],"mappings":";;;;;AAmBO,SAAS,eACd,OACA,aACwB;AACxB,SAAO,eAAe,OAAO,CAAC,WAAW;AAC3C;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addMicroseconds
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TI6WBLCB.js";
|
|
4
4
|
|
|
5
5
|
// src/subMicroseconds.ts
|
|
6
6
|
function subMicroseconds(input, microseconds) {
|
|
@@ -10,4 +10,4 @@ function subMicroseconds(input, microseconds) {
|
|
|
10
10
|
export {
|
|
11
11
|
subMicroseconds
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-IXNGK5OF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/subMicroseconds.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { addMicroseconds } from './addMicroseconds';\n\n/**\n * Subtracts the specified number of microseconds from a datetime.\n *\n * This is a convenience wrapper around addMicroseconds with negated value.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @param microseconds - Number of microseconds to subtract\n * @returns ZonedDateTime with microseconds subtracted, in the same timezone as input\n *\n * @example\n * ```ts\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00.001Z');\n * const result = subMicroseconds(instant, 500);\n * // 2025-01-20T12:00:00.
|
|
1
|
+
{"version":3,"sources":["../src/subMicroseconds.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { addMicroseconds } from './addMicroseconds';\n\n/**\n * Subtracts the specified number of microseconds from a datetime.\n *\n * This is a convenience wrapper around addMicroseconds with negated value.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @param microseconds - Number of microseconds to subtract\n * @returns ZonedDateTime with microseconds subtracted, in the same timezone as input\n *\n * @example\n * ```ts\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00.001Z');\n * const result = subMicroseconds(instant, 500);\n * // 2025-01-20T12:00:00.000500+00:00[UTC] (500 microseconds earlier)\n * ```\n */\nexport function subMicroseconds(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n microseconds: number\n): Temporal.ZonedDateTime {\n return addMicroseconds(input, -microseconds);\n}\n"],"mappings":";;;;;AAmBO,SAAS,gBACd,OACA,cACwB;AACxB,SAAO,gBAAgB,OAAO,CAAC,YAAY;AAC7C;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
|
|
5
5
|
// src/roundToNearestSecond.ts
|
|
6
6
|
var MODE_TO_ROUNDING_MODE = {
|
|
@@ -22,4 +22,4 @@ function roundToNearestSecond(input, options) {
|
|
|
22
22
|
export {
|
|
23
23
|
roundToNearestSecond
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-JA5ER27P.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
6
|
} from "./chunk-BSVOJYJ7.js";
|
|
@@ -23,4 +23,4 @@ function differenceInDays(laterDate, earlierDate, options) {
|
|
|
23
23
|
export {
|
|
24
24
|
differenceInDays
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-JGPTGV5X.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addSeconds
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7IKCDOCT.js";
|
|
4
4
|
|
|
5
5
|
// src/subSeconds.ts
|
|
6
6
|
function subSeconds(input, seconds) {
|
|
@@ -10,4 +10,4 @@ function subSeconds(input, seconds) {
|
|
|
10
10
|
export {
|
|
11
11
|
subSeconds
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-K3L6MJJB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/subSeconds.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { addSeconds } from './addSeconds';\n\n/**\n * Subtracts the specified number of seconds from a datetime.\n *\n * This is a convenience wrapper around addSeconds with negated value.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @param seconds - Number of seconds to subtract\n * @returns ZonedDateTime with seconds subtracted, in the same timezone as input\n *\n * @example\n * ```ts\n * const instant = Temporal.Instant.from('2025-01-20T12:00:45Z');\n * const result = subSeconds(instant, 30);\n * // 2025-01-20T12:00:
|
|
1
|
+
{"version":3,"sources":["../src/subSeconds.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { addSeconds } from './addSeconds';\n\n/**\n * Subtracts the specified number of seconds from a datetime.\n *\n * This is a convenience wrapper around addSeconds with negated value.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @param seconds - Number of seconds to subtract\n * @returns ZonedDateTime with seconds subtracted, in the same timezone as input\n *\n * @example\n * ```ts\n * const instant = Temporal.Instant.from('2025-01-20T12:00:45Z');\n * const result = subSeconds(instant, 30);\n * // 2025-01-20T12:00:15+00:00[UTC] (30 seconds earlier)\n * ```\n */\nexport function subSeconds(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n seconds: number\n): Temporal.ZonedDateTime {\n return addSeconds(input, -seconds);\n}\n"],"mappings":";;;;;AAmBO,SAAS,WACd,OACA,SACwB;AACxB,SAAO,WAAW,OAAO,CAAC,OAAO;AACnC;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
|
|
5
5
|
// src/isSameMillisecond.ts
|
|
6
6
|
function isSameMillisecond(date1, date2) {
|
|
@@ -12,4 +12,4 @@ function isSameMillisecond(date1, date2) {
|
|
|
12
12
|
export {
|
|
13
13
|
isSameMillisecond
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-K6NQZIAW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isSameMillisecond.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * Returns true if both datetimes fall in the same millisecond.\n * Compares the year, month, day, hour, minute, second, and millisecond fields directly.\n * Ignores sub-millisecond precision (microseconds, nanoseconds).\n *\n * Instant inputs are converted to UTC. For ZonedDateTime inputs, their\n * timezone is preserved. Convert to a common timezone before calling if\n * you need to compare from a specific perspective.\n *\n * @param date1 - First datetime (Instant or ZonedDateTime)\n * @param date2 - Second datetime (Instant or ZonedDateTime)\n * @returns true if both dates are in the same millisecond, false otherwise\n *\n * @example\n * ```ts\n * // Same timezone, same millisecond\n * const time1 = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123+00:00[UTC]');\n * const time2 = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123999+00:00[UTC]');\n *\n * isSameMillisecond(time1, time2); // true\n * ```\n *\n * @example\n * ```ts\n * // Same timezone, different milliseconds\n * const ms123 = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123+00:00[UTC]');\n * const ms124 = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.124+00:00[UTC]');\n *\n * isSameMillisecond(ms123, ms124); // false\n * ```\n *\n * @example\n * ```ts\n * // Different timezones - compares their local milliseconds\n * const ny = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123-05:00[America/New_York]');\n * const tokyo = Temporal.ZonedDateTime.from('2025-01-21T04:30:45.123+09:00[Asia/Tokyo]');\n *\n * // Same instant, different local milliseconds from each person's perspective\n * isSameMillisecond(ny, tokyo); // false (14:30:45.123 in NY, 04:30:45.123 in Tokyo)\n *\n * // Convert to UTC to compare in UTC timezone\n * isSameMillisecond(ny.withTimeZone('UTC'), tokyo.withTimeZone('UTC')); // true (both 19:30:45.123 in UTC)\n *\n * // Convert to NY timezone to compare from NY perspective\n * isSameMillisecond(ny, tokyo.withTimeZone('America/New_York')); // true (both 14:30:45.123 in NY)\n * ```\n *\n * @example\n * ```ts\n * // Instant inputs are converted to UTC\n * const instant1 = Temporal.Instant.from('2025-01-20T14:30:45.123456Z');\n * const instant2 = Temporal.Instant.from('2025-01-20T14:30:45.123999Z');\n *\n * isSameMillisecond(instant1, instant2); // true (both 14:30:45.123 in UTC)\n * ```\n */\nexport function isSameMillisecond(\n date1: Temporal.Instant | Temporal.ZonedDateTime,\n date2: Temporal.Instant | Temporal.ZonedDateTime\n): boolean {\n const zoned1 = normalizeTemporalInput(date1);\n const zoned2 = normalizeTemporalInput(date2);\n\n return (\n zoned1.year === zoned2.year &&\n zoned1.month === zoned2.month &&\n zoned1.day === zoned2.day &&\n zoned1.hour === zoned2.hour &&\n zoned1.minute === zoned2.minute &&\n zoned1.second === zoned2.second &&\n zoned1.millisecond === zoned2.millisecond\n );\n}\n"],"mappings":";;;;;AA2DO,SAAS,kBACd,OACA,OACS;AACT,QAAM,SAAS,uBAAuB,KAAK;AAC3C,QAAM,SAAS,uBAAuB,KAAK;AAE3C,SACE,OAAO,SAAS,OAAO,QACvB,OAAO,UAAU,OAAO,SACxB,OAAO,QAAQ,OAAO,OACtB,OAAO,SAAS,OAAO,QACvB,OAAO,WAAW,OAAO,UACzB,OAAO,WAAW,OAAO,UACzB,OAAO,gBAAgB,OAAO;AAElC;","names":[]}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isWeekendDay,
|
|
3
|
-
isoDate
|
|
4
|
-
|
|
3
|
+
isoDate,
|
|
4
|
+
weekdayHolidays
|
|
5
|
+
} from "./chunk-4YCEFGZA.js";
|
|
5
6
|
import {
|
|
7
|
+
Temporal,
|
|
6
8
|
isPlainDate
|
|
7
9
|
} from "./chunk-BSVOJYJ7.js";
|
|
8
10
|
|
|
9
11
|
// src/differenceInBusinessDays.ts
|
|
10
|
-
function differenceInBusinessDays(laterDate, earlierDate) {
|
|
12
|
+
function differenceInBusinessDays(laterDate, earlierDate, holidays = []) {
|
|
11
13
|
if (isPlainDate(laterDate) !== isPlainDate(earlierDate)) {
|
|
12
14
|
throw new TypeError("PlainDate differences require two PlainDate values");
|
|
13
15
|
}
|
|
@@ -21,10 +23,14 @@ function differenceInBusinessDays(laterDate, earlierDate) {
|
|
|
21
23
|
if (!isWeekendDay(day.dayOfWeek)) count++;
|
|
22
24
|
day = day.add({ days: 1 });
|
|
23
25
|
}
|
|
26
|
+
const end = from.add({ days: span });
|
|
27
|
+
count -= weekdayHolidays(holidays).filter(
|
|
28
|
+
(date) => Temporal.PlainDate.compare(date, from) >= 0 && Temporal.PlainDate.compare(date, end) < 0
|
|
29
|
+
).length;
|
|
24
30
|
return days < 0 && count !== 0 ? -count : count;
|
|
25
31
|
}
|
|
26
32
|
|
|
27
33
|
export {
|
|
28
34
|
differenceInBusinessDays
|
|
29
35
|
};
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
36
|
+
//# sourceMappingURL=chunk-K7SY2MAX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/differenceInBusinessDays.ts"],"sourcesContent":["import { Temporal, isPlainDate } from './shared/temporal';\nimport { isWeekendDay, isoDate, weekdayHolidays } from './shared/businessDays';\n\n/**\n * Returns the number of business days (Monday–Friday) from earlierDate up to\n * laterDate: the earlier date counts, the later date does not. Dates in\n * `holidays` are not counted. Swapping the arguments negates the result.\n *\n * Only calendar dates matter; times of day are ignored. Instant inputs use\n * their UTC date and ZonedDateTime inputs use their own timezone's date.\n * Convert both to one timezone first to count from a single perspective.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param holidays - Dates that are not business days, matched by date\n * @returns Business days between the dates (negative if laterDate is earlier)\n *\n * @example\n * ```ts\n * const friday = Temporal.PlainDate.from('2025-01-24');\n * const nextFriday = Temporal.PlainDate.from('2025-01-31');\n *\n * differenceInBusinessDays(nextFriday, friday); // 5\n * differenceInBusinessDays(friday, nextFriday); // -5\n * differenceInBusinessDays(nextFriday, friday, [Temporal.PlainDate.from('2025-01-27')]); // 4\n * ```\n */\nexport function differenceInBusinessDays(\n laterDate: Temporal.PlainDate,\n earlierDate: Temporal.PlainDate,\n holidays?: readonly Temporal.PlainDate[]\n): number;\nexport function differenceInBusinessDays(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime,\n holidays?: readonly Temporal.PlainDate[]\n): number;\nexport function differenceInBusinessDays(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n holidays: readonly Temporal.PlainDate[] = []\n): number {\n if (isPlainDate(laterDate) !== isPlainDate(earlierDate)) {\n throw new TypeError('PlainDate differences require two PlainDate values');\n }\n const later = isoDate(laterDate);\n const earlier = isoDate(earlierDate);\n const days = earlier.until(later, { largestUnit: 'days' }).days;\n const [from, span] = days < 0 ? [later, -days] : [earlier, days];\n\n // Every full week holds five business days; walk the remainder.\n const fullWeeks = Math.trunc(span / 7);\n let count = fullWeeks * 5;\n for (let day = from.add({ days: fullWeeks * 7 }), i = fullWeeks * 7; i < span; i++) {\n if (!isWeekendDay(day.dayOfWeek)) count++;\n day = day.add({ days: 1 });\n }\n const end = from.add({ days: span });\n count -= weekdayHolidays(holidays).filter(\n (date) =>\n Temporal.PlainDate.compare(date, from) >= 0 && Temporal.PlainDate.compare(date, end) < 0\n ).length;\n return days < 0 && count !== 0 ? -count : count;\n}\n"],"mappings":";;;;;;;;;;;AAqCO,SAAS,yBACd,WACA,aACA,WAA0C,CAAC,GACnC;AACR,MAAI,YAAY,SAAS,MAAM,YAAY,WAAW,GAAG;AACvD,UAAM,IAAI,UAAU,oDAAoD;AAAA,EAC1E;AACA,QAAM,QAAQ,QAAQ,SAAS;AAC/B,QAAM,UAAU,QAAQ,WAAW;AACnC,QAAM,OAAO,QAAQ,MAAM,OAAO,EAAE,aAAa,OAAO,CAAC,EAAE;AAC3D,QAAM,CAAC,MAAM,IAAI,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,SAAS,IAAI;AAG/D,QAAM,YAAY,KAAK,MAAM,OAAO,CAAC;AACrC,MAAI,QAAQ,YAAY;AACxB,WAAS,MAAM,KAAK,IAAI,EAAE,MAAM,YAAY,EAAE,CAAC,GAAG,IAAI,YAAY,GAAG,IAAI,MAAM,KAAK;AAClF,QAAI,CAAC,aAAa,IAAI,SAAS,EAAG;AAClC,UAAM,IAAI,IAAI,EAAE,MAAM,EAAE,CAAC;AAAA,EAC3B;AACA,QAAM,MAAM,KAAK,IAAI,EAAE,MAAM,KAAK,CAAC;AACnC,WAAS,gBAAgB,QAAQ,EAAE;AAAA,IACjC,CAAC,SACC,SAAS,UAAU,QAAQ,MAAM,IAAI,KAAK,KAAK,SAAS,UAAU,QAAQ,MAAM,GAAG,IAAI;AAAA,EAC3F,EAAE;AACF,SAAO,OAAO,KAAK,UAAU,IAAI,CAAC,QAAQ;AAC5C;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addQuarters
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QDY2KMYX.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
6
|
} from "./chunk-BSVOJYJ7.js";
|
|
@@ -13,4 +13,4 @@ function subQuarters(input, quarters) {
|
|
|
13
13
|
export {
|
|
14
14
|
subQuarters
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-KYS54PLJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/subQuarters.ts"],"sourcesContent":["import { type Temporal, isPlainDate } from \"./shared/temporal\";\nimport { addQuarters } from \"./addQuarters\";\n\n/**\n * Subtracts the specified number of quarters (3-month blocks) from a datetime or date.\n *\n * This is a convenience wrapper around addQuarters with the count negated.\n * PlainDate inputs stay in calendar space and return a PlainDate.\n *\n * @param input - A Temporal.Instant (UTC), Temporal.ZonedDateTime, or Temporal.PlainDate\n * @param quarters - Number of quarters to subtract\n * @returns PlainDate for a date input; otherwise ZonedDateTime with the quarters subtracted\n *\n * @example\n * ```ts\n * const instant = Temporal.Instant.from('2025-07-20T12:00:00Z');\n * subQuarters(instant, 2);\n * // 2025-01-20T12:00:00+00:00[UTC] (6 months earlier)\n * ```\n *\n * @example\n * ```ts\n * subQuarters(Temporal.PlainDate.from('2025-07-20'), 1);\n * // 2025-04-20\n * ```\n */\nexport function subQuarters(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n quarters: number,\n): Temporal.ZonedDateTime;\nexport function subQuarters(input: Temporal.PlainDate, quarters: number): Temporal.PlainDate;\nexport function subQuarters(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n quarters: number,\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n // Branch so each call resolves to the matching addQuarters overload.\n return isPlainDate(input) ? addQuarters(input, -quarters) : addQuarters(input, -quarters);\n}\n"],"mappings":";;;;;;;;AA+BO,SAAS,YACd,OACA,UAC6C;AAE7C,SAAO,YAAY,KAAK,IAAI,YAAY,OAAO,CAAC,QAAQ,IAAI,YAAY,OAAO,CAAC,QAAQ;AAC1F;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
6
|
} from "./chunk-BSVOJYJ7.js";
|
|
@@ -25,4 +25,4 @@ function differenceInMonths(laterDate, earlierDate, options) {
|
|
|
25
25
|
export {
|
|
26
26
|
differenceInMonths
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
//# sourceMappingURL=chunk-KZCSP3DU.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
daysIntoWeek
|
|
3
|
+
} from "./chunk-M2XB72L5.js";
|
|
4
|
+
import {
|
|
5
|
+
calendarDates
|
|
6
|
+
} from "./chunk-H43LMOCK.js";
|
|
7
|
+
|
|
8
|
+
// src/differenceInCalendarWeeks.ts
|
|
9
|
+
function differenceInCalendarWeeks(laterDate, earlierDate, options) {
|
|
10
|
+
const [later, earlier] = calendarDates(laterDate, earlierDate);
|
|
11
|
+
const laterStart = later.subtract({ days: daysIntoWeek(later.dayOfWeek, options) });
|
|
12
|
+
const earlierStart = earlier.subtract({ days: daysIntoWeek(earlier.dayOfWeek, options) });
|
|
13
|
+
return earlierStart.until(laterStart, { largestUnit: "days" }).days / 7;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
differenceInCalendarWeeks
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=chunk-KZYWHHAQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/differenceInCalendarWeeks.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { calendarDates } from './shared/calendarDates';\nimport { daysIntoWeek, type WeekOptions } from './shared/week';\n\n/**\n * Returns the number of week boundaries crossed between two dates, ignoring the\n * day within the week. Weeks start on Monday (ISO 8601) unless `weekStartsOn`\n * says otherwise.\n *\n * PlainDate inputs are compared as given. Instant inputs use their UTC date and\n * ZonedDateTime inputs use the date in their own timezone; convert both to one\n * timezone first to count from a single point of view. Mixing a PlainDate with\n * an Instant or ZonedDateTime throws a TypeError.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - `weekStartsOn`: 1 = Monday (default) … 7 = Sunday\n * @returns Calendar weeks from earlierDate to laterDate; negative if laterDate is earlier\n *\n * @example\n * ```ts\n * const sunday = Temporal.PlainDate.from('2025-01-26');\n * const monday = Temporal.PlainDate.from('2025-01-27');\n *\n * differenceInCalendarWeeks(monday, sunday); // 1\n * differenceInCalendarWeeks(monday, sunday, { weekStartsOn: 7 }); // 0\n * ```\n */\nexport function differenceInCalendarWeeks(\n laterDate: Temporal.PlainDate,\n earlierDate: Temporal.PlainDate,\n options?: WeekOptions\n): number;\nexport function differenceInCalendarWeeks(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime,\n options?: WeekOptions\n): number;\nexport function differenceInCalendarWeeks(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n options?: WeekOptions\n): number {\n const [later, earlier] = calendarDates(laterDate, earlierDate);\n const laterStart = later.subtract({ days: daysIntoWeek(later.dayOfWeek, options) });\n const earlierStart = earlier.subtract({ days: daysIntoWeek(earlier.dayOfWeek, options) });\n return earlierStart.until(laterStart, { largestUnit: 'days' }).days / 7;\n}\n"],"mappings":";;;;;;;;AAsCO,SAAS,0BACd,WACA,aACA,SACQ;AACR,QAAM,CAAC,OAAO,OAAO,IAAI,cAAc,WAAW,WAAW;AAC7D,QAAM,aAAa,MAAM,SAAS,EAAE,MAAM,aAAa,MAAM,WAAW,OAAO,EAAE,CAAC;AAClF,QAAM,eAAe,QAAQ,SAAS,EAAE,MAAM,aAAa,QAAQ,WAAW,OAAO,EAAE,CAAC;AACxF,SAAO,aAAa,MAAM,YAAY,EAAE,aAAa,OAAO,CAAC,EAAE,OAAO;AACxE;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
6
|
} from "./chunk-BSVOJYJ7.js";
|
|
@@ -25,4 +25,4 @@ function differenceInYears(laterDate, earlierDate, options) {
|
|
|
25
25
|
export {
|
|
26
26
|
differenceInYears
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
//# sourceMappingURL=chunk-LMOAA73F.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/shared/week.ts
|
|
2
|
+
function assertDayOfWeek(day, name) {
|
|
3
|
+
if (!Number.isInteger(day) || day < 1 || day > 7) {
|
|
4
|
+
throw new RangeError(`${name} must be 1 (Monday) through 7 (Sunday), got ${day}`);
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
function daysIntoWeek(dayOfWeek, options) {
|
|
8
|
+
const weekStartsOn = options?.weekStartsOn ?? 1;
|
|
9
|
+
assertDayOfWeek(weekStartsOn, "weekStartsOn");
|
|
10
|
+
return (dayOfWeek - weekStartsOn + 7) % 7;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
assertDayOfWeek,
|
|
15
|
+
daysIntoWeek
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=chunk-M2XB72L5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/week.ts"],"sourcesContent":["/**\n * Day of the week, numbered as Temporal numbers it: 1 = Monday … 7 = Sunday.\n */\nexport type DayOfWeek = 1 | 2 | 3 | 4 | 5 | 6 | 7;\n\n/**\n * Options for functions that need to know where a week begins.\n */\nexport interface WeekOptions {\n /**\n * The first day of the week: 1 = Monday … 7 = Sunday.\n * @default 1 (Monday, as in ISO 8601)\n */\n weekStartsOn?: DayOfWeek;\n}\n\n/**\n * @internal\n * Checks a day-of-week argument. date-fns numbers Sunday 0; Temporal numbers it 7,\n * so 0 is rejected rather than silently meaning something else.\n */\nexport function assertDayOfWeek(day: number, name: string): asserts day is DayOfWeek {\n if (!Number.isInteger(day) || day < 1 || day > 7) {\n throw new RangeError(`${name} must be 1 (Monday) through 7 (Sunday), got ${day}`);\n }\n}\n\n/**\n * @internal\n * Days from the start of the week to a given day of the week (0–6).\n */\nexport function daysIntoWeek(dayOfWeek: number, options: WeekOptions | undefined): number {\n const weekStartsOn = options?.weekStartsOn ?? 1;\n assertDayOfWeek(weekStartsOn, 'weekStartsOn');\n return (dayOfWeek - weekStartsOn + 7) % 7;\n}\n"],"mappings":";AAqBO,SAAS,gBAAgB,KAAa,MAAwC;AACnF,MAAI,CAAC,OAAO,UAAU,GAAG,KAAK,MAAM,KAAK,MAAM,GAAG;AAChD,UAAM,IAAI,WAAW,GAAG,IAAI,+CAA+C,GAAG,EAAE;AAAA,EAClF;AACF;AAMO,SAAS,aAAa,WAAmB,SAA0C;AACxF,QAAM,eAAe,SAAS,gBAAgB;AAC9C,kBAAgB,cAAc,cAAc;AAC5C,UAAQ,YAAY,eAAe,KAAK;AAC1C;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addMonths
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZXKU4SKR.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
6
|
} from "./chunk-BSVOJYJ7.js";
|
|
@@ -13,4 +13,4 @@ function subMonths(input, months) {
|
|
|
13
13
|
export {
|
|
14
14
|
subMonths
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-MVGBYHG5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/subMonths.ts"],"sourcesContent":["import { type Temporal, isPlainDate } from './shared/temporal';\nimport { addMonths } from './addMonths';\n\n/**\n * Subtracts the specified number of months from a datetime or date.\n *\n * This is a convenience wrapper around addMonths with negated value.\n * Properly handles month-end dates and calendar edge cases through Temporal API.\n *\n * PlainDate inputs stay in calendar space, preserving their calendar without a timezone.\n *\n * @param input - A Temporal.Instant (UTC), Temporal.ZonedDateTime, or Temporal.PlainDate\n * @param months - Number of months to subtract\n * @returns PlainDate for a date input; otherwise ZonedDateTime with months subtracted\n *\n * @example\n * ```ts\n * const instant = Temporal.Instant.from('2025-04-20T12:00:00Z');\n * const result = subMonths(instant, 3);\n * // 2025-01-20T12:00:
|
|
1
|
+
{"version":3,"sources":["../src/subMonths.ts"],"sourcesContent":["import { type Temporal, isPlainDate } from './shared/temporal';\nimport { addMonths } from './addMonths';\n\n/**\n * Subtracts the specified number of months from a datetime or date.\n *\n * This is a convenience wrapper around addMonths with negated value.\n * Properly handles month-end dates and calendar edge cases through Temporal API.\n *\n * PlainDate inputs stay in calendar space, preserving their calendar without a timezone.\n *\n * @param input - A Temporal.Instant (UTC), Temporal.ZonedDateTime, or Temporal.PlainDate\n * @param months - Number of months to subtract\n * @returns PlainDate for a date input; otherwise ZonedDateTime with months subtracted\n *\n * @example\n * ```ts\n * const instant = Temporal.Instant.from('2025-04-20T12:00:00Z');\n * const result = subMonths(instant, 3);\n * // 2025-01-20T12:00:00+00:00[UTC] (3 months earlier)\n * ```\n */\nexport function subMonths(input: Temporal.PlainDate, months: number): Temporal.PlainDate;\nexport function subMonths(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n months: number\n): Temporal.ZonedDateTime;\nexport function subMonths(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n months: number\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n // Narrow each branch to the matching addMonths overload.\n return isPlainDate(input) ? addMonths(input, -months) : addMonths(input, -months);\n}\n"],"mappings":";;;;;;;;AA2BO,SAAS,UACd,OACA,QAC6C;AAE7C,SAAO,YAAY,KAAK,IAAI,UAAU,OAAO,CAAC,MAAM,IAAI,UAAU,OAAO,CAAC,MAAM;AAClF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeWithPlainDate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TCB3IDJM.js";
|
|
4
4
|
import {
|
|
5
5
|
getEndOfDay
|
|
6
6
|
} from "./chunk-NMMMAMKP.js";
|
|
@@ -14,4 +14,4 @@ function endOfDay(input, timezone) {
|
|
|
14
14
|
export {
|
|
15
15
|
endOfDay
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-NOWUJERX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/endOfDay.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\nimport type { Timezone } from './types';\nimport { getEndOfDay } from './shared/endOfDay';\nimport { normalizeWithPlainDate } from './shared/normalizeWithPlainDate';\n\n/**\n * Returns a ZonedDateTime representing the last nanosecond of the day.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at 23:59:59.999999999\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00Z');\n * const end = endOfDay(instant);\n * // 2025-01-20T23:59:59.999999999+00:00[UTC]\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-01-20T15:30:00-05:00[America/New_York]');\n * const end = endOfDay(zoned);\n * // 2025-01-20T23:59:59.999999999-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (requires timezone)\n * const date = Temporal.PlainDate.from('2025-01-20');\n * const end = endOfDay(date, 'America/New_York');\n * // 2025-01-20T23:59:59.999999999-05:00[America/New_York]\n * ```\n */\nexport function endOfDay(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function endOfDay(\n input: Temporal.PlainDate,\n timezone: Timezone\n): Temporal.ZonedDateTime;\nexport function endOfDay(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone\n): Temporal.ZonedDateTime {\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n return getEndOfDay(zonedDateTime);\n}\n"],"mappings":";;;;;;;;AA0CO,SAAS,SACd,OACA,UACwB;AACxB,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,SAAO,YAAY,aAAa;AAClC;","names":[]}
|