@gobrand/tiempo 3.1.3 → 3.2.1
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 +4 -4
- package/dist/addDays.js +3 -3
- package/dist/addHours.js +3 -3
- package/dist/addMicroseconds.js +3 -3
- package/dist/addMilliseconds.js +3 -3
- package/dist/addMinutes.js +3 -3
- package/dist/addMonths.js +3 -3
- package/dist/addNanoseconds.js +3 -3
- package/dist/addQuarters.d.ts +1 -1
- package/dist/addQuarters.js +3 -3
- package/dist/addSeconds.js +3 -3
- package/dist/addWeeks.js +3 -3
- package/dist/addYears.js +3 -3
- 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-CN3OICYB.js → chunk-2LXWY2VY.js} +2 -2
- package/dist/{chunk-K3L6MJJB.js → chunk-2MWQYQ53.js} +2 -2
- package/dist/{chunk-LRIVI5ZC.js → chunk-34UWPATE.js} +2 -2
- package/dist/{chunk-QVSHSIA3.js → chunk-3OF6TFYK.js} +2 -2
- package/dist/{chunk-4KAIF44F.js → chunk-3YNUMQFB.js} +3 -3
- package/dist/{chunk-DZ3647ZK.js → chunk-4A3ORKMC.js} +3 -3
- package/dist/{chunk-Y24VUXMX.js → chunk-4JCRRIM3.js} +3 -3
- package/dist/{chunk-Y24VUXMX.js.map → chunk-4JCRRIM3.js.map} +1 -1
- package/dist/{chunk-IXNGK5OF.js → chunk-5EX3GTEU.js} +2 -2
- package/dist/{chunk-KTMCYEU5.js → chunk-5GRUOAYD.js} +2 -2
- package/dist/{chunk-KTMCYEU5.js.map → chunk-5GRUOAYD.js.map} +1 -1
- package/dist/{chunk-KZCSP3DU.js → chunk-5YKAVRED.js} +3 -3
- package/dist/{chunk-KYS54PLJ.js → chunk-6M654ZYJ.js} +3 -3
- package/dist/chunk-6M654ZYJ.js.map +1 -0
- package/dist/{chunk-DRBZDI52.js → chunk-6O66POF3.js} +2 -2
- package/dist/{chunk-U7VOIXLY.js → chunk-6SEPAWIA.js} +2 -2
- package/dist/{chunk-X27XGVCT.js → chunk-7DVEJNCP.js} +2 -2
- package/dist/{chunk-OF5YEVUT.js → chunk-7J7N4PCE.js} +2 -2
- package/dist/{chunk-OF5YEVUT.js.map → chunk-7J7N4PCE.js.map} +1 -1
- package/dist/chunk-7NHKDMBY.js +14 -0
- package/dist/chunk-7NHKDMBY.js.map +1 -0
- package/dist/{chunk-NMMMAMKP.js → chunk-7WGGUDW4.js} +1 -1
- package/dist/chunk-7WGGUDW4.js.map +1 -0
- package/dist/{chunk-DGUAV5XN.js → chunk-7ZJIEKIZ.js} +2 -2
- package/dist/chunk-7ZJIEKIZ.js.map +1 -0
- package/dist/{chunk-7IKCDOCT.js → chunk-AEAZ2F2T.js} +2 -2
- package/dist/{chunk-3HD7HEN4.js → chunk-APWSLQ47.js} +4 -4
- package/dist/{chunk-AOODDNHA.js → chunk-AWERPSJ5.js} +18 -16
- package/dist/chunk-AWERPSJ5.js.map +1 -0
- package/dist/{chunk-32AWWYBF.js → chunk-B7RDUXDN.js} +2 -2
- package/dist/{chunk-LQ3EQYIX.js → chunk-BE7CIKP7.js} +14 -6
- package/dist/chunk-BE7CIKP7.js.map +1 -0
- package/dist/{chunk-BI42E23Z.js → chunk-BM4OZR7U.js} +4 -4
- package/dist/{chunk-BI42E23Z.js.map → chunk-BM4OZR7U.js.map} +1 -1
- package/dist/{chunk-MXYAZTDE.js → chunk-C4LUGHIM.js} +7 -7
- package/dist/chunk-C4LUGHIM.js.map +1 -0
- package/dist/{chunk-3S6TSXZ3.js → chunk-CCDDXIAC.js} +2 -2
- package/dist/{chunk-BMX7CIRD.js → chunk-CMOBOTVN.js} +1 -1
- package/dist/chunk-CMOBOTVN.js.map +1 -0
- package/dist/{chunk-7NGP7SAD.js → chunk-COQJXPPT.js} +5 -5
- package/dist/{chunk-7NGP7SAD.js.map → chunk-COQJXPPT.js.map} +1 -1
- package/dist/{chunk-SLH6TKGN.js → chunk-CX37IV4D.js} +3 -3
- package/dist/{chunk-HYSGJJUR.js → chunk-D2HKS2OM.js} +2 -2
- package/dist/{chunk-4GEF7B7W.js → chunk-D73HU7YA.js} +3 -3
- package/dist/{chunk-OMYVTYHI.js → chunk-DAWWOF5W.js} +2 -2
- package/dist/{chunk-6QZUAJVF.js → chunk-DCQCZCKG.js} +4 -4
- package/dist/{chunk-5WHGX2J3.js → chunk-DEVXW65H.js} +2 -2
- package/dist/chunk-DFVLLH5O.js +17 -0
- package/dist/chunk-DFVLLH5O.js.map +1 -0
- package/dist/{chunk-ZM32S3YU.js → chunk-DYDSR35L.js} +2 -2
- package/dist/{chunk-ZM32S3YU.js.map → chunk-DYDSR35L.js.map} +1 -1
- package/dist/{chunk-QNZJR53W.js → chunk-DZFUKW5U.js} +4 -4
- package/dist/{chunk-QNZJR53W.js.map → chunk-DZFUKW5U.js.map} +1 -1
- package/dist/{chunk-F3UZDWOQ.js → chunk-EMJXV6KH.js} +2 -2
- package/dist/{chunk-F3UZDWOQ.js.map → chunk-EMJXV6KH.js.map} +1 -1
- package/dist/chunk-EMLUESE5.js +33 -0
- package/dist/chunk-EMLUESE5.js.map +1 -0
- package/dist/{chunk-QDY2KMYX.js → chunk-EQ3AZDKF.js} +3 -3
- package/dist/chunk-EQ3AZDKF.js.map +1 -0
- package/dist/{chunk-GQXJICRA.js → chunk-EWRNJC27.js} +2 -2
- package/dist/{chunk-TD6MVGV2.js → chunk-EYTJNGGV.js} +2 -2
- package/dist/{chunk-HCVE7FSF.js → chunk-FS7VH6AY.js} +2 -2
- package/dist/{chunk-HCVE7FSF.js.map → chunk-FS7VH6AY.js.map} +1 -1
- package/dist/{chunk-IWVSM77B.js → chunk-FTXHKXCS.js} +2 -2
- package/dist/{chunk-WTLMIOKZ.js → chunk-G7X7NHPV.js} +6 -3
- package/dist/{chunk-WTLMIOKZ.js.map → chunk-G7X7NHPV.js.map} +1 -1
- package/dist/{chunk-3HF4F36S.js → chunk-GLKCUJIZ.js} +3 -3
- package/dist/{chunk-GXSVYUCG.js → chunk-GZKKAIXF.js} +2 -2
- package/dist/{chunk-CDKIT7D3.js → chunk-H5TI3O4P.js} +1 -1
- package/dist/chunk-H5TI3O4P.js.map +1 -0
- package/dist/chunk-HH2HTC44.js +87 -0
- package/dist/chunk-HH2HTC44.js.map +1 -0
- package/dist/{chunk-TU3LNQKW.js → chunk-HMPHUFC6.js} +3 -3
- package/dist/{chunk-4VWUTQKP.js → chunk-HQ7JUUWD.js} +9 -5
- package/dist/chunk-HQ7JUUWD.js.map +1 -0
- package/dist/chunk-HXB6CDB4.js +26 -0
- package/dist/chunk-HXB6CDB4.js.map +1 -0
- package/dist/{chunk-SHKSAHJO.js → chunk-IOHTFQCP.js} +2 -2
- package/dist/chunk-IXRFVP3X.js +14 -0
- package/dist/chunk-IXRFVP3X.js.map +1 -0
- package/dist/{chunk-XSHFR2SX.js → chunk-IZPKAMAP.js} +2 -2
- package/dist/{chunk-3XGUCQ2A.js → chunk-JBGAF2FW.js} +2 -2
- package/dist/chunk-JDKM6JTT.js +20 -0
- package/dist/chunk-JDKM6JTT.js.map +1 -0
- package/dist/{chunk-ADPVFELS.js → chunk-K6IGDI5W.js} +2 -2
- package/dist/{chunk-ADPVFELS.js.map → chunk-K6IGDI5W.js.map} +1 -1
- package/dist/{chunk-AUOZACFS.js → chunk-KISBF5GX.js} +2 -2
- package/dist/{chunk-67XABEBT.js → chunk-KUDGVLQT.js} +11 -6
- package/dist/{chunk-67XABEBT.js.map → chunk-KUDGVLQT.js.map} +1 -1
- package/dist/{chunk-ZXKU4SKR.js → chunk-L535UIYN.js} +3 -3
- package/dist/{chunk-TIZJRCAA.js → chunk-L7X3FQZI.js} +2 -2
- package/dist/{chunk-TIZJRCAA.js.map → chunk-L7X3FQZI.js.map} +1 -1
- package/dist/{chunk-YMJHVVM4.js → chunk-LJMPJUHN.js} +2 -2
- package/dist/{chunk-NL5MQVGD.js → chunk-LKDENGBC.js} +2 -2
- package/dist/{chunk-A34P5Z5O.js → chunk-LL7XWZGU.js} +2 -2
- package/dist/chunk-LL7XWZGU.js.map +1 -0
- package/dist/{chunk-VDV24TWQ.js → chunk-LTYIPGQD.js} +2 -2
- package/dist/{chunk-JA5ER27P.js → chunk-LXAT3CDM.js} +2 -2
- package/dist/chunk-LXAT3CDM.js.map +1 -0
- package/dist/{chunk-MVGBYHG5.js → chunk-LY7IXVZO.js} +3 -3
- package/dist/{chunk-EBOLL4LY.js → chunk-M2QFNUJF.js} +2 -2
- package/dist/chunk-M2XB72L5.js +17 -0
- package/dist/chunk-M2XB72L5.js.map +1 -0
- package/dist/{chunk-BSVOJYJ7.js → chunk-M4ESIRFH.js} +1 -1
- package/dist/chunk-M4ESIRFH.js.map +1 -0
- package/dist/{chunk-RDMDCTHJ.js → chunk-MLD3VIOP.js} +2 -2
- package/dist/{chunk-BYPHFTFD.js → chunk-MPJ6UOLX.js} +7 -85
- package/dist/chunk-MPJ6UOLX.js.map +1 -0
- package/dist/{chunk-JGPTGV5X.js → chunk-MRJNMV4A.js} +3 -3
- package/dist/chunk-MYCH45BC.js +28 -0
- package/dist/chunk-MYCH45BC.js.map +1 -0
- package/dist/chunk-MZ26BHHP.js +21 -0
- package/dist/chunk-MZ26BHHP.js.map +1 -0
- package/dist/{chunk-EH4GVGXD.js → chunk-N5YFRFLA.js} +2 -2
- package/dist/{chunk-EH4GVGXD.js.map → chunk-N5YFRFLA.js.map} +1 -1
- package/dist/{chunk-NGS5UKDW.js → chunk-OJIV6AKO.js} +5 -5
- package/dist/chunk-OJIV6AKO.js.map +1 -0
- package/dist/{chunk-DBOIK3XA.js → chunk-ONTXMGEZ.js} +2 -2
- package/dist/{chunk-YKXRVQ4S.js → chunk-OURPZP7V.js} +2 -2
- package/dist/{chunk-MWUVGTKC.js → chunk-OZ5APQB7.js} +5 -5
- package/dist/{chunk-OOOVMKOG.js → chunk-PCYPESIN.js} +2 -2
- package/dist/{chunk-NZLRMN35.js → chunk-PENSGCVW.js} +2 -2
- package/dist/{chunk-6XEHR3MG.js → chunk-PI3QU5U5.js} +2 -2
- package/dist/{chunk-6XEHR3MG.js.map → chunk-PI3QU5U5.js.map} +1 -1
- package/dist/chunk-PJABNMRI.js +16 -0
- package/dist/chunk-PJABNMRI.js.map +1 -0
- package/dist/chunk-POCGMXLO.js +247 -0
- package/dist/chunk-POCGMXLO.js.map +1 -0
- package/dist/{chunk-VM2YJ5PN.js → chunk-PXKPP6C4.js} +2 -2
- package/dist/{chunk-HCORON7B.js → chunk-Q6MDBQRJ.js} +4 -4
- package/dist/{chunk-HCORON7B.js.map → chunk-Q6MDBQRJ.js.map} +1 -1
- package/dist/{chunk-TCB3IDJM.js → chunk-QCIY5PSJ.js} +4 -4
- package/dist/{chunk-LXOLIOAD.js → chunk-QF4M4T6G.js} +14 -6
- package/dist/{chunk-LXOLIOAD.js.map → chunk-QF4M4T6G.js.map} +1 -1
- package/dist/chunk-QFQHFBN4.js +61 -0
- package/dist/chunk-QFQHFBN4.js.map +1 -0
- package/dist/{chunk-ZW32E6EJ.js → chunk-QKIREPRK.js} +9 -9
- package/dist/{chunk-ZW32E6EJ.js.map → chunk-QKIREPRK.js.map} +1 -1
- package/dist/{chunk-LMOAA73F.js → chunk-QPE2V3MY.js} +3 -3
- package/dist/{chunk-2AID4P2C.js → chunk-R6CQ6XSS.js} +2 -2
- package/dist/{chunk-2AID4P2C.js.map → chunk-R6CQ6XSS.js.map} +1 -1
- package/dist/{chunk-6QH4NCPA.js → chunk-RCX6YW4I.js} +2 -2
- package/dist/{chunk-EAO2SO4N.js → chunk-RFUXK65B.js} +2 -2
- package/dist/chunk-RMVIA3NK.js +19 -0
- package/dist/chunk-RMVIA3NK.js.map +1 -0
- package/dist/chunk-S5CDK44R.js +22 -0
- package/dist/chunk-S5CDK44R.js.map +1 -0
- package/dist/{chunk-GU3CZAIN.js → chunk-SKHUBXIN.js} +2 -2
- package/dist/chunk-SURP2NUP.js +19 -0
- package/dist/chunk-SURP2NUP.js.map +1 -0
- package/dist/chunk-TH6YVPP4.js +21 -0
- package/dist/chunk-TH6YVPP4.js.map +1 -0
- package/dist/{chunk-V2NSN6ET.js → chunk-TP3VDQLF.js} +2 -2
- package/dist/{chunk-3X2U6I44.js → chunk-TZ4NUY3W.js} +3 -3
- package/dist/{chunk-6QOLNYFY.js → chunk-UB3F342R.js} +2 -2
- package/dist/chunk-UB3F342R.js.map +1 -0
- package/dist/{chunk-YSDLXJHE.js → chunk-UIOLC7XM.js} +2 -2
- package/dist/{chunk-PAM6VJQM.js → chunk-UP5M7NHW.js} +3 -3
- package/dist/chunk-UP5M7NHW.js.map +1 -0
- package/dist/chunk-UPWUAGEV.js +36 -0
- package/dist/chunk-UPWUAGEV.js.map +1 -0
- package/dist/{chunk-TI6WBLCB.js → chunk-UQ5GR6IX.js} +2 -2
- package/dist/{chunk-Q6QLOUXJ.js → chunk-UTM7YAT4.js} +2 -2
- package/dist/{chunk-HT6L4VRQ.js → chunk-UYHQBNQ4.js} +2 -2
- package/dist/{chunk-HT6L4VRQ.js.map → chunk-UYHQBNQ4.js.map} +1 -1
- package/dist/{chunk-R5XRTUWH.js → chunk-VQFWMNZO.js} +2 -2
- package/dist/{chunk-R2DCUSBY.js → chunk-WALS2M6Z.js} +2 -2
- package/dist/{chunk-K6NQZIAW.js → chunk-WTZ4LRQT.js} +2 -2
- package/dist/{chunk-3D4YR2SR.js → chunk-WVBZIXQP.js} +3 -3
- package/dist/{chunk-3D4YR2SR.js.map → chunk-WVBZIXQP.js.map} +1 -1
- package/dist/{chunk-525OLFRD.js → chunk-WWCLSC2B.js} +3 -3
- package/dist/chunk-WWCLSC2B.js.map +1 -0
- package/dist/chunk-X4ULMQ53.js +14 -0
- package/dist/chunk-X4ULMQ53.js.map +1 -0
- package/dist/{chunk-OEPVYNB6.js → chunk-XD4JKMGT.js} +2 -2
- package/dist/{chunk-OVBZ2NBB.js → chunk-XEAP4MXS.js} +11 -5
- package/dist/chunk-XEAP4MXS.js.map +1 -0
- package/dist/{chunk-BPMS34GV.js → chunk-XKS2HTEX.js} +3 -3
- package/dist/chunk-XKS2HTEX.js.map +1 -0
- package/dist/{chunk-TWXUGWYX.js → chunk-YN3Z5H5O.js} +1 -1
- package/dist/chunk-YN3Z5H5O.js.map +1 -0
- package/dist/{chunk-QZ6WXAUO.js → chunk-YPAI5UGF.js} +2 -2
- package/dist/{chunk-HRCTWTP3.js → chunk-YSUNJQBP.js} +3 -3
- package/dist/{chunk-NOWUJERX.js → chunk-Z7C5ZNPZ.js} +3 -3
- package/dist/{chunk-NOWUJERX.js.map → chunk-Z7C5ZNPZ.js.map} +1 -1
- package/dist/{chunk-QJYU5TLL.js → chunk-ZBNR46A5.js} +2 -2
- package/dist/{chunk-QJYU5TLL.js.map → chunk-ZBNR46A5.js.map} +1 -1
- package/dist/{chunk-JQ4Z4JTW.js → chunk-ZMAMJNWT.js} +2 -2
- package/dist/{chunk-NVFFQJEW.js → chunk-ZVAPV5JP.js} +4 -4
- package/dist/{chunk-NVFFQJEW.js.map → chunk-ZVAPV5JP.js.map} +1 -1
- package/dist/clamp.js +3 -3
- package/dist/closestTo.js +3 -3
- package/dist/compareAsc.js +3 -3
- package/dist/compareDesc.js +3 -3
- package/dist/differenceInBusinessDays.d.ts +7 -5
- package/dist/differenceInBusinessDays.d.ts.map +1 -1
- package/dist/differenceInBusinessDays.js +4 -4
- 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 +3 -3
- package/dist/differenceInHours.js +3 -3
- package/dist/differenceInMicroseconds.js +3 -3
- package/dist/differenceInMilliseconds.js +3 -3
- package/dist/differenceInMinutes.js +3 -3
- package/dist/differenceInMonths.js +3 -3
- package/dist/differenceInNanoseconds.js +3 -3
- package/dist/differenceInQuarters.d.ts +2 -2
- package/dist/differenceInQuarters.js +4 -4
- package/dist/differenceInSeconds.js +3 -3
- package/dist/differenceInWeeks.js +3 -3
- package/dist/differenceInYears.js +3 -3
- package/dist/eachDayOfInterval.js +4 -4
- package/dist/eachHourOfInterval.d.ts.map +1 -1
- package/dist/eachHourOfInterval.js +3 -3
- package/dist/eachMinuteOfInterval.js +3 -3
- package/dist/eachMonthOfInterval.js +5 -5
- package/dist/eachQuarterOfInterval.d.ts +1 -1
- package/dist/eachQuarterOfInterval.js +4 -4
- package/dist/eachWeekOfInterval.d.ts +7 -5
- package/dist/eachWeekOfInterval.d.ts.map +1 -1
- package/dist/eachWeekOfInterval.js +6 -5
- package/dist/eachYearOfInterval.js +5 -5
- package/dist/endOfDay.d.ts.map +1 -1
- package/dist/endOfDay.js +6 -6
- package/dist/endOfMonth.d.ts.map +1 -1
- package/dist/endOfMonth.js +6 -6
- package/dist/endOfQuarter.d.ts +2 -2
- package/dist/endOfQuarter.js +6 -6
- package/dist/endOfWeek.d.ts +17 -7
- package/dist/endOfWeek.d.ts.map +1 -1
- package/dist/endOfWeek.js +6 -5
- package/dist/endOfYear.d.ts.map +1 -1
- package/dist/endOfYear.js +6 -6
- package/dist/format.d.ts.map +1 -1
- package/dist/format.js +5 -4
- package/dist/formatPlainDate.js +2 -2
- package/dist/getQuarter.d.ts +1 -1
- package/dist/getQuarter.js +3 -3
- package/dist/index.d.ts +116 -106
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +191 -152
- package/dist/intlFormatDistance.js +10 -10
- package/dist/isAfter.js +3 -3
- package/dist/isBefore.js +3 -3
- package/dist/isEqual.js +3 -3
- package/dist/isFuture.d.ts.map +1 -1
- package/dist/isFuture.js +5 -5
- package/dist/isPast.d.ts.map +1 -1
- package/dist/isPast.js +5 -5
- package/dist/isPlainDateAfter.d.ts.map +1 -1
- package/dist/isPlainDateAfter.js +2 -2
- package/dist/isPlainDateBefore.d.ts.map +1 -1
- package/dist/isPlainDateBefore.js +2 -2
- package/dist/isPlainDateEqual.d.ts.map +1 -1
- package/dist/isPlainDateEqual.js +2 -2
- package/dist/isPlainTimeAfter.d.ts.map +1 -1
- package/dist/isPlainTimeAfter.js +2 -2
- package/dist/isPlainTimeBefore.d.ts.map +1 -1
- package/dist/isPlainTimeBefore.js +2 -2
- package/dist/isPlainTimeEqual.d.ts.map +1 -1
- package/dist/isPlainTimeEqual.js +2 -2
- package/dist/isSameDay.d.ts.map +1 -1
- package/dist/isSameDay.js +3 -3
- package/dist/isSameHour.js +3 -3
- package/dist/isSameMicrosecond.js +3 -3
- package/dist/isSameMillisecond.js +3 -3
- package/dist/isSameMinute.js +3 -3
- package/dist/isSameMonth.js +3 -3
- package/dist/isSameNanosecond.js +3 -3
- package/dist/isSameQuarter.d.ts +1 -1
- package/dist/isSameQuarter.js +3 -3
- package/dist/isSameSecond.js +3 -3
- package/dist/isSameWeek.d.ts +16 -7
- package/dist/isSameWeek.d.ts.map +1 -1
- package/dist/isSameWeek.js +4 -3
- package/dist/isSameYear.js +3 -3
- package/dist/isToday.js +6 -6
- package/dist/isTomorrow.js +6 -6
- package/dist/isWeekend.js +4 -4
- package/dist/isWithinInterval.d.ts +41 -6
- package/dist/isWithinInterval.d.ts.map +1 -1
- package/dist/isWithinInterval.js +6 -5
- package/dist/isYesterday.js +6 -6
- package/dist/max.js +3 -3
- package/dist/min.js +3 -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/now.js +2 -2
- 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 +3 -3
- package/dist/roundToNearestMinute.js +3 -3
- package/dist/roundToNearestSecond.js +3 -3
- package/dist/shared/businessDays.d.ts +15 -0
- package/dist/shared/businessDays.d.ts.map +1 -1
- package/dist/shared/businessDays.js +9 -5
- 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/compare.js +2 -2
- package/dist/shared/differenceInMilliseconds.js +1 -1
- package/dist/shared/endOfDay.d.ts.map +1 -1
- package/dist/shared/endOfDay.js +1 -1
- 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/isAfter.d.ts.map +1 -1
- package/dist/shared/isAfter.js +1 -1
- package/dist/shared/isBefore.d.ts.map +1 -1
- package/dist/shared/isBefore.js +1 -1
- package/dist/shared/normalizeTemporalInput.js +2 -2
- package/dist/shared/normalizeWithPlainDate.js +4 -4
- package/dist/shared/nowZoned.js +3 -3
- package/dist/shared/plainDateToZonedDateTime.js +2 -2
- package/dist/shared/relativeDay.js +5 -5
- package/dist/shared/temporal.d.ts +1 -1
- package/dist/shared/temporal.js +1 -1
- 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/simpleFormat.d.ts.map +1 -1
- package/dist/simpleFormat.js +2 -2
- package/dist/startOfDay.d.ts.map +1 -1
- package/dist/startOfDay.js +5 -5
- package/dist/startOfMonth.d.ts.map +1 -1
- package/dist/startOfMonth.js +5 -5
- package/dist/startOfQuarter.d.ts +2 -2
- package/dist/startOfQuarter.js +5 -5
- package/dist/startOfWeek.d.ts +17 -7
- package/dist/startOfWeek.d.ts.map +1 -1
- package/dist/startOfWeek.js +5 -4
- package/dist/startOfYear.d.ts.map +1 -1
- package/dist/startOfYear.js +5 -5
- package/dist/subBusinessDays.d.ts +6 -4
- package/dist/subBusinessDays.d.ts.map +1 -1
- package/dist/subBusinessDays.js +5 -5
- package/dist/subDays.js +4 -4
- package/dist/subHours.js +4 -4
- package/dist/subMicroseconds.js +4 -4
- package/dist/subMilliseconds.js +4 -4
- package/dist/subMinutes.js +4 -4
- package/dist/subMonths.js +4 -4
- package/dist/subNanoseconds.js +4 -4
- package/dist/subQuarters.d.ts +1 -1
- package/dist/subQuarters.js +4 -4
- package/dist/subSeconds.js +4 -4
- package/dist/subWeeks.js +4 -4
- package/dist/subYears.js +4 -4
- package/dist/toDate.d.ts.map +1 -1
- package/dist/toDate.js +2 -2
- package/dist/toInstant.js +2 -2
- package/dist/toIso.d.ts.map +1 -1
- package/dist/toIso.js +2 -2
- package/dist/toIso9075.d.ts.map +1 -1
- package/dist/toIso9075.js +2 -2
- package/dist/toPlainDate.js +2 -2
- package/dist/toPlainTime.js +2 -2
- package/dist/toZonedTime.js +2 -2
- package/dist/today.js +2 -2
- package/package.json +33 -26
- package/dist/chunk-2TISXHHK.js +0 -29
- package/dist/chunk-2TISXHHK.js.map +0 -1
- package/dist/chunk-4PS6BEAC.js +0 -16
- package/dist/chunk-4PS6BEAC.js.map +0 -1
- package/dist/chunk-4VWUTQKP.js.map +0 -1
- package/dist/chunk-525OLFRD.js.map +0 -1
- package/dist/chunk-57MHNRCU.js +0 -22
- package/dist/chunk-57MHNRCU.js.map +0 -1
- package/dist/chunk-6QOLNYFY.js.map +0 -1
- package/dist/chunk-A34P5Z5O.js.map +0 -1
- package/dist/chunk-AOODDNHA.js.map +0 -1
- package/dist/chunk-BMX7CIRD.js.map +0 -1
- package/dist/chunk-BPMS34GV.js.map +0 -1
- package/dist/chunk-BSVOJYJ7.js.map +0 -1
- package/dist/chunk-BYPHFTFD.js.map +0 -1
- package/dist/chunk-CDKIT7D3.js.map +0 -1
- package/dist/chunk-D3N7BT44.js +0 -22
- package/dist/chunk-D3N7BT44.js.map +0 -1
- package/dist/chunk-DGUAV5XN.js.map +0 -1
- package/dist/chunk-GCVX5QIX.js +0 -15
- package/dist/chunk-GCVX5QIX.js.map +0 -1
- package/dist/chunk-JA5ER27P.js.map +0 -1
- package/dist/chunk-K7CLBBBM.js +0 -36
- package/dist/chunk-K7CLBBBM.js.map +0 -1
- package/dist/chunk-KYS54PLJ.js.map +0 -1
- package/dist/chunk-LQ3EQYIX.js.map +0 -1
- package/dist/chunk-MLHFNZEA.js +0 -26
- package/dist/chunk-MLHFNZEA.js.map +0 -1
- package/dist/chunk-MXYAZTDE.js.map +0 -1
- package/dist/chunk-NGS5UKDW.js.map +0 -1
- package/dist/chunk-NMMMAMKP.js.map +0 -1
- package/dist/chunk-OVBZ2NBB.js.map +0 -1
- package/dist/chunk-PAM6VJQM.js.map +0 -1
- package/dist/chunk-QDY2KMYX.js.map +0 -1
- package/dist/chunk-TWXUGWYX.js.map +0 -1
- /package/dist/{chunk-CN3OICYB.js.map → chunk-2LXWY2VY.js.map} +0 -0
- /package/dist/{chunk-K3L6MJJB.js.map → chunk-2MWQYQ53.js.map} +0 -0
- /package/dist/{chunk-LRIVI5ZC.js.map → chunk-34UWPATE.js.map} +0 -0
- /package/dist/{chunk-QVSHSIA3.js.map → chunk-3OF6TFYK.js.map} +0 -0
- /package/dist/{chunk-4KAIF44F.js.map → chunk-3YNUMQFB.js.map} +0 -0
- /package/dist/{chunk-DZ3647ZK.js.map → chunk-4A3ORKMC.js.map} +0 -0
- /package/dist/{chunk-IXNGK5OF.js.map → chunk-5EX3GTEU.js.map} +0 -0
- /package/dist/{chunk-KZCSP3DU.js.map → chunk-5YKAVRED.js.map} +0 -0
- /package/dist/{chunk-DRBZDI52.js.map → chunk-6O66POF3.js.map} +0 -0
- /package/dist/{chunk-U7VOIXLY.js.map → chunk-6SEPAWIA.js.map} +0 -0
- /package/dist/{chunk-X27XGVCT.js.map → chunk-7DVEJNCP.js.map} +0 -0
- /package/dist/{chunk-7IKCDOCT.js.map → chunk-AEAZ2F2T.js.map} +0 -0
- /package/dist/{chunk-3HD7HEN4.js.map → chunk-APWSLQ47.js.map} +0 -0
- /package/dist/{chunk-32AWWYBF.js.map → chunk-B7RDUXDN.js.map} +0 -0
- /package/dist/{chunk-3S6TSXZ3.js.map → chunk-CCDDXIAC.js.map} +0 -0
- /package/dist/{chunk-SLH6TKGN.js.map → chunk-CX37IV4D.js.map} +0 -0
- /package/dist/{chunk-HYSGJJUR.js.map → chunk-D2HKS2OM.js.map} +0 -0
- /package/dist/{chunk-4GEF7B7W.js.map → chunk-D73HU7YA.js.map} +0 -0
- /package/dist/{chunk-OMYVTYHI.js.map → chunk-DAWWOF5W.js.map} +0 -0
- /package/dist/{chunk-6QZUAJVF.js.map → chunk-DCQCZCKG.js.map} +0 -0
- /package/dist/{chunk-5WHGX2J3.js.map → chunk-DEVXW65H.js.map} +0 -0
- /package/dist/{chunk-GQXJICRA.js.map → chunk-EWRNJC27.js.map} +0 -0
- /package/dist/{chunk-TD6MVGV2.js.map → chunk-EYTJNGGV.js.map} +0 -0
- /package/dist/{chunk-IWVSM77B.js.map → chunk-FTXHKXCS.js.map} +0 -0
- /package/dist/{chunk-3HF4F36S.js.map → chunk-GLKCUJIZ.js.map} +0 -0
- /package/dist/{chunk-GXSVYUCG.js.map → chunk-GZKKAIXF.js.map} +0 -0
- /package/dist/{chunk-TU3LNQKW.js.map → chunk-HMPHUFC6.js.map} +0 -0
- /package/dist/{chunk-SHKSAHJO.js.map → chunk-IOHTFQCP.js.map} +0 -0
- /package/dist/{chunk-XSHFR2SX.js.map → chunk-IZPKAMAP.js.map} +0 -0
- /package/dist/{chunk-3XGUCQ2A.js.map → chunk-JBGAF2FW.js.map} +0 -0
- /package/dist/{chunk-AUOZACFS.js.map → chunk-KISBF5GX.js.map} +0 -0
- /package/dist/{chunk-ZXKU4SKR.js.map → chunk-L535UIYN.js.map} +0 -0
- /package/dist/{chunk-YMJHVVM4.js.map → chunk-LJMPJUHN.js.map} +0 -0
- /package/dist/{chunk-NL5MQVGD.js.map → chunk-LKDENGBC.js.map} +0 -0
- /package/dist/{chunk-VDV24TWQ.js.map → chunk-LTYIPGQD.js.map} +0 -0
- /package/dist/{chunk-MVGBYHG5.js.map → chunk-LY7IXVZO.js.map} +0 -0
- /package/dist/{chunk-EBOLL4LY.js.map → chunk-M2QFNUJF.js.map} +0 -0
- /package/dist/{chunk-RDMDCTHJ.js.map → chunk-MLD3VIOP.js.map} +0 -0
- /package/dist/{chunk-JGPTGV5X.js.map → chunk-MRJNMV4A.js.map} +0 -0
- /package/dist/{chunk-DBOIK3XA.js.map → chunk-ONTXMGEZ.js.map} +0 -0
- /package/dist/{chunk-YKXRVQ4S.js.map → chunk-OURPZP7V.js.map} +0 -0
- /package/dist/{chunk-MWUVGTKC.js.map → chunk-OZ5APQB7.js.map} +0 -0
- /package/dist/{chunk-OOOVMKOG.js.map → chunk-PCYPESIN.js.map} +0 -0
- /package/dist/{chunk-NZLRMN35.js.map → chunk-PENSGCVW.js.map} +0 -0
- /package/dist/{chunk-VM2YJ5PN.js.map → chunk-PXKPP6C4.js.map} +0 -0
- /package/dist/{chunk-TCB3IDJM.js.map → chunk-QCIY5PSJ.js.map} +0 -0
- /package/dist/{chunk-LMOAA73F.js.map → chunk-QPE2V3MY.js.map} +0 -0
- /package/dist/{chunk-6QH4NCPA.js.map → chunk-RCX6YW4I.js.map} +0 -0
- /package/dist/{chunk-EAO2SO4N.js.map → chunk-RFUXK65B.js.map} +0 -0
- /package/dist/{chunk-GU3CZAIN.js.map → chunk-SKHUBXIN.js.map} +0 -0
- /package/dist/{chunk-V2NSN6ET.js.map → chunk-TP3VDQLF.js.map} +0 -0
- /package/dist/{chunk-3X2U6I44.js.map → chunk-TZ4NUY3W.js.map} +0 -0
- /package/dist/{chunk-YSDLXJHE.js.map → chunk-UIOLC7XM.js.map} +0 -0
- /package/dist/{chunk-TI6WBLCB.js.map → chunk-UQ5GR6IX.js.map} +0 -0
- /package/dist/{chunk-Q6QLOUXJ.js.map → chunk-UTM7YAT4.js.map} +0 -0
- /package/dist/{chunk-R5XRTUWH.js.map → chunk-VQFWMNZO.js.map} +0 -0
- /package/dist/{chunk-R2DCUSBY.js.map → chunk-WALS2M6Z.js.map} +0 -0
- /package/dist/{chunk-K6NQZIAW.js.map → chunk-WTZ4LRQT.js.map} +0 -0
- /package/dist/{chunk-OEPVYNB6.js.map → chunk-XD4JKMGT.js.map} +0 -0
- /package/dist/{chunk-QZ6WXAUO.js.map → chunk-YPAI5UGF.js.map} +0 -0
- /package/dist/{chunk-HRCTWTP3.js.map → chunk-YSUNJQBP.js.map} +0 -0
- /package/dist/{chunk-JQ4Z4JTW.js.map → chunk-ZMAMJNWT.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/intlFormatDistance.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { differenceInDays } from './differenceInDays.js';\nimport { differenceInHours } from './differenceInHours.js';\nimport { differenceInMinutes } from './differenceInMinutes.js';\nimport { differenceInMonths } from './differenceInMonths.js';\nimport { differenceInSeconds } from './differenceInSeconds.js';\nimport { differenceInWeeks } from './differenceInWeeks.js';\nimport { differenceInYears } from './differenceInYears.js';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput.js';\n\nexport interface IntlFormatDistanceOptions {\n /**\n * The unit to force formatting in. If not specified, the unit will be automatically selected.\n */\n unit?: Intl.RelativeTimeFormatUnit;\n /**\n * The locale to use for formatting. Defaults to the system locale.\n */\n locale?: string | string[];\n /**\n * The locale matching algorithm to use.\n */\n localeMatcher?: 'best fit' | 'lookup';\n /**\n * Whether to use numeric values always, or use special strings like \"yesterday\", \"tomorrow\", etc.\n * Defaults to 'auto'.\n */\n numeric?: 'always' | 'auto';\n /**\n * The formatting style to use.\n */\n style?: 'long' | 'short' | 'narrow';\n}\n\n/**\n * Formats the distance between two dates as a human-readable, internationalized string.\n *\n * The function automatically picks the most appropriate unit based on the distance between dates.\n * For example, if the distance is a few hours, it returns \"in X hours\". If the distance is a few\n * months, it returns \"in X months\".\n *\n * You can force a specific unit using the `options.unit` parameter.\n *\n * @param laterDate - The later date to compare\n * @param earlierDate - The earlier date to compare with\n * @param options - Formatting options\n * @returns The formatted distance string\n *\n * @example\n * ```typescript\n * const later = Temporal.Instant.from('2024-01-01T12:00:00Z');\n * const earlier = Temporal.Instant.from('2024-01-01T11:00:00Z');\n *\n * intlFormatDistance(later, earlier);\n * // => 'in 1 hour'\n *\n * intlFormatDistance(earlier, later);\n * // => '1 hour ago'\n * ```\n *\n * @example\n * ```typescript\n * // Force a specific unit\n * const later = Temporal.Instant.from('2025-01-01T00:00:00Z');\n * const earlier = Temporal.Instant.from('2024-01-01T00:00:00Z');\n *\n * intlFormatDistance(later, earlier, { unit: 'quarter' });\n * // => 'in 4 quarters'\n * ```\n *\n * @example\n * ```typescript\n * // Use a different locale\n * const later = Temporal.Instant.from('2024-01-01T12:00:00Z');\n * const earlier = Temporal.Instant.from('2024-01-01T11:00:00Z');\n *\n * intlFormatDistance(later, earlier, { locale: 'es' });\n * // => 'dentro de 1 hora'\n * ```\n *\n * @example\n * ```typescript\n * // Use numeric: 'always' to avoid special strings\n * const later = Temporal.Instant.from('2024-01-02T00:00:00Z');\n * const earlier = Temporal.Instant.from('2024-01-01T00:00:00Z');\n *\n * intlFormatDistance(later, earlier, { numeric: 'auto' });\n * // => 'tomorrow'\n *\n * intlFormatDistance(later, earlier, { numeric: 'always' });\n * // => 'in 1 day'\n * ```\n */\nexport function intlFormatDistance(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime,\n options?: IntlFormatDistanceOptions\n): string {\n const zoned1 = normalizeTemporalInput(laterDate);\n const zoned2 = normalizeTemporalInput(earlierDate);\n\n // Determine unit if not specified\n let unit = options?.unit;\n if (!unit) {\n const absSeconds = Math.abs(differenceInSeconds(zoned1, zoned2));\n const absMinutes = Math.abs(differenceInMinutes(zoned1, zoned2));\n const absHours = Math.abs(differenceInHours(zoned1, zoned2));\n // calendar units were fractional pre-2.x; sub-day units stay truncated so Math.round below is a no-op\n const absDays = Math.abs(differenceInDays(zoned1, zoned2, { fractional: true }));\n const absWeeks = Math.abs(differenceInWeeks(zoned1, zoned2, { fractional: true }));\n const absMonths = Math.abs(differenceInMonths(zoned1, zoned2, { fractional: true }));\n\n if (absSeconds < 60) {\n unit = 'second';\n } else if (absMinutes < 60) {\n unit = 'minute';\n } else if (absHours < 24) {\n unit = 'hour';\n } else if (absDays < 7) {\n unit = 'day';\n } else if (absWeeks < 4) {\n unit = 'week';\n } else if (absMonths < 12) {\n unit = 'month';\n } else {\n unit = 'year';\n }\n }\n\n // Calculate value for the selected unit\n let value: number;\n switch (unit) {\n case 'second':\n value = Math.round(differenceInSeconds(zoned1, zoned2));\n break;\n case 'minute':\n value = Math.round(differenceInMinutes(zoned1, zoned2));\n break;\n case 'hour':\n value = Math.round(differenceInHours(zoned1, zoned2));\n break;\n // calendar units were fractional pre-2.x; sub-day units stay truncated so Math.round is a no-op\n case 'day':\n value = Math.round(differenceInDays(zoned1, zoned2, { fractional: true }));\n break;\n case 'week':\n value = Math.round(differenceInWeeks(zoned1, zoned2, { fractional: true }));\n break;\n case 'month':\n value = Math.round(differenceInMonths(zoned1, zoned2, { fractional: true }));\n break;\n case 'quarter':\n value = Math.round(differenceInMonths(zoned1, zoned2, { fractional: true }) / 3);\n break;\n case 'year':\n value = Math.round(differenceInYears(zoned1, zoned2, { fractional: true }));\n break;\n default:\n // For any other unit type, try to use it directly\n value = Math.round(differenceInSeconds(zoned1, zoned2));\n }\n\n // Format using Intl.RelativeTimeFormat\n const formatter = new Intl.RelativeTimeFormat(options?.locale, {\n localeMatcher: options?.localeMatcher,\n numeric: options?.numeric ?? 'auto',\n style: options?.style
|
|
1
|
+
{"version":3,"sources":["../src/intlFormatDistance.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { differenceInDays } from './differenceInDays.js';\nimport { differenceInHours } from './differenceInHours.js';\nimport { differenceInMinutes } from './differenceInMinutes.js';\nimport { differenceInMonths } from './differenceInMonths.js';\nimport { differenceInSeconds } from './differenceInSeconds.js';\nimport { differenceInWeeks } from './differenceInWeeks.js';\nimport { differenceInYears } from './differenceInYears.js';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput.js';\n\nexport interface IntlFormatDistanceOptions {\n /**\n * The unit to force formatting in. If not specified, the unit will be automatically selected.\n */\n unit?: Intl.RelativeTimeFormatUnit;\n /**\n * The locale to use for formatting. Defaults to the system locale.\n */\n locale?: string | string[];\n /**\n * The locale matching algorithm to use.\n */\n localeMatcher?: 'best fit' | 'lookup';\n /**\n * Whether to use numeric values always, or use special strings like \"yesterday\", \"tomorrow\", etc.\n * Defaults to 'auto'.\n */\n numeric?: 'always' | 'auto';\n /**\n * The formatting style to use.\n */\n style?: 'long' | 'short' | 'narrow';\n}\n\n/**\n * Formats the distance between two dates as a human-readable, internationalized string.\n *\n * The function automatically picks the most appropriate unit based on the distance between dates.\n * For example, if the distance is a few hours, it returns \"in X hours\". If the distance is a few\n * months, it returns \"in X months\".\n *\n * You can force a specific unit using the `options.unit` parameter.\n *\n * @param laterDate - The later date to compare\n * @param earlierDate - The earlier date to compare with\n * @param options - Formatting options\n * @returns The formatted distance string\n *\n * @example\n * ```typescript\n * const later = Temporal.Instant.from('2024-01-01T12:00:00Z');\n * const earlier = Temporal.Instant.from('2024-01-01T11:00:00Z');\n *\n * intlFormatDistance(later, earlier);\n * // => 'in 1 hour'\n *\n * intlFormatDistance(earlier, later);\n * // => '1 hour ago'\n * ```\n *\n * @example\n * ```typescript\n * // Force a specific unit\n * const later = Temporal.Instant.from('2025-01-01T00:00:00Z');\n * const earlier = Temporal.Instant.from('2024-01-01T00:00:00Z');\n *\n * intlFormatDistance(later, earlier, { unit: 'quarter' });\n * // => 'in 4 quarters'\n * ```\n *\n * @example\n * ```typescript\n * // Use a different locale\n * const later = Temporal.Instant.from('2024-01-01T12:00:00Z');\n * const earlier = Temporal.Instant.from('2024-01-01T11:00:00Z');\n *\n * intlFormatDistance(later, earlier, { locale: 'es' });\n * // => 'dentro de 1 hora'\n * ```\n *\n * @example\n * ```typescript\n * // Use numeric: 'always' to avoid special strings\n * const later = Temporal.Instant.from('2024-01-02T00:00:00Z');\n * const earlier = Temporal.Instant.from('2024-01-01T00:00:00Z');\n *\n * intlFormatDistance(later, earlier, { numeric: 'auto' });\n * // => 'tomorrow'\n *\n * intlFormatDistance(later, earlier, { numeric: 'always' });\n * // => 'in 1 day'\n * ```\n */\nexport function intlFormatDistance(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime,\n options?: IntlFormatDistanceOptions\n): string {\n const zoned1 = normalizeTemporalInput(laterDate);\n const zoned2 = normalizeTemporalInput(earlierDate);\n\n // Determine unit if not specified\n let unit = options?.unit;\n if (!unit) {\n const absSeconds = Math.abs(differenceInSeconds(zoned1, zoned2));\n const absMinutes = Math.abs(differenceInMinutes(zoned1, zoned2));\n const absHours = Math.abs(differenceInHours(zoned1, zoned2));\n // calendar units were fractional pre-2.x; sub-day units stay truncated so Math.round below is a no-op\n const absDays = Math.abs(differenceInDays(zoned1, zoned2, { fractional: true }));\n const absWeeks = Math.abs(differenceInWeeks(zoned1, zoned2, { fractional: true }));\n const absMonths = Math.abs(differenceInMonths(zoned1, zoned2, { fractional: true }));\n\n if (absSeconds < 60) {\n unit = 'second';\n } else if (absMinutes < 60) {\n unit = 'minute';\n } else if (absHours < 24) {\n unit = 'hour';\n } else if (absDays < 7) {\n unit = 'day';\n } else if (absWeeks < 4) {\n unit = 'week';\n } else if (absMonths < 12) {\n unit = 'month';\n } else {\n unit = 'year';\n }\n }\n\n // Calculate value for the selected unit\n let value: number;\n switch (unit) {\n case 'second':\n value = Math.round(differenceInSeconds(zoned1, zoned2));\n break;\n case 'minute':\n value = Math.round(differenceInMinutes(zoned1, zoned2));\n break;\n case 'hour':\n value = Math.round(differenceInHours(zoned1, zoned2));\n break;\n // calendar units were fractional pre-2.x; sub-day units stay truncated so Math.round is a no-op\n case 'day':\n value = Math.round(differenceInDays(zoned1, zoned2, { fractional: true }));\n break;\n case 'week':\n value = Math.round(differenceInWeeks(zoned1, zoned2, { fractional: true }));\n break;\n case 'month':\n value = Math.round(differenceInMonths(zoned1, zoned2, { fractional: true }));\n break;\n case 'quarter':\n value = Math.round(differenceInMonths(zoned1, zoned2, { fractional: true }) / 3);\n break;\n case 'year':\n value = Math.round(differenceInYears(zoned1, zoned2, { fractional: true }));\n break;\n default:\n // For any other unit type, try to use it directly\n value = Math.round(differenceInSeconds(zoned1, zoned2));\n }\n\n // Format using Intl.RelativeTimeFormat\n const formatter = new Intl.RelativeTimeFormat(options?.locale, {\n localeMatcher: options?.localeMatcher,\n numeric: options?.numeric ?? 'auto',\n style: options?.style\n });\n\n return formatter.format(value, unit);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA6FO,SAAS,mBACd,WACA,aACA,SACQ;AACR,QAAM,SAAS,uBAAuB,SAAS;AAC/C,QAAM,SAAS,uBAAuB,WAAW;AAGjD,MAAI,OAAO,SAAS;AACpB,MAAI,CAAC,MAAM;AACT,UAAM,aAAa,KAAK,IAAI,oBAAoB,QAAQ,MAAM,CAAC;AAC/D,UAAM,aAAa,KAAK,IAAI,oBAAoB,QAAQ,MAAM,CAAC;AAC/D,UAAM,WAAW,KAAK,IAAI,kBAAkB,QAAQ,MAAM,CAAC;AAE3D,UAAM,UAAU,KAAK,IAAI,iBAAiB,QAAQ,QAAQ,EAAE,YAAY,KAAK,CAAC,CAAC;AAC/E,UAAM,WAAW,KAAK,IAAI,kBAAkB,QAAQ,QAAQ,EAAE,YAAY,KAAK,CAAC,CAAC;AACjF,UAAM,YAAY,KAAK,IAAI,mBAAmB,QAAQ,QAAQ,EAAE,YAAY,KAAK,CAAC,CAAC;AAEnF,QAAI,aAAa,IAAI;AACnB,aAAO;AAAA,IACT,WAAW,aAAa,IAAI;AAC1B,aAAO;AAAA,IACT,WAAW,WAAW,IAAI;AACxB,aAAO;AAAA,IACT,WAAW,UAAU,GAAG;AACtB,aAAO;AAAA,IACT,WAAW,WAAW,GAAG;AACvB,aAAO;AAAA,IACT,WAAW,YAAY,IAAI;AACzB,aAAO;AAAA,IACT,OAAO;AACL,aAAO;AAAA,IACT;AAAA,EACF;AAGA,MAAI;AACJ,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,cAAQ,KAAK,MAAM,oBAAoB,QAAQ,MAAM,CAAC;AACtD;AAAA,IACF,KAAK;AACH,cAAQ,KAAK,MAAM,oBAAoB,QAAQ,MAAM,CAAC;AACtD;AAAA,IACF,KAAK;AACH,cAAQ,KAAK,MAAM,kBAAkB,QAAQ,MAAM,CAAC;AACpD;AAAA;AAAA,IAEF,KAAK;AACH,cAAQ,KAAK,MAAM,iBAAiB,QAAQ,QAAQ,EAAE,YAAY,KAAK,CAAC,CAAC;AACzE;AAAA,IACF,KAAK;AACH,cAAQ,KAAK,MAAM,kBAAkB,QAAQ,QAAQ,EAAE,YAAY,KAAK,CAAC,CAAC;AAC1E;AAAA,IACF,KAAK;AACH,cAAQ,KAAK,MAAM,mBAAmB,QAAQ,QAAQ,EAAE,YAAY,KAAK,CAAC,CAAC;AAC3E;AAAA,IACF,KAAK;AACH,cAAQ,KAAK,MAAM,mBAAmB,QAAQ,QAAQ,EAAE,YAAY,KAAK,CAAC,IAAI,CAAC;AAC/E;AAAA,IACF,KAAK;AACH,cAAQ,KAAK,MAAM,kBAAkB,QAAQ,QAAQ,EAAE,YAAY,KAAK,CAAC,CAAC;AAC1E;AAAA,IACF;AAEE,cAAQ,KAAK,MAAM,oBAAoB,QAAQ,MAAM,CAAC;AAAA,EAC1D;AAGA,QAAM,YAAY,IAAI,KAAK,mBAAmB,SAAS,QAAQ;AAAA,IAC7D,eAAe,SAAS;AAAA,IACxB,SAAS,SAAS,WAAW;AAAA,IAC7B,OAAO,SAAS;AAAA,EAClB,CAAC;AAED,SAAO,UAAU,OAAO,OAAO,IAAI;AACrC;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTM7YAT4.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-M4ESIRFH.js";
|
|
7
7
|
|
|
8
8
|
// src/differenceInYears.ts
|
|
9
9
|
function differenceInYears(laterDate, earlierDate, options) {
|
|
@@ -25,4 +25,4 @@ function differenceInYears(laterDate, earlierDate, options) {
|
|
|
25
25
|
export {
|
|
26
26
|
differenceInYears
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
//# sourceMappingURL=chunk-QPE2V3MY.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Temporal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-M4ESIRFH.js";
|
|
4
4
|
|
|
5
5
|
// src/shared/plainDateToZonedDateTime.ts
|
|
6
6
|
function plainDateToZonedDateTime(date, timezone) {
|
|
@@ -13,4 +13,4 @@ function plainDateToZonedDateTime(date, timezone) {
|
|
|
13
13
|
export {
|
|
14
14
|
plainDateToZonedDateTime
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-R6CQ6XSS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/shared/plainDateToZonedDateTime.ts"],"sourcesContent":["import { Temporal } from './temporal';\nimport type { Timezone } from '../types';\n\n/**\n * @internal\n * Converts a PlainDate to a ZonedDateTime at midnight in the specified timezone.\n * This is an internal helper - do not use directly.\n */\nexport function plainDateToZonedDateTime(\n date: Temporal.PlainDate,\n timezone: Timezone\n): Temporal.ZonedDateTime {\n return date.toZonedDateTime({\n timeZone: timezone,\n plainTime: Temporal.PlainTime.from('00:00')
|
|
1
|
+
{"version":3,"sources":["../src/shared/plainDateToZonedDateTime.ts"],"sourcesContent":["import { Temporal } from './temporal';\nimport type { Timezone } from '../types';\n\n/**\n * @internal\n * Converts a PlainDate to a ZonedDateTime at midnight in the specified timezone.\n * This is an internal helper - do not use directly.\n */\nexport function plainDateToZonedDateTime(\n date: Temporal.PlainDate,\n timezone: Timezone\n): Temporal.ZonedDateTime {\n return date.toZonedDateTime({\n timeZone: timezone,\n plainTime: Temporal.PlainTime.from('00:00')\n });\n}\n"],"mappings":";;;;;AAQO,SAAS,yBACd,MACA,UACwB;AACxB,SAAO,KAAK,gBAAgB;AAAA,IAC1B,UAAU;AAAA,IACV,WAAW,SAAS,UAAU,KAAK,OAAO;AAAA,EAC5C,CAAC;AACH;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addMilliseconds
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KISBF5GX.js";
|
|
4
4
|
|
|
5
5
|
// src/subMilliseconds.ts
|
|
6
6
|
function subMilliseconds(input, milliseconds) {
|
|
@@ -10,4 +10,4 @@ function subMilliseconds(input, milliseconds) {
|
|
|
10
10
|
export {
|
|
11
11
|
subMilliseconds
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-RCX6YW4I.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addMinutes
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GZKKAIXF.js";
|
|
4
4
|
|
|
5
5
|
// src/subMinutes.ts
|
|
6
6
|
function subMinutes(input, minutes) {
|
|
@@ -10,4 +10,4 @@ function subMinutes(input, minutes) {
|
|
|
10
10
|
export {
|
|
11
11
|
subMinutes
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-RFUXK65B.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
quarterOfMonth
|
|
3
|
+
} from "./chunk-XS2HUADA.js";
|
|
4
|
+
import {
|
|
5
|
+
calendarDates
|
|
6
|
+
} from "./chunk-HXB6CDB4.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-RMVIA3NK.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":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
addBusinessDaysSkipping
|
|
3
|
+
} from "./chunk-QFQHFBN4.js";
|
|
4
|
+
import {
|
|
5
|
+
normalizeTemporalInput
|
|
6
|
+
} from "./chunk-UTM7YAT4.js";
|
|
7
|
+
import {
|
|
8
|
+
isPlainDate
|
|
9
|
+
} from "./chunk-M4ESIRFH.js";
|
|
10
|
+
|
|
11
|
+
// src/addBusinessDays.ts
|
|
12
|
+
function addBusinessDays(input, days, holidays = []) {
|
|
13
|
+
if (isPlainDate(input)) {
|
|
14
|
+
return addBusinessDaysSkipping(input, days, holidays);
|
|
15
|
+
}
|
|
16
|
+
return addBusinessDaysSkipping(normalizeTemporalInput(input), days, holidays);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
addBusinessDays
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=chunk-S5CDK44R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/addBusinessDays.ts"],"sourcesContent":["import { type Temporal, isPlainDate } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport { addBusinessDaysSkipping } from './shared/businessDays';\n\n/**\n * Adds business days (Monday–Friday), skipping weekends and any holidays you pass.\n *\n * Starting on a weekend, the first business day counted is the next Monday\n * (or the previous Friday for negative values). Adding 0 returns the input's\n * date unchanged, even on a weekend.\n *\n * Instant inputs are converted to UTC. ZonedDateTime inputs keep their\n * timezone and time of day. PlainDate inputs stay dates.\n *\n * @param input - An Instant (UTC), ZonedDateTime, or PlainDate\n * @param days - Whole business days to add (negative to subtract)\n * @param holidays - Dates that are not business days. For Instant and ZonedDateTime\n * inputs they are matched against the input's own date (UTC for Instant).\n * @returns PlainDate for a date input; otherwise ZonedDateTime\n * @throws RangeError if days is not an integer\n *\n * @example\n * ```ts\n * const friday = Temporal.PlainDate.from('2025-01-24');\n *\n * addBusinessDays(friday, 1); // 2025-01-27 (Monday)\n * addBusinessDays(friday, 5); // 2025-01-31 (Friday)\n * ```\n *\n * @example\n * ```ts\n * // Skip holidays too\n * const christmasEve = Temporal.PlainDate.from('2025-12-24');\n * const holidays = [Temporal.PlainDate.from('2025-12-25'), Temporal.PlainDate.from('2025-12-26')];\n *\n * addBusinessDays(christmasEve, 1, holidays).toString(); // \"2025-12-29\"\n * ```\n */\nexport function addBusinessDays(\n input: Temporal.PlainDate,\n days: number,\n holidays?: readonly Temporal.PlainDate[]\n): Temporal.PlainDate;\nexport function addBusinessDays(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n days: number,\n holidays?: readonly Temporal.PlainDate[]\n): Temporal.ZonedDateTime;\nexport function addBusinessDays(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n days: number,\n holidays: readonly Temporal.PlainDate[] = []\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n if (isPlainDate(input)) {\n return addBusinessDaysSkipping(input, days, holidays);\n }\n return addBusinessDaysSkipping(normalizeTemporalInput(input), days, holidays);\n}\n"],"mappings":";;;;;;;;;;;AAgDO,SAAS,gBACd,OACA,MACA,WAA0C,CAAC,GACE;AAC7C,MAAI,YAAY,KAAK,GAAG;AACtB,WAAO,wBAAwB,OAAO,MAAM,QAAQ;AAAA,EACtD;AACA,SAAO,wBAAwB,uBAAuB,KAAK,GAAG,MAAM,QAAQ;AAC9E;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTM7YAT4.js";
|
|
4
4
|
|
|
5
5
|
// src/differenceInHours.ts
|
|
6
6
|
function differenceInHours(laterDate, earlierDate, options) {
|
|
@@ -13,4 +13,4 @@ function differenceInHours(laterDate, earlierDate, options) {
|
|
|
13
13
|
export {
|
|
14
14
|
differenceInHours
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-SKHUBXIN.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
daysIntoWeek
|
|
3
|
+
} from "./chunk-M2XB72L5.js";
|
|
4
|
+
import {
|
|
5
|
+
calendarDates
|
|
6
|
+
} from "./chunk-HXB6CDB4.js";
|
|
7
|
+
|
|
8
|
+
// src/differenceInCalendarWeeks.ts
|
|
9
|
+
function differenceInCalendarWeeks(laterDate, earlierDate, options) {
|
|
10
|
+
const [later, earlier] = calendarDates(laterDate, earlierDate);
|
|
11
|
+
const laterStart = later.subtract({ days: daysIntoWeek(later.dayOfWeek, options) });
|
|
12
|
+
const earlierStart = earlier.subtract({ days: daysIntoWeek(earlier.dayOfWeek, options) });
|
|
13
|
+
return earlierStart.until(laterStart, { largestUnit: "days" }).days / 7;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
differenceInCalendarWeeks
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=chunk-SURP2NUP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/differenceInCalendarWeeks.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { calendarDates } from './shared/calendarDates';\nimport { daysIntoWeek, type WeekOptions } from './shared/week';\n\n/**\n * Returns the number of week boundaries crossed between two dates, ignoring the\n * day within the week. Weeks start on Monday (ISO 8601) unless `weekStartsOn`\n * says otherwise.\n *\n * PlainDate inputs are compared as given. Instant inputs use their UTC date and\n * ZonedDateTime inputs use the date in their own timezone; convert both to one\n * timezone first to count from a single point of view. Mixing a PlainDate with\n * an Instant or ZonedDateTime throws a TypeError.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - `weekStartsOn`: 1 = Monday (default) … 7 = Sunday\n * @returns Calendar weeks from earlierDate to laterDate; negative if laterDate is earlier\n *\n * @example\n * ```ts\n * const sunday = Temporal.PlainDate.from('2025-01-26');\n * const monday = Temporal.PlainDate.from('2025-01-27');\n *\n * differenceInCalendarWeeks(monday, sunday); // 1\n * differenceInCalendarWeeks(monday, sunday, { weekStartsOn: 7 }); // 0\n * ```\n */\nexport function differenceInCalendarWeeks(\n laterDate: Temporal.PlainDate,\n earlierDate: Temporal.PlainDate,\n options?: WeekOptions\n): number;\nexport function differenceInCalendarWeeks(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime,\n options?: WeekOptions\n): number;\nexport function differenceInCalendarWeeks(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n options?: WeekOptions\n): number {\n const [later, earlier] = calendarDates(laterDate, earlierDate);\n const laterStart = later.subtract({ days: daysIntoWeek(later.dayOfWeek, options) });\n const earlierStart = earlier.subtract({ days: daysIntoWeek(earlier.dayOfWeek, options) });\n return earlierStart.until(laterStart, { largestUnit: 'days' }).days / 7;\n}\n"],"mappings":";;;;;;;;AAsCO,SAAS,0BACd,WACA,aACA,SACQ;AACR,QAAM,CAAC,OAAO,OAAO,IAAI,cAAc,WAAW,WAAW;AAC7D,QAAM,aAAa,MAAM,SAAS,EAAE,MAAM,aAAa,MAAM,WAAW,OAAO,EAAE,CAAC;AAClF,QAAM,eAAe,QAAQ,SAAS,EAAE,MAAM,aAAa,QAAQ,WAAW,OAAO,EAAE,CAAC;AACxF,SAAO,aAAa,MAAM,YAAY,EAAE,aAAa,OAAO,CAAC,EAAE,OAAO;AACxE;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assertDayOfWeek
|
|
3
|
+
} from "./chunk-M2XB72L5.js";
|
|
4
|
+
import {
|
|
5
|
+
normalizeTemporalInput
|
|
6
|
+
} from "./chunk-UTM7YAT4.js";
|
|
7
|
+
import {
|
|
8
|
+
isPlainDate
|
|
9
|
+
} from "./chunk-M4ESIRFH.js";
|
|
10
|
+
|
|
11
|
+
// src/nextDay.ts
|
|
12
|
+
function nextDay(input, day) {
|
|
13
|
+
assertDayOfWeek(day, "day");
|
|
14
|
+
const value = isPlainDate(input) ? input : normalizeTemporalInput(input);
|
|
15
|
+
return value.add({ days: (day - value.dayOfWeek + 6) % 7 + 1 });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
nextDay
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=chunk-TH6YVPP4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/nextDay.ts"],"sourcesContent":["import { type Temporal, isPlainDate } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport { assertDayOfWeek, type DayOfWeek } from './shared/week';\n\n/**\n * Returns the next date that falls on the given day of the week, always after\n * the input: next Friday from a Friday is a week later.\n *\n * Days are numbered as Temporal numbers them: 1 = Monday … 7 = Sunday.\n * PlainDate inputs stay dates. Instant inputs are read in UTC and ZonedDateTime\n * inputs keep their timezone; both keep their wall-clock time.\n *\n * @param input - A Temporal.Instant (UTC), Temporal.ZonedDateTime, or Temporal.PlainDate\n * @param day - The day of the week to find, 1 = Monday … 7 = Sunday\n * @returns The next date on that day of the week\n *\n * @example\n * ```ts\n * const wednesday = Temporal.PlainDate.from('2025-01-22');\n *\n * nextDay(wednesday, 5).toString(); // \"2025-01-24\"\n * nextDay(wednesday, 3).toString(); // \"2025-01-29\"\n * ```\n *\n * @example\n * ```ts\n * // Keeps the wall-clock time across a DST change\n * const fridayEvening = Temporal.ZonedDateTime.from('2025-03-07T18:00:00-05:00[America/New_York]');\n *\n * nextDay(fridayEvening, 1).toString(); // \"2025-03-10T18:00:00-04:00[America/New_York]\"\n * ```\n */\nexport function nextDay(input: Temporal.PlainDate, day: DayOfWeek): Temporal.PlainDate;\nexport function nextDay(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n day: DayOfWeek\n): Temporal.ZonedDateTime;\nexport function nextDay(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n day: DayOfWeek\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n assertDayOfWeek(day, 'day');\n const value = isPlainDate(input) ? input : normalizeTemporalInput(input);\n return value.add({ days: ((day - value.dayOfWeek + 6) % 7) + 1 });\n}\n"],"mappings":";;;;;;;;;;;AAqCO,SAAS,QACd,OACA,KAC6C;AAC7C,kBAAgB,KAAK,KAAK;AAC1B,QAAM,QAAQ,YAAY,KAAK,IAAI,QAAQ,uBAAuB,KAAK;AACvE,SAAO,MAAM,IAAI,EAAE,OAAQ,MAAM,MAAM,YAAY,KAAK,IAAK,EAAE,CAAC;AAClE;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compare
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DAWWOF5W.js";
|
|
4
4
|
|
|
5
5
|
// src/isEqual.ts
|
|
6
6
|
function isEqual(date1, date2) {
|
|
@@ -10,4 +10,4 @@ function isEqual(date1, date2) {
|
|
|
10
10
|
export {
|
|
11
11
|
isEqual
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-TP3VDQLF.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTM7YAT4.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-M4ESIRFH.js";
|
|
7
7
|
|
|
8
8
|
// src/addWeeks.ts
|
|
9
9
|
function addWeeks(input, weeks) {
|
|
@@ -16,4 +16,4 @@ function addWeeks(input, weeks) {
|
|
|
16
16
|
export {
|
|
17
17
|
addWeeks
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
19
|
+
//# sourceMappingURL=chunk-TZ4NUY3W.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTM7YAT4.js";
|
|
4
4
|
|
|
5
5
|
// src/roundToNearestMinute.ts
|
|
6
6
|
var MODE_TO_ROUNDING_MODE = {
|
|
@@ -22,4 +22,4 @@ function roundToNearestMinute(input, options) {
|
|
|
22
22
|
export {
|
|
23
23
|
roundToNearestMinute
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-UB3F342R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/roundToNearestMinute.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * Options for rounding to nearest minute.\n */\nexport interface RoundToNearestMinuteOptions {\n /**\n * The rounding mode to use.\n *\n * Given time 14:37:20:\n * - `'round'` → 14:37 (20 sec < 30, rounds DOWN to nearest)\n * - `'ceil'` → 14:38 (always rounds UP to next minute)\n * - `'floor'` → 14:37 (always rounds DOWN to current minute)\n *\n * Given time 14:37:00 with nearestTo: 15:\n * - `'round'` → 14:30 (37 is closer to 30 than 45)\n * - `'ceil'` → 14:45 (always rounds UP to next 15-min slot)\n * - `'floor'` → 14:30 (always rounds DOWN to current 15-min slot)\n *\n * @default 'round'\n */\n mode?: 'round' | 'ceil' | 'floor';\n /**\n * Round to the nearest N minutes. Must divide evenly into 60.\n * Valid values: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30\n * @example nearestTo: 15 rounds to quarter-hour marks (00, 15, 30, 45)\n */\n nearestTo?: 1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30;\n}\n\nconst MODE_TO_ROUNDING_MODE = {\n round: 'halfExpand',\n ceil: 'ceil',\n floor: 'floor'\n} as const;\n\n/**\n * Rounds a datetime to the nearest minute boundary.\n *\n * ## Mode comparison (given 14:37 with 15-min slots)\n *\n * ```\n * 14:30 ─────────●───────────────────── 14:45\n * 14:37\n *\n * 'round' → 14:30 (nearest slot - 37 is closer to 30 than 45)\n * 'ceil' → 14:45 (next slot - always up)\n * 'floor' → 14:30 (current slot - always down)\n * ```\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @param options - Rounding options\n * @returns ZonedDateTime rounded to the minute boundary\n *\n * @example\n * ```ts\n * // 15-minute booking slots at 14:37\n * const time = Temporal.ZonedDateTime.from('2025-01-20T14:37:00[America/New_York]');\n *\n * roundToNearestMinute(time, { nearestTo: 15 }); // → 14:30 (nearest)\n * roundToNearestMinute(time, { mode: 'ceil', nearestTo: 15 }); // → 14:45 (next slot)\n * roundToNearestMinute(time, { mode: 'floor', nearestTo: 15 }); // → 14:30 (current slot)\n * ```\n *\n * @example\n * ```ts\n * // Basic minute rounding (no slots)\n * const time = Temporal.ZonedDateTime.from('2025-01-20T14:37:42[America/New_York]');\n *\n * roundToNearestMinute(time); // → 14:38 (42 sec >= 30)\n * roundToNearestMinute(time, { mode: 'ceil' }); // → 14:38 (always up)\n * roundToNearestMinute(time, { mode: 'floor' }); // → 14:37 (always down)\n * ```\n *\n * @example\n * ```ts\n * // Billing: round up to 30-minute increments\n * const sessionEnd = Temporal.ZonedDateTime.from('2025-01-20T11:07:00[America/New_York]');\n * roundToNearestMinute(sessionEnd, { mode: 'ceil', nearestTo: 30 });\n * // → 11:30 (bill for 30 mins even though session was 7 mins)\n * ```\n */\nexport function roundToNearestMinute(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n options?: RoundToNearestMinuteOptions\n): Temporal.ZonedDateTime {\n const zonedDateTime = normalizeTemporalInput(input);\n const mode = options?.mode ?? 'round';\n const nearestTo = options?.nearestTo ?? 1;\n\n return zonedDateTime.round({\n smallestUnit: 'minute',\n roundingMode: MODE_TO_ROUNDING_MODE[mode],\n roundingIncrement: nearestTo\n });\n}\n"],"mappings":";;;;;AA+BA,IAAM,wBAAwB;AAAA,EAC5B,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AACT;AAgDO,SAAS,qBACd,OACA,SACwB;AACxB,QAAM,gBAAgB,uBAAuB,KAAK;AAClD,QAAM,OAAO,SAAS,QAAQ;AAC9B,QAAM,YAAY,SAAS,aAAa;AAExC,SAAO,cAAc,MAAM;AAAA,IACzB,cAAc;AAAA,IACd,cAAc,sBAAsB,IAAI;AAAA,IACxC,mBAAmB;AAAA,EACrB,CAAC;AACH;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compare
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DAWWOF5W.js";
|
|
4
4
|
|
|
5
5
|
// src/min.ts
|
|
6
6
|
function min(values) {
|
|
@@ -13,4 +13,4 @@ function min(values) {
|
|
|
13
13
|
export {
|
|
14
14
|
min
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-UIOLC7XM.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
differenceInMonths
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5YKAVRED.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-M4ESIRFH.js";
|
|
7
7
|
|
|
8
8
|
// src/differenceInQuarters.ts
|
|
9
9
|
function differenceInQuarters(laterDate, earlierDate, options) {
|
|
@@ -22,4 +22,4 @@ function differenceInQuarters(laterDate, earlierDate, options) {
|
|
|
22
22
|
export {
|
|
23
23
|
differenceInQuarters
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-UP5M7NHW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/differenceInQuarters.ts"],"sourcesContent":["import { type Temporal, isPlainDate } from './shared/temporal';\nimport { differenceInMonths } from './differenceInMonths';\nimport type { DifferenceOptions } from './shared/differenceOptions';\n\n/**\n * Returns the number of quarters (3-month blocks) between two datetimes or dates.\n * The result is positive if laterDate is after earlierDate, negative if before.\n *\n * Uses calendar-aware, elapsed-time calculation (a quarter is three months).\n * Instant inputs are converted to UTC; ZonedDateTime inputs keep their timezone.\n * PlainDate inputs are compared directly — no timezone needed.\n *\n * @param laterDate - The later Instant or ZonedDateTime\n * @param earlierDate - The earlier Instant or ZonedDateTime\n * @param options - Optional { fractional } to return the precise value\n * @returns The number of quarters, truncated toward zero (pass { fractional: true } for the precise value)\n *\n * @example\n * ```ts\n * const later = Temporal.Instant.from('2025-07-20T12:00:00Z');\n * const earlier = Temporal.Instant.from('2025-01-20T12:00:00Z');\n * differenceInQuarters(later, earlier); // 2\n * ```\n *\n * @example\n * ```ts\n * // PlainDate comparison needs no timezone\n * const later = Temporal.PlainDate.from('2025-07-20');\n * const earlier = Temporal.PlainDate.from('2025-01-20');\n * differenceInQuarters(later, earlier); // 2\n * ```\n */\nexport function differenceInQuarters(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime,\n options?: DifferenceOptions\n): number;\nexport function differenceInQuarters(\n laterDate: Temporal.PlainDate,\n earlierDate: Temporal.PlainDate,\n options?: DifferenceOptions\n): number;\nexport function differenceInQuarters(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n options?: DifferenceOptions\n): number {\n // A quarter is three months, so work in elapsed months and divide by 3.\n // Serialize the other date to preserve its calendar across implementations.\n const months =\n isPlainDate(laterDate) && isPlainDate(earlierDate)\n ? earlierDate.until(laterDate.toString()).total({\n unit: 'months',\n relativeTo: earlierDate\n })\n : differenceInMonths(\n laterDate as Temporal.Instant | Temporal.ZonedDateTime,\n earlierDate as Temporal.Instant | Temporal.ZonedDateTime,\n { fractional: true }\n );\n\n const quarters = months / 3;\n return options?.fractional ? quarters : Math.trunc(quarters);\n}\n"],"mappings":";;;;;;;;AA0CO,SAAS,qBACd,WACA,aACA,SACQ;AAGR,QAAM,SACJ,YAAY,SAAS,KAAK,YAAY,WAAW,IAC7C,YAAY,MAAM,UAAU,SAAS,CAAC,EAAE,MAAM;AAAA,IAC5C,MAAM;AAAA,IACN,YAAY;AAAA,EACd,CAAC,IACD;AAAA,IACE;AAAA,IACA;AAAA,IACA,EAAE,YAAY,KAAK;AAAA,EACrB;AAEN,QAAM,WAAW,SAAS;AAC1B,SAAO,SAAS,aAAa,WAAW,KAAK,MAAM,QAAQ;AAC7D;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isBefore
|
|
3
|
+
} from "./chunk-CMOBOTVN.js";
|
|
4
|
+
import {
|
|
5
|
+
isAfter
|
|
6
|
+
} from "./chunk-H5TI3O4P.js";
|
|
7
|
+
import {
|
|
8
|
+
compare
|
|
9
|
+
} from "./chunk-DAWWOF5W.js";
|
|
10
|
+
import {
|
|
11
|
+
normalizeTemporalInput
|
|
12
|
+
} from "./chunk-UTM7YAT4.js";
|
|
13
|
+
import {
|
|
14
|
+
isPlainDate,
|
|
15
|
+
isPlainTime
|
|
16
|
+
} from "./chunk-M4ESIRFH.js";
|
|
17
|
+
|
|
18
|
+
// src/isWithinInterval.ts
|
|
19
|
+
function isWithinInterval(date, interval) {
|
|
20
|
+
const { start, end } = interval;
|
|
21
|
+
if ([date, start, end].some((value) => isPlainDate(value) || isPlainTime(value))) {
|
|
22
|
+
const afterStart = compare(date, start) >= 0;
|
|
23
|
+
const beforeEnd = compare(date, end) <= 0;
|
|
24
|
+
if (isPlainTime(start) && compare(start, end) > 0) return afterStart || beforeEnd;
|
|
25
|
+
return afterStart && beforeEnd;
|
|
26
|
+
}
|
|
27
|
+
const normalizedDate = normalizeTemporalInput(date);
|
|
28
|
+
const normalizedStart = normalizeTemporalInput(start);
|
|
29
|
+
const normalizedEnd = normalizeTemporalInput(end);
|
|
30
|
+
return !isBefore(normalizedDate, normalizedStart) && !isAfter(normalizedDate, normalizedEnd);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
isWithinInterval
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-UPWUAGEV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isWithinInterval.ts"],"sourcesContent":["import { type Temporal, isPlainDate, isPlainTime } from './shared/temporal';\nimport { compare, type Comparable, type Timeline } from './shared/compare';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport { isBefore } from './shared/isBefore';\nimport { isAfter } from './shared/isAfter';\n\n/**\n * Returns true if the given value is within the interval (inclusive of start and end).\n *\n * Instants and ZonedDateTimes compare by the moment they represent, not by\n * calendar date/time. PlainDates compare by date. PlainTimes compare by\n * wall-clock time, and an interval whose start is later than its end wraps\n * past midnight: 22:00 to 02:00 contains 23:30 and 01:00. A reversed timeline\n * or PlainDate interval contains nothing.\n *\n * Mixing PlainDate, PlainTime, and timeline values throws a TypeError.\n *\n * @param date - The value to check\n * @param interval - The interval with start and end values of the same kind\n * @returns true if the value is within the interval, false otherwise\n *\n * @example\n * ```ts\n * const start = Temporal.ZonedDateTime.from('2025-01-01T00:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-07T00:00:00+00:00[UTC]');\n * const date = Temporal.ZonedDateTime.from('2025-01-03T00:00:00+00:00[UTC]');\n *\n * isWithinInterval(date, { start, end }); // true\n * ```\n *\n * @example\n * ```ts\n * // Date outside the interval\n * const start = Temporal.ZonedDateTime.from('2025-01-01T00:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-07T00:00:00+00:00[UTC]');\n * const date = Temporal.ZonedDateTime.from('2025-01-10T00:00:00+00:00[UTC]');\n *\n * isWithinInterval(date, { start, end }); // false\n * ```\n *\n * @example\n * ```ts\n * // Date equal to interval start (inclusive)\n * const start = Temporal.ZonedDateTime.from('2025-01-01T00:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-07T00:00:00+00:00[UTC]');\n *\n * isWithinInterval(start, { start, end }); // true\n * ```\n *\n * @example\n * ```ts\n * // Date equal to interval end (inclusive)\n * const start = Temporal.ZonedDateTime.from('2025-01-01T00:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-07T00:00:00+00:00[UTC]');\n *\n * isWithinInterval(end, { start, end }); // true\n * ```\n *\n * @example\n * ```ts\n * // Works with Instant too\n * const start = Temporal.Instant.from('2025-01-01T00:00:00Z');\n * const end = Temporal.Instant.from('2025-01-07T00:00:00Z');\n * const date = Temporal.Instant.from('2025-01-03T00:00:00Z');\n *\n * isWithinInterval(date, { start, end }); // true\n * ```\n *\n * @example\n * ```ts\n * // Different timezones - compares by instant\n * const start = Temporal.ZonedDateTime.from('2025-01-01T00:00:00-05:00[America/New_York]');\n * const end = Temporal.ZonedDateTime.from('2025-01-07T00:00:00+09:00[Asia/Tokyo]');\n * const date = Temporal.ZonedDateTime.from('2025-01-03T12:00:00+00:00[UTC]');\n *\n * isWithinInterval(date, { start, end }); // true\n * ```\n *\n * @example\n * ```ts\n * // Dates\n * const start = Temporal.PlainDate.from('2025-07-01');\n * const end = Temporal.PlainDate.from('2025-07-15');\n *\n * isWithinInterval(Temporal.PlainDate.from('2025-07-15'), { start, end }); // true\n * ```\n *\n * @example\n * ```ts\n * // Opening hours that run past midnight\n * const start = Temporal.PlainTime.from('22:00');\n * const end = Temporal.PlainTime.from('02:00');\n *\n * isWithinInterval(Temporal.PlainTime.from('23:30'), { start, end }); // true\n * isWithinInterval(Temporal.PlainTime.from('01:00'), { start, end }); // true\n * isWithinInterval(Temporal.PlainTime.from('12:00'), { start, end }); // false\n * ```\n */\nexport function isWithinInterval(\n date: Temporal.PlainDate,\n interval: { start: Temporal.PlainDate; end: Temporal.PlainDate }\n): boolean;\nexport function isWithinInterval(\n date: Temporal.PlainTime,\n interval: { start: Temporal.PlainTime; end: Temporal.PlainTime }\n): boolean;\nexport function isWithinInterval(\n date: Temporal.Instant | Temporal.ZonedDateTime,\n interval: {\n start: Temporal.Instant | Temporal.ZonedDateTime;\n end: Temporal.Instant | Temporal.ZonedDateTime;\n }\n): boolean;\nexport function isWithinInterval(\n date: Comparable,\n interval: { start: Comparable; end: Comparable }\n): boolean {\n const { start, end } = interval;\n if ([date, start, end].some((value) => isPlainDate(value) || isPlainTime(value))) {\n const afterStart = compare(date, start) >= 0;\n const beforeEnd = compare(date, end) <= 0;\n if (isPlainTime(start) && compare(start, end) > 0) return afterStart || beforeEnd;\n return afterStart && beforeEnd;\n }\n\n const normalizedDate = normalizeTemporalInput(date as Timeline);\n const normalizedStart = normalizeTemporalInput(start as Timeline);\n const normalizedEnd = normalizeTemporalInput(end as Timeline);\n\n return !isBefore(normalizedDate, normalizedStart) && !isAfter(normalizedDate, normalizedEnd);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiHO,SAAS,iBACd,MACA,UACS;AACT,QAAM,EAAE,OAAO,IAAI,IAAI;AACvB,MAAI,CAAC,MAAM,OAAO,GAAG,EAAE,KAAK,CAAC,UAAU,YAAY,KAAK,KAAK,YAAY,KAAK,CAAC,GAAG;AAChF,UAAM,aAAa,QAAQ,MAAM,KAAK,KAAK;AAC3C,UAAM,YAAY,QAAQ,MAAM,GAAG,KAAK;AACxC,QAAI,YAAY,KAAK,KAAK,QAAQ,OAAO,GAAG,IAAI,EAAG,QAAO,cAAc;AACxE,WAAO,cAAc;AAAA,EACvB;AAEA,QAAM,iBAAiB,uBAAuB,IAAgB;AAC9D,QAAM,kBAAkB,uBAAuB,KAAiB;AAChE,QAAM,gBAAgB,uBAAuB,GAAe;AAE5D,SAAO,CAAC,SAAS,gBAAgB,eAAe,KAAK,CAAC,QAAQ,gBAAgB,aAAa;AAC7F;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTM7YAT4.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-UQ5GR6IX.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isInstant,
|
|
3
3
|
isZonedDateTime
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-M4ESIRFH.js";
|
|
5
5
|
|
|
6
6
|
// src/shared/normalizeTemporalInput.ts
|
|
7
7
|
function normalizeTemporalInput(input) {
|
|
@@ -15,4 +15,4 @@ function normalizeTemporalInput(input) {
|
|
|
15
15
|
export {
|
|
16
16
|
normalizeTemporalInput
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
18
|
+
//# sourceMappingURL=chunk-UTM7YAT4.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isInstant
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-M4ESIRFH.js";
|
|
4
4
|
|
|
5
5
|
// src/toDate.ts
|
|
6
6
|
function toDate(input) {
|
|
@@ -13,4 +13,4 @@ function toDate(input) {
|
|
|
13
13
|
export {
|
|
14
14
|
toDate
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-UYHQBNQ4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/toDate.ts"],"sourcesContent":["import { type Temporal, isInstant } from './shared/temporal';\n\n/**\n * Convert a Temporal.Instant or ZonedDateTime to a Date object.\n *\n * @param input - A Temporal.Instant or Temporal.ZonedDateTime\n * @returns A Date object representing the same moment in time\n *\n * @example\n * ```typescript\n * // From Instant\n * const instant = Temporal.Instant.from(\"2025-01-20T20:00:00Z\");\n * const date = toDate(instant);\n * // date.toISOString() === \"2025-01-20T20:00:00.000Z\"\n *\n * // From ZonedDateTime\n * const zoned = Temporal.ZonedDateTime.from(\"2025-01-20T15:00:00-05:00[America/New_York]\");\n * const date2 = toDate(zoned);\n * // date2.toISOString() === \"2025-01-20T20:00:00.000Z\"\n *\n * // Use with Drizzle ORM (for storing back to database)\n * async function publish(id: string, at: Temporal.Instant) {\n * await db.update(posts).set({ publishedAt: toDate(at) }).where(eq(posts.id, id));\n * }\n * ```\n */\nexport function toDate(
|
|
1
|
+
{"version":3,"sources":["../src/toDate.ts"],"sourcesContent":["import { type Temporal, isInstant } from './shared/temporal';\n\n/**\n * Convert a Temporal.Instant or ZonedDateTime to a Date object.\n *\n * @param input - A Temporal.Instant or Temporal.ZonedDateTime\n * @returns A Date object representing the same moment in time\n *\n * @example\n * ```typescript\n * // From Instant\n * const instant = Temporal.Instant.from(\"2025-01-20T20:00:00Z\");\n * const date = toDate(instant);\n * // date.toISOString() === \"2025-01-20T20:00:00.000Z\"\n *\n * // From ZonedDateTime\n * const zoned = Temporal.ZonedDateTime.from(\"2025-01-20T15:00:00-05:00[America/New_York]\");\n * const date2 = toDate(zoned);\n * // date2.toISOString() === \"2025-01-20T20:00:00.000Z\"\n *\n * // Use with Drizzle ORM (for storing back to database)\n * async function publish(id: string, at: Temporal.Instant) {\n * await db.update(posts).set({ publishedAt: toDate(at) }).where(eq(posts.id, id));\n * }\n * ```\n */\nexport function toDate(input: Temporal.Instant | Temporal.ZonedDateTime): Date {\n if (isInstant(input)) {\n return new Date(input.toString());\n }\n\n return new Date(input.toInstant().toString());\n}\n"],"mappings":";;;;;AA0BO,SAAS,OAAO,OAAwD;AAC7E,MAAI,UAAU,KAAK,GAAG;AACpB,WAAO,IAAI,KAAK,MAAM,SAAS,CAAC;AAAA,EAClC;AAEA,SAAO,IAAI,KAAK,MAAM,UAAU,EAAE,SAAS,CAAC;AAC9C;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTM7YAT4.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-VQFWMNZO.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTM7YAT4.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-WALS2M6Z.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTM7YAT4.js";
|
|
4
4
|
|
|
5
5
|
// src/isSameMillisecond.ts
|
|
6
6
|
function isSameMillisecond(date1, date2) {
|
|
@@ -12,4 +12,4 @@ function isSameMillisecond(date1, date2) {
|
|
|
12
12
|
export {
|
|
13
13
|
isSameMillisecond
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-WTZ4LRQT.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeWithPlainDate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QCIY5PSJ.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-M4ESIRFH.js";
|
|
7
7
|
|
|
8
8
|
// src/startOfMonth.ts
|
|
9
9
|
function startOfMonth(input, timezone) {
|
|
@@ -18,4 +18,4 @@ function startOfMonth(input, timezone) {
|
|
|
18
18
|
export {
|
|
19
19
|
startOfMonth
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-WVBZIXQP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/startOfMonth.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 month.\n * PlainDate inputs stay in calendar space unless a timezone is provided.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at the 1st day of the month at 00:00:00.000000000\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-01-15T12:00:00Z');\n * const start = startOfMonth(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-01-15T15:30:00-05:00[America/New_York]');\n * const start = startOfMonth(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-01-15');\n * const start = startOfMonth(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-01-15');\n * const start = startOfMonth(date, 'America/New_York');\n * // 2025-01-01T00:00:00-05:00[America/New_York]\n * ```\n */\nexport function startOfMonth(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function startOfMonth(input: Temporal.PlainDate): Temporal.PlainDate;\nexport function startOfMonth(
|
|
1
|
+
{"version":3,"sources":["../src/startOfMonth.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 month.\n * PlainDate inputs stay in calendar space unless a timezone is provided.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at the 1st day of the month at 00:00:00.000000000\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-01-15T12:00:00Z');\n * const start = startOfMonth(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-01-15T15:30:00-05:00[America/New_York]');\n * const start = startOfMonth(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-01-15');\n * const start = startOfMonth(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-01-15');\n * const start = startOfMonth(date, 'America/New_York');\n * // 2025-01-01T00:00:00-05:00[America/New_York]\n * ```\n */\nexport function startOfMonth(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function startOfMonth(input: Temporal.PlainDate): Temporal.PlainDate;\nexport function startOfMonth(input: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;\nexport function startOfMonth(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n if (isPlainDate(input) && timezone === undefined) {\n return input.with({ day: 1 });\n }\n\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n const firstDay = zonedDateTime.with({ day: 1 });\n return firstDay.startOfDay();\n}\n"],"mappings":";;;;;;;;AAgDO,SAAS,aACd,OACA,UAC6C;AAC7C,MAAI,YAAY,KAAK,KAAK,aAAa,QAAW;AAChD,WAAO,MAAM,KAAK,EAAE,KAAK,EAAE,CAAC;AAAA,EAC9B;AAEA,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,QAAM,WAAW,cAAc,KAAK,EAAE,KAAK,EAAE,CAAC;AAC9C,SAAO,SAAS,WAAW;AAC7B;","names":[]}
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-XS2HUADA.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeTemporalInput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UTM7YAT4.js";
|
|
7
7
|
import {
|
|
8
8
|
isPlainDate
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-M4ESIRFH.js";
|
|
10
10
|
|
|
11
11
|
// src/getQuarter.ts
|
|
12
12
|
function getQuarter(input) {
|
|
@@ -17,4 +17,4 @@ function getQuarter(input) {
|
|
|
17
17
|
export {
|
|
18
18
|
getQuarter
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-WWCLSC2B.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/getQuarter.ts"],"sourcesContent":["import { type Temporal, isPlainDate } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport { quarterOfMonth } from './shared/quarter';\n\n/**\n * Returns the quarter (1-4) that a datetime or date falls in.\n *\n * Quarters: Q1 = Jan–Mar, Q2 = Apr–Jun, Q3 = Jul–Sep, Q4 = Oct–Dec.\n *\n * A quarter is intrinsic to the calendar date, so no timezone is ever needed.\n * `Instant` inputs are interpreted in UTC; `ZonedDateTime` inputs use their own\n * timezone; `PlainDate` inputs use their calendar month directly.\n *\n * @param input - A Temporal.Instant (UTC), Temporal.ZonedDateTime, or Temporal.PlainDate\n * @returns The quarter number: 1, 2, 3, or 4\n *\n * @example\n * ```ts\n * getQuarter(Temporal.Instant.from('2025-05-15T12:00:00Z')); // 2\n * getQuarter(Temporal.PlainDate.from('2025-11-15')); // 4\n * ```\n */\nexport function getQuarter(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate\n): 1 | 2 | 3 | 4 {\n const month = isPlainDate(input) ? input.month : normalizeTemporalInput(input).month;\n return quarterOfMonth(month);\n}\n"],"mappings":";;;;;;;;;;;AAsBO,SAAS,WACd,OACe;AACf,QAAM,QAAQ,YAAY,KAAK,IAAI,MAAM,QAAQ,uBAAuB,KAAK,EAAE;AAC/E,SAAO,eAAe,KAAK;AAC7B;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
calendarDates
|
|
3
|
+
} from "./chunk-HXB6CDB4.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-X4ULMQ53.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-UTM7YAT4.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-XD4JKMGT.js.map
|