@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
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-CDKIT7D3.js";
|
|
4
4
|
import {
|
|
5
5
|
nowZoned
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4GEF7B7W.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeTemporalInput
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
10
10
|
|
|
11
11
|
// src/isFuture.ts
|
|
12
12
|
function isFuture(date) {
|
|
@@ -17,4 +17,4 @@ function isFuture(date) {
|
|
|
17
17
|
export {
|
|
18
18
|
isFuture
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-NVFFQJEW.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
|
|
5
5
|
// src/differenceInMinutes.ts
|
|
6
6
|
function differenceInMinutes(laterDate, earlierDate, options) {
|
|
@@ -13,4 +13,4 @@ function differenceInMinutes(laterDate, earlierDate, options) {
|
|
|
13
13
|
export {
|
|
14
14
|
differenceInMinutes
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-OEPVYNB6.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
|
|
5
5
|
// src/eachHourOfInterval.ts
|
|
6
6
|
function eachHourOfInterval(interval) {
|
|
@@ -29,4 +29,4 @@ function eachHourOfInterval(interval) {
|
|
|
29
29
|
export {
|
|
30
30
|
eachHourOfInterval
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=chunk-
|
|
32
|
+
//# sourceMappingURL=chunk-OF5YEVUT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eachHourOfInterval.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * Returns an array of ZonedDateTime objects for each hour within the interval.\n * Each element represents a local hour boundary (minute/second/etc. set to 0),\n * or the first valid instant after an offset transition within an hour.\n * The interval is inclusive of both start and end hours.\n *\n * For Instant inputs, UTC is used as the timezone.\n * For ZonedDateTime inputs, the timezone of the start date is preserved.\n *\n * Completely missing hours are skipped. Partial hours start at the transition,\n * and repeated hours have separate entries for each offset. Later entries\n * realign to local hour boundaries, so steps need not be 60 elapsed minutes.\n *\n * @param interval - The interval with start and end datetimes\n * @returns Array of ZonedDateTime at start of each hour in the interval\n *\n * @example\n * ```ts\n * const start = Temporal.ZonedDateTime.from('2025-01-06T10:30:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-06T14:15:00+00:00[UTC]');\n *\n * const hours = eachHourOfInterval({ start, end });\n * // [\n * // 2025-01-06T10:00:00+00:00[UTC],\n * // 2025-01-06T11:00:00+00:00[UTC],\n * // 2025-01-06T12:00:00+00:00[UTC],\n * // 2025-01-06T13:00:00+00:00[UTC],\n * // 2025-01-06T14:00:00+00:00[UTC]\n * // ]\n * ```\n *\n * @example\n * ```ts\n * // Cross-day boundary\n * const start = Temporal.ZonedDateTime.from('2025-01-06T22:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-07T02:00:00+00:00[UTC]');\n *\n * const hours = eachHourOfInterval({ start, end });\n * // [\n * // 2025-01-06T22:00:00+00:00[UTC],\n * // 2025-01-06T23:00:00+00:00[UTC],\n * // 2025-01-07T00:00:00+00:00[UTC],\n * // 2025-01-07T01:00:00+00:00[UTC],\n * // 2025-01-07T02:00:00+00:00[UTC]\n * // ]\n * ```\n */\nexport function eachHourOfInterval(interval: {\n start: Temporal.Instant | Temporal.ZonedDateTime;\n end: Temporal.Instant | Temporal.ZonedDateTime;\n}): Temporal.ZonedDateTime[] {\n const startZoned = normalizeTemporalInput(interval.start);\n const endZoned = normalizeTemporalInput(interval.end);\n if (startZoned.epochNanoseconds > endZoned.epochNanoseconds) return [];\n\n let current = startZoned.round({ smallestUnit: 'hour', roundingMode: 'floor' });\n // A repeated partial hour can begin at :30 even though rounding selects the\n // earlier :00. Include only the occurrence containing the starting instant.\n const transition = current.getTimeZoneTransition('next');\n if (transition && transition.epochNanoseconds <= startZoned.epochNanoseconds) {\n current = transition;\n }\n\n const hours: Temporal.ZonedDateTime[] = [];\n while (current.epochNanoseconds <= endZoned.epochNanoseconds) {\n hours.push(current);\n const nextLocalHour = current.toPlainDateTime()\n .round({ smallestUnit: 'hour', roundingMode: 'floor' })\n .add({ hours: 1 });\n let next = nextLocalHour.toZonedDateTime(current.timeZoneId);\n if (next.epochNanoseconds <= current.epochNanoseconds) {\n next = nextLocalHour.toZonedDateTime(current.timeZoneId, { disambiguation: 'later' });\n }\n // Offset transitions can start a partial or repeated hour before the next\n // local :00. Afterwards, compute a local boundary again to avoid drift.\n const nextTransition = current.getTimeZoneTransition('next');\n current = nextTransition && nextTransition.epochNanoseconds < next.epochNanoseconds\n ? nextTransition\n : next;\n }\n\n return hours;\n}\n"],"mappings":";;;;;AAkDO,SAAS,mBAAmB,UAGN;AAC3B,QAAM,aAAa,uBAAuB,SAAS,KAAK;AACxD,QAAM,WAAW,uBAAuB,SAAS,GAAG;AACpD,MAAI,WAAW,mBAAmB,SAAS,iBAAkB,QAAO,CAAC;AAErE,MAAI,UAAU,WAAW,MAAM,EAAE,cAAc,QAAQ,cAAc,QAAQ,CAAC;AAG9E,QAAM,aAAa,QAAQ,sBAAsB,MAAM;AACvD,MAAI,cAAc,WAAW,oBAAoB,WAAW,kBAAkB;AAC5E,cAAU;AAAA,EACZ;AAEA,QAAM,QAAkC,CAAC;AACzC,SAAO,QAAQ,oBAAoB,SAAS,kBAAkB;AAC5D,UAAM,KAAK,OAAO;AAClB,UAAM,gBAAgB,QAAQ,gBAAgB,EAC3C,MAAM,EAAE,cAAc,QAAQ,cAAc,QAAQ,CAAC,EACrD,IAAI,EAAE,OAAO,EAAE,CAAC;AACnB,QAAI,OAAO,cAAc,gBAAgB,QAAQ,UAAU;AAC3D,QAAI,KAAK,oBAAoB,QAAQ,kBAAkB;AACrD,aAAO,cAAc,gBAAgB,QAAQ,YAAY,EAAE,gBAAgB,QAAQ,CAAC;AAAA,IACtF;AAGA,UAAM,iBAAiB,QAAQ,sBAAsB,MAAM;AAC3D,cAAU,kBAAkB,eAAe,mBAAmB,KAAK,mBAC/D,iBACA;AAAA,EACN;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
quarterOfMonth
|
|
3
|
+
} from "./chunk-XS2HUADA.js";
|
|
4
|
+
import {
|
|
5
|
+
calendarDates
|
|
6
|
+
} from "./chunk-H43LMOCK.js";
|
|
7
|
+
|
|
8
|
+
// src/differenceInCalendarQuarters.ts
|
|
9
|
+
function differenceInCalendarQuarters(laterDate, earlierDate) {
|
|
10
|
+
const [later, earlier] = calendarDates(laterDate, earlierDate).map(
|
|
11
|
+
(date) => date.withCalendar("iso8601")
|
|
12
|
+
);
|
|
13
|
+
return (later.year - earlier.year) * 4 + quarterOfMonth(later.month) - quarterOfMonth(earlier.month);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
differenceInCalendarQuarters
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=chunk-OMUK2MOH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/differenceInCalendarQuarters.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { calendarDates } from './shared/calendarDates';\nimport { quarterOfMonth } from './shared/quarter';\n\n/**\n * Returns the number of calendar quarters between two dates, ignoring the\n * position within the quarter. Quarters follow ISO months: Q1 is January–March.\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 * @returns Calendar quarters from earlierDate to laterDate; negative if laterDate is earlier\n *\n * @example\n * ```ts\n * const endOfQ1 = Temporal.PlainDate.from('2025-03-31');\n * const startOfQ2 = Temporal.PlainDate.from('2025-04-01');\n *\n * differenceInCalendarQuarters(startOfQ2, endOfQ1); // 1\n * differenceInQuarters(startOfQ2, endOfQ1); // 0\n * ```\n */\nexport function differenceInCalendarQuarters(\n laterDate: Temporal.PlainDate,\n earlierDate: Temporal.PlainDate\n): number;\nexport function differenceInCalendarQuarters(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime\n): number;\nexport function differenceInCalendarQuarters(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate\n): number {\n const [later, earlier] = calendarDates(laterDate, earlierDate).map((date) =>\n date.withCalendar('iso8601')\n ) as [Temporal.PlainDate, Temporal.PlainDate];\n return (\n (later.year - earlier.year) * 4 + quarterOfMonth(later.month) - quarterOfMonth(earlier.month)\n );\n}\n"],"mappings":";;;;;;;;AAkCO,SAAS,6BACd,WACA,aACQ;AACR,QAAM,CAAC,OAAO,OAAO,IAAI,cAAc,WAAW,WAAW,EAAE;AAAA,IAAI,CAAC,SAClE,KAAK,aAAa,SAAS;AAAA,EAC7B;AACA,UACG,MAAM,OAAO,QAAQ,QAAQ,IAAI,eAAe,MAAM,KAAK,IAAI,eAAe,QAAQ,KAAK;AAEhG;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
differenceInMonths
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KZCSP3DU.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
6
|
} from "./chunk-BSVOJYJ7.js";
|
|
@@ -22,4 +22,4 @@ function differenceInQuarters(laterDate, earlierDate, options) {
|
|
|
22
22
|
export {
|
|
23
23
|
differenceInQuarters
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-PAM6VJQM.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
plainDateToZonedDateTime
|
|
3
|
+
} from "./chunk-2AID4P2C.js";
|
|
4
|
+
import {
|
|
5
|
+
daysIntoWeek
|
|
6
|
+
} from "./chunk-M2XB72L5.js";
|
|
7
|
+
import {
|
|
8
|
+
normalizeTemporalInput
|
|
9
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
10
|
+
import {
|
|
11
|
+
isPlainDate
|
|
12
|
+
} from "./chunk-BSVOJYJ7.js";
|
|
13
|
+
|
|
14
|
+
// src/startOfWeek.ts
|
|
15
|
+
function startOfWeek(input, timezoneOrOptions, options) {
|
|
16
|
+
const timezone = typeof timezoneOrOptions === "string" ? timezoneOrOptions : void 0;
|
|
17
|
+
const weekOptions = typeof timezoneOrOptions === "string" ? options : timezoneOrOptions;
|
|
18
|
+
if (isPlainDate(input) && timezone === void 0) {
|
|
19
|
+
return input.subtract({ days: daysIntoWeek(input.dayOfWeek, weekOptions) });
|
|
20
|
+
}
|
|
21
|
+
const zonedDateTime = isPlainDate(input) ? plainDateToZonedDateTime(input, timezone) : normalizeTemporalInput(input);
|
|
22
|
+
return zonedDateTime.subtract({ days: daysIntoWeek(zonedDateTime.dayOfWeek, weekOptions) }).startOfDay();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
startOfWeek
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=chunk-PLPGYCQQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/startOfWeek.ts"],"sourcesContent":["import { type Temporal, isPlainDate } from './shared/temporal';\nimport type { Timezone } from './types';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport { plainDateToZonedDateTime } from './shared/plainDateToZonedDateTime';\nimport { daysIntoWeek, type WeekOptions } from './shared/week';\n\n/**\n * Returns the first boundary of the week.\n * Weeks start on Monday (ISO 8601) unless `weekStartsOn` says otherwise.\n * PlainDate inputs stay in calendar space unless a timezone is provided.\n *\n * @param input - A Temporal.Instant (UTC), Temporal.ZonedDateTime, or Temporal.PlainDate\n * @param options - `weekStartsOn`: 1 = Monday (default) … 7 = Sunday\n * @returns The first day of the week at 00:00, or that date for PlainDate input\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00Z'); // Monday\n * const start = startOfWeek(instant);\n * // 2025-01-20T00:00:00+00:00[UTC] (same day, it's already Monday)\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-01-22T15:30:00-05:00[America/New_York]'); // Wednesday\n * const start = startOfWeek(zoned);\n * // 2025-01-20T00:00:00-05:00[America/New_York] (previous Monday)\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (stays a date)\n * const date = Temporal.PlainDate.from('2025-01-22'); // Wednesday\n * const start = startOfWeek(date);\n * // 2025-01-20 (previous Monday)\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate with a timezone (returns a ZonedDateTime)\n * const date = Temporal.PlainDate.from('2025-01-22'); // Wednesday\n * const start = startOfWeek(date, 'America/New_York');\n * // 2025-01-20T00:00:00-05:00[America/New_York] (previous Monday)\n * ```\n *\n * @example\n * ```ts\n * // Weeks that start on Sunday\n * const date = Temporal.PlainDate.from('2025-01-22'); // Wednesday\n * const start = startOfWeek(date, { weekStartsOn: 7 });\n * // 2025-01-19 (previous Sunday)\n * ```\n */\nexport function startOfWeek(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n options?: WeekOptions\n): Temporal.ZonedDateTime;\nexport function startOfWeek(input: Temporal.PlainDate, options?: WeekOptions): Temporal.PlainDate;\nexport function startOfWeek(\n input: Temporal.PlainDate,\n timezone: Timezone,\n options?: WeekOptions\n): Temporal.ZonedDateTime;\nexport function startOfWeek(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezoneOrOptions?: Timezone | WeekOptions,\n options?: WeekOptions\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n const timezone = typeof timezoneOrOptions === 'string' ? timezoneOrOptions : undefined;\n const weekOptions = typeof timezoneOrOptions === 'string' ? options : timezoneOrOptions;\n\n if (isPlainDate(input) && timezone === undefined) {\n return input.subtract({ days: daysIntoWeek(input.dayOfWeek, weekOptions) });\n }\n\n const zonedDateTime = isPlainDate(input)\n ? plainDateToZonedDateTime(input, timezone!)\n : normalizeTemporalInput(input);\n\n return zonedDateTime\n .subtract({ days: daysIntoWeek(zonedDateTime.dayOfWeek, weekOptions) })\n .startOfDay();\n}\n"],"mappings":";;;;;;;;;;;;;;AAiEO,SAAS,YACd,OACA,mBACA,SAC6C;AAC7C,QAAM,WAAW,OAAO,sBAAsB,WAAW,oBAAoB;AAC7E,QAAM,cAAc,OAAO,sBAAsB,WAAW,UAAU;AAEtE,MAAI,YAAY,KAAK,KAAK,aAAa,QAAW;AAChD,WAAO,MAAM,SAAS,EAAE,MAAM,aAAa,MAAM,WAAW,WAAW,EAAE,CAAC;AAAA,EAC5E;AAEA,QAAM,gBAAgB,YAAY,KAAK,IACnC,yBAAyB,OAAO,QAAS,IACzC,uBAAuB,KAAK;AAEhC,SAAO,cACJ,SAAS,EAAE,MAAM,aAAa,cAAc,WAAW,WAAW,EAAE,CAAC,EACrE,WAAW;AAChB;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isInstant,
|
|
3
|
+
isZonedDateTime
|
|
4
|
+
} from "./chunk-BSVOJYJ7.js";
|
|
5
|
+
|
|
6
|
+
// src/shared/normalizeTemporalInput.ts
|
|
7
|
+
function normalizeTemporalInput(input) {
|
|
8
|
+
if (isInstant(input)) return input.toZonedDateTimeISO("UTC");
|
|
9
|
+
if (isZonedDateTime(input)) return input;
|
|
10
|
+
throw new TypeError(
|
|
11
|
+
`Expected a Temporal.Instant or Temporal.ZonedDateTime, got ${Object.prototype.toString.call(input).slice(8, -1)}`
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
normalizeTemporalInput
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=chunk-Q6QLOUXJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/normalizeTemporalInput.ts"],"sourcesContent":["import { type Temporal, isInstant, isZonedDateTime } from './temporal';\n\n/**\n * @internal\n * Normalizes input to ZonedDateTime. Converts Instant to UTC, or returns existing ZonedDateTime.\n * Anything else (a PlainDate, a string, a Date) throws, so a wrong-domain value can never\n * flow through as if it were a moment.\n * This is an internal helper - do not use directly.\n */\nexport function normalizeTemporalInput(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime {\n if (isInstant(input)) return input.toZonedDateTimeISO('UTC');\n if (isZonedDateTime(input)) return input;\n throw new TypeError(\n `Expected a Temporal.Instant or Temporal.ZonedDateTime, got ${Object.prototype.toString.call(input).slice(8, -1)}`\n );\n}\n"],"mappings":";;;;;;AASO,SAAS,uBACd,OACwB;AACxB,MAAI,UAAU,KAAK,EAAG,QAAO,MAAM,mBAAmB,KAAK;AAC3D,MAAI,gBAAgB,KAAK,EAAG,QAAO;AACnC,QAAM,IAAI;AAAA,IACR,8DAA8D,OAAO,UAAU,SAAS,KAAK,KAAK,EAAE,MAAM,GAAG,EAAE,CAAC;AAAA,EAClH;AACF;","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 addQuarters(input, quarters) {
|
|
|
16
16
|
export {
|
|
17
17
|
addQuarters
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
19
|
+
//# sourceMappingURL=chunk-QDY2KMYX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/addQuarters.ts"],"sourcesContent":["import { type Temporal, isPlainDate } from \"./shared/temporal\";\nimport { normalizeTemporalInput } from \"./shared/normalizeTemporalInput\";\n\n/**\n * Adds the specified number of quarters (3-month blocks) to a datetime or date.\n *\n * Properly handles month-end dates and calendar edge cases through Temporal API.\n * Instant inputs are converted to UTC; ZonedDateTime inputs preserve their\n * timezone. 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 add (can be negative to subtract)\n * @returns PlainDate for a date input; otherwise ZonedDateTime with the quarters added\n *\n * @example\n * ```ts\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00Z');\n * addQuarters(instant, 2);\n * // 2025-07-20T12:00:00+00:00[UTC] (6 months later)\n * ```\n *\n * @example\n * ```ts\n * // Calendar arithmetic on a date stays a date\n * addQuarters(Temporal.PlainDate.from('2025-01-31'), 1);\n * // 2025-04-30 (Jan 31 → Apr 30)\n * ```\n */\nexport function addQuarters(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n quarters: number,\n): Temporal.ZonedDateTime;\nexport function addQuarters(input: Temporal.PlainDate, quarters: number): Temporal.PlainDate;\nexport function addQuarters(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n quarters: number,\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n if (isPlainDate(input)) {\n return input.add({ months: quarters * 3 });\n }\n return normalizeTemporalInput(input).add({ months: quarters * 3 });\n}\n"],"mappings":";;;;;;;;AAiCO,SAAS,YACd,OACA,UAC6C;AAC7C,MAAI,YAAY,KAAK,GAAG;AACtB,WAAO,MAAM,IAAI,EAAE,QAAQ,WAAW,EAAE,CAAC;AAAA,EAC3C;AACA,SAAO,uBAAuB,KAAK,EAAE,IAAI,EAAE,QAAQ,WAAW,EAAE,CAAC;AACnE;","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";
|
|
@@ -23,4 +23,4 @@ function endOfYear(input, timezone) {
|
|
|
23
23
|
export {
|
|
24
24
|
endOfYear
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-QNZJR53W.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/endOfYear.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 year.\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 year at 23:59:59.999999999\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-06-15T12:00:00Z');\n * const end = endOfYear(instant);\n * // 2025-12-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-06-15T15:30:00-04:00[America/New_York]');\n * const end = endOfYear(zoned);\n * // 2025-12-31T23: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-06-15');\n * const end = endOfYear(date);\n * // 2025-12-31\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate with a timezone (returns a ZonedDateTime)\n * const date = Temporal.PlainDate.from('2025-06-15');\n * const end = endOfYear(date, 'America/New_York');\n * // 2025-12-31T23:59:59.999999999-05:00[America/New_York]\n * ```\n */\nexport function endOfYear(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function endOfYear(input: Temporal.PlainDate): Temporal.PlainDate;\nexport function endOfYear(\n input: Temporal.PlainDate,\n timezone: Timezone\n): Temporal.ZonedDateTime;\nexport function endOfYear(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n if (isPlainDate(input) && timezone === undefined) {\n const lastMonth = input.with({ month: input.monthsInYear });\n return lastMonth.with({ day: lastMonth.daysInMonth });\n }\n\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n const lastMonth = zonedDateTime.with({ month: zonedDateTime.monthsInYear });\n const lastDay = lastMonth.with({ day: lastMonth.daysInMonth });\n return getEndOfDay(lastDay);\n}\n"],"mappings":";;;;;;;;;;;AAoDO,SAAS,UACd,OACA,UAC6C;AAC7C,MAAI,YAAY,KAAK,KAAK,aAAa,QAAW;AAChD,UAAMA,aAAY,MAAM,KAAK,EAAE,OAAO,MAAM,aAAa,CAAC;AAC1D,WAAOA,WAAU,KAAK,EAAE,KAAKA,WAAU,YAAY,CAAC;AAAA,EACtD;AAEA,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,QAAM,YAAY,cAAc,KAAK,EAAE,OAAO,cAAc,aAAa,CAAC;AAC1E,QAAM,UAAU,UAAU,KAAK,EAAE,KAAK,UAAU,YAAY,CAAC;AAC7D,SAAO,YAAY,OAAO;AAC5B;","names":["lastMonth"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
|
|
5
5
|
// src/isSameHour.ts
|
|
6
6
|
function isSameHour(date1, date2) {
|
|
@@ -12,4 +12,4 @@ function isSameHour(date1, date2) {
|
|
|
12
12
|
export {
|
|
13
13
|
isSameHour
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-QZ6WXAUO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isSameHour.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 hour.\n * Compares the year, month, day, and hour 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 hour, false otherwise\n *\n * @example\n * ```ts\n * // Same timezone, same hour\n * const start = Temporal.ZonedDateTime.from('2025-01-20T14:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-20T14:59:59.999+00:00[UTC]');\n *\n * isSameHour(start, end); // true\n * ```\n *\n * @example\n * ```ts\n * // Same timezone, different hours\n * const hour14 = Temporal.ZonedDateTime.from('2025-01-20T14:59:59+00:00[UTC]');\n * const hour15 = Temporal.ZonedDateTime.from('2025-01-20T15:00:00+00:00[UTC]');\n *\n * isSameHour(hour14, hour15); // false\n * ```\n *\n * @example\n * ```ts\n * // Different timezones - compares their local hours\n * const ny = Temporal.ZonedDateTime.from('2025-01-20T14:30:00-05:00[America/New_York]');\n * const tokyo = Temporal.ZonedDateTime.from('2025-01-21T04:30:00+09:00[Asia/Tokyo]');\n *\n * // Same instant, different local hours from each person's perspective\n * isSameHour(ny, tokyo); // false (14:xx in NY, 04:xx in Tokyo)\n *\n * // Convert to UTC to compare in UTC timezone\n * isSameHour(ny.withTimeZone('UTC'), tokyo.withTimeZone('UTC')); // true (both 19:xx in UTC)\n *\n * // Convert to NY timezone to compare from NY perspective\n * isSameHour(ny, tokyo.withTimeZone('America/New_York')); // true (both 14:xx in NY)\n * ```\n *\n * @example\n * ```ts\n * // Instant inputs are converted to UTC\n * const instant1 = Temporal.Instant.from('2025-01-20T14:15:30Z');\n * const instant2 = Temporal.Instant.from('2025-01-20T14:45:50Z');\n *\n * isSameHour(instant1, instant2); // true (both 14:xx in UTC)\n * ```\n */\nexport function isSameHour(\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 );\n}\n"],"mappings":";;;;;AA0DO,SAAS,WACd,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;AAE3B;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
|
|
5
5
|
// src/isSameYear.ts
|
|
6
6
|
function isSameYear(date1, date2) {
|
|
@@ -12,4 +12,4 @@ function isSameYear(date1, date2) {
|
|
|
12
12
|
export {
|
|
13
13
|
isSameYear
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-R2DCUSBY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isSameYear.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 year.\n * Compares the year field 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 year, false otherwise\n *\n * @example\n * ```ts\n * // Same timezone, same year\n * const jan = Temporal.ZonedDateTime.from('2025-01-20T08:00:00+00:00[UTC]');\n * const dec = Temporal.ZonedDateTime.from('2025-12-31T23:59:59+00:00[UTC]');\n *\n * isSameYear(jan, dec); // true\n * ```\n *\n * @example\n * ```ts\n * // Same timezone, different years\n * const endOf2024 = Temporal.ZonedDateTime.from('2024-12-31T23:59:59+00:00[UTC]');\n * const startOf2025 = Temporal.ZonedDateTime.from('2025-01-01T00:00:00+00:00[UTC]');\n *\n * isSameYear(endOf2024, startOf2025); // false\n * ```\n *\n * @example\n * ```ts\n * // Different timezones - compares their local calendar years\n * const ny = Temporal.ZonedDateTime.from('2024-12-31T23:00:00-05:00[America/New_York]');\n * const tokyo = Temporal.ZonedDateTime.from('2025-01-01T13:00:00+09:00[Asia/Tokyo]');\n *\n * // Same instant, different calendar years from each person's perspective\n * isSameYear(ny, tokyo); // false (2024 in NY, 2025 in Tokyo)\n *\n * // Convert to UTC to compare in UTC timezone\n * isSameYear(ny.withTimeZone('UTC'), tokyo.withTimeZone('UTC')); // true (both 2025 in UTC)\n *\n * // Convert to NY timezone to compare from NY perspective\n * isSameYear(ny, tokyo.withTimeZone('America/New_York')); // true (both 2024 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-12-31T23:59:59Z');\n *\n * isSameYear(instant1, instant2); // true (both 2025 in UTC)\n * ```\n */\nexport function isSameYear(\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;\n}\n"],"mappings":";;;;;AA0DO,SAAS,WACd,OACA,OACS;AACT,QAAM,SAAS,uBAAuB,KAAK;AAC3C,QAAM,SAAS,uBAAuB,KAAK;AAE3C,SAAO,OAAO,SAAS,OAAO;AAChC;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
|
|
5
5
|
// src/isSameNanosecond.ts
|
|
6
6
|
function isSameNanosecond(date1, date2) {
|
|
@@ -12,4 +12,4 @@ function isSameNanosecond(date1, date2) {
|
|
|
12
12
|
export {
|
|
13
13
|
isSameNanosecond
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-R5XRTUWH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isSameNanosecond.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * Returns true if both datetimes represent the exact same nanosecond.\n * Compares all time fields: year, month, day, hour, minute, second, millisecond, microsecond, and nanosecond.\n * This is the most precise comparison possible, representing exact instant equality in their respective timezones.\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 exact same nanosecond, false otherwise\n *\n * @example\n * ```ts\n * // Same timezone, exact same nanosecond\n * const time1 = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123456789+00:00[UTC]');\n * const time2 = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123456789+00:00[UTC]');\n *\n * isSameNanosecond(time1, time2); // true\n * ```\n *\n * @example\n * ```ts\n * // Same timezone, different nanoseconds\n * const ns789 = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123456789+00:00[UTC]');\n * const ns790 = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123456790+00:00[UTC]');\n *\n * isSameNanosecond(ns789, ns790); // false\n * ```\n *\n * @example\n * ```ts\n * // Different timezones - compares their local nanoseconds\n * const ny = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123456789-05:00[America/New_York]');\n * const tokyo = Temporal.ZonedDateTime.from('2025-01-21T04:30:45.123456789+09:00[Asia/Tokyo]');\n *\n * // Same instant, different local nanoseconds from each person's perspective\n * isSameNanosecond(ny, tokyo); // false (14:30:45.123456789 in NY, 04:30:45.123456789 in Tokyo)\n *\n * // Convert to UTC to compare in UTC timezone\n * isSameNanosecond(ny.withTimeZone('UTC'), tokyo.withTimeZone('UTC')); // true (both 19:30:45.123456789 in UTC)\n *\n * // Convert to NY timezone to compare from NY perspective\n * isSameNanosecond(ny, tokyo.withTimeZone('America/New_York')); // true (both 14:30:45.123456789 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.123456789Z');\n * const instant2 = Temporal.Instant.from('2025-01-20T14:30:45.123456789Z');\n *\n * isSameNanosecond(instant1, instant2); // true\n * ```\n */\nexport function isSameNanosecond(\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 zoned1.microsecond === zoned2.microsecond &&\n zoned1.nanosecond === zoned2.nanosecond\n );\n}\n"],"mappings":";;;;;AA2DO,SAAS,iBACd,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,eAC9B,OAAO,gBAAgB,OAAO,eAC9B,OAAO,eAAe,OAAO;AAEjC;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
compare
|
|
3
|
+
} from "./chunk-OMYVTYHI.js";
|
|
4
|
+
|
|
5
|
+
// src/areIntervalsOverlapping.ts
|
|
6
|
+
function areIntervalsOverlapping(left, right, options) {
|
|
7
|
+
if (compare(left.start, left.end) > 0 || compare(right.start, right.end) > 0) {
|
|
8
|
+
throw new RangeError("Interval start must not be after its end");
|
|
9
|
+
}
|
|
10
|
+
const limit = options?.inclusive ? 0 : -1;
|
|
11
|
+
return compare(left.start, right.end) <= limit && compare(right.start, left.end) <= limit;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
areIntervalsOverlapping
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=chunk-R6D3Y5NV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/areIntervalsOverlapping.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { compare, type Timeline } from './shared/compare';\n\n/**\n * Returns true if two intervals share any time.\n *\n * By default an interval that ends exactly where the other starts does not\n * overlap it, so back-to-back bookings are allowed. Pass `{ inclusive: true }`\n * to count a shared endpoint, as for inclusive date ranges.\n *\n * Instants and ZonedDateTimes compare by the moment they represent. PlainDate\n * intervals compare by date. Mixing PlainDate and timeline endpoints throws a\n * TypeError; an interval whose start is after its end throws a RangeError.\n *\n * @param left - The first interval\n * @param right - The second interval\n * @param options - `inclusive`: count intervals that only touch as overlapping\n * @returns true if the intervals overlap\n *\n * @example\n * ```ts\n * const meeting = {\n * start: Temporal.ZonedDateTime.from('2025-01-20T09:00:00+01:00[Europe/Madrid]'),\n * end: Temporal.ZonedDateTime.from('2025-01-20T10:00:00+01:00[Europe/Madrid]')\n * };\n * const call = {\n * start: Temporal.Instant.from('2025-01-20T08:30:00Z'), // 09:30 in Madrid\n * end: Temporal.Instant.from('2025-01-20T09:30:00Z')\n * };\n *\n * areIntervalsOverlapping(meeting, call); // true\n * ```\n *\n * @example\n * ```ts\n * const firstStay = { start: Temporal.PlainDate.from('2025-07-01'), end: Temporal.PlainDate.from('2025-07-04') };\n * const nextStay = { start: Temporal.PlainDate.from('2025-07-04'), end: Temporal.PlainDate.from('2025-07-08') };\n *\n * areIntervalsOverlapping(firstStay, nextStay); // false\n * areIntervalsOverlapping(firstStay, nextStay, { inclusive: true }); // true\n * ```\n */\nexport function areIntervalsOverlapping(\n left: { start: Temporal.PlainDate; end: Temporal.PlainDate },\n right: { start: Temporal.PlainDate; end: Temporal.PlainDate },\n options?: { inclusive?: boolean }\n): boolean;\nexport function areIntervalsOverlapping(\n left: { start: Timeline; end: Timeline },\n right: { start: Timeline; end: Timeline },\n options?: { inclusive?: boolean }\n): boolean;\nexport function areIntervalsOverlapping(\n left: { start: Timeline | Temporal.PlainDate; end: Timeline | Temporal.PlainDate },\n right: { start: Timeline | Temporal.PlainDate; end: Timeline | Temporal.PlainDate },\n options?: { inclusive?: boolean }\n): boolean {\n if (compare(left.start, left.end) > 0 || compare(right.start, right.end) > 0) {\n throw new RangeError('Interval start must not be after its end');\n }\n const limit = options?.inclusive ? 0 : -1;\n return compare(left.start, right.end) <= limit && compare(right.start, left.end) <= limit;\n}\n"],"mappings":";;;;;AAoDO,SAAS,wBACd,MACA,OACA,SACS;AACT,MAAI,QAAQ,KAAK,OAAO,KAAK,GAAG,IAAI,KAAK,QAAQ,MAAM,OAAO,MAAM,GAAG,IAAI,GAAG;AAC5E,UAAM,IAAI,WAAW,0CAA0C;AAAA,EACjE;AACA,QAAM,QAAQ,SAAS,YAAY,IAAI;AACvC,SAAO,QAAQ,KAAK,OAAO,MAAM,GAAG,KAAK,SAAS,QAAQ,MAAM,OAAO,KAAK,GAAG,KAAK;AACtF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
|
|
5
5
|
// src/eachMinuteOfInterval.ts
|
|
6
6
|
function eachMinuteOfInterval(interval) {
|
|
@@ -23,4 +23,4 @@ function eachMinuteOfInterval(interval) {
|
|
|
23
23
|
export {
|
|
24
24
|
eachMinuteOfInterval
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-SHKSAHJO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eachMinuteOfInterval.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * Returns an array of ZonedDateTime objects for each minute within the interval.\n * Each element represents the start of the minute (seconds/etc. set to 0).\n * The interval is inclusive of both start and end minutes.\n *\n * For Instant inputs, UTC is used as the timezone.\n * For ZonedDateTime inputs, the timezone of the start date is preserved.\n *\n * Warning: Large intervals can produce very large arrays. For example, a 24-hour\n * interval produces 1,441 elements. Consider whether this is appropriate for your use case.\n *\n * @param interval - The interval with start and end datetimes\n * @returns Array of ZonedDateTime at start of each minute in the interval\n *\n * @example\n * ```ts\n * const start = Temporal.ZonedDateTime.from('2025-01-06T10:30:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-06T10:33:45+00:00[UTC]');\n *\n * const minutes = eachMinuteOfInterval({ start, end });\n * // [\n * // 2025-01-06T10:30:00+00:00[UTC],\n * // 2025-01-06T10:31:00+00:00[UTC],\n * // 2025-01-06T10:32:00+00:00[UTC],\n * // 2025-01-06T10:33:00+00:00[UTC]\n * // ]\n * ```\n *\n * @example\n * ```ts\n * // Cross-hour boundary\n * const start = Temporal.ZonedDateTime.from('2025-01-06T10:58:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-06T11:02:00+00:00[UTC]');\n *\n * const minutes = eachMinuteOfInterval({ start, end });\n * // [\n * // 2025-01-06T10:58:00+00:00[UTC],\n * // 2025-01-06T10:59:00+00:00[UTC],\n * // 2025-01-06T11:00:00+00:00[UTC],\n * // 2025-01-06T11:01:00+00:00[UTC],\n * // 2025-01-06T11:02:00+00:00[UTC]\n * // ]\n * ```\n */\nexport function eachMinuteOfInterval(interval: {\n start: Temporal.Instant | Temporal.ZonedDateTime;\n end: Temporal.Instant | Temporal.ZonedDateTime;\n}): Temporal.ZonedDateTime[] {\n const startZoned = normalizeTemporalInput(interval.start);\n const endZoned = normalizeTemporalInput(interval.end);\n if (startZoned.epochNanoseconds > endZoned.epochNanoseconds) return [];\n\n const timezone = startZoned.timeZoneId;\n\n // Get start of the starting minute\n const startMinute = startZoned.round({ smallestUnit: 'minute', roundingMode: 'floor' });\n\n // Get start of the ending minute in the same timezone\n const endInTimezone = endZoned.withTimeZone(timezone);\n const endMinute = endInTimezone.round({ smallestUnit: 'minute', roundingMode: 'floor' });\n\n const minutes: Temporal.ZonedDateTime[] = [];\n let current = startMinute;\n\n while (current.epochNanoseconds <= endMinute.epochNanoseconds) {\n minutes.push(current);\n current = current.add({ minutes: 1 });\n }\n\n return minutes;\n}\n"],"mappings":";;;;;AA+CO,SAAS,qBAAqB,UAGR;AAC3B,QAAM,aAAa,uBAAuB,SAAS,KAAK;AACxD,QAAM,WAAW,uBAAuB,SAAS,GAAG;AACpD,MAAI,WAAW,mBAAmB,SAAS,iBAAkB,QAAO,CAAC;AAErE,QAAM,WAAW,WAAW;AAG5B,QAAM,cAAc,WAAW,MAAM,EAAE,cAAc,UAAU,cAAc,QAAQ,CAAC;AAGtF,QAAM,gBAAgB,SAAS,aAAa,QAAQ;AACpD,QAAM,YAAY,cAAc,MAAM,EAAE,cAAc,UAAU,cAAc,QAAQ,CAAC;AAEvF,QAAM,UAAoC,CAAC;AAC3C,MAAI,UAAU;AAEd,SAAO,QAAQ,oBAAoB,UAAU,kBAAkB;AAC7D,YAAQ,KAAK,OAAO;AACpB,cAAU,QAAQ,IAAI,EAAE,SAAS,EAAE,CAAC;AAAA,EACtC;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addWeeks
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3X2U6I44.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
6
|
} from "./chunk-BSVOJYJ7.js";
|
|
@@ -13,4 +13,4 @@ function subWeeks(input, weeks) {
|
|
|
13
13
|
export {
|
|
14
14
|
subWeeks
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-SLH6TKGN.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/subWeeks.ts"],"sourcesContent":["import { type Temporal, isPlainDate } from './shared/temporal';\nimport { addWeeks } from './addWeeks';\n\n/**\n * Subtracts the specified number of weeks from a datetime or date.\n *\n * This is a convenience wrapper around addWeeks with negated value.\n * Properly handles DST transitions 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 weeks - Number of weeks to subtract\n * @returns PlainDate for a date input; otherwise ZonedDateTime with weeks subtracted\n *\n * @example\n * ```ts\n * const instant = Temporal.Instant.from('2025-02-03T12:00:00Z');\n * const result = subWeeks(instant, 2);\n * // 2025-01-20T12:00:
|
|
1
|
+
{"version":3,"sources":["../src/subWeeks.ts"],"sourcesContent":["import { type Temporal, isPlainDate } from './shared/temporal';\nimport { addWeeks } from './addWeeks';\n\n/**\n * Subtracts the specified number of weeks from a datetime or date.\n *\n * This is a convenience wrapper around addWeeks with negated value.\n * Properly handles DST transitions 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 weeks - Number of weeks to subtract\n * @returns PlainDate for a date input; otherwise ZonedDateTime with weeks subtracted\n *\n * @example\n * ```ts\n * const instant = Temporal.Instant.from('2025-02-03T12:00:00Z');\n * const result = subWeeks(instant, 2);\n * // 2025-01-20T12:00:00+00:00[UTC] (2 weeks earlier)\n * ```\n */\nexport function subWeeks(input: Temporal.PlainDate, weeks: number): Temporal.PlainDate;\nexport function subWeeks(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n weeks: number\n): Temporal.ZonedDateTime;\nexport function subWeeks(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n weeks: number\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n // Narrow each branch to the matching addWeeks overload.\n return isPlainDate(input) ? addWeeks(input, -weeks) : addWeeks(input, -weeks);\n}\n"],"mappings":";;;;;;;;AA2BO,SAAS,SACd,OACA,OAC6C;AAE7C,SAAO,YAAY,KAAK,IAAI,SAAS,OAAO,CAAC,KAAK,IAAI,SAAS,OAAO,CAAC,KAAK;AAC9E;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-2AID4P2C.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeTemporalInput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
7
7
|
import {
|
|
8
8
|
isPlainDate
|
|
9
9
|
} from "./chunk-BSVOJYJ7.js";
|
|
@@ -16,4 +16,4 @@ function normalizeWithPlainDate(input, timezone) {
|
|
|
16
16
|
export {
|
|
17
17
|
normalizeWithPlainDate
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
19
|
+
//# sourceMappingURL=chunk-TCB3IDJM.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-3KE6GK4R.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeTemporalInput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
7
7
|
|
|
8
8
|
// src/differenceInMilliseconds.ts
|
|
9
9
|
function differenceInMilliseconds2(laterDate, earlierDate) {
|
|
@@ -15,4 +15,4 @@ function differenceInMilliseconds2(laterDate, earlierDate) {
|
|
|
15
15
|
export {
|
|
16
16
|
differenceInMilliseconds2 as differenceInMilliseconds
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
18
|
+
//# sourceMappingURL=chunk-TD6MVGV2.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
|
|
5
5
|
// src/addMicroseconds.ts
|
|
6
6
|
function addMicroseconds(input, microseconds) {
|
|
@@ -11,4 +11,4 @@ function addMicroseconds(input, microseconds) {
|
|
|
11
11
|
export {
|
|
12
12
|
addMicroseconds
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-TI6WBLCB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/addMicroseconds.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * Adds the specified number of microseconds 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 microseconds - Number of microseconds to add (can be negative to subtract)\n * @returns ZonedDateTime with microseconds 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 = addMicroseconds(instant, 500);\n * // 2025-01-20T12:00:00.000500+00:00[UTC] (500 microseconds 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 = addMicroseconds(zoned, 1000);\n * // 2025-01-20T15:30:00.001-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // Negative values subtract microseconds\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00.001Z');\n * const result = addMicroseconds(instant, -500);\n * // 2025-01-20T12:00:00.000500+00:00[UTC] (500 microseconds earlier)\n * ```\n */\nexport function addMicroseconds(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n microseconds: number\n): Temporal.ZonedDateTime {\n const zonedDateTime = normalizeTemporalInput(input);\n return zonedDateTime.add({ microseconds });\n}\n"],"mappings":";;;;;AAoCO,SAAS,gBACd,OACA,cACwB;AACxB,QAAM,gBAAgB,uBAAuB,KAAK;AAClD,SAAO,cAAc,IAAI,EAAE,aAAa,CAAC;AAC3C;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeWithPlainDate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TCB3IDJM.js";
|
|
4
4
|
|
|
5
5
|
// src/startOfDay.ts
|
|
6
6
|
function startOfDay(input, timezone) {
|
|
@@ -11,4 +11,4 @@ function startOfDay(input, timezone) {
|
|
|
11
11
|
export {
|
|
12
12
|
startOfDay
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-TIZJRCAA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/startOfDay.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\nimport type { Timezone } from './types';\nimport { normalizeWithPlainDate } from './shared/normalizeWithPlainDate';\n\n/**\n * Returns a ZonedDateTime representing the first moment of the day (midnight).\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at 00:00:00.000000000\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00Z');\n * const start = startOfDay(instant);\n * // 2025-01-20T00:00:00+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 start = startOfDay(zoned);\n * // 2025-01-20T00:00:00-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 start = startOfDay(date, 'America/New_York');\n * // 2025-01-20T00:00:00-05:00[America/New_York]\n * ```\n */\nexport function startOfDay(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function startOfDay(\n input: Temporal.PlainDate,\n timezone: Timezone\n): Temporal.ZonedDateTime;\nexport function startOfDay(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone\n): Temporal.ZonedDateTime {\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n return zonedDateTime.startOfDay();\n}\n"],"mappings":";;;;;AAyCO,SAAS,WACd,OACA,UACwB;AACxB,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,SAAO,cAAc,WAAW;AAClC;","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 differenceInWeeks(laterDate, earlierDate, options) {
|
|
|
25
25
|
export {
|
|
26
26
|
differenceInWeeks
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
//# sourceMappingURL=chunk-TU3LNQKW.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
calendarDates
|
|
3
|
+
} from "./chunk-H43LMOCK.js";
|
|
4
|
+
|
|
5
|
+
// src/differenceInCalendarMonths.ts
|
|
6
|
+
function differenceInCalendarMonths(laterDate, earlierDate) {
|
|
7
|
+
const [later, earlier] = calendarDates(laterDate, earlierDate);
|
|
8
|
+
return earlier.with({ day: 1 }).until(later.with({ day: 1 }), { largestUnit: "months" }).months;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
differenceInCalendarMonths
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=chunk-U6VFT2A5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/differenceInCalendarMonths.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { calendarDates } from './shared/calendarDates';\n\n/**\n * Returns the number of calendar months between two dates, ignoring the day of\n * the month. Unlike differenceInMonths, which counts complete months, January 31\n * to February 1 is one calendar month.\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 * @returns Calendar months from earlierDate to laterDate; negative if laterDate is earlier\n *\n * @example\n * ```ts\n * const jan31 = Temporal.PlainDate.from('2025-01-31');\n * const feb1 = Temporal.PlainDate.from('2025-02-01');\n *\n * differenceInCalendarMonths(feb1, jan31); // 1\n * differenceInMonths(feb1, jan31); // 0\n * ```\n */\nexport function differenceInCalendarMonths(\n laterDate: Temporal.PlainDate,\n earlierDate: Temporal.PlainDate\n): number;\nexport function differenceInCalendarMonths(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime\n): number;\nexport function differenceInCalendarMonths(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate\n): number {\n const [later, earlier] = calendarDates(laterDate, earlierDate);\n return earlier.with({ day: 1 }).until(later.with({ day: 1 }), { largestUnit: 'months' }).months;\n}\n"],"mappings":";;;;;AAkCO,SAAS,2BACd,WACA,aACQ;AACR,QAAM,CAAC,OAAO,OAAO,IAAI,cAAc,WAAW,WAAW;AAC7D,SAAO,QAAQ,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,MAAM,KAAK,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,aAAa,SAAS,CAAC,EAAE;AAC3F;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
|
|
5
5
|
// src/differenceInNanoseconds.ts
|
|
6
6
|
function differenceInNanoseconds(laterDate, earlierDate) {
|
|
@@ -12,4 +12,4 @@ function differenceInNanoseconds(laterDate, earlierDate) {
|
|
|
12
12
|
export {
|
|
13
13
|
differenceInNanoseconds
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-X27XGVCT.js.map
|
|
@@ -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/previousDay.ts
|
|
12
|
+
function previousDay(input, day) {
|
|
13
|
+
assertDayOfWeek(day, "day");
|
|
14
|
+
const value = isPlainDate(input) ? input : normalizeTemporalInput(input);
|
|
15
|
+
return value.subtract({ days: (value.dayOfWeek - day + 6) % 7 + 1 });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
previousDay
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=chunk-XMEPH226.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/previousDay.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 previous date that falls on the given day of the week, always\n * before the input: previous Monday from a Monday is a week earlier.\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 previous date on that day of the week\n *\n * @example\n * ```ts\n * const wednesday = Temporal.PlainDate.from('2025-01-22');\n *\n * previousDay(wednesday, 1).toString(); // \"2025-01-20\"\n * previousDay(wednesday, 3).toString(); // \"2025-01-15\"\n * previousDay(wednesday, 7).toString(); // \"2025-01-19\"\n * ```\n */\nexport function previousDay(input: Temporal.PlainDate, day: DayOfWeek): Temporal.PlainDate;\nexport function previousDay(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n day: DayOfWeek\n): Temporal.ZonedDateTime;\nexport function previousDay(\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.subtract({ days: ((value.dayOfWeek - day + 6) % 7) + 1 });\n}\n"],"mappings":";;;;;;;;;;;AA8BO,SAAS,YACd,OACA,KAC6C;AAC7C,kBAAgB,KAAK,KAAK;AAC1B,QAAM,QAAQ,YAAY,KAAK,IAAI,QAAQ,uBAAuB,KAAK;AACvE,SAAO,MAAM,SAAS,EAAE,OAAQ,MAAM,YAAY,MAAM,KAAK,IAAK,EAAE,CAAC;AACvE;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
|
|
5
5
|
// src/differenceInSeconds.ts
|
|
6
6
|
function differenceInSeconds(laterDate, earlierDate, options) {
|
|
@@ -13,4 +13,4 @@ function differenceInSeconds(laterDate, earlierDate, options) {
|
|
|
13
13
|
export {
|
|
14
14
|
differenceInSeconds
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-XSHFR2SX.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeWithPlainDate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TCB3IDJM.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
6
|
} from "./chunk-BSVOJYJ7.js";
|
|
@@ -18,4 +18,4 @@ function startOfYear(input, timezone) {
|
|
|
18
18
|
export {
|
|
19
19
|
startOfYear
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-Y24VUXMX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/startOfYear.ts"],"sourcesContent":["import { isPlainDate, Temporal } from './shared/temporal';\nimport type { Timezone } from './types';\nimport { normalizeWithPlainDate } from './shared/normalizeWithPlainDate';\n\n/**\n * Returns the first boundary of the year.\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 January 1st at 00:00:00.000000000\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-06-15T12:00:00Z');\n * const start = startOfYear(instant);\n * // 2025-01-01T00:00:00+00:00[UTC]\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-06-15T15:30:00-04:00[America/New_York]');\n * const start = startOfYear(zoned);\n * // 2025-01-01T00:00:00-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (stays a date)\n * const date = Temporal.PlainDate.from('2025-06-15');\n * const start = startOfYear(date);\n * // 2025-01-01\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate with a timezone (returns a ZonedDateTime)\n * const date = Temporal.PlainDate.from('2025-06-15');\n * const start = startOfYear(date, 'America/New_York');\n * // 2025-01-01T00:00:00-05:00[America/New_York]\n * ```\n */\nexport function startOfYear(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function startOfYear(input: Temporal.PlainDate): Temporal.PlainDate;\nexport function startOfYear(\n input: Temporal.PlainDate,\n timezone: Timezone\n): Temporal.ZonedDateTime;\nexport function startOfYear(\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({ month: 1, day: 1 });\n }\n\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n const firstDay = zonedDateTime.with({ month: 1, day: 1 });\n return firstDay.startOfDay();\n}\n"],"mappings":";;;;;;;;AAmDO,SAAS,YACd,OACA,UAC6C;AAC7C,MAAI,YAAY,KAAK,KAAK,aAAa,QAAW;AAChD,WAAO,MAAM,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,CAAC;AAAA,EACxC;AAEA,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,QAAM,WAAW,cAAc,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,CAAC;AACxD,SAAO,SAAS,WAAW;AAC7B;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
|
|
5
5
|
// src/addHours.ts
|
|
6
6
|
function addHours(input, hours) {
|
|
@@ -11,4 +11,4 @@ function addHours(input, hours) {
|
|
|
11
11
|
export {
|
|
12
12
|
addHours
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-YKXRVQ4S.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/addHours.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * Adds the specified number of hours to a datetime.\n *\n * Properly handles DST transitions through Temporal API.\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 hours - Number of hours to add (can be negative to subtract)\n * @returns ZonedDateTime with hours 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 = addHours(instant, 3);\n * // 2025-01-20T15:00:00+00:00[UTC] (3 hours 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 = addHours(zoned, 24);\n * // 2025-01-21T15:30:00-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // Negative values subtract hours\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00Z');\n * const result = addHours(instant, -5);\n * // 2025-01-20T07:00:00+00:00[UTC] (5 hours earlier)\n * ```\n */\nexport function addHours(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n hours: number\n): Temporal.ZonedDateTime {\n const zonedDateTime = normalizeTemporalInput(input);\n return zonedDateTime.add({ hours });\n}\n"],"mappings":";;;;;AAqCO,SAAS,SACd,OACA,OACwB;AACxB,QAAM,gBAAgB,uBAAuB,KAAK;AAClD,SAAO,cAAc,IAAI,EAAE,MAAM,CAAC;AACpC;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizeWithPlainDate
|
|
3
|
+
} from "./chunk-TCB3IDJM.js";
|
|
1
4
|
import {
|
|
2
5
|
quarterStartMonth
|
|
3
6
|
} from "./chunk-XS2HUADA.js";
|
|
4
|
-
import {
|
|
5
|
-
normalizeWithPlainDate
|
|
6
|
-
} from "./chunk-2MFBXSTL.js";
|
|
7
7
|
import {
|
|
8
8
|
isPlainDate
|
|
9
9
|
} from "./chunk-BSVOJYJ7.js";
|
|
@@ -24,4 +24,4 @@ function startOfQuarter(input, timezone) {
|
|
|
24
24
|
export {
|
|
25
25
|
startOfQuarter
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=chunk-
|
|
27
|
+
//# sourceMappingURL=chunk-ZNRTNR2Q.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/startOfQuarter.ts"],"sourcesContent":["import { type Temporal, isPlainDate } from \"./shared/temporal\";\nimport type { Timezone } from \"./types\";\nimport { normalizeWithPlainDate } from \"./shared/normalizeWithPlainDate\";\nimport { quarterStartMonth } from \"./shared/quarter\";\n\n/**\n * Returns a ZonedDateTime representing the first moment of the quarter\n * (first day of the quarter's starting month at midnight).\n *\n * Quarters: Q1 = Jan–Mar, Q2 = Apr–Jun, Q3 = Jul–Sep, Q4 = Oct–Dec.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at the 1st day of the quarter at 00:00:00.000000000\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-05-15T12:00:00Z');\n * const start = startOfQuarter(instant);\n * // 2025-04-01T00:00:00+00:00[UTC]\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-08-15T15:30:00-04:00[America/New_York]');\n * const start = startOfQuarter(zoned);\n * // 2025-07-01T00:00:00-04:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // From a PlainDate in a timezone\n * const date = Temporal.PlainDate.from('2025-11-15');\n * const start = startOfQuarter(date, 'America/New_York');\n * // 2025-10-01T00:00:00-04:00[America/New_York]\n * ```\n */\nexport function startOfQuarter(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n): Temporal.ZonedDateTime;\nexport function startOfQuarter(input: Temporal.PlainDate): Temporal.PlainDate;\nexport function startOfQuarter(\n input: Temporal.PlainDate,\n timezone: Timezone,\n): Temporal.ZonedDateTime;\nexport function startOfQuarter(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone,\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n // PlainDate with no timezone stays in calendar space → first day of quarter.\n if (isPlainDate(input) && timezone === undefined) {\n return input.with({ month: quarterStartMonth(input.month), day: 1 });\n }\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n const firstDay = zonedDateTime.with({\n month: quarterStartMonth(zonedDateTime.month),\n day: 1,\n });\n return firstDay.startOfDay();\n}\n"],"mappings":";;;;;;;;;;;AA8CO,SAAS,eACd,OACA,UAC6C;AAE7C,MAAI,YAAY,KAAK,KAAK,aAAa,QAAW;AAChD,WAAO,MAAM,KAAK,EAAE,OAAO,kBAAkB,MAAM,KAAK,GAAG,KAAK,EAAE,CAAC;AAAA,EACrE;AACA,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,QAAM,WAAW,cAAc,KAAK;AAAA,IAClC,OAAO,kBAAkB,cAAc,KAAK;AAAA,IAC5C,KAAK;AAAA,EACP,CAAC;AACD,SAAO,SAAS,WAAW;AAC7B;","names":[]}
|