@gobrand/tiempo 2.8.0 → 2.9.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/addDays.js +3 -2
- package/dist/addHours.js +3 -2
- package/dist/addMicroseconds.js +3 -2
- package/dist/addMilliseconds.js +3 -2
- package/dist/addMinutes.js +3 -2
- package/dist/addMonths.js +3 -2
- package/dist/addNanoseconds.js +3 -2
- package/dist/addSeconds.js +3 -2
- package/dist/addWeeks.js +3 -2
- package/dist/addYears.js +3 -2
- package/dist/{chunk-OLEOU3XE.js → chunk-2J434XZJ.js} +5 -3
- package/dist/chunk-2J434XZJ.js.map +1 -0
- package/dist/{chunk-RW3C2677.js → chunk-3QC5YINX.js} +2 -3
- package/dist/chunk-3QC5YINX.js.map +1 -0
- package/dist/{chunk-YIT6EMBC.js → chunk-3WWRI3NR.js} +2 -3
- package/dist/chunk-3WWRI3NR.js.map +1 -0
- package/dist/{chunk-X26WIJ6L.js → chunk-46EP6MO2.js} +7 -5
- package/dist/chunk-46EP6MO2.js.map +1 -0
- package/dist/{chunk-UBY22QWM.js → chunk-4ZRJ3EHQ.js} +4 -4
- package/dist/{chunk-Q2F3HEXB.js → chunk-5HVHKQTJ.js} +2 -2
- package/dist/{chunk-BV6CLVSI.js → chunk-76RCTVBW.js} +3 -4
- package/dist/chunk-76RCTVBW.js.map +1 -0
- package/dist/{chunk-O6RIN7K3.js → chunk-7LZPFGGV.js} +5 -2
- package/dist/chunk-7LZPFGGV.js.map +1 -0
- package/dist/{chunk-5C3TQSWA.js → chunk-7NQ76UHP.js} +4 -5
- package/dist/chunk-7NQ76UHP.js.map +1 -0
- package/dist/{chunk-52NEOY34.js → chunk-7XVPK2AV.js} +2 -2
- package/dist/{chunk-PVAOUYXF.js → chunk-AAORAX74.js} +5 -5
- package/dist/chunk-AAORAX74.js.map +1 -0
- package/dist/{chunk-776JOVV6.js → chunk-ADAN2I34.js} +2 -3
- package/dist/chunk-ADAN2I34.js.map +1 -0
- package/dist/{chunk-WUAIUEH7.js → chunk-BIH6JETG.js} +5 -2
- package/dist/chunk-BIH6JETG.js.map +1 -0
- package/dist/{chunk-DT2EWLHU.js → chunk-BOGN7JC3.js} +2 -2
- package/dist/{chunk-WY63VEXE.js → chunk-C5HDCIRV.js} +5 -2
- package/dist/chunk-C5HDCIRV.js.map +1 -0
- package/dist/{chunk-WVHAYLBW.js → chunk-CP4JNCMO.js} +2 -2
- package/dist/{chunk-HFQUXON5.js → chunk-DGRZ6HO3.js} +10 -5
- package/dist/chunk-DGRZ6HO3.js.map +1 -0
- package/dist/{chunk-MMI2HHT7.js → chunk-DHJ353HR.js} +2 -2
- package/dist/{chunk-4NJMCCUM.js → chunk-DJRIH2PX.js} +2 -2
- package/dist/{chunk-YKBP3G7L.js → chunk-DN3V4IZC.js} +2 -2
- package/dist/{chunk-EYO2ZJLH.js → chunk-DOGZ2WBH.js} +2 -2
- package/dist/{chunk-QFNGYTTH.js → chunk-DTZPE5PM.js} +5 -3
- package/dist/chunk-DTZPE5PM.js.map +1 -0
- package/dist/chunk-ERCE3YCO.js +19 -0
- package/dist/chunk-ERCE3YCO.js.map +1 -0
- package/dist/{chunk-6IP245MS.js → chunk-ESTLMF2X.js} +5 -5
- package/dist/chunk-ESTLMF2X.js.map +1 -0
- package/dist/chunk-F6EWMA4K.js +13 -0
- package/dist/chunk-F6EWMA4K.js.map +1 -0
- package/dist/{chunk-7VLSSOVC.js → chunk-FEUIZJOV.js} +3 -4
- package/dist/chunk-FEUIZJOV.js.map +1 -0
- package/dist/{chunk-ZGR4NZTS.js → chunk-FIX6LQG5.js} +2 -3
- package/dist/chunk-FIX6LQG5.js.map +1 -0
- package/dist/{chunk-L4SVABDH.js → chunk-G4COVQ5S.js} +2 -2
- package/dist/{chunk-LDO6PRNJ.js → chunk-GEMTHX5S.js} +2 -2
- package/dist/{chunk-3TSFIPUR.js → chunk-GS3J5YVW.js} +2 -3
- package/dist/chunk-GS3J5YVW.js.map +1 -0
- package/dist/{chunk-DKYVFYWM.js → chunk-GVZOCS7O.js} +5 -3
- package/dist/chunk-GVZOCS7O.js.map +1 -0
- package/dist/{chunk-BIAPE4MR.js → chunk-HHPXUFZP.js} +5 -5
- package/dist/chunk-HHPXUFZP.js.map +1 -0
- package/dist/{chunk-S63QUP4W.js → chunk-I3RXBZP5.js} +2 -2
- package/dist/{chunk-ADQTZVMH.js → chunk-IPWSPA4H.js} +2 -2
- package/dist/chunk-JVB5IARQ.js +19 -0
- package/dist/chunk-JVB5IARQ.js.map +1 -0
- package/dist/{chunk-JOD4ATPE.js → chunk-JXBC2VU2.js} +2 -2
- package/dist/{chunk-V27NUBXQ.js → chunk-KKMM6HYC.js} +2 -2
- package/dist/{chunk-A5VVBYNT.js → chunk-KONRPZXK.js} +2 -2
- package/dist/{chunk-CY746ZUQ.js → chunk-L2CNUS43.js} +2 -2
- package/dist/{chunk-KZB6NERH.js → chunk-LGLV7RIC.js} +5 -2
- package/dist/chunk-LGLV7RIC.js.map +1 -0
- package/dist/{chunk-JA7SVLAF.js → chunk-LLN2SKGE.js} +4 -4
- package/dist/{chunk-JNA3AFOC.js → chunk-LYPSZYIG.js} +5 -2
- package/dist/chunk-LYPSZYIG.js.map +1 -0
- package/dist/{chunk-AE36GX4F.js → chunk-MHXSUAPE.js} +5 -2
- package/dist/chunk-MHXSUAPE.js.map +1 -0
- package/dist/{chunk-BUX26GTD.js → chunk-NKWGZIOJ.js} +5 -3
- package/dist/chunk-NKWGZIOJ.js.map +1 -0
- package/dist/{chunk-VZJGCDAG.js → chunk-NT7VDFLO.js} +5 -2
- package/dist/chunk-NT7VDFLO.js.map +1 -0
- package/dist/{chunk-7ATM7AXL.js → chunk-OGNREZPA.js} +2 -2
- package/dist/{chunk-EZ7NVTZI.js → chunk-OKPTY2ZQ.js} +7 -5
- package/dist/chunk-OKPTY2ZQ.js.map +1 -0
- package/dist/{chunk-ISHZRFVN.js → chunk-OPACRBGV.js} +2 -2
- package/dist/{chunk-J6G2I2TU.js → chunk-OZYC3TAR.js} +2 -2
- package/dist/{chunk-2XHAHSB6.js → chunk-PBT2OZJH.js} +2 -2
- package/dist/{chunk-BSV32PSO.js → chunk-PEGMMWZU.js} +6 -3
- package/dist/chunk-PEGMMWZU.js.map +1 -0
- package/dist/{chunk-BH2YB4MV.js → chunk-PWPACA4G.js} +2 -2
- package/dist/{chunk-3A6X6WV5.js → chunk-PXF3RMFH.js} +1 -2
- package/dist/chunk-PXF3RMFH.js.map +1 -0
- package/dist/{chunk-HDBH7RTY.js → chunk-QGXK664C.js} +2 -2
- package/dist/{chunk-AJEIDKVJ.js → chunk-QHQACJEU.js} +5 -2
- package/dist/chunk-QHQACJEU.js.map +1 -0
- package/dist/{chunk-CHW2EN2O.js → chunk-QPGTY5DD.js} +5 -5
- package/dist/chunk-QPGTY5DD.js.map +1 -0
- package/dist/{chunk-Y7CIJQ67.js → chunk-QRLTVRYC.js} +5 -3
- package/dist/chunk-QRLTVRYC.js.map +1 -0
- package/dist/{chunk-JHRXY36W.js → chunk-QVXCG625.js} +2 -2
- package/dist/{chunk-OQ4CWKJT.js → chunk-R7MM4BDS.js} +2 -3
- package/dist/chunk-R7MM4BDS.js.map +1 -0
- package/dist/{chunk-EEQ3REET.js → chunk-RSY3BI3P.js} +2 -2
- package/dist/{chunk-NRD5HRZV.js → chunk-RTANLM3L.js} +2 -2
- package/dist/{chunk-OABS374T.js → chunk-RUJC6FOA.js} +2 -3
- package/dist/chunk-RUJC6FOA.js.map +1 -0
- package/dist/{chunk-BQBLSXK2.js → chunk-SDCVBRJP.js} +2 -2
- package/dist/{chunk-HLGMUTFK.js → chunk-SFXJV5ZT.js} +2 -3
- package/dist/chunk-SFXJV5ZT.js.map +1 -0
- package/dist/{chunk-BPZ7BRJW.js → chunk-SHDXBQ7E.js} +5 -2
- package/dist/chunk-SHDXBQ7E.js.map +1 -0
- package/dist/{chunk-VLZ3HQQA.js → chunk-SQJTTKEI.js} +2 -2
- package/dist/{chunk-RBEW6PXR.js → chunk-SRXD4AGD.js} +5 -2
- package/dist/chunk-SRXD4AGD.js.map +1 -0
- package/dist/{chunk-4PSMM55Q.js → chunk-SWDOKPVX.js} +7 -3
- package/dist/chunk-SWDOKPVX.js.map +1 -0
- package/dist/{chunk-UJWM2BV2.js → chunk-SY2S6MMZ.js} +10 -5
- package/dist/chunk-SY2S6MMZ.js.map +1 -0
- package/dist/{chunk-ZC6KWXCW.js → chunk-SZATPYBI.js} +36 -27
- package/dist/chunk-SZATPYBI.js.map +1 -0
- package/dist/{chunk-TGKWBQ7L.js → chunk-T6ONGPRF.js} +6 -3
- package/dist/chunk-T6ONGPRF.js.map +1 -0
- package/dist/{chunk-PPB62JYV.js → chunk-TDZ3XUH7.js} +2 -2
- package/dist/{chunk-G2JUEBC5.js → chunk-TIEAKS3O.js} +5 -3
- package/dist/chunk-TIEAKS3O.js.map +1 -0
- package/dist/{chunk-DFLGGK4F.js → chunk-U7ZWIAB3.js} +6 -3
- package/dist/chunk-U7ZWIAB3.js.map +1 -0
- package/dist/chunk-VOZTLX5F.js +22 -0
- package/dist/chunk-VOZTLX5F.js.map +1 -0
- package/dist/{chunk-XW5MLXX5.js → chunk-VVV5BNLP.js} +2 -2
- package/dist/{chunk-AJ4JBKJK.js → chunk-VXOQ7IG5.js} +1 -2
- package/dist/chunk-VXOQ7IG5.js.map +1 -0
- package/dist/{chunk-HOCNCQTC.js → chunk-W6RF44CV.js} +2 -3
- package/dist/chunk-W6RF44CV.js.map +1 -0
- package/dist/{chunk-AHMKY474.js → chunk-WJOGQ6IB.js} +2 -2
- package/dist/{chunk-ZJQS7ZY7.js → chunk-WLW622M7.js} +22 -21
- package/dist/chunk-WLW622M7.js.map +1 -0
- package/dist/{chunk-ZDA7GSWU.js → chunk-WNPPRDN3.js} +3 -4
- package/dist/chunk-WNPPRDN3.js.map +1 -0
- package/dist/{chunk-4E7OGJ3F.js → chunk-XONITURH.js} +5 -2
- package/dist/chunk-XONITURH.js.map +1 -0
- package/dist/{chunk-UJW2FPI4.js → chunk-XRZUPSUB.js} +2 -2
- package/dist/chunk-Y4HT4LCB.js +19 -0
- package/dist/chunk-Y4HT4LCB.js.map +1 -0
- package/dist/{chunk-TNCLJK4Y.js → chunk-Z2LOTP6T.js} +5 -3
- package/dist/chunk-Z2LOTP6T.js.map +1 -0
- package/dist/chunk-ZBEEQUE4.js +19 -0
- package/dist/chunk-ZBEEQUE4.js.map +1 -0
- package/dist/{chunk-FSD3DDFC.js → chunk-ZFXBHDFB.js} +5 -2
- package/dist/chunk-ZFXBHDFB.js.map +1 -0
- package/dist/{chunk-U4RNUZXO.js → chunk-ZKGR3F4F.js} +2 -2
- package/dist/{chunk-YQBM63DC.js → chunk-ZSRCVDZ2.js} +9 -4
- package/dist/chunk-ZSRCVDZ2.js.map +1 -0
- package/dist/differenceInDays.d.ts +5 -3
- package/dist/differenceInDays.d.ts.map +1 -1
- package/dist/differenceInDays.js +3 -2
- package/dist/differenceInHours.d.ts +5 -3
- package/dist/differenceInHours.d.ts.map +1 -1
- package/dist/differenceInHours.js +4 -3
- package/dist/differenceInMicroseconds.d.ts +1 -1
- package/dist/differenceInMicroseconds.d.ts.map +1 -1
- package/dist/differenceInMicroseconds.js +3 -2
- package/dist/differenceInMilliseconds.d.ts +1 -1
- package/dist/differenceInMilliseconds.d.ts.map +1 -1
- package/dist/differenceInMilliseconds.js +4 -3
- package/dist/differenceInMinutes.d.ts +5 -3
- package/dist/differenceInMinutes.d.ts.map +1 -1
- package/dist/differenceInMinutes.js +4 -3
- package/dist/differenceInMonths.d.ts +8 -5
- package/dist/differenceInMonths.d.ts.map +1 -1
- package/dist/differenceInMonths.js +3 -2
- package/dist/differenceInNanoseconds.d.ts +1 -1
- package/dist/differenceInNanoseconds.d.ts.map +1 -1
- package/dist/differenceInNanoseconds.js +3 -2
- package/dist/differenceInSeconds.d.ts +5 -3
- package/dist/differenceInSeconds.d.ts.map +1 -1
- package/dist/differenceInSeconds.js +4 -3
- package/dist/differenceInWeeks.d.ts +6 -4
- package/dist/differenceInWeeks.d.ts.map +1 -1
- package/dist/differenceInWeeks.js +3 -2
- package/dist/differenceInYears.d.ts +8 -5
- package/dist/differenceInYears.d.ts.map +1 -1
- package/dist/differenceInYears.js +3 -2
- package/dist/eachDayOfInterval.d.ts +1 -1
- package/dist/eachDayOfInterval.d.ts.map +1 -1
- package/dist/eachDayOfInterval.js +3 -2
- package/dist/eachHourOfInterval.d.ts +1 -1
- package/dist/eachHourOfInterval.d.ts.map +1 -1
- package/dist/eachHourOfInterval.js +3 -2
- package/dist/eachMinuteOfInterval.d.ts +1 -1
- package/dist/eachMinuteOfInterval.d.ts.map +1 -1
- package/dist/eachMinuteOfInterval.js +3 -2
- package/dist/eachMonthOfInterval.d.ts +1 -1
- package/dist/eachMonthOfInterval.d.ts.map +1 -1
- package/dist/eachMonthOfInterval.js +3 -2
- package/dist/eachWeekOfInterval.d.ts +1 -1
- package/dist/eachWeekOfInterval.d.ts.map +1 -1
- package/dist/eachWeekOfInterval.js +3 -2
- package/dist/eachYearOfInterval.d.ts +1 -1
- package/dist/eachYearOfInterval.d.ts.map +1 -1
- package/dist/eachYearOfInterval.js +3 -2
- package/dist/endOfDay.d.ts +1 -1
- package/dist/endOfDay.d.ts.map +1 -1
- package/dist/endOfDay.js +5 -4
- package/dist/endOfMonth.d.ts +1 -1
- package/dist/endOfMonth.d.ts.map +1 -1
- package/dist/endOfMonth.js +5 -4
- package/dist/endOfWeek.d.ts +1 -1
- package/dist/endOfWeek.d.ts.map +1 -1
- package/dist/endOfWeek.js +4 -3
- package/dist/endOfYear.d.ts +1 -1
- package/dist/endOfYear.d.ts.map +1 -1
- package/dist/endOfYear.js +5 -4
- package/dist/format.d.ts +1 -1
- package/dist/format.d.ts.map +1 -1
- package/dist/format.js +3 -2
- package/dist/formatPlainDate.d.ts +1 -1
- package/dist/formatPlainDate.d.ts.map +1 -1
- package/dist/formatPlainDate.js +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +89 -88
- package/dist/intlFormatDistance.d.ts.map +1 -1
- package/dist/intlFormatDistance.js +11 -10
- package/dist/isAfter.d.ts +1 -1
- package/dist/isAfter.d.ts.map +1 -1
- package/dist/isAfter.js +4 -3
- package/dist/isBefore.d.ts +1 -1
- package/dist/isBefore.d.ts.map +1 -1
- package/dist/isBefore.js +4 -3
- package/dist/isFuture.js +5 -4
- package/dist/isPast.js +5 -4
- package/dist/isPlainDateAfter.d.ts +1 -1
- package/dist/isPlainDateAfter.d.ts.map +1 -1
- package/dist/isPlainDateAfter.js +2 -1
- package/dist/isPlainDateBefore.d.ts +1 -1
- package/dist/isPlainDateBefore.d.ts.map +1 -1
- package/dist/isPlainDateBefore.js +2 -1
- package/dist/isPlainDateEqual.d.ts +1 -1
- package/dist/isPlainDateEqual.d.ts.map +1 -1
- package/dist/isPlainDateEqual.js +2 -1
- package/dist/isPlainTimeAfter.d.ts +1 -1
- package/dist/isPlainTimeAfter.d.ts.map +1 -1
- package/dist/isPlainTimeAfter.js +2 -1
- package/dist/isPlainTimeBefore.d.ts +1 -1
- package/dist/isPlainTimeBefore.d.ts.map +1 -1
- package/dist/isPlainTimeBefore.js +2 -1
- package/dist/isPlainTimeEqual.d.ts +1 -1
- package/dist/isPlainTimeEqual.d.ts.map +1 -1
- package/dist/isPlainTimeEqual.js +2 -1
- package/dist/isSameDay.d.ts +1 -1
- package/dist/isSameDay.d.ts.map +1 -1
- package/dist/isSameDay.js +3 -2
- package/dist/isSameHour.js +3 -2
- package/dist/isSameMicrosecond.js +3 -2
- package/dist/isSameMillisecond.js +3 -2
- package/dist/isSameMinute.js +3 -2
- package/dist/isSameMonth.js +3 -2
- package/dist/isSameNanosecond.js +3 -2
- package/dist/isSameSecond.js +3 -2
- package/dist/isSameWeek.js +3 -2
- package/dist/isSameYear.js +3 -2
- package/dist/isWithinInterval.d.ts +1 -1
- package/dist/isWithinInterval.d.ts.map +1 -1
- package/dist/isWithinInterval.js +5 -4
- package/dist/now.d.ts +1 -1
- package/dist/now.d.ts.map +1 -1
- package/dist/now.js +2 -1
- package/dist/roundToNearestHour.js +3 -2
- package/dist/roundToNearestMinute.js +3 -2
- package/dist/roundToNearestSecond.js +3 -2
- package/dist/shared/differenceInMilliseconds.d.ts +1 -1
- package/dist/shared/differenceInMilliseconds.d.ts.map +1 -1
- package/dist/shared/differenceInMilliseconds.js +2 -1
- package/dist/shared/differenceOptions.d.ts +16 -0
- package/dist/shared/differenceOptions.d.ts.map +1 -0
- package/dist/shared/differenceOptions.js +1 -0
- package/dist/shared/differenceOptions.js.map +1 -0
- package/dist/shared/isAfter.d.ts +1 -1
- package/dist/shared/isAfter.d.ts.map +1 -1
- package/dist/shared/isAfter.js +2 -1
- package/dist/shared/isBefore.d.ts +1 -1
- package/dist/shared/isBefore.d.ts.map +1 -1
- package/dist/shared/isBefore.js +2 -1
- package/dist/shared/normalizeTemporalInput.d.ts +1 -1
- package/dist/shared/normalizeTemporalInput.d.ts.map +1 -1
- package/dist/shared/normalizeTemporalInput.js +2 -1
- package/dist/shared/normalizeWithPlainDate.d.ts +1 -1
- package/dist/shared/normalizeWithPlainDate.d.ts.map +1 -1
- package/dist/shared/normalizeWithPlainDate.js +4 -3
- package/dist/shared/nowZoned.d.ts +1 -1
- package/dist/shared/nowZoned.d.ts.map +1 -1
- package/dist/shared/nowZoned.js +3 -2
- package/dist/shared/plainDateToZonedDateTime.d.ts +1 -1
- package/dist/shared/plainDateToZonedDateTime.d.ts.map +1 -1
- package/dist/shared/plainDateToZonedDateTime.js +2 -1
- package/dist/shared/temporal.d.ts +37 -0
- package/dist/shared/temporal.d.ts.map +1 -0
- package/dist/shared/temporal.js +13 -0
- package/dist/shared/temporal.js.map +1 -0
- package/dist/shared/temporal.test.d.ts +2 -0
- package/dist/shared/temporal.test.d.ts.map +1 -0
- package/dist/simpleFormat.d.ts +1 -1
- package/dist/simpleFormat.d.ts.map +1 -1
- package/dist/simpleFormat.js +2 -1
- package/dist/startOfDay.d.ts +1 -1
- package/dist/startOfDay.d.ts.map +1 -1
- package/dist/startOfDay.js +5 -4
- package/dist/startOfMonth.d.ts +1 -1
- package/dist/startOfMonth.d.ts.map +1 -1
- package/dist/startOfMonth.js +5 -4
- package/dist/startOfWeek.d.ts +1 -1
- package/dist/startOfWeek.d.ts.map +1 -1
- package/dist/startOfWeek.js +4 -3
- package/dist/startOfYear.d.ts +1 -1
- package/dist/startOfYear.d.ts.map +1 -1
- package/dist/startOfYear.js +5 -4
- package/dist/subDays.js +4 -3
- package/dist/subHours.js +4 -3
- package/dist/subMicroseconds.js +4 -3
- package/dist/subMilliseconds.js +4 -3
- package/dist/subMinutes.js +4 -3
- package/dist/subMonths.js +4 -3
- package/dist/subNanoseconds.js +4 -3
- package/dist/subSeconds.js +4 -3
- package/dist/subWeeks.js +4 -3
- package/dist/subYears.js +4 -3
- package/dist/toDate.d.ts +1 -1
- package/dist/toDate.d.ts.map +1 -1
- package/dist/toDate.js +2 -1
- package/dist/toIso.d.ts +1 -1
- package/dist/toIso.d.ts.map +1 -1
- package/dist/toIso.js +2 -1
- package/dist/toIso9075.d.ts +1 -1
- package/dist/toIso9075.d.ts.map +1 -1
- package/dist/toIso9075.js +2 -1
- package/dist/toPlainDate.d.ts +1 -1
- package/dist/toPlainDate.d.ts.map +1 -1
- package/dist/toPlainDate.js +2 -1
- package/dist/toPlainTime.d.ts +1 -1
- package/dist/toPlainTime.d.ts.map +1 -1
- package/dist/toPlainTime.js +2 -1
- package/dist/toUtc.d.ts +1 -1
- package/dist/toUtc.d.ts.map +1 -1
- package/dist/toUtc.js +2 -1
- package/dist/toZonedTime.d.ts +1 -1
- package/dist/toZonedTime.d.ts.map +1 -1
- package/dist/toZonedTime.js +2 -1
- package/dist/today.d.ts +1 -1
- package/dist/today.d.ts.map +1 -1
- package/dist/today.js +2 -1
- package/package.json +1 -1
- package/dist/chunk-3A6X6WV5.js.map +0 -1
- package/dist/chunk-3TSFIPUR.js.map +0 -1
- package/dist/chunk-4E7OGJ3F.js.map +0 -1
- package/dist/chunk-4PSMM55Q.js.map +0 -1
- package/dist/chunk-5C3TQSWA.js.map +0 -1
- package/dist/chunk-6IP245MS.js.map +0 -1
- package/dist/chunk-776JOVV6.js.map +0 -1
- package/dist/chunk-7VLSSOVC.js.map +0 -1
- package/dist/chunk-AE36GX4F.js.map +0 -1
- package/dist/chunk-AJ4JBKJK.js.map +0 -1
- package/dist/chunk-AJEIDKVJ.js.map +0 -1
- package/dist/chunk-B2R2G5YK.js +0 -19
- package/dist/chunk-B2R2G5YK.js.map +0 -1
- package/dist/chunk-BIAPE4MR.js.map +0 -1
- package/dist/chunk-BPZ7BRJW.js.map +0 -1
- package/dist/chunk-BSV32PSO.js.map +0 -1
- package/dist/chunk-BUX26GTD.js.map +0 -1
- package/dist/chunk-BV6CLVSI.js.map +0 -1
- package/dist/chunk-CHW2EN2O.js.map +0 -1
- package/dist/chunk-DFLGGK4F.js.map +0 -1
- package/dist/chunk-DKYVFYWM.js.map +0 -1
- package/dist/chunk-EZ7NVTZI.js.map +0 -1
- package/dist/chunk-FSD3DDFC.js.map +0 -1
- package/dist/chunk-G2JUEBC5.js.map +0 -1
- package/dist/chunk-HFQUXON5.js.map +0 -1
- package/dist/chunk-HLGMUTFK.js.map +0 -1
- package/dist/chunk-HOCNCQTC.js.map +0 -1
- package/dist/chunk-JNA3AFOC.js.map +0 -1
- package/dist/chunk-KGVUENQO.js +0 -17
- package/dist/chunk-KGVUENQO.js.map +0 -1
- package/dist/chunk-KZB6NERH.js.map +0 -1
- package/dist/chunk-MJSZNWCV.js +0 -10
- package/dist/chunk-MJSZNWCV.js.map +0 -1
- package/dist/chunk-O6RIN7K3.js.map +0 -1
- package/dist/chunk-OABS374T.js.map +0 -1
- package/dist/chunk-OLEOU3XE.js.map +0 -1
- package/dist/chunk-OQ4CWKJT.js.map +0 -1
- package/dist/chunk-PMJD5N5J.js +0 -19
- package/dist/chunk-PMJD5N5J.js.map +0 -1
- package/dist/chunk-PVAOUYXF.js.map +0 -1
- package/dist/chunk-QFNGYTTH.js.map +0 -1
- package/dist/chunk-QVOEXF46.js +0 -19
- package/dist/chunk-QVOEXF46.js.map +0 -1
- package/dist/chunk-RBEW6PXR.js.map +0 -1
- package/dist/chunk-RW3C2677.js.map +0 -1
- package/dist/chunk-TGKWBQ7L.js.map +0 -1
- package/dist/chunk-TNCLJK4Y.js.map +0 -1
- package/dist/chunk-UJWM2BV2.js.map +0 -1
- package/dist/chunk-VZJGCDAG.js.map +0 -1
- package/dist/chunk-WUAIUEH7.js.map +0 -1
- package/dist/chunk-WY63VEXE.js.map +0 -1
- package/dist/chunk-X26WIJ6L.js.map +0 -1
- package/dist/chunk-Y7CIJQ67.js.map +0 -1
- package/dist/chunk-YIT6EMBC.js.map +0 -1
- package/dist/chunk-YQBM63DC.js.map +0 -1
- package/dist/chunk-ZC6KWXCW.js.map +0 -1
- package/dist/chunk-ZDA7GSWU.js.map +0 -1
- package/dist/chunk-ZGR4NZTS.js.map +0 -1
- package/dist/chunk-ZJQS7ZY7.js.map +0 -1
- /package/dist/{chunk-UBY22QWM.js.map → chunk-4ZRJ3EHQ.js.map} +0 -0
- /package/dist/{chunk-Q2F3HEXB.js.map → chunk-5HVHKQTJ.js.map} +0 -0
- /package/dist/{chunk-52NEOY34.js.map → chunk-7XVPK2AV.js.map} +0 -0
- /package/dist/{chunk-DT2EWLHU.js.map → chunk-BOGN7JC3.js.map} +0 -0
- /package/dist/{chunk-WVHAYLBW.js.map → chunk-CP4JNCMO.js.map} +0 -0
- /package/dist/{chunk-MMI2HHT7.js.map → chunk-DHJ353HR.js.map} +0 -0
- /package/dist/{chunk-4NJMCCUM.js.map → chunk-DJRIH2PX.js.map} +0 -0
- /package/dist/{chunk-YKBP3G7L.js.map → chunk-DN3V4IZC.js.map} +0 -0
- /package/dist/{chunk-EYO2ZJLH.js.map → chunk-DOGZ2WBH.js.map} +0 -0
- /package/dist/{chunk-L4SVABDH.js.map → chunk-G4COVQ5S.js.map} +0 -0
- /package/dist/{chunk-LDO6PRNJ.js.map → chunk-GEMTHX5S.js.map} +0 -0
- /package/dist/{chunk-S63QUP4W.js.map → chunk-I3RXBZP5.js.map} +0 -0
- /package/dist/{chunk-ADQTZVMH.js.map → chunk-IPWSPA4H.js.map} +0 -0
- /package/dist/{chunk-JOD4ATPE.js.map → chunk-JXBC2VU2.js.map} +0 -0
- /package/dist/{chunk-V27NUBXQ.js.map → chunk-KKMM6HYC.js.map} +0 -0
- /package/dist/{chunk-A5VVBYNT.js.map → chunk-KONRPZXK.js.map} +0 -0
- /package/dist/{chunk-CY746ZUQ.js.map → chunk-L2CNUS43.js.map} +0 -0
- /package/dist/{chunk-JA7SVLAF.js.map → chunk-LLN2SKGE.js.map} +0 -0
- /package/dist/{chunk-7ATM7AXL.js.map → chunk-OGNREZPA.js.map} +0 -0
- /package/dist/{chunk-ISHZRFVN.js.map → chunk-OPACRBGV.js.map} +0 -0
- /package/dist/{chunk-J6G2I2TU.js.map → chunk-OZYC3TAR.js.map} +0 -0
- /package/dist/{chunk-2XHAHSB6.js.map → chunk-PBT2OZJH.js.map} +0 -0
- /package/dist/{chunk-BH2YB4MV.js.map → chunk-PWPACA4G.js.map} +0 -0
- /package/dist/{chunk-HDBH7RTY.js.map → chunk-QGXK664C.js.map} +0 -0
- /package/dist/{chunk-JHRXY36W.js.map → chunk-QVXCG625.js.map} +0 -0
- /package/dist/{chunk-EEQ3REET.js.map → chunk-RSY3BI3P.js.map} +0 -0
- /package/dist/{chunk-NRD5HRZV.js.map → chunk-RTANLM3L.js.map} +0 -0
- /package/dist/{chunk-BQBLSXK2.js.map → chunk-SDCVBRJP.js.map} +0 -0
- /package/dist/{chunk-VLZ3HQQA.js.map → chunk-SQJTTKEI.js.map} +0 -0
- /package/dist/{chunk-PPB62JYV.js.map → chunk-TDZ3XUH7.js.map} +0 -0
- /package/dist/{chunk-XW5MLXX5.js.map → chunk-VVV5BNLP.js.map} +0 -0
- /package/dist/{chunk-AHMKY474.js.map → chunk-WJOGQ6IB.js.map} +0 -0
- /package/dist/{chunk-UJW2FPI4.js.map → chunk-XRZUPSUB.js.map} +0 -0
- /package/dist/{chunk-U4RNUZXO.js.map → chunk-ZKGR3F4F.js.map} +0 -0
package/dist/addDays.js
CHANGED
package/dist/addHours.js
CHANGED
package/dist/addMicroseconds.js
CHANGED
package/dist/addMilliseconds.js
CHANGED
package/dist/addMinutes.js
CHANGED
package/dist/addMonths.js
CHANGED
package/dist/addNanoseconds.js
CHANGED
package/dist/addSeconds.js
CHANGED
package/dist/addWeeks.js
CHANGED
package/dist/addYears.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F6EWMA4K.js";
|
|
4
|
+
import {
|
|
5
|
+
Temporal
|
|
6
|
+
} from "./chunk-VOZTLX5F.js";
|
|
4
7
|
|
|
5
8
|
// src/eachWeekOfInterval.ts
|
|
6
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
7
9
|
function eachWeekOfInterval(interval) {
|
|
8
10
|
const startZoned = normalizeTemporalInput(interval.start);
|
|
9
11
|
const endZoned = normalizeTemporalInput(interval.end);
|
|
@@ -25,4 +27,4 @@ function eachWeekOfInterval(interval) {
|
|
|
25
27
|
export {
|
|
26
28
|
eachWeekOfInterval
|
|
27
29
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
30
|
+
//# sourceMappingURL=chunk-2J434XZJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eachWeekOfInterval.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * Returns an array of ZonedDateTime objects for each week within the interval.\n * Each element represents the first moment of the week (Monday at midnight).\n * Uses ISO 8601 week definition: weeks start on Monday.\n * The interval is inclusive of both start and end weeks.\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 * @param interval - The interval with start and end datetimes\n * @returns Array of ZonedDateTime at start of each week (Monday) in the interval\n *\n * @example\n * ```ts\n * const start = Temporal.ZonedDateTime.from('2025-01-06T10:00:00Z[UTC]'); // Monday\n * const end = Temporal.ZonedDateTime.from('2025-01-22T14:00:00Z[UTC]'); // Wednesday\n *\n * const weeks = eachWeekOfInterval({ start, end });\n * // [\n * // 2025-01-06T00:00:00Z[UTC], // Week 2\n * // 2025-01-13T00:00:00Z[UTC], // Week 3\n * // 2025-01-20T00:00:00Z[UTC] // Week 4\n * // ]\n * ```\n *\n * @example\n * ```ts\n * // Mid-week start\n * const start = Temporal.ZonedDateTime.from('2025-01-08T10:00:00Z[UTC]'); // Wednesday\n * const end = Temporal.ZonedDateTime.from('2025-01-15T14:00:00Z[UTC]'); // Wednesday\n *\n * const weeks = eachWeekOfInterval({ start, end });\n * // [\n * // 2025-01-06T00:00:00Z[UTC], // Monday of week containing Jan 8\n * // 2025-01-13T00:00:00Z[UTC] // Monday of week containing Jan 15\n * // ]\n * ```\n *\n * @example\n * ```ts\n * // Cross-year boundary\n * const start = Temporal.ZonedDateTime.from('2024-12-25T00:00:00Z[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-08T00:00:00Z[UTC]');\n *\n * const weeks = eachWeekOfInterval({ start, end });\n * // [\n * // 2024-12-23T00:00:00Z[UTC], // Monday of week containing Dec 25\n * // 2024-12-30T00:00:00Z[UTC], // Monday of week containing Dec 30\n * // 2025-01-06T00:00:00Z[UTC] // Monday of week containing Jan 8\n * // ]\n * ```\n */\nexport function eachWeekOfInterval(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\n const timezone = startZoned.timeZoneId;\n\n // Get Monday of the starting week\n // dayOfWeek: 1 = Monday, 7 = Sunday (ISO 8601)\n const daysToSubtractStart = startZoned.dayOfWeek - 1;\n const startMonday = startZoned.subtract({ days: daysToSubtractStart }).startOfDay();\n\n // Get Monday of the ending week\n const endInTimezone = endZoned.withTimeZone(timezone);\n const daysToSubtractEnd = endInTimezone.dayOfWeek - 1;\n const endMonday = endInTimezone.subtract({ days: daysToSubtractEnd }).startOfDay();\n\n const weeks: Temporal.ZonedDateTime[] = [];\n let current = startMonday;\n\n while (Temporal.ZonedDateTime.compare(current, endMonday) <= 0) {\n weeks.push(current);\n current = current.add({ weeks: 1 });\n }\n\n return weeks;\n}\n"],"mappings":";;;;;;;;AAuDO,SAAS,mBAAmB,UAGN;AAC3B,QAAM,aAAa,uBAAuB,SAAS,KAAK;AACxD,QAAM,WAAW,uBAAuB,SAAS,GAAG;AAEpD,QAAM,WAAW,WAAW;AAI5B,QAAM,sBAAsB,WAAW,YAAY;AACnD,QAAM,cAAc,WAAW,SAAS,EAAE,MAAM,oBAAoB,CAAC,EAAE,WAAW;AAGlF,QAAM,gBAAgB,SAAS,aAAa,QAAQ;AACpD,QAAM,oBAAoB,cAAc,YAAY;AACpD,QAAM,YAAY,cAAc,SAAS,EAAE,MAAM,kBAAkB,CAAC,EAAE,WAAW;AAEjF,QAAM,QAAkC,CAAC;AACzC,MAAI,UAAU;AAEd,SAAO,SAAS,cAAc,QAAQ,SAAS,SAAS,KAAK,GAAG;AAC9D,UAAM,KAAK,OAAO;AAClB,cAAU,QAAQ,IAAI,EAAE,OAAO,EAAE,CAAC;AAAA,EACpC;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F6EWMA4K.js";
|
|
4
4
|
|
|
5
5
|
// src/isSameDay.ts
|
|
6
|
-
import "@js-temporal/polyfill";
|
|
7
6
|
function isSameDay(date1, date2) {
|
|
8
7
|
const zoned1 = normalizeTemporalInput(date1);
|
|
9
8
|
const zoned2 = normalizeTemporalInput(date2);
|
|
@@ -13,4 +12,4 @@ function isSameDay(date1, date2) {
|
|
|
13
12
|
export {
|
|
14
13
|
isSameDay
|
|
15
14
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-3QC5YINX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isSameDay.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * Returns true if both datetimes fall on the same calendar day.\n * Compares the year, month, and day 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 on the same calendar day, false otherwise\n *\n * @example\n * ```ts\n * // Same timezone, same day\n * const morning = Temporal.ZonedDateTime.from('2025-01-20T08:00:00Z[UTC]');\n * const evening = Temporal.ZonedDateTime.from('2025-01-20T23:00:00Z[UTC]');\n *\n * isSameDay(morning, evening); // true\n * ```\n *\n * @example\n * ```ts\n * // Same timezone, different days\n * const today = Temporal.ZonedDateTime.from('2025-01-20T23:59:59Z[UTC]');\n * const tomorrow = Temporal.ZonedDateTime.from('2025-01-21T00:00:00Z[UTC]');\n *\n * isSameDay(today, tomorrow); // false\n * ```\n *\n * @example\n * ```ts\n * // Different timezones - compares their local calendar days\n * const ny = Temporal.ZonedDateTime.from('2025-01-20T23:00:00-05:00[America/New_York]');\n * const tokyo = Temporal.ZonedDateTime.from('2025-01-21T13:00:00+09:00[Asia/Tokyo]');\n *\n * // Same instant, different calendar days from each person's perspective\n * isSameDay(ny, tokyo); // false (Jan 20 in NY, Jan 21 in Tokyo)\n *\n * // Convert to UTC to compare in UTC timezone\n * isSameDay(ny.withTimeZone('UTC'), tokyo.withTimeZone('UTC')); // true (both Jan 21 in UTC)\n *\n * // Convert to NY timezone to compare from NY perspective\n * isSameDay(ny, tokyo.withTimeZone('America/New_York')); // true (both Jan 20 in NY)\n * ```\n *\n * @example\n * ```ts\n * // Instant inputs are converted to UTC\n * const instant1 = Temporal.Instant.from('2025-01-20T10:00:00Z');\n * const instant2 = Temporal.Instant.from('2025-01-20T23:00:00Z');\n *\n * isSameDay(instant1, instant2); // true (both Jan 20 in UTC)\n * ```\n */\nexport function isSameDay(\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 );\n}\n"],"mappings":";;;;;AA0DO,SAAS,UACd,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;AAE1B;","names":[]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeWithPlainDate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y4HT4LCB.js";
|
|
4
4
|
|
|
5
5
|
// src/startOfDay.ts
|
|
6
|
-
import "@js-temporal/polyfill";
|
|
7
6
|
function startOfDay(input, timezone) {
|
|
8
7
|
const zonedDateTime = normalizeWithPlainDate(input, timezone);
|
|
9
8
|
return zonedDateTime.startOfDay();
|
|
@@ -12,4 +11,4 @@ function startOfDay(input, timezone) {
|
|
|
12
11
|
export {
|
|
13
12
|
startOfDay
|
|
14
13
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-3WWRI3NR.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:00Z[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":[]}
|
|
@@ -3,15 +3,17 @@ import {
|
|
|
3
3
|
} from "./chunk-AVGNRINZ.js";
|
|
4
4
|
import {
|
|
5
5
|
plainDateToZonedDateTime
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LYPSZYIG.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeTemporalInput
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-F6EWMA4K.js";
|
|
10
|
+
import {
|
|
11
|
+
isPlainDate
|
|
12
|
+
} from "./chunk-VOZTLX5F.js";
|
|
10
13
|
|
|
11
14
|
// src/endOfWeek.ts
|
|
12
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
13
15
|
function endOfWeek(input, timezone) {
|
|
14
|
-
const zonedDateTime = input
|
|
16
|
+
const zonedDateTime = isPlainDate(input) ? plainDateToZonedDateTime(input, timezone) : normalizeTemporalInput(input);
|
|
15
17
|
const dayOfWeek = zonedDateTime.dayOfWeek;
|
|
16
18
|
const daysToAdd = 7 - dayOfWeek;
|
|
17
19
|
const sunday = zonedDateTime.add({ days: daysToAdd });
|
|
@@ -21,4 +23,4 @@ function endOfWeek(input, timezone) {
|
|
|
21
23
|
export {
|
|
22
24
|
endOfWeek
|
|
23
25
|
};
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-46EP6MO2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/endOfWeek.ts"],"sourcesContent":["import { isPlainDate } from './shared/temporal';\nimport type { Temporal } from '@js-temporal/polyfill';\nimport type { Timezone } from './types';\nimport { getEndOfDay } from './shared/endOfDay';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport { plainDateToZonedDateTime } from './shared/plainDateToZonedDateTime';\n\n/**\n * Returns a ZonedDateTime representing the last moment of the week (Sunday at 23:59:59.999999999).\n * Uses ISO 8601 week definition: weeks end on Sunday.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at Sunday 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'); // Monday\n * const end = endOfWeek(instant);\n * // 2025-01-26T23:59:59.999999999Z[UTC] (next Sunday)\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 end = endOfWeek(zoned);\n * // 2025-01-26T23:59:59.999999999-05:00[America/New_York] (next Sunday)\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (requires timezone)\n * const date = Temporal.PlainDate.from('2025-01-22'); // Wednesday\n * const end = endOfWeek(date, 'America/New_York');\n * // 2025-01-26T23:59:59.999999999-05:00[America/New_York] (next Sunday)\n * ```\n */\nexport function endOfWeek(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function endOfWeek(\n input: Temporal.PlainDate,\n timezone: Timezone\n): Temporal.ZonedDateTime;\nexport function endOfWeek(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone\n): Temporal.ZonedDateTime {\n const zonedDateTime =\n isPlainDate(input)\n ? plainDateToZonedDateTime(input, timezone!)\n : normalizeTemporalInput(input);\n\n // Get the day of week (1 = Monday, 7 = Sunday in ISO 8601)\n const dayOfWeek = zonedDateTime.dayOfWeek;\n\n // Calculate days to add to get to Sunday\n const daysToAdd = 7 - dayOfWeek;\n\n // Go to Sunday, then get end of that day\n const sunday = zonedDateTime.add({ days: daysToAdd });\n\n return getEndOfDay(sunday);\n}\n"],"mappings":";;;;;;;;;;;;;;AA6CO,SAAS,UACd,OACA,UACwB;AACxB,QAAM,gBACJ,YAAY,KAAK,IACb,yBAAyB,OAAO,QAAS,IACzC,uBAAuB,KAAK;AAGlC,QAAM,YAAY,cAAc;AAGhC,QAAM,YAAY,IAAI;AAGtB,QAAM,SAAS,cAAc,IAAI,EAAE,MAAM,UAAU,CAAC;AAEpD,SAAO,YAAY,MAAM;AAC3B;","names":[]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isBefore
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BIH6JETG.js";
|
|
4
4
|
import {
|
|
5
5
|
nowZoned
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DTZPE5PM.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeTemporalInput
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-F6EWMA4K.js";
|
|
10
10
|
|
|
11
11
|
// src/isPast.ts
|
|
12
12
|
function isPast(date) {
|
|
@@ -17,4 +17,4 @@ function isPast(date) {
|
|
|
17
17
|
export {
|
|
18
18
|
isPast
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-4ZRJ3EHQ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F6EWMA4K.js";
|
|
4
4
|
|
|
5
5
|
// src/addYears.ts
|
|
6
6
|
function addYears(input, years) {
|
|
@@ -11,4 +11,4 @@ function addYears(input, years) {
|
|
|
11
11
|
export {
|
|
12
12
|
addYears
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-5HVHKQTJ.js.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
differenceInMilliseconds
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VXOQ7IG5.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeTemporalInput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-F6EWMA4K.js";
|
|
7
7
|
|
|
8
8
|
// src/differenceInMilliseconds.ts
|
|
9
|
-
import "@js-temporal/polyfill";
|
|
10
9
|
function differenceInMilliseconds2(laterDate, earlierDate) {
|
|
11
10
|
const zoned1 = normalizeTemporalInput(laterDate);
|
|
12
11
|
const zoned2 = normalizeTemporalInput(earlierDate);
|
|
@@ -16,4 +15,4 @@ function differenceInMilliseconds2(laterDate, earlierDate) {
|
|
|
16
15
|
export {
|
|
17
16
|
differenceInMilliseconds2 as differenceInMilliseconds
|
|
18
17
|
};
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
18
|
+
//# sourceMappingURL=chunk-76RCTVBW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/differenceInMilliseconds.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport { differenceInMilliseconds as differenceInMillisecondsInternal } from './shared/differenceInMilliseconds';\n\n/**\n * Returns the number of milliseconds between two datetimes.\n * The result is positive if laterDate is after earlierDate, negative if before.\n *\n * @param laterDate - The later datetime (Instant or ZonedDateTime)\n * @param earlierDate - The earlier datetime (Instant or ZonedDateTime)\n * @returns The number of milliseconds between the dates\n *\n * @example\n * ```ts\n * const later = Temporal.Instant.from('2025-01-20T12:30:21.700Z');\n * const earlier = Temporal.Instant.from('2025-01-20T12:30:20.600Z');\n *\n * differenceInMilliseconds(later, earlier); // 1100\n * ```\n *\n * @example\n * ```ts\n * // Works with ZonedDateTime\n * const later = Temporal.ZonedDateTime.from('2025-01-20T15:00:00-05:00[America/New_York]');\n * const earlier = Temporal.ZonedDateTime.from('2025-01-20T14:00:00-05:00[America/New_York]');\n *\n * differenceInMilliseconds(later, earlier); // 3600000\n * ```\n *\n * @example\n * ```ts\n * // Handles different timezones - compares by instant\n * const tokyo = Temporal.ZonedDateTime.from('2025-01-21T00:00:00+09:00[Asia/Tokyo]');\n * const ny = Temporal.ZonedDateTime.from('2025-01-20T10:00:00-05:00[America/New_York]');\n *\n * differenceInMilliseconds(tokyo, ny); // 0 (same instant)\n * ```\n */\nexport function differenceInMilliseconds(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime\n): number {\n const zoned1 = normalizeTemporalInput(laterDate);\n const zoned2 = normalizeTemporalInput(earlierDate);\n\n return differenceInMillisecondsInternal(zoned1, zoned2);\n}\n"],"mappings":";;;;;;;;AAsCO,SAASA,0BACd,WACA,aACQ;AACR,QAAM,SAAS,uBAAuB,SAAS;AAC/C,QAAM,SAAS,uBAAuB,WAAW;AAEjD,SAAO,yBAAiC,QAAQ,MAAM;AACxD;","names":["differenceInMilliseconds"]}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Temporal
|
|
3
|
+
} from "./chunk-VOZTLX5F.js";
|
|
4
|
+
|
|
1
5
|
// src/isPlainDateEqual.ts
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
6
|
function isPlainDateEqual(date1, date2) {
|
|
4
7
|
return Temporal.PlainDate.compare(date1, date2) === 0;
|
|
5
8
|
}
|
|
@@ -7,4 +10,4 @@ function isPlainDateEqual(date1, date2) {
|
|
|
7
10
|
export {
|
|
8
11
|
isPlainDateEqual
|
|
9
12
|
};
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-7LZPFGGV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isPlainDateEqual.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\n\n/**\n * Returns true if the two plain dates are equal.\n * Compares calendar dates without time or timezone considerations.\n *\n * @param date1 - First plain date\n * @param date2 - Second plain date\n * @returns true if date1 equals date2, false otherwise\n *\n * @example\n * ```ts\n * const jan20a = Temporal.PlainDate.from('2025-01-20');\n * const jan20b = Temporal.PlainDate.from('2025-01-20');\n * const jan25 = Temporal.PlainDate.from('2025-01-25');\n *\n * isPlainDateEqual(jan20a, jan20b); // true\n * isPlainDateEqual(jan20a, jan25); // false\n * ```\n */\nexport function isPlainDateEqual(\n date1: Temporal.PlainDate,\n date2: Temporal.PlainDate\n): boolean {\n return Temporal.PlainDate.compare(date1, date2) === 0;\n}\n"],"mappings":";;;;;AAoBO,SAAS,iBACd,OACA,OACS;AACT,SAAO,SAAS,UAAU,QAAQ,OAAO,KAAK,MAAM;AACtD;","names":[]}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAfter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-C5HDCIRV.js";
|
|
4
4
|
import {
|
|
5
5
|
isBefore
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BIH6JETG.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeTemporalInput
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-F6EWMA4K.js";
|
|
10
10
|
|
|
11
11
|
// src/isWithinInterval.ts
|
|
12
|
-
import "@js-temporal/polyfill";
|
|
13
12
|
function isWithinInterval(date, interval) {
|
|
14
13
|
const normalizedDate = normalizeTemporalInput(date);
|
|
15
14
|
const normalizedStart = normalizeTemporalInput(interval.start);
|
|
@@ -20,4 +19,4 @@ function isWithinInterval(date, interval) {
|
|
|
20
19
|
export {
|
|
21
20
|
isWithinInterval
|
|
22
21
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
22
|
+
//# sourceMappingURL=chunk-7NQ76UHP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isWithinInterval.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport { isBefore } from './shared/isBefore';\nimport { isAfter } from './shared/isAfter';\n\n/**\n * Returns true if the given date is within the interval (inclusive of start and end).\n * Compares by the underlying instant (epoch time), not by calendar date/time.\n *\n * @param date - The date to check (Instant or ZonedDateTime)\n * @param interval - The interval with start and end dates\n * @returns true if date is within the interval, false otherwise\n *\n * @example\n * ```ts\n * const start = Temporal.ZonedDateTime.from('2025-01-01T00:00:00Z[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-07T00:00:00Z[UTC]');\n * const date = Temporal.ZonedDateTime.from('2025-01-03T00:00:00Z[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:00Z[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-07T00:00:00Z[UTC]');\n * const date = Temporal.ZonedDateTime.from('2025-01-10T00:00:00Z[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:00Z[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-07T00:00:00Z[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:00Z[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-07T00:00:00Z[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:00Z[UTC]');\n *\n * isWithinInterval(date, { start, end }); // true\n * ```\n */\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 {\n const normalizedDate = normalizeTemporalInput(date);\n const normalizedStart = normalizeTemporalInput(interval.start);\n const normalizedEnd = normalizeTemporalInput(interval.end);\n\n return !isBefore(normalizedDate, normalizedStart) && !isAfter(normalizedDate, normalizedEnd);\n}\n"],"mappings":";;;;;;;;;;;AAsEO,SAAS,iBACd,MACA,UAIS;AACT,QAAM,iBAAiB,uBAAuB,IAAI;AAClD,QAAM,kBAAkB,uBAAuB,SAAS,KAAK;AAC7D,QAAM,gBAAgB,uBAAuB,SAAS,GAAG;AAEzD,SAAO,CAAC,SAAS,gBAAgB,eAAe,KAAK,CAAC,QAAQ,gBAAgB,aAAa;AAC7F;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addMonths
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OGNREZPA.js";
|
|
4
4
|
|
|
5
5
|
// src/subMonths.ts
|
|
6
6
|
function subMonths(input, months) {
|
|
@@ -10,4 +10,4 @@ function subMonths(input, months) {
|
|
|
10
10
|
export {
|
|
11
11
|
subMonths
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-7XVPK2AV.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F6EWMA4K.js";
|
|
4
4
|
|
|
5
5
|
// src/differenceInWeeks.ts
|
|
6
|
-
|
|
7
|
-
function differenceInWeeks(laterDate, earlierDate) {
|
|
6
|
+
function differenceInWeeks(laterDate, earlierDate, options) {
|
|
8
7
|
const zoned1 = normalizeTemporalInput(laterDate);
|
|
9
8
|
const zoned2 = normalizeTemporalInput(earlierDate);
|
|
10
9
|
const duration = zoned2.until(zoned1, { largestUnit: "hours" });
|
|
11
|
-
|
|
10
|
+
const precise = duration.total({ unit: "weeks", relativeTo: zoned2 });
|
|
11
|
+
return options?.fractional ? precise : Math.trunc(precise);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export {
|
|
15
15
|
differenceInWeeks
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-AAORAX74.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/differenceInWeeks.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport type { DifferenceOptions } from './shared/differenceOptions';\n\n/**\n * Returns the number of weeks between two datetimes.\n * The result is positive if laterDate is after earlierDate, negative if before.\n *\n * This function uses calendar-aware calculation, which means it properly handles\n * DST transitions and calendar weeks.\n *\n * Instant inputs are converted to UTC for calendar calculations.\n * For ZonedDateTime inputs, their timezone is preserved.\n *\n * @param laterDate - The later datetime (Instant or ZonedDateTime)\n * @param earlierDate - The earlier datetime (Instant or ZonedDateTime)\n * @param options - Optional { fractional } to return the precise value\n * @returns The number of weeks between the dates, truncated toward zero (pass { fractional: true } for the precise value)\n *\n * @example\n * ```ts\n * const later = Temporal.Instant.from('2025-02-10T12:00:00Z');\n * const earlier = Temporal.Instant.from('2025-01-20T12:00:00Z');\n *\n * differenceInWeeks(later, earlier); // 3\n * ```\n *\n * @example\n * ```ts\n * // Works with ZonedDateTime\n * const later = Temporal.ZonedDateTime.from('2025-02-10T15:00:00-05:00[America/New_York]');\n * const earlier = Temporal.ZonedDateTime.from('2025-01-20T15:00:00-05:00[America/New_York]');\n *\n * differenceInWeeks(later, earlier); // 3\n * ```\n *\n * @example\n * ```ts\n * // Pass { fractional: true } for partial-unit precision\n * const later = Temporal.Instant.from('2025-01-27T12:00:00Z');\n * const earlier = Temporal.Instant.from('2025-01-20T12:00:00Z');\n *\n * differenceInWeeks(later, earlier); // 1\n * ```\n */\nexport function differenceInWeeks(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime,\n options?: DifferenceOptions\n): number {\n const zoned1 = normalizeTemporalInput(laterDate);\n const zoned2 = normalizeTemporalInput(earlierDate);\n\n const duration = zoned2.until(zoned1, { largestUnit: 'hours' });\n const precise = duration.total({ unit: 'weeks', relativeTo: zoned2 });\n return options?.fractional ? precise : Math.trunc(precise);\n}\n"],"mappings":";;;;;AA6CO,SAAS,kBACd,WACA,aACA,SACQ;AACR,QAAM,SAAS,uBAAuB,SAAS;AAC/C,QAAM,SAAS,uBAAuB,WAAW;AAEjD,QAAM,WAAW,OAAO,MAAM,QAAQ,EAAE,aAAa,QAAQ,CAAC;AAC9D,QAAM,UAAU,SAAS,MAAM,EAAE,MAAM,SAAS,YAAY,OAAO,CAAC;AACpE,SAAO,SAAS,aAAa,UAAU,KAAK,MAAM,OAAO;AAC3D;","names":[]}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeWithPlainDate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y4HT4LCB.js";
|
|
4
4
|
import {
|
|
5
5
|
getEndOfDay
|
|
6
6
|
} from "./chunk-AVGNRINZ.js";
|
|
7
7
|
|
|
8
8
|
// src/endOfYear.ts
|
|
9
|
-
import "@js-temporal/polyfill";
|
|
10
9
|
function endOfYear(input, timezone) {
|
|
11
10
|
const zonedDateTime = normalizeWithPlainDate(input, timezone);
|
|
12
11
|
const lastMonth = zonedDateTime.with({ month: zonedDateTime.monthsInYear });
|
|
@@ -17,4 +16,4 @@ function endOfYear(input, timezone) {
|
|
|
17
16
|
export {
|
|
18
17
|
endOfYear
|
|
19
18
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
19
|
+
//# sourceMappingURL=chunk-ADAN2I34.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/endOfYear.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 moment of the year (last day at 23:59:59.999999999).\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.999999999Z[UTC]\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-06-15T15:30:00-05: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 (requires timezone)\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(\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 {\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":";;;;;;;;AA0CO,SAAS,UACd,OACA,UACwB;AACxB,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":[]}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Temporal
|
|
3
|
+
} from "./chunk-VOZTLX5F.js";
|
|
4
|
+
|
|
1
5
|
// src/shared/isBefore.ts
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
6
|
function isBefore(date1, date2) {
|
|
4
7
|
return Temporal.ZonedDateTime.compare(date1, date2) < 0;
|
|
5
8
|
}
|
|
@@ -7,4 +10,4 @@ function isBefore(date1, date2) {
|
|
|
7
10
|
export {
|
|
8
11
|
isBefore
|
|
9
12
|
};
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-BIH6JETG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/isBefore.ts"],"sourcesContent":["import { Temporal } from './temporal';\n\nexport function isBefore(\n date1: Temporal.ZonedDateTime,\n date2: Temporal.ZonedDateTime\n): boolean {\n return Temporal.ZonedDateTime.compare(date1, date2) < 0;\n}\n"],"mappings":";;;;;AAEO,SAAS,SACd,OACA,OACS;AACT,SAAO,SAAS,cAAc,QAAQ,OAAO,KAAK,IAAI;AACxD;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F6EWMA4K.js";
|
|
4
4
|
|
|
5
5
|
// src/addWeeks.ts
|
|
6
6
|
function addWeeks(input, weeks) {
|
|
@@ -11,4 +11,4 @@ function addWeeks(input, weeks) {
|
|
|
11
11
|
export {
|
|
12
12
|
addWeeks
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-BOGN7JC3.js.map
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Temporal
|
|
3
|
+
} from "./chunk-VOZTLX5F.js";
|
|
4
|
+
|
|
1
5
|
// src/shared/isAfter.ts
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
6
|
function isAfter(date1, date2) {
|
|
4
7
|
return Temporal.ZonedDateTime.compare(date1, date2) > 0;
|
|
5
8
|
}
|
|
@@ -7,4 +10,4 @@ function isAfter(date1, date2) {
|
|
|
7
10
|
export {
|
|
8
11
|
isAfter
|
|
9
12
|
};
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-C5HDCIRV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/isAfter.ts"],"sourcesContent":["import { Temporal } from './temporal';\n\nexport function isAfter(\n date1: Temporal.ZonedDateTime,\n date2: Temporal.ZonedDateTime\n): boolean {\n return Temporal.ZonedDateTime.compare(date1, date2) > 0;\n}\n"],"mappings":";;;;;AAEO,SAAS,QACd,OACA,OACS;AACT,SAAO,SAAS,cAAc,QAAQ,OAAO,KAAK,IAAI;AACxD;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addNanoseconds
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DOGZ2WBH.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-CP4JNCMO.js.map
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Temporal,
|
|
3
|
+
isInstant,
|
|
4
|
+
isZonedDateTime
|
|
5
|
+
} from "./chunk-VOZTLX5F.js";
|
|
6
|
+
|
|
1
7
|
// src/toPlainDate.ts
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
8
|
var PLAIN_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
4
9
|
function toPlainDate(input, timezone) {
|
|
5
|
-
if (input
|
|
10
|
+
if (isZonedDateTime(input) && timezone === void 0) {
|
|
6
11
|
return input.toPlainDate();
|
|
7
12
|
}
|
|
8
13
|
if (input instanceof Date) {
|
|
@@ -11,13 +16,13 @@ function toPlainDate(input, timezone) {
|
|
|
11
16
|
}
|
|
12
17
|
return Temporal.Instant.from(input.toISOString()).toZonedDateTimeISO(timezone).toPlainDate();
|
|
13
18
|
}
|
|
14
|
-
if (input
|
|
19
|
+
if (isInstant(input)) {
|
|
15
20
|
if (timezone === void 0) {
|
|
16
21
|
throw new Error("Timezone is required unless input is a ZonedDateTime, PlainDateLike, or plain date string");
|
|
17
22
|
}
|
|
18
23
|
return input.toZonedDateTimeISO(timezone).toPlainDate();
|
|
19
24
|
}
|
|
20
|
-
if (input
|
|
25
|
+
if (isZonedDateTime(input)) {
|
|
21
26
|
if (timezone === void 0) {
|
|
22
27
|
throw new Error("Timezone is required unless input is a ZonedDateTime, PlainDateLike, or plain date string");
|
|
23
28
|
}
|
|
@@ -38,4 +43,4 @@ function toPlainDate(input, timezone) {
|
|
|
38
43
|
export {
|
|
39
44
|
toPlainDate
|
|
40
45
|
};
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
46
|
+
//# sourceMappingURL=chunk-DGRZ6HO3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/toPlainDate.ts"],"sourcesContent":["import { Temporal, isInstant, isZonedDateTime } from './shared/temporal';\nimport type { Timezone } from './types';\n\n// Pattern to detect plain date strings: YYYY-MM-DD\nconst PLAIN_DATE_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/;\n\n/**\n * Parse a plain date or extract the calendar date from a datetime.\n *\n * @param input - A PlainDateLike object, plain date string (YYYY-MM-DD), ZonedDateTime, or datetime input requiring timezone\n * @param timezone - IANA timezone identifier. Required for ISO strings, Date, and Instant inputs.\n * @returns A Temporal.PlainDate representing the calendar date\n *\n * @example\n * ```typescript\n * import { toPlainDate, toZonedTime } from '@gobrand/tiempo';\n *\n * // From PlainDateLike object (no timezone needed)\n * const date = toPlainDate({ year: 2025, month: 1, day: 20 }); // 2025-01-20\n *\n * // From plain date string (no timezone needed)\n * const date2 = toPlainDate(\"2025-01-20\"); // 2025-01-20\n *\n * // From ZonedDateTime (no timezone needed)\n * const zdt = toZonedTime(\"2025-01-20T15:30:00Z\", \"America/New_York\");\n * const date3 = toPlainDate(zdt); // 2025-01-20\n *\n * // From UTC string with timezone\n * const date4 = toPlainDate(\"2025-01-20T15:30:00Z\", \"America/New_York\"); // 2025-01-20\n *\n * // From Date with timezone\n * const jsDate = new Date(\"2025-01-20T15:30:00.000Z\");\n * const date5 = toPlainDate(jsDate, \"Europe/London\"); // 2025-01-20\n *\n * // Date boundary crossing: 23:00 UTC on Jan 20 → Jan 21 in Tokyo\n * const date6 = toPlainDate(\"2025-01-20T23:00:00Z\", \"Asia/Tokyo\"); // 2025-01-21\n * ```\n */\nexport function toPlainDate(input: Temporal.ZonedDateTime): Temporal.PlainDate;\nexport function toPlainDate(\n input: string | Date | Temporal.Instant | Temporal.ZonedDateTime,\n timezone: Timezone\n): Temporal.PlainDate;\nexport function toPlainDate(input: Temporal.PlainDateLike | string): Temporal.PlainDate;\nexport function toPlainDate(\n input: string | Date | Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDateLike,\n timezone?: Timezone\n): Temporal.PlainDate {\n // ZonedDateTime without timezone override\n if (isZonedDateTime(input) && timezone === undefined) {\n return input.toPlainDate();\n }\n\n // Date requires timezone\n if (input instanceof Date) {\n if (timezone === undefined) {\n throw new Error('Timezone is required unless input is a ZonedDateTime, PlainDateLike, or plain date string');\n }\n return Temporal.Instant.from(input.toISOString()).toZonedDateTimeISO(timezone).toPlainDate();\n }\n\n // Instant requires timezone\n if (isInstant(input)) {\n if (timezone === undefined) {\n throw new Error('Timezone is required unless input is a ZonedDateTime, PlainDateLike, or plain date string');\n }\n return input.toZonedDateTimeISO(timezone).toPlainDate();\n }\n\n // ZonedDateTime with timezone override\n if (isZonedDateTime(input)) {\n if (timezone === undefined) {\n throw new Error('Timezone is required unless input is a ZonedDateTime, PlainDateLike, or plain date string');\n }\n return input.toInstant().toZonedDateTimeISO(timezone).toPlainDate();\n }\n\n // String: ISO datetime (requires timezone) or plain date (no timezone)\n if (typeof input === 'string') {\n if (timezone !== undefined) {\n return Temporal.Instant.from(input).toZonedDateTimeISO(timezone).toPlainDate();\n }\n if (PLAIN_DATE_PATTERN.test(input)) {\n return Temporal.PlainDate.from(input);\n }\n throw new Error('Timezone is required unless input is a ZonedDateTime, PlainDateLike, or plain date string');\n }\n\n // PlainDateLike object - pass directly to Temporal.PlainDate.from()\n return Temporal.PlainDate.from(input);\n}\n"],"mappings":";;;;;;;AAIA,IAAM,qBAAqB;AAwCpB,SAAS,YACd,OACA,UACoB;AAEpB,MAAI,gBAAgB,KAAK,KAAK,aAAa,QAAW;AACpD,WAAO,MAAM,YAAY;AAAA,EAC3B;AAGA,MAAI,iBAAiB,MAAM;AACzB,QAAI,aAAa,QAAW;AAC1B,YAAM,IAAI,MAAM,2FAA2F;AAAA,IAC7G;AACA,WAAO,SAAS,QAAQ,KAAK,MAAM,YAAY,CAAC,EAAE,mBAAmB,QAAQ,EAAE,YAAY;AAAA,EAC7F;AAGA,MAAI,UAAU,KAAK,GAAG;AACpB,QAAI,aAAa,QAAW;AAC1B,YAAM,IAAI,MAAM,2FAA2F;AAAA,IAC7G;AACA,WAAO,MAAM,mBAAmB,QAAQ,EAAE,YAAY;AAAA,EACxD;AAGA,MAAI,gBAAgB,KAAK,GAAG;AAC1B,QAAI,aAAa,QAAW;AAC1B,YAAM,IAAI,MAAM,2FAA2F;AAAA,IAC7G;AACA,WAAO,MAAM,UAAU,EAAE,mBAAmB,QAAQ,EAAE,YAAY;AAAA,EACpE;AAGA,MAAI,OAAO,UAAU,UAAU;AAC7B,QAAI,aAAa,QAAW;AAC1B,aAAO,SAAS,QAAQ,KAAK,KAAK,EAAE,mBAAmB,QAAQ,EAAE,YAAY;AAAA,IAC/E;AACA,QAAI,mBAAmB,KAAK,KAAK,GAAG;AAClC,aAAO,SAAS,UAAU,KAAK,KAAK;AAAA,IACtC;AACA,UAAM,IAAI,MAAM,2FAA2F;AAAA,EAC7G;AAGA,SAAO,SAAS,UAAU,KAAK,KAAK;AACtC;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F6EWMA4K.js";
|
|
4
4
|
|
|
5
5
|
// src/roundToNearestHour.ts
|
|
6
6
|
var MODE_TO_ROUNDING_MODE = {
|
|
@@ -22,4 +22,4 @@ function roundToNearestHour(input, options) {
|
|
|
22
22
|
export {
|
|
23
23
|
roundToNearestHour
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-DHJ353HR.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F6EWMA4K.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-DJRIH2PX.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addDays
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-G4COVQ5S.js";
|
|
4
4
|
|
|
5
5
|
// src/subDays.ts
|
|
6
6
|
function subDays(input, days) {
|
|
@@ -10,4 +10,4 @@ function subDays(input, days) {
|
|
|
10
10
|
export {
|
|
11
11
|
subDays
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-DN3V4IZC.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F6EWMA4K.js";
|
|
4
4
|
|
|
5
5
|
// src/addNanoseconds.ts
|
|
6
6
|
function addNanoseconds(input, nanoseconds) {
|
|
@@ -11,4 +11,4 @@ function addNanoseconds(input, nanoseconds) {
|
|
|
11
11
|
export {
|
|
12
12
|
addNanoseconds
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-DOGZ2WBH.js.map
|