@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/roundToNearestHour.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * Options for rounding to nearest hour.\n */\nexport interface RoundToNearestHourOptions {\n /**\n * The rounding mode to use.\n *\n * Given time 14:20:\n * - `'round'` → 14:00 (20 min < 30, rounds DOWN to nearest)\n * - `'ceil'` → 15:00 (always rounds UP to next hour)\n * - `'floor'` → 14:00 (always rounds DOWN to current hour)\n *\n * Given time 14:40:\n * - `'round'` → 15:00 (40 min >= 30, rounds UP to nearest)\n * - `'ceil'` → 15:00 (always rounds UP to next hour)\n * - `'floor'` → 14:00 (always rounds DOWN to current hour)\n *\n * @default 'round'\n */\n mode?: 'round' | 'ceil' | 'floor';\n /**\n * Round to the nearest N hours. Must divide evenly into 24.\n * Valid values: 1, 2, 3, 4, 6, 8, 12\n * @example nearestTo: 6 rounds to 00:00, 06:00, 12:00, or 18:00\n */\n nearestTo?: 1 | 2 | 3 | 4 | 6 | 8 | 12;\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 hour boundary.\n *\n * ## Mode comparison (given 14:20)\n *\n * ```\n * 14:00 ─────────────●───────────────── 15:00\n * 14:20\n *\n * 'round' → 14:00 (nearest hour - 20 min < 30)\n * 'ceil' → 15:00 (next hour - always up)\n * 'floor' → 14:00 (current hour - 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 hour boundary\n *\n * @example\n * ```ts\n * const time = Temporal.ZonedDateTime.from('2025-01-20T14:20:00[America/New_York]');\n *\n * roundToNearestHour(time); // → 14:00 (nearest)\n * roundToNearestHour(time, { mode: 'ceil' }); // → 15:00 (always up)\n * roundToNearestHour(time, { mode: 'floor' }); // → 14:00 (always down)\n * ```\n *\n * @example\n * ```ts\n * // With 37 minutes (past the halfway point)\n * const time = Temporal.ZonedDateTime.from('2025-01-20T14:37:00[America/New_York]');\n *\n * roundToNearestHour(time); // → 15:00 (nearest - 37 >= 30)\n * roundToNearestHour(time, { mode: 'ceil' }); // → 15:00 (always up)\n * roundToNearestHour(time, { mode: 'floor' }); // → 14:00 (always down)\n * ```\n *\n * @example\n * ```ts\n * // Round to 6-hour blocks (shift scheduling)\n * const time = Temporal.ZonedDateTime.from('2025-01-20T14:00:00[America/New_York]');\n *\n * roundToNearestHour(time, { nearestTo: 6 }); // → 12:00\n * roundToNearestHour(time, { mode: 'ceil', nearestTo: 6 }); // → 18:00\n * roundToNearestHour(time, { mode: 'floor', nearestTo: 6 }); // → 12:00\n * ```\n */\nexport function roundToNearestHour(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n options?: RoundToNearestHourOptions\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: 'hour',\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;AAiDO,SAAS,mBACd,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
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTM7YAT4.js";
|
|
4
4
|
|
|
5
5
|
// src/addSeconds.ts
|
|
6
6
|
function addSeconds(input, seconds) {
|
|
@@ -11,4 +11,4 @@ function addSeconds(input, seconds) {
|
|
|
11
11
|
export {
|
|
12
12
|
addSeconds
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-AEAZ2F2T.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
differenceInDays
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MRJNMV4A.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/eachDayOfInterval.ts
|
|
12
12
|
function eachDayOfInterval(interval) {
|
|
@@ -39,4 +39,4 @@ function eachDayOfInterval(interval) {
|
|
|
39
39
|
export {
|
|
40
40
|
eachDayOfInterval
|
|
41
41
|
};
|
|
42
|
-
//# sourceMappingURL=chunk-
|
|
42
|
+
//# sourceMappingURL=chunk-APWSLQ47.js.map
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isPlainDateBefore
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DYDSR35L.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDateAfter
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-K6IGDI5W.js";
|
|
7
|
+
import {
|
|
8
|
+
daysIntoWeek
|
|
9
|
+
} from "./chunk-M2XB72L5.js";
|
|
7
10
|
import {
|
|
8
11
|
normalizeTemporalInput
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UTM7YAT4.js";
|
|
10
13
|
import {
|
|
11
14
|
isPlainDate
|
|
12
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-M4ESIRFH.js";
|
|
13
16
|
|
|
14
17
|
// src/eachWeekOfInterval.ts
|
|
15
|
-
function eachWeekOfInterval(interval) {
|
|
18
|
+
function eachWeekOfInterval(interval, options) {
|
|
16
19
|
if (isPlainDate(interval.start) || isPlainDate(interval.end)) {
|
|
17
20
|
if (!isPlainDate(interval.start) || !isPlainDate(interval.end)) {
|
|
18
21
|
throw new TypeError("PlainDate intervals require two PlainDate endpoints");
|
|
19
22
|
}
|
|
20
23
|
if (isPlainDateAfter(interval.start, interval.end)) return [];
|
|
21
24
|
const end = interval.end.withCalendar(interval.start.calendarId);
|
|
22
|
-
const last = end.subtract({ days: end.dayOfWeek
|
|
23
|
-
let current2 = interval.start.subtract({
|
|
25
|
+
const last = end.subtract({ days: daysIntoWeek(end.dayOfWeek, options) });
|
|
26
|
+
let current2 = interval.start.subtract({
|
|
27
|
+
days: daysIntoWeek(interval.start.dayOfWeek, options)
|
|
28
|
+
});
|
|
24
29
|
const dates = [];
|
|
25
30
|
while (isPlainDateBefore(current2, last)) {
|
|
26
31
|
dates.push(current2);
|
|
@@ -32,15 +37,12 @@ function eachWeekOfInterval(interval) {
|
|
|
32
37
|
const startZoned = normalizeTemporalInput(interval.start);
|
|
33
38
|
const endZoned = normalizeTemporalInput(interval.end);
|
|
34
39
|
if (startZoned.epochNanoseconds > endZoned.epochNanoseconds) return [];
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const endInTimezone = endZoned.withTimeZone(timezone);
|
|
39
|
-
const daysToSubtractEnd = endInTimezone.dayOfWeek - 1;
|
|
40
|
-
const endMonday = endInTimezone.subtract({ days: daysToSubtractEnd }).startOfDay();
|
|
40
|
+
const startOfFirstWeek = startZoned.subtract({ days: daysIntoWeek(startZoned.dayOfWeek, options) }).startOfDay();
|
|
41
|
+
const endInTimezone = endZoned.withTimeZone(startZoned.timeZoneId);
|
|
42
|
+
const startOfLastWeek = endInTimezone.subtract({ days: daysIntoWeek(endInTimezone.dayOfWeek, options) }).startOfDay();
|
|
41
43
|
const weeks = [];
|
|
42
|
-
let current =
|
|
43
|
-
while (current.epochNanoseconds <=
|
|
44
|
+
let current = startOfFirstWeek;
|
|
45
|
+
while (current.epochNanoseconds <= startOfLastWeek.epochNanoseconds) {
|
|
44
46
|
weeks.push(current);
|
|
45
47
|
current = current.add({ weeks: 1 });
|
|
46
48
|
}
|
|
@@ -50,4 +52,4 @@ function eachWeekOfInterval(interval) {
|
|
|
50
52
|
export {
|
|
51
53
|
eachWeekOfInterval
|
|
52
54
|
};
|
|
53
|
-
//# sourceMappingURL=chunk-
|
|
55
|
+
//# sourceMappingURL=chunk-AWERPSJ5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eachWeekOfInterval.ts"],"sourcesContent":["import { Temporal, isPlainDate } from './shared/temporal';\nimport { isPlainDateAfter } from './isPlainDateAfter';\nimport { isPlainDateBefore } from './isPlainDateBefore';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport { daysIntoWeek, type WeekOptions } from './shared/week';\n\n/**\n * PlainDate endpoints return date-only period starts in the start calendar.\n * Mixed date-only/timeline endpoints are rejected. Reversed endpoints return [].\n *\n * Returns an array of ZonedDateTime objects for each week within the interval.\n * Each element represents the first moment of the week (midnight on its first day).\n * Weeks start on Monday (ISO 8601) unless `weekStartsOn` says otherwise.\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 * @param options - `weekStartsOn`: 1 = Monday (default) … 7 = Sunday\n * @returns Array of ZonedDateTime at the start of each week in the interval\n *\n * @example\n * ```ts\n * const start = Temporal.ZonedDateTime.from('2025-01-06T10:00:00+00:00[UTC]'); // Monday\n * const end = Temporal.ZonedDateTime.from('2025-01-22T14:00:00+00:00[UTC]'); // Wednesday\n *\n * const weeks = eachWeekOfInterval({ start, end });\n * // [\n * // 2025-01-06T00:00:00+00:00[UTC], // Week 2\n * // 2025-01-13T00:00:00+00:00[UTC], // Week 3\n * // 2025-01-20T00:00:00+00:00[UTC] // Week 4\n * // ]\n * ```\n *\n * @example\n * ```ts\n * // Mid-week start\n * const start = Temporal.ZonedDateTime.from('2025-01-08T10:00:00+00:00[UTC]'); // Wednesday\n * const end = Temporal.ZonedDateTime.from('2025-01-15T14:00:00+00:00[UTC]'); // Wednesday\n *\n * const weeks = eachWeekOfInterval({ start, end });\n * // [\n * // 2025-01-06T00:00:00+00:00[UTC], // Monday of week containing Jan 8\n * // 2025-01-13T00:00:00+00:00[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:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-01-08T00:00:00+00:00[UTC]');\n *\n * const weeks = eachWeekOfInterval({ start, end });\n * // [\n * // 2024-12-23T00:00:00+00:00[UTC], // Monday of week containing Dec 25\n * // 2024-12-30T00:00:00+00:00[UTC], // Monday of week containing Dec 30\n * // 2025-01-06T00:00:00+00:00[UTC] // Monday of week containing Jan 8\n * // ]\n * ```\n */\nexport function eachWeekOfInterval(\n interval: { start: Temporal.PlainDate; end: Temporal.PlainDate },\n options?: WeekOptions\n): Temporal.PlainDate[];\nexport function eachWeekOfInterval(\n interval: {\n start: Temporal.Instant | Temporal.ZonedDateTime;\n end: Temporal.Instant | Temporal.ZonedDateTime;\n },\n options?: WeekOptions\n): Temporal.ZonedDateTime[];\nexport function eachWeekOfInterval(\n interval: {\n start: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate;\n end: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate;\n },\n options?: WeekOptions\n): Temporal.ZonedDateTime[] | Temporal.PlainDate[] {\n if (isPlainDate(interval.start) || isPlainDate(interval.end)) {\n if (!isPlainDate(interval.start) || !isPlainDate(interval.end)) {\n throw new TypeError('PlainDate intervals require two PlainDate endpoints');\n }\n if (isPlainDateAfter(interval.start, interval.end)) return [];\n const end = interval.end.withCalendar(interval.start.calendarId);\n const last = end.subtract({ days: daysIntoWeek(end.dayOfWeek, options) });\n let current = interval.start.subtract({\n days: daysIntoWeek(interval.start.dayOfWeek, options)\n });\n const dates: Temporal.PlainDate[] = [];\n while (isPlainDateBefore(current, last)) {\n dates.push(current);\n current = current.add({ weeks: 1 });\n }\n dates.push(current);\n return dates;\n }\n const startZoned = normalizeTemporalInput(interval.start);\n const endZoned = normalizeTemporalInput(interval.end);\n if (startZoned.epochNanoseconds > endZoned.epochNanoseconds) return [];\n\n const startOfFirstWeek = startZoned\n .subtract({ days: daysIntoWeek(startZoned.dayOfWeek, options) })\n .startOfDay();\n const endInTimezone = endZoned.withTimeZone(startZoned.timeZoneId);\n const startOfLastWeek = endInTimezone\n .subtract({ days: daysIntoWeek(endInTimezone.dayOfWeek, options) })\n .startOfDay();\n\n const weeks: Temporal.ZonedDateTime[] = [];\n let current = startOfFirstWeek;\n\n while (current.epochNanoseconds <= startOfLastWeek.epochNanoseconds) {\n weeks.push(current);\n current = current.add({ weeks: 1 });\n }\n\n return weeks;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAyEO,SAAS,mBACd,UAIA,SACiD;AACjD,MAAI,YAAY,SAAS,KAAK,KAAK,YAAY,SAAS,GAAG,GAAG;AAC5D,QAAI,CAAC,YAAY,SAAS,KAAK,KAAK,CAAC,YAAY,SAAS,GAAG,GAAG;AAC9D,YAAM,IAAI,UAAU,qDAAqD;AAAA,IAC3E;AACA,QAAI,iBAAiB,SAAS,OAAO,SAAS,GAAG,EAAG,QAAO,CAAC;AAC5D,UAAM,MAAM,SAAS,IAAI,aAAa,SAAS,MAAM,UAAU;AAC/D,UAAM,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,IAAI,WAAW,OAAO,EAAE,CAAC;AACxE,QAAIA,WAAU,SAAS,MAAM,SAAS;AAAA,MACpC,MAAM,aAAa,SAAS,MAAM,WAAW,OAAO;AAAA,IACtD,CAAC;AACD,UAAM,QAA8B,CAAC;AACrC,WAAO,kBAAkBA,UAAS,IAAI,GAAG;AACvC,YAAM,KAAKA,QAAO;AAClB,MAAAA,WAAUA,SAAQ,IAAI,EAAE,OAAO,EAAE,CAAC;AAAA,IACpC;AACA,UAAM,KAAKA,QAAO;AAClB,WAAO;AAAA,EACT;AACA,QAAM,aAAa,uBAAuB,SAAS,KAAK;AACxD,QAAM,WAAW,uBAAuB,SAAS,GAAG;AACpD,MAAI,WAAW,mBAAmB,SAAS,iBAAkB,QAAO,CAAC;AAErE,QAAM,mBAAmB,WACtB,SAAS,EAAE,MAAM,aAAa,WAAW,WAAW,OAAO,EAAE,CAAC,EAC9D,WAAW;AACd,QAAM,gBAAgB,SAAS,aAAa,WAAW,UAAU;AACjE,QAAM,kBAAkB,cACrB,SAAS,EAAE,MAAM,aAAa,cAAc,WAAW,OAAO,EAAE,CAAC,EACjE,WAAW;AAEd,QAAM,QAAkC,CAAC;AACzC,MAAI,UAAU;AAEd,SAAO,QAAQ,oBAAoB,gBAAgB,kBAAkB;AACnE,UAAM,KAAK,OAAO;AAClB,cAAU,QAAQ,IAAI,EAAE,OAAO,EAAE,CAAC;AAAA,EACpC;AAEA,SAAO;AACT;","names":["current"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTM7YAT4.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-B7RDUXDN.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
isInstant,
|
|
4
4
|
isPlainDate,
|
|
5
5
|
isZonedDateTime
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-M4ESIRFH.js";
|
|
7
7
|
|
|
8
8
|
// src/toPlainDate.ts
|
|
9
9
|
var PLAIN_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
@@ -13,19 +13,25 @@ function toPlainDate(input, timezone) {
|
|
|
13
13
|
}
|
|
14
14
|
if (input instanceof Date) {
|
|
15
15
|
if (timezone === void 0) {
|
|
16
|
-
throw new Error(
|
|
16
|
+
throw new Error(
|
|
17
|
+
"Timezone is required unless input is a ZonedDateTime, PlainDateLike, or plain date string"
|
|
18
|
+
);
|
|
17
19
|
}
|
|
18
20
|
return Temporal.Instant.from(input.toISOString()).toZonedDateTimeISO(timezone).toPlainDate();
|
|
19
21
|
}
|
|
20
22
|
if (isInstant(input)) {
|
|
21
23
|
if (timezone === void 0) {
|
|
22
|
-
throw new Error(
|
|
24
|
+
throw new Error(
|
|
25
|
+
"Timezone is required unless input is a ZonedDateTime, PlainDateLike, or plain date string"
|
|
26
|
+
);
|
|
23
27
|
}
|
|
24
28
|
return input.toZonedDateTimeISO(timezone).toPlainDate();
|
|
25
29
|
}
|
|
26
30
|
if (isZonedDateTime(input)) {
|
|
27
31
|
if (timezone === void 0) {
|
|
28
|
-
throw new Error(
|
|
32
|
+
throw new Error(
|
|
33
|
+
"Timezone is required unless input is a ZonedDateTime, PlainDateLike, or plain date string"
|
|
34
|
+
);
|
|
29
35
|
}
|
|
30
36
|
return input.toInstant().toZonedDateTimeISO(timezone).toPlainDate();
|
|
31
37
|
}
|
|
@@ -36,7 +42,9 @@ function toPlainDate(input, timezone) {
|
|
|
36
42
|
if (PLAIN_DATE_PATTERN.test(input)) {
|
|
37
43
|
return Temporal.PlainDate.from(input);
|
|
38
44
|
}
|
|
39
|
-
throw new Error(
|
|
45
|
+
throw new Error(
|
|
46
|
+
"Timezone is required unless input is a ZonedDateTime, PlainDateLike, or plain date string"
|
|
47
|
+
);
|
|
40
48
|
}
|
|
41
49
|
return Temporal.PlainDate.from(isPlainDate(input) ? input.toString() : input);
|
|
42
50
|
}
|
|
@@ -44,4 +52,4 @@ function toPlainDate(input, timezone) {
|
|
|
44
52
|
export {
|
|
45
53
|
toPlainDate
|
|
46
54
|
};
|
|
47
|
-
//# sourceMappingURL=chunk-
|
|
55
|
+
//# sourceMappingURL=chunk-BE7CIKP7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/toPlainDate.ts"],"sourcesContent":["import { Temporal, isInstant, isZonedDateTime, isPlainDate } 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(\n 'Timezone is required unless input is a ZonedDateTime, PlainDateLike, or plain date string'\n );\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(\n 'Timezone is required unless input is a ZonedDateTime, PlainDateLike, or plain date string'\n );\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(\n 'Timezone is required unless input is a ZonedDateTime, PlainDateLike, or plain date string'\n );\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(\n 'Timezone is required unless input is a ZonedDateTime, PlainDateLike, or plain date string'\n );\n }\n\n // Foreign PlainDate objects expose calendarId, while property bags use calendar.\n // A canonical string keeps the ISO date and calendar together across implementations.\n return Temporal.PlainDate.from(isPlainDate(input) ? input.toString() : 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;AAAA,QACR;AAAA,MACF;AAAA,IACF;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;AAAA,QACR;AAAA,MACF;AAAA,IACF;AACA,WAAO,MAAM,mBAAmB,QAAQ,EAAE,YAAY;AAAA,EACxD;AAGA,MAAI,gBAAgB,KAAK,GAAG;AAC1B,QAAI,aAAa,QAAW;AAC1B,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;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;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAIA,SAAO,SAAS,UAAU,KAAK,YAAY,KAAK,IAAI,MAAM,SAAS,IAAI,KAAK;AAC9E;","names":[]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isBefore
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CMOBOTVN.js";
|
|
4
4
|
import {
|
|
5
5
|
nowZoned
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-D73HU7YA.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeTemporalInput
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UTM7YAT4.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-BM4OZR7U.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/isPast.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport { isBefore } from './shared/isBefore';\nimport { nowZoned } from './shared/nowZoned';\n\n/**\n * Returns true if the given datetime is in the past.\n * Compares by the underlying instant (epoch time) against the current time.\n *\n * @param date - Datetime to check (Instant or ZonedDateTime)\n * @returns true if date is before the current instant, false otherwise\n *\n * @example\n * ```ts\n * const yesterday = Temporal.Now.zonedDateTimeISO().subtract({ days: 1 });\n * const tomorrow = Temporal.Now.zonedDateTimeISO().add({ days: 1 });\n *\n * isPast(yesterday); // true\n * isPast(tomorrow); // false\n * ```\n *\n * @example\n * ```ts\n * // Works with Instant too\n * const pastInstant = Temporal.Now.instant().subtract({ hours: 1 });\n *\n * isPast(pastInstant); // true\n * ```\n *\n * @example\n * ```ts\n * // Works with any timezone\n * const pastInTokyo = Temporal.ZonedDateTime.from('1970-01-01T00:00:00+09:00[Asia/Tokyo]');\n *\n * isPast(pastInTokyo); // true\n * ```\n */\nexport function isPast(
|
|
1
|
+
{"version":3,"sources":["../src/isPast.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport { isBefore } from './shared/isBefore';\nimport { nowZoned } from './shared/nowZoned';\n\n/**\n * Returns true if the given datetime is in the past.\n * Compares by the underlying instant (epoch time) against the current time.\n *\n * @param date - Datetime to check (Instant or ZonedDateTime)\n * @returns true if date is before the current instant, false otherwise\n *\n * @example\n * ```ts\n * const yesterday = Temporal.Now.zonedDateTimeISO().subtract({ days: 1 });\n * const tomorrow = Temporal.Now.zonedDateTimeISO().add({ days: 1 });\n *\n * isPast(yesterday); // true\n * isPast(tomorrow); // false\n * ```\n *\n * @example\n * ```ts\n * // Works with Instant too\n * const pastInstant = Temporal.Now.instant().subtract({ hours: 1 });\n *\n * isPast(pastInstant); // true\n * ```\n *\n * @example\n * ```ts\n * // Works with any timezone\n * const pastInTokyo = Temporal.ZonedDateTime.from('1970-01-01T00:00:00+09:00[Asia/Tokyo]');\n *\n * isPast(pastInTokyo); // true\n * ```\n */\nexport function isPast(date: Temporal.Instant | Temporal.ZonedDateTime): boolean {\n const zoned = normalizeTemporalInput(date);\n\n return isBefore(zoned, nowZoned());\n}\n"],"mappings":";;;;;;;;;;;AAqCO,SAAS,OAAO,MAA0D;AAC/E,QAAM,QAAQ,uBAAuB,IAAI;AAEzC,SAAO,SAAS,OAAO,SAAS,CAAC;AACnC;","names":[]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
quarterStartMonth
|
|
3
|
-
} from "./chunk-XS2HUADA.js";
|
|
4
1
|
import {
|
|
5
2
|
normalizeWithPlainDate
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QCIY5PSJ.js";
|
|
7
4
|
import {
|
|
8
5
|
getEndOfDay
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7WGGUDW4.js";
|
|
7
|
+
import {
|
|
8
|
+
quarterStartMonth
|
|
9
|
+
} from "./chunk-XS2HUADA.js";
|
|
10
10
|
import {
|
|
11
11
|
isPlainDate
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-M4ESIRFH.js";
|
|
13
13
|
|
|
14
14
|
// src/endOfQuarter.ts
|
|
15
15
|
function endOfQuarter(input, timezone) {
|
|
@@ -32,4 +32,4 @@ function endOfQuarter(input, timezone) {
|
|
|
32
32
|
export {
|
|
33
33
|
endOfQuarter
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-C4LUGHIM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/endOfQuarter.ts"],"sourcesContent":["import { type Temporal, isPlainDate } from './shared/temporal';\nimport type { Timezone } from './types';\nimport { getEndOfDay } from './shared/endOfDay';\nimport { normalizeWithPlainDate } from './shared/normalizeWithPlainDate';\nimport { quarterStartMonth } from './shared/quarter';\n\n/**\n * Returns a ZonedDateTime representing the last moment of the quarter\n * (last day of the quarter's ending month at 23:59:59.999999999).\n *\n * Quarters: Q1 = Jan–Mar, Q2 = Apr–Jun, Q3 = Jul–Sep, Q4 = Oct–Dec.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at the last day of the quarter at 23:59:59.999999999\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-05-15T12:00:00Z');\n * const end = endOfQuarter(instant);\n * // 2025-06-30T23:59:59.999999999+00:00[UTC]\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-02-15T15:30:00-05:00[America/New_York]');\n * const end = endOfQuarter(zoned);\n * // 2025-03-31T23:59:59.999999999-04:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // From a PlainDate in a timezone\n * const date = Temporal.PlainDate.from('2025-11-15');\n * const end = endOfQuarter(date, 'America/New_York');\n * // 2025-12-31T23:59:59.999999999-05:00[America/New_York]\n * ```\n */\nexport function endOfQuarter(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function endOfQuarter(input: Temporal.PlainDate): Temporal.PlainDate;\nexport function endOfQuarter(input: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;\nexport function endOfQuarter(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n // PlainDate with no timezone stays in calendar space → last day of quarter.\n if (isPlainDate(input) && timezone === undefined) {\n const endMonth = input.with({\n month: quarterStartMonth(input.month) + 2,\n day: 1\n });\n return endMonth.with({ day: endMonth.daysInMonth });\n }\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n const endMonth = zonedDateTime.with({\n month: quarterStartMonth(zonedDateTime.month) + 2,\n day: 1\n });\n const lastDay = endMonth.with({ day: endMonth.daysInMonth });\n return getEndOfDay(lastDay);\n}\n"],"mappings":";;;;;;;;;;;;;;AA4CO,SAAS,aACd,OACA,UAC6C;AAE7C,MAAI,YAAY,KAAK,KAAK,aAAa,QAAW;AAChD,UAAMA,YAAW,MAAM,KAAK;AAAA,MAC1B,OAAO,kBAAkB,MAAM,KAAK,IAAI;AAAA,MACxC,KAAK;AAAA,IACP,CAAC;AACD,WAAOA,UAAS,KAAK,EAAE,KAAKA,UAAS,YAAY,CAAC;AAAA,EACpD;AACA,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,QAAM,WAAW,cAAc,KAAK;AAAA,IAClC,OAAO,kBAAkB,cAAc,KAAK,IAAI;AAAA,IAChD,KAAK;AAAA,EACP,CAAC;AACD,QAAM,UAAU,SAAS,KAAK,EAAE,KAAK,SAAS,YAAY,CAAC;AAC3D,SAAO,YAAY,OAAO;AAC5B;","names":["endMonth"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compare
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DAWWOF5W.js";
|
|
4
4
|
|
|
5
5
|
// src/clamp.ts
|
|
6
6
|
function clamp(value, interval) {
|
|
@@ -15,4 +15,4 @@ function clamp(value, interval) {
|
|
|
15
15
|
export {
|
|
16
16
|
clamp
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
18
|
+
//# sourceMappingURL=chunk-CCDDXIAC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/isBefore.ts"],"sourcesContent":["import type { Temporal } from './temporal';\n\nexport function isBefore(date1: Temporal.ZonedDateTime, date2: Temporal.ZonedDateTime): boolean {\n return date1.epochNanoseconds < date2.epochNanoseconds;\n}\n"],"mappings":";AAEO,SAAS,SAAS,OAA+B,OAAwC;AAC9F,SAAO,MAAM,mBAAmB,MAAM;AACxC;","names":[]}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isPlainDateBefore
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DYDSR35L.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDateAfter
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-K6IGDI5W.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeTemporalInput
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UTM7YAT4.js";
|
|
10
10
|
import {
|
|
11
11
|
Temporal,
|
|
12
12
|
isPlainDate
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-M4ESIRFH.js";
|
|
14
14
|
|
|
15
15
|
// src/eachMonthOfInterval.ts
|
|
16
16
|
function eachMonthOfInterval(interval) {
|
|
@@ -63,4 +63,4 @@ function eachMonthOfInterval(interval) {
|
|
|
63
63
|
export {
|
|
64
64
|
eachMonthOfInterval
|
|
65
65
|
};
|
|
66
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-COQJXPPT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/eachMonthOfInterval.ts"],"sourcesContent":["import { Temporal, isPlainDate } from './shared/temporal';\nimport { isPlainDateAfter } from './isPlainDateAfter';\nimport { isPlainDateBefore } from './isPlainDateBefore';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * PlainDate endpoints return date-only period starts in the start calendar.\n * Mixed date-only/timeline endpoints are rejected. Reversed endpoints return [].\n *\n * Uses the start endpoint's calendar and timezone, including for the end bound.\n * Native and polyfill endpoints may be mixed.\n *\n * Returns an array of ZonedDateTime objects for each month within the interval.\n * Each element represents the first moment of the month (day 1 at midnight).\n * The interval is inclusive of both start and end months.\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 month in the interval\n *\n * @example\n * ```ts\n * const start = Temporal.ZonedDateTime.from('2025-01-15T10:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-04-20T14:00:00+00:00[UTC]');\n *\n * const months = eachMonthOfInterval({ start, end });\n * // [\n * // 2025-01-01T00:00:00+00:00[UTC],\n * // 2025-02-01T00:00:00+00:00[UTC],\n * // 2025-03-01T00:00:00+00:00[UTC],\n * // 2025-04-01T00:00:00+00:00[UTC]\n * // ]\n * ```\n *\n * @example\n * ```ts\n * // Cross-year boundary\n * const start = Temporal.ZonedDateTime.from('2024-11-15T00:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-02-15T00:00:00+00:00[UTC]');\n *\n * const months = eachMonthOfInterval({ start, end });\n * // [\n * // 2024-11-01T00:00:00+00:00[UTC],\n * // 2024-12-01T00:00:00+00:00[UTC],\n * // 2025-01-01T00:00:00+00:00[UTC],\n * // 2025-02-01T00:00:00+00:00[UTC]\n * // ]\n * ```\n */\nexport function eachMonthOfInterval(interval: {\n start: Temporal.PlainDate;\n end: Temporal.PlainDate;\n}): Temporal.PlainDate[];\nexport function eachMonthOfInterval(interval: {\n start: Temporal.Instant | Temporal.ZonedDateTime;\n end: Temporal.Instant | Temporal.ZonedDateTime;\n}): Temporal.ZonedDateTime[];\nexport function eachMonthOfInterval(interval: {\n start: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate;\n end: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate;\n}): Temporal.ZonedDateTime[] | Temporal.PlainDate[] {\n if (isPlainDate(interval.start) || isPlainDate(interval.end)) {\n if (!isPlainDate(interval.start) || !isPlainDate(interval.end)) {\n throw new TypeError('PlainDate intervals require two PlainDate endpoints');\n }\n if (isPlainDateAfter(interval.start, interval.end)) return [];\n const end = interval.end.withCalendar(interval.start.calendarId);\n const last = end.with({ day: 1 });\n let current = interval.start.with({ day: 1 });\n const dates: Temporal.PlainDate[] = [];\n while (isPlainDateBefore(current, last)) {\n dates.push(current);\n current = current.add({ months: 1 });\n }\n dates.push(current);\n return dates;\n }\n const startZoned = normalizeTemporalInput(interval.start);\n const endZoned = normalizeTemporalInput(interval.end);\n if (startZoned.epochNanoseconds > endZoned.epochNanoseconds) return [];\n\n const timezone = startZoned.timeZoneId;\n\n // Get start of the starting month\n const startYearMonth = Temporal.PlainYearMonth.from({\n year: startZoned.year,\n month: startZoned.month,\n calendar: startZoned.calendarId
|
|
1
|
+
{"version":3,"sources":["../src/eachMonthOfInterval.ts"],"sourcesContent":["import { Temporal, isPlainDate } from './shared/temporal';\nimport { isPlainDateAfter } from './isPlainDateAfter';\nimport { isPlainDateBefore } from './isPlainDateBefore';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * PlainDate endpoints return date-only period starts in the start calendar.\n * Mixed date-only/timeline endpoints are rejected. Reversed endpoints return [].\n *\n * Uses the start endpoint's calendar and timezone, including for the end bound.\n * Native and polyfill endpoints may be mixed.\n *\n * Returns an array of ZonedDateTime objects for each month within the interval.\n * Each element represents the first moment of the month (day 1 at midnight).\n * The interval is inclusive of both start and end months.\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 month in the interval\n *\n * @example\n * ```ts\n * const start = Temporal.ZonedDateTime.from('2025-01-15T10:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-04-20T14:00:00+00:00[UTC]');\n *\n * const months = eachMonthOfInterval({ start, end });\n * // [\n * // 2025-01-01T00:00:00+00:00[UTC],\n * // 2025-02-01T00:00:00+00:00[UTC],\n * // 2025-03-01T00:00:00+00:00[UTC],\n * // 2025-04-01T00:00:00+00:00[UTC]\n * // ]\n * ```\n *\n * @example\n * ```ts\n * // Cross-year boundary\n * const start = Temporal.ZonedDateTime.from('2024-11-15T00:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-02-15T00:00:00+00:00[UTC]');\n *\n * const months = eachMonthOfInterval({ start, end });\n * // [\n * // 2024-11-01T00:00:00+00:00[UTC],\n * // 2024-12-01T00:00:00+00:00[UTC],\n * // 2025-01-01T00:00:00+00:00[UTC],\n * // 2025-02-01T00:00:00+00:00[UTC]\n * // ]\n * ```\n */\nexport function eachMonthOfInterval(interval: {\n start: Temporal.PlainDate;\n end: Temporal.PlainDate;\n}): Temporal.PlainDate[];\nexport function eachMonthOfInterval(interval: {\n start: Temporal.Instant | Temporal.ZonedDateTime;\n end: Temporal.Instant | Temporal.ZonedDateTime;\n}): Temporal.ZonedDateTime[];\nexport function eachMonthOfInterval(interval: {\n start: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate;\n end: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate;\n}): Temporal.ZonedDateTime[] | Temporal.PlainDate[] {\n if (isPlainDate(interval.start) || isPlainDate(interval.end)) {\n if (!isPlainDate(interval.start) || !isPlainDate(interval.end)) {\n throw new TypeError('PlainDate intervals require two PlainDate endpoints');\n }\n if (isPlainDateAfter(interval.start, interval.end)) return [];\n const end = interval.end.withCalendar(interval.start.calendarId);\n const last = end.with({ day: 1 });\n let current = interval.start.with({ day: 1 });\n const dates: Temporal.PlainDate[] = [];\n while (isPlainDateBefore(current, last)) {\n dates.push(current);\n current = current.add({ months: 1 });\n }\n dates.push(current);\n return dates;\n }\n const startZoned = normalizeTemporalInput(interval.start);\n const endZoned = normalizeTemporalInput(interval.end);\n if (startZoned.epochNanoseconds > endZoned.epochNanoseconds) return [];\n\n const timezone = startZoned.timeZoneId;\n\n // Get start of the starting month\n const startYearMonth = Temporal.PlainYearMonth.from({\n year: startZoned.year,\n month: startZoned.month,\n calendar: startZoned.calendarId\n });\n\n // Get end month in the same timezone\n const endInTimezone = endZoned.withTimeZone(timezone).withCalendar(startZoned.calendarId);\n const endYearMonth = Temporal.PlainYearMonth.from({\n year: endInTimezone.year,\n month: endInTimezone.month,\n calendar: startZoned.calendarId\n });\n\n const months: Temporal.ZonedDateTime[] = [];\n let current = startYearMonth;\n\n while (Temporal.PlainYearMonth.compare(current, endYearMonth) <= 0) {\n const firstOfMonth = current.toPlainDate({ day: 1 });\n months.push(\n firstOfMonth.toZonedDateTime({\n timeZone: timezone,\n plainTime: new Temporal.PlainTime()\n })\n );\n current = current.add({ months: 1 });\n }\n\n return months;\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2DO,SAAS,oBAAoB,UAGgB;AAClD,MAAI,YAAY,SAAS,KAAK,KAAK,YAAY,SAAS,GAAG,GAAG;AAC5D,QAAI,CAAC,YAAY,SAAS,KAAK,KAAK,CAAC,YAAY,SAAS,GAAG,GAAG;AAC9D,YAAM,IAAI,UAAU,qDAAqD;AAAA,IAC3E;AACA,QAAI,iBAAiB,SAAS,OAAO,SAAS,GAAG,EAAG,QAAO,CAAC;AAC5D,UAAM,MAAM,SAAS,IAAI,aAAa,SAAS,MAAM,UAAU;AAC/D,UAAM,OAAO,IAAI,KAAK,EAAE,KAAK,EAAE,CAAC;AAChC,QAAIA,WAAU,SAAS,MAAM,KAAK,EAAE,KAAK,EAAE,CAAC;AAC5C,UAAM,QAA8B,CAAC;AACrC,WAAO,kBAAkBA,UAAS,IAAI,GAAG;AACvC,YAAM,KAAKA,QAAO;AAClB,MAAAA,WAAUA,SAAQ,IAAI,EAAE,QAAQ,EAAE,CAAC;AAAA,IACrC;AACA,UAAM,KAAKA,QAAO;AAClB,WAAO;AAAA,EACT;AACA,QAAM,aAAa,uBAAuB,SAAS,KAAK;AACxD,QAAM,WAAW,uBAAuB,SAAS,GAAG;AACpD,MAAI,WAAW,mBAAmB,SAAS,iBAAkB,QAAO,CAAC;AAErE,QAAM,WAAW,WAAW;AAG5B,QAAM,iBAAiB,SAAS,eAAe,KAAK;AAAA,IAClD,MAAM,WAAW;AAAA,IACjB,OAAO,WAAW;AAAA,IAClB,UAAU,WAAW;AAAA,EACvB,CAAC;AAGD,QAAM,gBAAgB,SAAS,aAAa,QAAQ,EAAE,aAAa,WAAW,UAAU;AACxF,QAAM,eAAe,SAAS,eAAe,KAAK;AAAA,IAChD,MAAM,cAAc;AAAA,IACpB,OAAO,cAAc;AAAA,IACrB,UAAU,WAAW;AAAA,EACvB,CAAC;AAED,QAAM,SAAmC,CAAC;AAC1C,MAAI,UAAU;AAEd,SAAO,SAAS,eAAe,QAAQ,SAAS,YAAY,KAAK,GAAG;AAClE,UAAM,eAAe,QAAQ,YAAY,EAAE,KAAK,EAAE,CAAC;AACnD,WAAO;AAAA,MACL,aAAa,gBAAgB;AAAA,QAC3B,UAAU;AAAA,QACV,WAAW,IAAI,SAAS,UAAU;AAAA,MACpC,CAAC;AAAA,IACH;AACA,cAAU,QAAQ,IAAI,EAAE,QAAQ,EAAE,CAAC;AAAA,EACrC;AAEA,SAAO;AACT;","names":["current"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addWeeks
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TZ4NUY3W.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-M4ESIRFH.js";
|
|
7
7
|
|
|
8
8
|
// src/subWeeks.ts
|
|
9
9
|
function subWeeks(input, weeks) {
|
|
@@ -13,4 +13,4 @@ function subWeeks(input, weeks) {
|
|
|
13
13
|
export {
|
|
14
14
|
subWeeks
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-CX37IV4D.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/isSameMonth.ts
|
|
6
6
|
function isSameMonth(date1, date2) {
|
|
@@ -12,4 +12,4 @@ function isSameMonth(date1, date2) {
|
|
|
12
12
|
export {
|
|
13
13
|
isSameMonth
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-D2HKS2OM.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
|
Temporal
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-M4ESIRFH.js";
|
|
7
7
|
|
|
8
8
|
// src/shared/nowZoned.ts
|
|
9
9
|
function nowZoned() {
|
|
@@ -13,4 +13,4 @@ function nowZoned() {
|
|
|
13
13
|
export {
|
|
14
14
|
nowZoned
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-D73HU7YA.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
Temporal,
|
|
3
3
|
isPlainDate,
|
|
4
4
|
isPlainTime
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-M4ESIRFH.js";
|
|
6
6
|
|
|
7
7
|
// src/shared/compare.ts
|
|
8
8
|
function assertSameDomain(a, b) {
|
|
@@ -44,4 +44,4 @@ export {
|
|
|
44
44
|
compare,
|
|
45
45
|
position
|
|
46
46
|
};
|
|
47
|
-
//# sourceMappingURL=chunk-
|
|
47
|
+
//# sourceMappingURL=chunk-DAWWOF5W.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isWeekendDay
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QFQHFBN4.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/isWeekend.ts
|
|
12
12
|
function isWeekend(input) {
|
|
@@ -17,4 +17,4 @@ function isWeekend(input) {
|
|
|
17
17
|
export {
|
|
18
18
|
isWeekend
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-DCQCZCKG.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/isSameSecond.ts
|
|
6
6
|
function isSameSecond(date1, date2) {
|
|
@@ -12,4 +12,4 @@ function isSameSecond(date1, date2) {
|
|
|
12
12
|
export {
|
|
13
13
|
isSameSecond
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-DEVXW65H.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
compare
|
|
3
|
+
} from "./chunk-DAWWOF5W.js";
|
|
4
|
+
|
|
5
|
+
// src/areIntervalsOverlapping.ts
|
|
6
|
+
function areIntervalsOverlapping(left, right, options) {
|
|
7
|
+
if (compare(left.start, left.end) > 0 || compare(right.start, right.end) > 0) {
|
|
8
|
+
throw new RangeError("Interval start must not be after its end");
|
|
9
|
+
}
|
|
10
|
+
const limit = options?.inclusive ? 0 : -1;
|
|
11
|
+
return compare(left.start, right.end) <= limit && compare(right.start, left.end) <= limit;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
areIntervalsOverlapping
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=chunk-DFVLLH5O.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/areIntervalsOverlapping.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { compare, type Timeline } from './shared/compare';\n\n/**\n * Returns true if two intervals share any time.\n *\n * By default an interval that ends exactly where the other starts does not\n * overlap it, so back-to-back bookings are allowed. Pass `{ inclusive: true }`\n * to count a shared endpoint, as for inclusive date ranges.\n *\n * Instants and ZonedDateTimes compare by the moment they represent. PlainDate\n * intervals compare by date. Mixing PlainDate and timeline endpoints throws a\n * TypeError; an interval whose start is after its end throws a RangeError.\n *\n * @param left - The first interval\n * @param right - The second interval\n * @param options - `inclusive`: count intervals that only touch as overlapping\n * @returns true if the intervals overlap\n *\n * @example\n * ```ts\n * const meeting = {\n * start: Temporal.ZonedDateTime.from('2025-01-20T09:00:00+01:00[Europe/Madrid]'),\n * end: Temporal.ZonedDateTime.from('2025-01-20T10:00:00+01:00[Europe/Madrid]')\n * };\n * const call = {\n * start: Temporal.Instant.from('2025-01-20T08:30:00Z'), // 09:30 in Madrid\n * end: Temporal.Instant.from('2025-01-20T09:30:00Z')\n * };\n *\n * areIntervalsOverlapping(meeting, call); // true\n * ```\n *\n * @example\n * ```ts\n * const firstStay = { start: Temporal.PlainDate.from('2025-07-01'), end: Temporal.PlainDate.from('2025-07-04') };\n * const nextStay = { start: Temporal.PlainDate.from('2025-07-04'), end: Temporal.PlainDate.from('2025-07-08') };\n *\n * areIntervalsOverlapping(firstStay, nextStay); // false\n * areIntervalsOverlapping(firstStay, nextStay, { inclusive: true }); // true\n * ```\n */\nexport function areIntervalsOverlapping(\n left: { start: Temporal.PlainDate; end: Temporal.PlainDate },\n right: { start: Temporal.PlainDate; end: Temporal.PlainDate },\n options?: { inclusive?: boolean }\n): boolean;\nexport function areIntervalsOverlapping(\n left: { start: Timeline; end: Timeline },\n right: { start: Timeline; end: Timeline },\n options?: { inclusive?: boolean }\n): boolean;\nexport function areIntervalsOverlapping(\n left: { start: Timeline | Temporal.PlainDate; end: Timeline | Temporal.PlainDate },\n right: { start: Timeline | Temporal.PlainDate; end: Timeline | Temporal.PlainDate },\n options?: { inclusive?: boolean }\n): boolean {\n if (compare(left.start, left.end) > 0 || compare(right.start, right.end) > 0) {\n throw new RangeError('Interval start must not be after its end');\n }\n const limit = options?.inclusive ? 0 : -1;\n return compare(left.start, right.end) <= limit && compare(right.start, left.end) <= limit;\n}\n"],"mappings":";;;;;AAoDO,SAAS,wBACd,MACA,OACA,SACS;AACT,MAAI,QAAQ,KAAK,OAAO,KAAK,GAAG,IAAI,KAAK,QAAQ,MAAM,OAAO,MAAM,GAAG,IAAI,GAAG;AAC5E,UAAM,IAAI,WAAW,0CAA0C;AAAA,EACjE;AACA,QAAM,QAAQ,SAAS,YAAY,IAAI;AACvC,SAAO,QAAQ,KAAK,OAAO,MAAM,GAAG,KAAK,SAAS,QAAQ,MAAM,OAAO,KAAK,GAAG,KAAK;AACtF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Temporal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-M4ESIRFH.js";
|
|
4
4
|
|
|
5
5
|
// src/isPlainDateBefore.ts
|
|
6
6
|
function isPlainDateBefore(date1, date2) {
|
|
@@ -13,4 +13,4 @@ function isPlainDateBefore(date1, date2) {
|
|
|
13
13
|
export {
|
|
14
14
|
isPlainDateBefore
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-DYDSR35L.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/isPlainDateBefore.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\n\n/**\n * Returns true if the first plain date is before the second plain date.\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 is before date2, false otherwise\n *\n * @example\n * ```ts\n * const jan20 = Temporal.PlainDate.from('2025-01-20');\n * const jan25 = Temporal.PlainDate.from('2025-01-25');\n *\n * isPlainDateBefore(jan20, jan25); // true\n * isPlainDateBefore(jan25, jan20); // false\n * isPlainDateBefore(jan20, jan20); // false\n * ```\n */\nexport function isPlainDateBefore(
|
|
1
|
+
{"version":3,"sources":["../src/isPlainDateBefore.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\n\n/**\n * Returns true if the first plain date is before the second plain date.\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 is before date2, false otherwise\n *\n * @example\n * ```ts\n * const jan20 = Temporal.PlainDate.from('2025-01-20');\n * const jan25 = Temporal.PlainDate.from('2025-01-25');\n *\n * isPlainDateBefore(jan20, jan25); // true\n * isPlainDateBefore(jan25, jan20); // false\n * isPlainDateBefore(jan20, jan20); // false\n * ```\n */\nexport function isPlainDateBefore(date1: Temporal.PlainDate, date2: Temporal.PlainDate): boolean {\n // Only foreign objects need conversion; strings retain their calendar annotations.\n return (\n Temporal.PlainDate.compare(\n Temporal.PlainDate.prototype.isPrototypeOf(date1) ? date1 : date1.toString(),\n Temporal.PlainDate.prototype.isPrototypeOf(date2) ? date2 : date2.toString()\n ) < 0\n );\n}\n"],"mappings":";;;;;AAoBO,SAAS,kBAAkB,OAA2B,OAAoC;AAE/F,SACE,SAAS,UAAU;AAAA,IACjB,SAAS,UAAU,UAAU,cAAc,KAAK,IAAI,QAAQ,MAAM,SAAS;AAAA,IAC3E,SAAS,UAAU,UAAU,cAAc,KAAK,IAAI,QAAQ,MAAM,SAAS;AAAA,EAC7E,IAAI;AAER;","names":[]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeWithPlainDate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QCIY5PSJ.js";
|
|
4
4
|
import {
|
|
5
5
|
getEndOfDay
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7WGGUDW4.js";
|
|
7
7
|
import {
|
|
8
8
|
isPlainDate
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-M4ESIRFH.js";
|
|
10
10
|
|
|
11
11
|
// src/endOfYear.ts
|
|
12
12
|
function endOfYear(input, timezone) {
|
|
@@ -23,4 +23,4 @@ function endOfYear(input, timezone) {
|
|
|
23
23
|
export {
|
|
24
24
|
endOfYear
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-DZFUKW5U.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/endOfYear.ts"],"sourcesContent":["import { isPlainDate, Temporal } from './shared/temporal';\nimport type { Timezone } from './types';\nimport { getEndOfDay } from './shared/endOfDay';\nimport { normalizeWithPlainDate } from './shared/normalizeWithPlainDate';\n\n/**\n * Returns the last boundary of the year.\n * PlainDate inputs stay in calendar space unless a timezone is provided.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at the last day of the year at 23:59:59.999999999\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-06-15T12:00:00Z');\n * const end = endOfYear(instant);\n * // 2025-12-31T23:59:59.999999999+00:00[UTC]\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-06-15T15:30:00-04:00[America/New_York]');\n * const end = endOfYear(zoned);\n * // 2025-12-31T23:59:59.999999999-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (stays a date)\n * const date = Temporal.PlainDate.from('2025-06-15');\n * const end = endOfYear(date);\n * // 2025-12-31\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate with a timezone (returns a ZonedDateTime)\n * const date = Temporal.PlainDate.from('2025-06-15');\n * const end = endOfYear(date, 'America/New_York');\n * // 2025-12-31T23:59:59.999999999-05:00[America/New_York]\n * ```\n */\nexport function endOfYear(
|
|
1
|
+
{"version":3,"sources":["../src/endOfYear.ts"],"sourcesContent":["import { isPlainDate, Temporal } from './shared/temporal';\nimport type { Timezone } from './types';\nimport { getEndOfDay } from './shared/endOfDay';\nimport { normalizeWithPlainDate } from './shared/normalizeWithPlainDate';\n\n/**\n * Returns the last boundary of the year.\n * PlainDate inputs stay in calendar space unless a timezone is provided.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at the last day of the year at 23:59:59.999999999\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-06-15T12:00:00Z');\n * const end = endOfYear(instant);\n * // 2025-12-31T23:59:59.999999999+00:00[UTC]\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-06-15T15:30:00-04:00[America/New_York]');\n * const end = endOfYear(zoned);\n * // 2025-12-31T23:59:59.999999999-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (stays a date)\n * const date = Temporal.PlainDate.from('2025-06-15');\n * const end = endOfYear(date);\n * // 2025-12-31\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate with a timezone (returns a ZonedDateTime)\n * const date = Temporal.PlainDate.from('2025-06-15');\n * const end = endOfYear(date, 'America/New_York');\n * // 2025-12-31T23:59:59.999999999-05:00[America/New_York]\n * ```\n */\nexport function endOfYear(input: Temporal.Instant | Temporal.ZonedDateTime): Temporal.ZonedDateTime;\nexport function endOfYear(input: Temporal.PlainDate): Temporal.PlainDate;\nexport function endOfYear(input: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;\nexport function endOfYear(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n if (isPlainDate(input) && timezone === undefined) {\n const lastMonth = input.with({ month: input.monthsInYear });\n return lastMonth.with({ day: lastMonth.daysInMonth });\n }\n\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n const lastMonth = zonedDateTime.with({ month: zonedDateTime.monthsInYear });\n const lastDay = lastMonth.with({ day: lastMonth.daysInMonth });\n return getEndOfDay(lastDay);\n}\n"],"mappings":";;;;;;;;;;;AA+CO,SAAS,UACd,OACA,UAC6C;AAC7C,MAAI,YAAY,KAAK,KAAK,aAAa,QAAW;AAChD,UAAMA,aAAY,MAAM,KAAK,EAAE,OAAO,MAAM,aAAa,CAAC;AAC1D,WAAOA,WAAU,KAAK,EAAE,KAAKA,WAAU,YAAY,CAAC;AAAA,EACtD;AAEA,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,QAAM,YAAY,cAAc,KAAK,EAAE,OAAO,cAAc,aAAa,CAAC;AAC1E,QAAM,UAAU,UAAU,KAAK,EAAE,KAAK,UAAU,YAAY,CAAC;AAC7D,SAAO,YAAY,OAAO;AAC5B;","names":["lastMonth"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTM7YAT4.js";
|
|
4
4
|
|
|
5
5
|
// src/isSameDay.ts
|
|
6
6
|
function isSameDay(date1, date2) {
|
|
@@ -12,4 +12,4 @@ function isSameDay(date1, date2) {
|
|
|
12
12
|
export {
|
|
13
13
|
isSameDay
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-EMJXV6KH.js.map
|
|
@@ -1 +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:00+00:00[UTC]');\n * const evening = Temporal.ZonedDateTime.from('2025-01-20T23:00:00+00:00[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:59+00:00[UTC]');\n * const tomorrow = Temporal.ZonedDateTime.from('2025-01-21T00:00:00+00:00[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
|
|
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:00+00:00[UTC]');\n * const evening = Temporal.ZonedDateTime.from('2025-01-20T23:00:00+00:00[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:59+00:00[UTC]');\n * const tomorrow = Temporal.ZonedDateTime.from('2025-01-21T00:00:00+00:00[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 zoned1.year === zoned2.year && zoned1.month === zoned2.month && zoned1.day === zoned2.day;\n}\n"],"mappings":";;;;;AA0DO,SAAS,UACd,OACA,OACS;AACT,QAAM,SAAS,uBAAuB,KAAK;AAC3C,QAAM,SAAS,uBAAuB,KAAK;AAE3C,SAAO,OAAO,SAAS,OAAO,QAAQ,OAAO,UAAU,OAAO,SAAS,OAAO,QAAQ,OAAO;AAC/F;","names":[]}
|