@gobrand/tiempo 3.0.1 → 3.1.3
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/README.md +6 -4
- package/dist/addBusinessDays.d.ts +28 -0
- package/dist/addBusinessDays.d.ts.map +1 -0
- package/dist/addBusinessDays.js +10 -0
- package/dist/addDays.d.ts +9 -6
- package/dist/addDays.d.ts.map +1 -1
- package/dist/addDays.js +3 -3
- package/dist/addHours.d.ts +3 -3
- package/dist/addHours.d.ts.map +1 -1
- package/dist/addHours.js +3 -3
- package/dist/addMicroseconds.d.ts +3 -3
- package/dist/addMicroseconds.d.ts.map +1 -1
- package/dist/addMicroseconds.js +3 -3
- package/dist/addMilliseconds.d.ts +3 -3
- package/dist/addMilliseconds.d.ts.map +1 -1
- package/dist/addMilliseconds.js +3 -3
- package/dist/addMinutes.d.ts +3 -3
- package/dist/addMinutes.d.ts.map +1 -1
- package/dist/addMinutes.js +3 -3
- package/dist/addMonths.d.ts +9 -6
- package/dist/addMonths.d.ts.map +1 -1
- package/dist/addMonths.js +3 -3
- package/dist/addNanoseconds.d.ts +3 -3
- package/dist/addNanoseconds.d.ts.map +1 -1
- package/dist/addNanoseconds.js +3 -3
- package/dist/addQuarters.d.ts +4 -4
- package/dist/addQuarters.d.ts.map +1 -1
- package/dist/addQuarters.js +3 -3
- package/dist/addSeconds.d.ts +3 -3
- package/dist/addSeconds.d.ts.map +1 -1
- package/dist/addSeconds.js +3 -3
- package/dist/addWeeks.d.ts +9 -6
- package/dist/addWeeks.d.ts.map +1 -1
- package/dist/addWeeks.js +3 -3
- package/dist/addYears.d.ts +9 -6
- package/dist/addYears.d.ts.map +1 -1
- package/dist/addYears.js +3 -3
- package/dist/{chunk-L5AMAEWX.js → chunk-2AID4P2C.js} +2 -2
- package/dist/{chunk-MTDZG4HK.js → chunk-2TISXHHK.js} +5 -5
- package/dist/chunk-2TISXHHK.js.map +1 -0
- package/dist/{chunk-WGLZHBJG.js → chunk-32AWWYBF.js} +2 -2
- package/dist/chunk-32AWWYBF.js.map +1 -0
- package/dist/{chunk-BV32K227.js → chunk-3D4YR2SR.js} +3 -3
- package/dist/chunk-3D4YR2SR.js.map +1 -0
- package/dist/chunk-3HD7HEN4.js +42 -0
- package/dist/chunk-3HD7HEN4.js.map +1 -0
- package/dist/chunk-3HF4F36S.js +16 -0
- package/dist/chunk-3HF4F36S.js.map +1 -0
- package/dist/{chunk-VXOQ7IG5.js → chunk-3KE6GK4R.js} +2 -2
- package/dist/{chunk-VXOQ7IG5.js.map → chunk-3KE6GK4R.js.map} +1 -1
- package/dist/chunk-3S6TSXZ3.js +18 -0
- package/dist/chunk-3S6TSXZ3.js.map +1 -0
- package/dist/chunk-3X2U6I44.js +19 -0
- package/dist/chunk-3X2U6I44.js.map +1 -0
- package/dist/{chunk-SDW4W3XE.js → chunk-3XGUCQ2A.js} +2 -2
- package/dist/chunk-3XGUCQ2A.js.map +1 -0
- package/dist/{chunk-6RETOV6A.js → chunk-4GEF7B7W.js} +3 -3
- package/dist/chunk-4KAIF44F.js +19 -0
- package/dist/chunk-4KAIF44F.js.map +1 -0
- package/dist/chunk-4PS6BEAC.js +16 -0
- package/dist/chunk-4PS6BEAC.js.map +1 -0
- package/dist/chunk-4VWUTQKP.js +65 -0
- package/dist/chunk-4VWUTQKP.js.map +1 -0
- package/dist/{chunk-GR7322AQ.js → chunk-525OLFRD.js} +3 -3
- package/dist/chunk-525OLFRD.js.map +1 -0
- package/dist/{chunk-PYALKKWZ.js → chunk-57MHNRCU.js} +4 -4
- package/dist/chunk-57MHNRCU.js.map +1 -0
- package/dist/{chunk-CSOSM46M.js → chunk-5WHGX2J3.js} +2 -2
- package/dist/chunk-5WHGX2J3.js.map +1 -0
- package/dist/chunk-67XABEBT.js +56 -0
- package/dist/chunk-67XABEBT.js.map +1 -0
- package/dist/{chunk-VS2VCQLP.js → chunk-6QH4NCPA.js} +2 -2
- package/dist/chunk-6QH4NCPA.js.map +1 -0
- package/dist/{chunk-IONQ6TOR.js → chunk-6QOLNYFY.js} +2 -2
- package/dist/chunk-6QOLNYFY.js.map +1 -0
- package/dist/chunk-6QZUAJVF.js +20 -0
- package/dist/chunk-6QZUAJVF.js.map +1 -0
- package/dist/{chunk-PURKYS5T.js → chunk-6XEHR3MG.js} +2 -2
- package/dist/{chunk-LAITZAIG.js → chunk-7IKCDOCT.js} +2 -2
- package/dist/chunk-7IKCDOCT.js.map +1 -0
- package/dist/chunk-7NGP7SAD.js +66 -0
- package/dist/chunk-7NGP7SAD.js.map +1 -0
- package/dist/{chunk-RL2NW7HP.js → chunk-A34P5Z5O.js} +2 -2
- package/dist/chunk-A34P5Z5O.js.map +1 -0
- package/dist/chunk-ADPVFELS.js +16 -0
- package/dist/{chunk-NEHYVVTH.js.map → chunk-ADPVFELS.js.map} +1 -1
- package/dist/chunk-AOODDNHA.js +53 -0
- package/dist/chunk-AOODDNHA.js.map +1 -0
- package/dist/{chunk-FCJO72WG.js → chunk-AUOZACFS.js} +2 -2
- package/dist/chunk-AUOZACFS.js.map +1 -0
- package/dist/{chunk-A42NID5P.js → chunk-BI42E23Z.js} +4 -4
- package/dist/chunk-BI42E23Z.js.map +1 -0
- package/dist/chunk-BMX7CIRD.js +9 -0
- package/dist/chunk-BMX7CIRD.js.map +1 -0
- package/dist/{chunk-25CVKMFC.js → chunk-BPMS34GV.js} +3 -3
- package/dist/chunk-BPMS34GV.js.map +1 -0
- package/dist/{chunk-R7ZCA6AQ.js → chunk-BSVOJYJ7.js} +7 -3
- package/dist/chunk-BSVOJYJ7.js.map +1 -0
- package/dist/{chunk-BEGD73DT.js → chunk-BYPHFTFD.js} +33 -47
- package/dist/chunk-BYPHFTFD.js.map +1 -0
- package/dist/chunk-CDKIT7D3.js +9 -0
- package/dist/chunk-CDKIT7D3.js.map +1 -0
- package/dist/chunk-CN3OICYB.js +13 -0
- package/dist/chunk-CN3OICYB.js.map +1 -0
- package/dist/chunk-D3N7BT44.js +22 -0
- package/dist/chunk-D3N7BT44.js.map +1 -0
- package/dist/{chunk-OLLX6YCN.js → chunk-DBOIK3XA.js} +2 -2
- package/dist/chunk-DBOIK3XA.js.map +1 -0
- package/dist/{chunk-6UMISP3B.js → chunk-DGUAV5XN.js} +2 -2
- package/dist/chunk-DGUAV5XN.js.map +1 -0
- package/dist/{chunk-OFIPZPEA.js → chunk-DRBZDI52.js} +2 -2
- package/dist/chunk-DRBZDI52.js.map +1 -0
- package/dist/chunk-DZ3647ZK.js +16 -0
- package/dist/chunk-DZ3647ZK.js.map +1 -0
- package/dist/{chunk-JQFD563S.js → chunk-EAO2SO4N.js} +2 -2
- package/dist/chunk-EAO2SO4N.js.map +1 -0
- package/dist/{chunk-DBVGH55Z.js → chunk-EBOLL4LY.js} +2 -2
- package/dist/chunk-EH4GVGXD.js +16 -0
- package/dist/{chunk-OKXCGA4Y.js.map → chunk-EH4GVGXD.js.map} +1 -1
- package/dist/{chunk-RLVCSGRU.js → chunk-F3UZDWOQ.js} +2 -2
- package/dist/chunk-F3UZDWOQ.js.map +1 -0
- package/dist/{chunk-MNV2H4N6.js → chunk-GCVX5QIX.js} +2 -2
- package/dist/chunk-GCVX5QIX.js.map +1 -0
- package/dist/chunk-GQXJICRA.js +26 -0
- package/dist/chunk-GQXJICRA.js.map +1 -0
- package/dist/chunk-GU3CZAIN.js +16 -0
- package/dist/chunk-GU3CZAIN.js.map +1 -0
- package/dist/{chunk-4PGGOVSG.js → chunk-GXSVYUCG.js} +2 -2
- package/dist/chunk-GXSVYUCG.js.map +1 -0
- package/dist/{chunk-YNLBS34B.js → chunk-HCORON7B.js} +4 -4
- package/dist/chunk-HCORON7B.js.map +1 -0
- package/dist/{chunk-H5BHFVEN.js → chunk-HCVE7FSF.js} +2 -2
- package/dist/chunk-HCVE7FSF.js.map +1 -0
- package/dist/chunk-HRCTWTP3.js +19 -0
- package/dist/chunk-HRCTWTP3.js.map +1 -0
- package/dist/{chunk-M7Y67IAB.js → chunk-HT6L4VRQ.js} +2 -2
- package/dist/chunk-HT6L4VRQ.js.map +1 -0
- package/dist/{chunk-SCD2JNY3.js → chunk-HYSGJJUR.js} +2 -2
- package/dist/chunk-HYSGJJUR.js.map +1 -0
- package/dist/{chunk-BTXU3OGV.js → chunk-IWVSM77B.js} +2 -2
- package/dist/chunk-IWVSM77B.js.map +1 -0
- package/dist/{chunk-URC6AG2N.js → chunk-IXNGK5OF.js} +2 -2
- package/dist/chunk-IXNGK5OF.js.map +1 -0
- package/dist/{chunk-RKEZOXD3.js → chunk-JA5ER27P.js} +2 -2
- package/dist/chunk-JA5ER27P.js.map +1 -0
- package/dist/chunk-JGPTGV5X.js +26 -0
- package/dist/chunk-JGPTGV5X.js.map +1 -0
- package/dist/chunk-JQ4Z4JTW.js +16 -0
- package/dist/chunk-JQ4Z4JTW.js.map +1 -0
- package/dist/{chunk-OQNFKOPA.js → chunk-K3L6MJJB.js} +2 -2
- package/dist/chunk-K3L6MJJB.js.map +1 -0
- package/dist/{chunk-T5WSO6US.js → chunk-K6NQZIAW.js} +2 -2
- package/dist/chunk-K6NQZIAW.js.map +1 -0
- package/dist/chunk-K7CLBBBM.js +36 -0
- package/dist/chunk-K7CLBBBM.js.map +1 -0
- package/dist/{chunk-NX7MXLFS.js → chunk-KTMCYEU5.js} +2 -2
- package/dist/{chunk-5Y5JH32Z.js → chunk-KYS54PLJ.js} +3 -3
- package/dist/chunk-KYS54PLJ.js.map +1 -0
- package/dist/chunk-KZCSP3DU.js +28 -0
- package/dist/chunk-KZCSP3DU.js.map +1 -0
- package/dist/chunk-LMOAA73F.js +28 -0
- package/dist/chunk-LMOAA73F.js.map +1 -0
- package/dist/{chunk-2E4KCD3Y.js → chunk-LQ3EQYIX.js} +4 -3
- package/dist/chunk-LQ3EQYIX.js.map +1 -0
- package/dist/{chunk-ELUSLRWQ.js → chunk-LRIVI5ZC.js} +2 -2
- package/dist/{chunk-M4KDJ4I4.js → chunk-LXOLIOAD.js} +2 -2
- package/dist/{chunk-3TS3D7WD.js → chunk-MLHFNZEA.js} +4 -4
- package/dist/chunk-MLHFNZEA.js.map +1 -0
- package/dist/chunk-MVGBYHG5.js +16 -0
- package/dist/chunk-MVGBYHG5.js.map +1 -0
- package/dist/chunk-MWUVGTKC.js +23 -0
- package/dist/chunk-MWUVGTKC.js.map +1 -0
- package/dist/{chunk-OSBVYUOQ.js → chunk-MXYAZTDE.js} +4 -4
- package/dist/chunk-MXYAZTDE.js.map +1 -0
- package/dist/{chunk-7SCQV77A.js → chunk-NGS5UKDW.js} +3 -3
- package/dist/chunk-NGS5UKDW.js.map +1 -0
- package/dist/{chunk-PX2I4GCF.js → chunk-NL5MQVGD.js} +2 -2
- package/dist/chunk-NMMMAMKP.js +9 -0
- package/dist/chunk-NMMMAMKP.js.map +1 -0
- package/dist/{chunk-S7L5KBI4.js → chunk-NOWUJERX.js} +3 -3
- package/dist/chunk-NOWUJERX.js.map +1 -0
- package/dist/{chunk-CCVPCHUO.js → chunk-NVFFQJEW.js} +4 -4
- package/dist/chunk-NVFFQJEW.js.map +1 -0
- package/dist/chunk-NZLRMN35.js +13 -0
- package/dist/chunk-NZLRMN35.js.map +1 -0
- package/dist/{chunk-EMZFQEWM.js → chunk-OEPVYNB6.js} +4 -7
- package/dist/chunk-OEPVYNB6.js.map +1 -0
- package/dist/chunk-OF5YEVUT.js +32 -0
- package/dist/chunk-OF5YEVUT.js.map +1 -0
- package/dist/chunk-OMYVTYHI.js +47 -0
- package/dist/chunk-OMYVTYHI.js.map +1 -0
- package/dist/chunk-OOOVMKOG.js +13 -0
- package/dist/chunk-OOOVMKOG.js.map +1 -0
- package/dist/chunk-OVBZ2NBB.js +30 -0
- package/dist/chunk-OVBZ2NBB.js.map +1 -0
- package/dist/{chunk-KPB5ENNM.js → chunk-PAM6VJQM.js} +4 -4
- package/dist/chunk-PAM6VJQM.js.map +1 -0
- package/dist/chunk-Q6QLOUXJ.js +18 -0
- package/dist/chunk-Q6QLOUXJ.js.map +1 -0
- package/dist/{chunk-UQ2F3I2S.js → chunk-QDY2KMYX.js} +3 -3
- package/dist/chunk-QDY2KMYX.js.map +1 -0
- package/dist/{chunk-TQUKIG26.js → chunk-QJYU5TLL.js} +2 -2
- package/dist/{chunk-7OEGJCW7.js → chunk-QNZJR53W.js} +4 -4
- package/dist/chunk-QNZJR53W.js.map +1 -0
- package/dist/{chunk-VQAGV72H.js → chunk-QVSHSIA3.js} +2 -2
- package/dist/{chunk-MENMDB6M.js → chunk-QZ6WXAUO.js} +2 -2
- package/dist/chunk-QZ6WXAUO.js.map +1 -0
- package/dist/{chunk-PWIEPZVO.js → chunk-R2DCUSBY.js} +2 -2
- package/dist/chunk-R2DCUSBY.js.map +1 -0
- package/dist/{chunk-3LTTYG6N.js → chunk-R5XRTUWH.js} +2 -2
- package/dist/chunk-R5XRTUWH.js.map +1 -0
- package/dist/chunk-RDMDCTHJ.js +13 -0
- package/dist/chunk-RDMDCTHJ.js.map +1 -0
- package/dist/{chunk-MM2HIW7M.js → chunk-SHKSAHJO.js} +4 -6
- package/dist/chunk-SHKSAHJO.js.map +1 -0
- package/dist/chunk-SLH6TKGN.js +16 -0
- package/dist/chunk-SLH6TKGN.js.map +1 -0
- package/dist/{chunk-ZOHYNJUD.js → chunk-TCB3IDJM.js} +4 -4
- package/dist/chunk-TCB3IDJM.js.map +1 -0
- package/dist/{chunk-WTLAKRCT.js → chunk-TD6MVGV2.js} +3 -3
- package/dist/chunk-TD6MVGV2.js.map +1 -0
- package/dist/{chunk-IAXVREU5.js → chunk-TI6WBLCB.js} +2 -2
- package/dist/chunk-TI6WBLCB.js.map +1 -0
- package/dist/{chunk-VKXN4FQD.js → chunk-TIZJRCAA.js} +2 -2
- package/dist/chunk-TIZJRCAA.js.map +1 -0
- package/dist/chunk-TU3LNQKW.js +28 -0
- package/dist/chunk-TU3LNQKW.js.map +1 -0
- package/dist/{chunk-PXF3RMFH.js → chunk-TWXUGWYX.js} +5 -3
- package/dist/{chunk-PXF3RMFH.js.map → chunk-TWXUGWYX.js.map} +1 -1
- package/dist/chunk-U7VOIXLY.js +13 -0
- package/dist/chunk-U7VOIXLY.js.map +1 -0
- package/dist/chunk-V2NSN6ET.js +13 -0
- package/dist/chunk-V2NSN6ET.js.map +1 -0
- package/dist/chunk-VDV24TWQ.js +13 -0
- package/dist/chunk-VDV24TWQ.js.map +1 -0
- package/dist/{chunk-YOSCEJ36.js → chunk-VM2YJ5PN.js} +2 -2
- package/dist/{chunk-XWBOD6MD.js → chunk-WTLMIOKZ.js} +2 -2
- package/dist/{chunk-VC7RTDJP.js → chunk-X27XGVCT.js} +2 -2
- package/dist/{chunk-EBVLBLR3.js → chunk-XSHFR2SX.js} +4 -7
- package/dist/chunk-XSHFR2SX.js.map +1 -0
- package/dist/{chunk-OVSCDXYN.js → chunk-Y24VUXMX.js} +3 -3
- package/dist/chunk-Y24VUXMX.js.map +1 -0
- package/dist/{chunk-DHFBKOFZ.js → chunk-YKXRVQ4S.js} +2 -2
- package/dist/chunk-YKXRVQ4S.js.map +1 -0
- package/dist/chunk-YMJHVVM4.js +13 -0
- package/dist/chunk-YMJHVVM4.js.map +1 -0
- package/dist/chunk-YSDLXJHE.js +16 -0
- package/dist/chunk-YSDLXJHE.js.map +1 -0
- package/dist/chunk-ZM32S3YU.js +16 -0
- package/dist/{chunk-UXMNCRG7.js.map → chunk-ZM32S3YU.js.map} +1 -1
- package/dist/{chunk-DMFV2AL7.js → chunk-ZW32E6EJ.js} +13 -13
- package/dist/chunk-ZW32E6EJ.js.map +1 -0
- package/dist/chunk-ZXKU4SKR.js +19 -0
- package/dist/chunk-ZXKU4SKR.js.map +1 -0
- package/dist/clamp.d.ts +36 -0
- package/dist/clamp.d.ts.map +1 -0
- package/dist/clamp.js +9 -0
- package/dist/clamp.js.map +1 -0
- package/dist/closestTo.d.ts +30 -0
- package/dist/closestTo.d.ts.map +1 -0
- package/dist/closestTo.js +9 -0
- package/dist/closestTo.js.map +1 -0
- package/dist/compareAsc.d.ts +28 -0
- package/dist/compareAsc.d.ts.map +1 -0
- package/dist/compareAsc.js +9 -0
- package/dist/compareAsc.js.map +1 -0
- package/dist/compareDesc.d.ts +28 -0
- package/dist/compareDesc.d.ts.map +1 -0
- package/dist/compareDesc.js +9 -0
- package/dist/compareDesc.js.map +1 -0
- package/dist/differenceInBusinessDays.d.ts +26 -0
- package/dist/differenceInBusinessDays.d.ts.map +1 -0
- package/dist/differenceInBusinessDays.js +10 -0
- package/dist/differenceInBusinessDays.js.map +1 -0
- package/dist/differenceInDays.d.ts +7 -3
- package/dist/differenceInDays.d.ts.map +1 -1
- package/dist/differenceInDays.js +3 -3
- package/dist/differenceInHours.d.ts +3 -0
- package/dist/differenceInHours.d.ts.map +1 -1
- package/dist/differenceInHours.js +3 -4
- package/dist/differenceInMicroseconds.js +3 -3
- package/dist/differenceInMilliseconds.d.ts +3 -0
- package/dist/differenceInMilliseconds.d.ts.map +1 -1
- package/dist/differenceInMilliseconds.js +4 -4
- package/dist/differenceInMinutes.d.ts +3 -0
- package/dist/differenceInMinutes.d.ts.map +1 -1
- package/dist/differenceInMinutes.js +3 -4
- package/dist/differenceInMonths.d.ts +5 -1
- package/dist/differenceInMonths.d.ts.map +1 -1
- package/dist/differenceInMonths.js +3 -3
- package/dist/differenceInNanoseconds.js +3 -3
- package/dist/differenceInQuarters.d.ts +1 -1
- package/dist/differenceInQuarters.d.ts.map +1 -1
- package/dist/differenceInQuarters.js +4 -4
- package/dist/differenceInSeconds.d.ts +3 -0
- package/dist/differenceInSeconds.d.ts.map +1 -1
- package/dist/differenceInSeconds.js +3 -4
- package/dist/differenceInWeeks.d.ts +4 -0
- package/dist/differenceInWeeks.d.ts.map +1 -1
- package/dist/differenceInWeeks.js +3 -3
- package/dist/differenceInYears.d.ts +6 -2
- package/dist/differenceInYears.d.ts.map +1 -1
- package/dist/differenceInYears.js +3 -3
- package/dist/eachDayOfInterval.d.ts +23 -16
- package/dist/eachDayOfInterval.d.ts.map +1 -1
- package/dist/eachDayOfInterval.js +4 -3
- package/dist/eachHourOfInterval.d.ts +19 -17
- package/dist/eachHourOfInterval.d.ts.map +1 -1
- package/dist/eachHourOfInterval.js +3 -3
- package/dist/eachMinuteOfInterval.d.ts +13 -13
- package/dist/eachMinuteOfInterval.d.ts.map +1 -1
- package/dist/eachMinuteOfInterval.js +3 -3
- package/dist/eachMonthOfInterval.d.ts +22 -12
- package/dist/eachMonthOfInterval.d.ts.map +1 -1
- package/dist/eachMonthOfInterval.js +5 -3
- package/dist/eachQuarterOfInterval.d.ts +5 -2
- package/dist/eachQuarterOfInterval.d.ts.map +1 -1
- package/dist/eachQuarterOfInterval.js +4 -3
- package/dist/eachWeekOfInterval.d.ts +21 -14
- package/dist/eachWeekOfInterval.d.ts.map +1 -1
- package/dist/eachWeekOfInterval.js +5 -3
- package/dist/eachYearOfInterval.d.ts +19 -9
- package/dist/eachYearOfInterval.d.ts.map +1 -1
- package/dist/eachYearOfInterval.js +5 -3
- package/dist/endOfDay.d.ts +1 -1
- package/dist/endOfDay.js +6 -6
- package/dist/endOfMonth.d.ts +1 -1
- package/dist/endOfMonth.js +6 -6
- package/dist/endOfQuarter.d.ts +3 -3
- package/dist/endOfQuarter.d.ts.map +1 -1
- package/dist/endOfQuarter.js +6 -6
- package/dist/endOfWeek.d.ts +2 -2
- package/dist/endOfWeek.d.ts.map +1 -1
- package/dist/endOfWeek.js +5 -5
- package/dist/endOfYear.d.ts +2 -2
- package/dist/endOfYear.js +6 -6
- package/dist/format.d.ts +9 -4
- package/dist/format.d.ts.map +1 -1
- package/dist/format.js +4 -3
- package/dist/formatPlainDate.js +2 -2
- package/dist/getQuarter.d.ts +1 -1
- package/dist/getQuarter.d.ts.map +1 -1
- package/dist/getQuarter.js +3 -3
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +201 -142
- package/dist/intlFormatDistance.d.ts +1 -1
- package/dist/intlFormatDistance.d.ts.map +1 -1
- package/dist/intlFormatDistance.js +10 -11
- package/dist/isAfter.d.ts +8 -5
- package/dist/isAfter.d.ts.map +1 -1
- package/dist/isAfter.js +3 -4
- package/dist/isBefore.d.ts +9 -6
- package/dist/isBefore.d.ts.map +1 -1
- package/dist/isBefore.js +3 -4
- package/dist/isEqual.d.ts +27 -0
- package/dist/isEqual.d.ts.map +1 -0
- package/dist/isEqual.js +9 -0
- package/dist/isEqual.js.map +1 -0
- package/dist/isFuture.d.ts +1 -1
- package/dist/isFuture.d.ts.map +1 -1
- package/dist/isFuture.js +5 -5
- package/dist/isPast.d.ts +1 -1
- 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.js +2 -2
- package/dist/isPlainTimeBefore.js +2 -2
- package/dist/isPlainTimeEqual.js +2 -2
- package/dist/isSameDay.d.ts +4 -4
- package/dist/isSameDay.js +3 -3
- package/dist/isSameHour.d.ts +5 -5
- package/dist/isSameHour.d.ts.map +1 -1
- package/dist/isSameHour.js +3 -3
- package/dist/isSameMicrosecond.d.ts +7 -7
- package/dist/isSameMicrosecond.d.ts.map +1 -1
- package/dist/isSameMicrosecond.js +3 -3
- package/dist/isSameMillisecond.d.ts +7 -7
- package/dist/isSameMillisecond.d.ts.map +1 -1
- package/dist/isSameMillisecond.js +3 -3
- package/dist/isSameMinute.d.ts +5 -5
- package/dist/isSameMinute.d.ts.map +1 -1
- package/dist/isSameMinute.js +3 -3
- package/dist/isSameMonth.d.ts +5 -5
- package/dist/isSameMonth.d.ts.map +1 -1
- package/dist/isSameMonth.js +3 -3
- package/dist/isSameNanosecond.d.ts +7 -7
- package/dist/isSameNanosecond.d.ts.map +1 -1
- package/dist/isSameNanosecond.js +3 -3
- package/dist/isSameQuarter.d.ts +3 -3
- package/dist/isSameQuarter.d.ts.map +1 -1
- package/dist/isSameQuarter.js +3 -3
- package/dist/isSameSecond.d.ts +5 -5
- package/dist/isSameSecond.d.ts.map +1 -1
- package/dist/isSameSecond.js +3 -3
- package/dist/isSameWeek.d.ts +7 -7
- package/dist/isSameWeek.d.ts.map +1 -1
- package/dist/isSameWeek.js +3 -3
- package/dist/isSameYear.d.ts +5 -5
- package/dist/isSameYear.d.ts.map +1 -1
- package/dist/isSameYear.js +3 -3
- package/dist/isToday.d.ts +21 -0
- package/dist/isToday.d.ts.map +1 -0
- package/dist/isToday.js +12 -0
- package/dist/isToday.js.map +1 -0
- package/dist/isTomorrow.d.ts +20 -0
- package/dist/isTomorrow.d.ts.map +1 -0
- package/dist/isTomorrow.js +12 -0
- package/dist/isTomorrow.js.map +1 -0
- package/dist/isWeekend.d.ts +18 -0
- package/dist/isWeekend.d.ts.map +1 -0
- package/dist/isWeekend.js +10 -0
- package/dist/isWeekend.js.map +1 -0
- package/dist/isWithinInterval.d.ts +11 -11
- package/dist/isWithinInterval.js +5 -5
- package/dist/isYesterday.d.ts +20 -0
- package/dist/isYesterday.d.ts.map +1 -0
- package/dist/isYesterday.js +12 -0
- package/dist/isYesterday.js.map +1 -0
- package/dist/max.d.ts +25 -0
- package/dist/max.d.ts.map +1 -0
- package/dist/max.js +9 -0
- package/dist/max.js.map +1 -0
- package/dist/min.d.ts +27 -0
- package/dist/min.d.ts.map +1 -0
- package/dist/min.js +9 -0
- package/dist/min.js.map +1 -0
- package/dist/now.js +2 -2
- package/dist/roundToNearestHour.d.ts +1 -1
- package/dist/roundToNearestHour.d.ts.map +1 -1
- package/dist/roundToNearestHour.js +3 -3
- package/dist/roundToNearestMinute.d.ts +1 -1
- package/dist/roundToNearestMinute.d.ts.map +1 -1
- package/dist/roundToNearestMinute.js +3 -3
- package/dist/roundToNearestSecond.d.ts +1 -1
- package/dist/roundToNearestSecond.d.ts.map +1 -1
- package/dist/roundToNearestSecond.js +3 -3
- package/dist/shared/businessDays.d.ts +24 -0
- package/dist/shared/businessDays.d.ts.map +1 -0
- package/dist/shared/businessDays.js +13 -0
- package/dist/shared/businessDays.js.map +1 -0
- package/dist/shared/compare.d.ts +22 -0
- package/dist/shared/compare.d.ts.map +1 -0
- package/dist/shared/compare.js +12 -0
- package/dist/shared/compare.js.map +1 -0
- package/dist/shared/differenceInMilliseconds.js +2 -2
- package/dist/shared/endOfDay.d.ts +1 -1
- package/dist/shared/endOfDay.d.ts.map +1 -1
- package/dist/shared/endOfDay.js +1 -1
- package/dist/shared/isAfter.d.ts +1 -1
- package/dist/shared/isAfter.d.ts.map +1 -1
- package/dist/shared/isAfter.js +1 -2
- package/dist/shared/isBefore.d.ts +1 -1
- package/dist/shared/isBefore.d.ts.map +1 -1
- package/dist/shared/isBefore.js +1 -2
- package/dist/shared/normalizeTemporalInput.d.ts +3 -1
- package/dist/shared/normalizeTemporalInput.d.ts.map +1 -1
- package/dist/shared/normalizeTemporalInput.js +2 -2
- package/dist/shared/normalizeWithPlainDate.d.ts +1 -1
- package/dist/shared/normalizeWithPlainDate.d.ts.map +1 -1
- 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.d.ts +9 -0
- package/dist/shared/relativeDay.d.ts.map +1 -0
- package/dist/shared/relativeDay.js +11 -0
- package/dist/shared/relativeDay.js.map +1 -0
- package/dist/shared/temporal.d.ts +1 -0
- package/dist/shared/temporal.d.ts.map +1 -1
- package/dist/shared/temporal.js +3 -1
- package/dist/simpleFormat.js +2 -2
- package/dist/startOfDay.d.ts +1 -1
- package/dist/startOfDay.js +5 -5
- package/dist/startOfMonth.d.ts +1 -1
- package/dist/startOfMonth.js +5 -5
- package/dist/startOfQuarter.d.ts +4 -4
- package/dist/startOfQuarter.d.ts.map +1 -1
- package/dist/startOfQuarter.js +5 -5
- package/dist/startOfWeek.d.ts +2 -2
- package/dist/startOfWeek.d.ts.map +1 -1
- package/dist/startOfWeek.js +4 -4
- package/dist/startOfYear.d.ts +2 -2
- package/dist/startOfYear.js +5 -5
- package/dist/subBusinessDays.d.ts +23 -0
- package/dist/subBusinessDays.d.ts.map +1 -0
- package/dist/subBusinessDays.js +11 -0
- package/dist/subBusinessDays.js.map +1 -0
- package/dist/subDays.d.ts +8 -5
- package/dist/subDays.d.ts.map +1 -1
- package/dist/subDays.js +4 -4
- package/dist/subHours.d.ts +2 -2
- package/dist/subHours.d.ts.map +1 -1
- package/dist/subHours.js +4 -4
- package/dist/subMicroseconds.d.ts +2 -2
- package/dist/subMicroseconds.d.ts.map +1 -1
- package/dist/subMicroseconds.js +4 -4
- package/dist/subMilliseconds.d.ts +2 -2
- package/dist/subMilliseconds.d.ts.map +1 -1
- package/dist/subMilliseconds.js +4 -4
- package/dist/subMinutes.d.ts +2 -2
- package/dist/subMinutes.d.ts.map +1 -1
- package/dist/subMinutes.js +4 -4
- package/dist/subMonths.d.ts +8 -5
- package/dist/subMonths.d.ts.map +1 -1
- package/dist/subMonths.js +4 -4
- package/dist/subNanoseconds.d.ts +2 -2
- package/dist/subNanoseconds.d.ts.map +1 -1
- package/dist/subNanoseconds.js +4 -4
- package/dist/subQuarters.d.ts +4 -4
- package/dist/subQuarters.d.ts.map +1 -1
- package/dist/subQuarters.js +4 -4
- package/dist/subSeconds.d.ts +2 -2
- package/dist/subSeconds.d.ts.map +1 -1
- package/dist/subSeconds.js +4 -4
- package/dist/subWeeks.d.ts +8 -5
- package/dist/subWeeks.d.ts.map +1 -1
- package/dist/subWeeks.js +4 -4
- package/dist/subYears.d.ts +8 -5
- package/dist/subYears.d.ts.map +1 -1
- package/dist/subYears.js +4 -4
- package/dist/toDate.d.ts +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 +1 -1
- package/dist/toIso.d.ts.map +1 -1
- package/dist/toIso.js +2 -2
- package/dist/toIso9075.d.ts +1 -1
- package/dist/toIso9075.d.ts.map +1 -1
- package/dist/toIso9075.js +2 -2
- package/dist/toPlainDate.d.ts.map +1 -1
- 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 +6 -3
- package/dist/chunk-25CVKMFC.js.map +0 -1
- package/dist/chunk-2E4KCD3Y.js.map +0 -1
- package/dist/chunk-2EFJSF2R.js +0 -13
- package/dist/chunk-2EFJSF2R.js.map +0 -1
- package/dist/chunk-3LTTYG6N.js.map +0 -1
- package/dist/chunk-3TS3D7WD.js.map +0 -1
- package/dist/chunk-4PGGOVSG.js.map +0 -1
- package/dist/chunk-567DXBLA.js +0 -27
- package/dist/chunk-567DXBLA.js.map +0 -1
- package/dist/chunk-5Y5JH32Z.js.map +0 -1
- package/dist/chunk-6UMISP3B.js.map +0 -1
- package/dist/chunk-6YU6BQOZ.js +0 -14
- package/dist/chunk-6YU6BQOZ.js.map +0 -1
- package/dist/chunk-7K5BJ6F7.js +0 -18
- package/dist/chunk-7K5BJ6F7.js.map +0 -1
- package/dist/chunk-7OEGJCW7.js.map +0 -1
- package/dist/chunk-7SCQV77A.js.map +0 -1
- package/dist/chunk-A42NID5P.js.map +0 -1
- package/dist/chunk-AVGNRINZ.js +0 -9
- package/dist/chunk-AVGNRINZ.js.map +0 -1
- package/dist/chunk-BEGD73DT.js.map +0 -1
- package/dist/chunk-BTXU3OGV.js.map +0 -1
- package/dist/chunk-BV32K227.js.map +0 -1
- package/dist/chunk-CCVPCHUO.js.map +0 -1
- package/dist/chunk-CIA46DWB.js +0 -17
- package/dist/chunk-CIA46DWB.js.map +0 -1
- package/dist/chunk-CSOSM46M.js.map +0 -1
- package/dist/chunk-DCCHY45G.js +0 -17
- package/dist/chunk-DCCHY45G.js.map +0 -1
- package/dist/chunk-DCFRBZBY.js +0 -32
- package/dist/chunk-DCFRBZBY.js.map +0 -1
- package/dist/chunk-DHFBKOFZ.js.map +0 -1
- package/dist/chunk-DMFV2AL7.js.map +0 -1
- package/dist/chunk-EBVLBLR3.js.map +0 -1
- package/dist/chunk-EMZFQEWM.js.map +0 -1
- package/dist/chunk-EU3SYJHM.js +0 -17
- package/dist/chunk-EU3SYJHM.js.map +0 -1
- package/dist/chunk-EVEMK2K2.js +0 -13
- package/dist/chunk-EVEMK2K2.js.map +0 -1
- package/dist/chunk-FCJO72WG.js.map +0 -1
- package/dist/chunk-G2U5WGRP.js +0 -14
- package/dist/chunk-G2U5WGRP.js.map +0 -1
- package/dist/chunk-GR7322AQ.js.map +0 -1
- package/dist/chunk-H5BHFVEN.js.map +0 -1
- package/dist/chunk-IAXVREU5.js.map +0 -1
- package/dist/chunk-IONQ6TOR.js.map +0 -1
- package/dist/chunk-JBM7DESQ.js +0 -13
- package/dist/chunk-JBM7DESQ.js.map +0 -1
- package/dist/chunk-JK4WDDWU.js +0 -28
- package/dist/chunk-JK4WDDWU.js.map +0 -1
- package/dist/chunk-JQFD563S.js.map +0 -1
- package/dist/chunk-KGO3G2QB.js +0 -18
- package/dist/chunk-KGO3G2QB.js.map +0 -1
- package/dist/chunk-KPB5ENNM.js.map +0 -1
- package/dist/chunk-LAITZAIG.js.map +0 -1
- package/dist/chunk-LODULPI3.js +0 -17
- package/dist/chunk-LODULPI3.js.map +0 -1
- package/dist/chunk-LSKER4FN.js +0 -13
- package/dist/chunk-LSKER4FN.js.map +0 -1
- package/dist/chunk-M7Y67IAB.js.map +0 -1
- package/dist/chunk-MDXN3WMH.js +0 -13
- package/dist/chunk-MDXN3WMH.js.map +0 -1
- package/dist/chunk-MENMDB6M.js.map +0 -1
- package/dist/chunk-MM2HIW7M.js.map +0 -1
- package/dist/chunk-MNV2H4N6.js.map +0 -1
- package/dist/chunk-MTDZG4HK.js.map +0 -1
- package/dist/chunk-NEHYVVTH.js +0 -13
- package/dist/chunk-NTMT5XGC.js +0 -13
- package/dist/chunk-NTMT5XGC.js.map +0 -1
- package/dist/chunk-OFIPZPEA.js.map +0 -1
- package/dist/chunk-OKXCGA4Y.js +0 -13
- package/dist/chunk-OLLX6YCN.js.map +0 -1
- package/dist/chunk-OQNFKOPA.js.map +0 -1
- package/dist/chunk-OSBVYUOQ.js.map +0 -1
- package/dist/chunk-OVSCDXYN.js.map +0 -1
- package/dist/chunk-PWIEPZVO.js.map +0 -1
- package/dist/chunk-PYALKKWZ.js.map +0 -1
- package/dist/chunk-R7ZCA6AQ.js.map +0 -1
- package/dist/chunk-RKEZOXD3.js.map +0 -1
- package/dist/chunk-RL2NW7HP.js.map +0 -1
- package/dist/chunk-RLVCSGRU.js.map +0 -1
- package/dist/chunk-S7L5KBI4.js.map +0 -1
- package/dist/chunk-SCD2JNY3.js.map +0 -1
- package/dist/chunk-SDW4W3XE.js.map +0 -1
- package/dist/chunk-T5WSO6US.js.map +0 -1
- package/dist/chunk-UQ2F3I2S.js.map +0 -1
- package/dist/chunk-URC6AG2N.js.map +0 -1
- package/dist/chunk-UTN7ZKL4.js +0 -30
- package/dist/chunk-UTN7ZKL4.js.map +0 -1
- package/dist/chunk-UXMNCRG7.js +0 -13
- package/dist/chunk-VKXN4FQD.js.map +0 -1
- package/dist/chunk-VQPIPLHX.js +0 -14
- package/dist/chunk-VQPIPLHX.js.map +0 -1
- package/dist/chunk-VS2VCQLP.js.map +0 -1
- package/dist/chunk-WGLZHBJG.js.map +0 -1
- package/dist/chunk-WTLAKRCT.js.map +0 -1
- package/dist/chunk-X3ARINEH.js +0 -19
- package/dist/chunk-X3ARINEH.js.map +0 -1
- package/dist/chunk-YNLBS34B.js.map +0 -1
- package/dist/chunk-YRCFMGBH.js +0 -54
- package/dist/chunk-YRCFMGBH.js.map +0 -1
- package/dist/chunk-ZG4ROOWI.js +0 -14
- package/dist/chunk-ZG4ROOWI.js.map +0 -1
- package/dist/chunk-ZGWLIISB.js +0 -40
- package/dist/chunk-ZGWLIISB.js.map +0 -1
- package/dist/chunk-ZOHYNJUD.js.map +0 -1
- package/dist/chunk-ZYU3P74L.js +0 -13
- package/dist/chunk-ZYU3P74L.js.map +0 -1
- package/dist/temporal.d.js +0 -1
- /package/dist/{temporal.d.js.map → addBusinessDays.js.map} +0 -0
- /package/dist/{chunk-L5AMAEWX.js.map → chunk-2AID4P2C.js.map} +0 -0
- /package/dist/{chunk-6RETOV6A.js.map → chunk-4GEF7B7W.js.map} +0 -0
- /package/dist/{chunk-PURKYS5T.js.map → chunk-6XEHR3MG.js.map} +0 -0
- /package/dist/{chunk-DBVGH55Z.js.map → chunk-EBOLL4LY.js.map} +0 -0
- /package/dist/{chunk-NX7MXLFS.js.map → chunk-KTMCYEU5.js.map} +0 -0
- /package/dist/{chunk-ELUSLRWQ.js.map → chunk-LRIVI5ZC.js.map} +0 -0
- /package/dist/{chunk-M4KDJ4I4.js.map → chunk-LXOLIOAD.js.map} +0 -0
- /package/dist/{chunk-PX2I4GCF.js.map → chunk-NL5MQVGD.js.map} +0 -0
- /package/dist/{chunk-TQUKIG26.js.map → chunk-QJYU5TLL.js.map} +0 -0
- /package/dist/{chunk-VQAGV72H.js.map → chunk-QVSHSIA3.js.map} +0 -0
- /package/dist/{chunk-YOSCEJ36.js.map → chunk-VM2YJ5PN.js.map} +0 -0
- /package/dist/{chunk-XWBOD6MD.js.map → chunk-WTLMIOKZ.js.map} +0 -0
- /package/dist/{chunk-VC7RTDJP.js.map → chunk-X27XGVCT.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/compareAsc.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { compare, type Comparable } from './shared/compare';\n\n/**\n * Compares two values for ascending order: -1 if the first is earlier,\n * 1 if it is later, 0 if they are equal. Pass it to `Array#sort`.\n *\n * Timeline values compare by exact instant, PlainDates by date, and\n * PlainTimes by wall-clock time. Mixed domains throw a TypeError.\n *\n * @param date1 - First value in a matching date, time, or timeline pair\n * @param date2 - Second value in the same comparison domain\n * @returns -1, 0, or 1\n *\n * @example\n * ```ts\n * const dates = [\n * Temporal.Instant.from('2025-03-01T00:00:00Z'),\n * Temporal.Instant.from('2025-01-01T00:00:00Z'),\n * Temporal.Instant.from('2025-02-01T00:00:00Z'),\n * ];\n *\n * dates.sort(compareAsc);\n * // [2025-01-01, 2025-02-01, 2025-03-01]\n * ```\n */\nexport function compareAsc(date1: Temporal.PlainDate, date2: Temporal.PlainDate): -1 | 0 | 1;\nexport function compareAsc(date1: Temporal.PlainTime, date2: Temporal.PlainTime): -1 | 0 | 1;\nexport function compareAsc(\n date1: Temporal.Instant | Temporal.ZonedDateTime,\n date2: Temporal.Instant | Temporal.ZonedDateTime\n): -1 | 0 | 1;\nexport function compareAsc(date1: Comparable, date2: Comparable): -1 | 0 | 1 {\n return compare(date1, date2);\n}\n"],"mappings":";;;;;AAgCO,SAAS,WAAW,OAAmB,OAA+B;AAC3E,SAAO,QAAQ,OAAO,KAAK;AAC7B;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isEqual.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { compare, type Comparable } from './shared/compare';\n\n/**\n * Returns true if both values are the same point in their domain.\n * Timeline values are equal when they are the same exact instant, even in\n * different timezones. PlainDate pairs compare dates; PlainTime pairs compare\n * wall-clock times.\n *\n * Use `isSameNanosecond` to compare wall-clock fields instead, or\n * `ZonedDateTime#equals` to also require the same timezone and calendar.\n *\n * @param date1 - First value in a matching date, time, or timeline pair\n * @param date2 - Second value in the same comparison domain\n * @returns true if date1 and date2 are equal, false otherwise\n *\n * @example\n * ```ts\n * const ny = Temporal.ZonedDateTime.from('2025-01-20T10:00:00-05:00[America/New_York]');\n * const utc = Temporal.Instant.from('2025-01-20T15:00:00Z');\n *\n * isEqual(ny, utc); // true (same instant)\n * isEqual(Temporal.PlainDate.from('2025-01-20'), Temporal.PlainDate.from('2025-01-21')); // false\n * ```\n */\nexport function isEqual(date1: Temporal.PlainDate, date2: Temporal.PlainDate): boolean;\nexport function isEqual(date1: Temporal.PlainTime, date2: Temporal.PlainTime): boolean;\nexport function isEqual(\n date1: Temporal.Instant | Temporal.ZonedDateTime,\n date2: Temporal.Instant | Temporal.ZonedDateTime\n): boolean;\nexport function isEqual(date1: Comparable, date2: Comparable): boolean {\n return compare(date1, date2) === 0;\n}\n"],"mappings":";;;;;AA+BO,SAAS,QAAQ,OAAmB,OAA4B;AACrE,SAAO,QAAQ,OAAO,KAAK,MAAM;AACnC;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isDaysFromToday
|
|
3
|
+
} from "./chunk-MWUVGTKC.js";
|
|
4
|
+
|
|
5
|
+
// src/isYesterday.ts
|
|
6
|
+
function isYesterday(date, timezone) {
|
|
7
|
+
return isDaysFromToday(date, timezone, -1);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
isYesterday
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=chunk-VDV24TWQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isYesterday.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport type { Timezone } from './types';\nimport { isDaysFromToday } from './shared/relativeDay';\n\n/**\n * Returns true if the value falls on yesterday's date in the given timezone.\n *\n * Instant and ZonedDateTime inputs are converted to the timezone before taking\n * their date. PlainDate inputs are compared to yesterday's date there directly.\n *\n * @param date - An Instant, ZonedDateTime, or PlainDate\n * @param timezone - The timezone that defines \"today\"\n * @returns true if date is yesterday in timezone, false otherwise\n *\n * @example\n * ```ts\n * const lastLogin = Temporal.Now.instant().subtract({ hours: 24 });\n * isYesterday(lastLogin, 'UTC'); // true\n * ```\n */\nexport function isYesterday(\n date: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone: Timezone\n): boolean {\n return isDaysFromToday(date, timezone, -1);\n}\n"],"mappings":";;;;;AAoBO,SAAS,YACd,MACA,UACS;AACT,SAAO,gBAAgB,MAAM,UAAU,EAAE;AAC3C;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Temporal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BSVOJYJ7.js";
|
|
4
4
|
|
|
5
5
|
// src/now.ts
|
|
6
6
|
function now(timezone) {
|
|
@@ -10,4 +10,4 @@ function now(timezone) {
|
|
|
10
10
|
export {
|
|
11
11
|
now
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-VM2YJ5PN.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
Temporal,
|
|
3
3
|
isInstant,
|
|
4
4
|
isZonedDateTime
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-BSVOJYJ7.js";
|
|
6
6
|
|
|
7
7
|
// src/simpleFormat.ts
|
|
8
8
|
function simpleFormat(input, options) {
|
|
@@ -59,4 +59,4 @@ function formatCompactTime(zdt) {
|
|
|
59
59
|
export {
|
|
60
60
|
simpleFormat
|
|
61
61
|
};
|
|
62
|
-
//# sourceMappingURL=chunk-
|
|
62
|
+
//# sourceMappingURL=chunk-WTLMIOKZ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
|
|
5
5
|
// src/differenceInNanoseconds.ts
|
|
6
6
|
function differenceInNanoseconds(laterDate, earlierDate) {
|
|
@@ -12,4 +12,4 @@ function differenceInNanoseconds(laterDate, earlierDate) {
|
|
|
12
12
|
export {
|
|
13
13
|
differenceInNanoseconds
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-X27XGVCT.js.map
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
differenceInMilliseconds
|
|
3
|
-
} from "./chunk-VXOQ7IG5.js";
|
|
4
1
|
import {
|
|
5
2
|
normalizeTemporalInput
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
7
4
|
|
|
8
5
|
// src/differenceInSeconds.ts
|
|
9
6
|
function differenceInSeconds(laterDate, earlierDate, options) {
|
|
10
7
|
const zoned1 = normalizeTemporalInput(laterDate);
|
|
11
8
|
const zoned2 = normalizeTemporalInput(earlierDate);
|
|
12
|
-
const
|
|
13
|
-
return options?.fractional ?
|
|
9
|
+
const nanoseconds = zoned1.epochNanoseconds - zoned2.epochNanoseconds;
|
|
10
|
+
return options?.fractional ? Number(nanoseconds) / 1e9 : Number(nanoseconds / 1000000000n);
|
|
14
11
|
}
|
|
15
12
|
|
|
16
13
|
export {
|
|
17
14
|
differenceInSeconds
|
|
18
15
|
};
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-XSHFR2SX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/differenceInSeconds.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport type { DifferenceOptions } from './shared/differenceOptions';\n\n/**\n * Returns the number of seconds between two datetimes.\n * The result is positive if laterDate is after earlierDate, negative if before.\n * Whole units are truncated toward zero after subtracting epoch nanoseconds.\n * Numeric results use JavaScript number precision; use differenceInNanoseconds\n * when an exact bigint elapsed difference is required.\n *\n * @param laterDate - The later datetime (Instant or ZonedDateTime)\n * @param earlierDate - The earlier datetime (Instant or ZonedDateTime)\n * @param options - Optional { fractional } to return the precise value\n * @returns The number of seconds between the dates, truncated toward zero (pass { fractional: true } for the precise value)\n *\n * @example\n * ```ts\n * const later = Temporal.Instant.from('2025-01-20T12:30:25Z');\n * const earlier = Temporal.Instant.from('2025-01-20T12:30:20Z');\n *\n * differenceInSeconds(later, earlier); // 5\n * ```\n *\n * @example\n * ```ts\n * // Works with ZonedDateTime\n * const later = Temporal.ZonedDateTime.from('2025-01-20T15:01:00-05:00[America/New_York]');\n * const earlier = Temporal.ZonedDateTime.from('2025-01-20T15:00:00-05:00[America/New_York]');\n *\n * differenceInSeconds(later, earlier); // 60\n * ```\n *\n * @example\n * ```ts\n * // Handles different timezones - compares by instant\n * const tokyo = Temporal.ZonedDateTime.from('2025-01-21T00:00:00+09:00[Asia/Tokyo]');\n * const ny = Temporal.ZonedDateTime.from('2025-01-20T10:00:00-05:00[America/New_York]');\n *\n * differenceInSeconds(tokyo, ny); // 0 (same instant)\n * ```\n */\nexport function differenceInSeconds(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime,\n options?: DifferenceOptions\n): number {\n const zoned1 = normalizeTemporalInput(laterDate);\n const zoned2 = normalizeTemporalInput(earlierDate);\n\n const nanoseconds = zoned1.epochNanoseconds - zoned2.epochNanoseconds;\n return options?.fractional\n ? Number(nanoseconds) / 1_000_000_000\n : Number(nanoseconds / 1_000_000_000n);\n}\n"],"mappings":";;;;;AA0CO,SAAS,oBACd,WACA,aACA,SACQ;AACR,QAAM,SAAS,uBAAuB,SAAS;AAC/C,QAAM,SAAS,uBAAuB,WAAW;AAEjD,QAAM,cAAc,OAAO,mBAAmB,OAAO;AACrD,SAAO,SAAS,aACZ,OAAO,WAAW,IAAI,MACtB,OAAO,cAAc,WAAc;AACzC;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeWithPlainDate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TCB3IDJM.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BSVOJYJ7.js";
|
|
7
7
|
|
|
8
8
|
// src/startOfYear.ts
|
|
9
9
|
function startOfYear(input, timezone) {
|
|
@@ -18,4 +18,4 @@ function startOfYear(input, timezone) {
|
|
|
18
18
|
export {
|
|
19
19
|
startOfYear
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-Y24VUXMX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/startOfYear.ts"],"sourcesContent":["import { isPlainDate, Temporal } from './shared/temporal';\nimport type { Timezone } from './types';\nimport { normalizeWithPlainDate } from './shared/normalizeWithPlainDate';\n\n/**\n * Returns the first boundary of the year.\n * PlainDate inputs stay in calendar space unless a timezone is provided.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at January 1st at 00:00:00.000000000\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-06-15T12:00:00Z');\n * const start = startOfYear(instant);\n * // 2025-01-01T00:00:00+00:00[UTC]\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-06-15T15:30:00-04:00[America/New_York]');\n * const start = startOfYear(zoned);\n * // 2025-01-01T00:00:00-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (stays a date)\n * const date = Temporal.PlainDate.from('2025-06-15');\n * const start = startOfYear(date);\n * // 2025-01-01\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate with a timezone (returns a ZonedDateTime)\n * const date = Temporal.PlainDate.from('2025-06-15');\n * const start = startOfYear(date, 'America/New_York');\n * // 2025-01-01T00:00:00-05:00[America/New_York]\n * ```\n */\nexport function startOfYear(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function startOfYear(input: Temporal.PlainDate): Temporal.PlainDate;\nexport function startOfYear(\n input: Temporal.PlainDate,\n timezone: Timezone\n): Temporal.ZonedDateTime;\nexport function startOfYear(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n if (isPlainDate(input) && timezone === undefined) {\n return input.with({ month: 1, day: 1 });\n }\n\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n const firstDay = zonedDateTime.with({ month: 1, day: 1 });\n return firstDay.startOfDay();\n}\n"],"mappings":";;;;;;;;AAmDO,SAAS,YACd,OACA,UAC6C;AAC7C,MAAI,YAAY,KAAK,KAAK,aAAa,QAAW;AAChD,WAAO,MAAM,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,CAAC;AAAA,EACxC;AAEA,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,QAAM,WAAW,cAAc,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,CAAC;AACxD,SAAO,SAAS,WAAW;AAC7B;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
4
|
|
|
5
5
|
// src/addHours.ts
|
|
6
6
|
function addHours(input, hours) {
|
|
@@ -11,4 +11,4 @@ function addHours(input, hours) {
|
|
|
11
11
|
export {
|
|
12
12
|
addHours
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-YKXRVQ4S.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/addHours.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * Adds the specified number of hours to a datetime.\n *\n * Properly handles DST transitions through Temporal API.\n * Instant inputs are converted to UTC. For ZonedDateTime inputs, their timezone is preserved.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @param hours - Number of hours to add (can be negative to subtract)\n * @returns ZonedDateTime with hours added, in the same timezone as input\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00Z');\n * const result = addHours(instant, 3);\n * // 2025-01-20T15:00:00+00:00[UTC] (3 hours later)\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (preserves timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-01-20T15:30:00-05:00[America/New_York]');\n * const result = addHours(zoned, 24);\n * // 2025-01-21T15:30:00-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // Negative values subtract hours\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00Z');\n * const result = addHours(instant, -5);\n * // 2025-01-20T07:00:00+00:00[UTC] (5 hours earlier)\n * ```\n */\nexport function addHours(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n hours: number\n): Temporal.ZonedDateTime {\n const zonedDateTime = normalizeTemporalInput(input);\n return zonedDateTime.add({ hours });\n}\n"],"mappings":";;;;;AAqCO,SAAS,SACd,OACA,OACwB;AACxB,QAAM,gBAAgB,uBAAuB,KAAK;AAClD,SAAO,cAAc,IAAI,EAAE,MAAM,CAAC;AACpC;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/compareDesc.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { compare, type Comparable } from './shared/compare';\n\n/**\n * Compares two values for descending order: -1 if the first is later,\n * 1 if it is earlier, 0 if they are equal. Pass it to `Array#sort`.\n *\n * Timeline values compare by exact instant, PlainDates by date, and\n * PlainTimes by wall-clock time. Mixed domains throw a TypeError.\n *\n * @param date1 - First value in a matching date, time, or timeline pair\n * @param date2 - Second value in the same comparison domain\n * @returns -1, 0, or 1\n *\n * @example\n * ```ts\n * const dates = [\n * Temporal.PlainDate.from('2025-01-01'),\n * Temporal.PlainDate.from('2025-03-01'),\n * Temporal.PlainDate.from('2025-02-01'),\n * ];\n *\n * dates.sort(compareDesc);\n * // [2025-03-01, 2025-02-01, 2025-01-01]\n * ```\n */\nexport function compareDesc(date1: Temporal.PlainDate, date2: Temporal.PlainDate): -1 | 0 | 1;\nexport function compareDesc(date1: Temporal.PlainTime, date2: Temporal.PlainTime): -1 | 0 | 1;\nexport function compareDesc(\n date1: Temporal.Instant | Temporal.ZonedDateTime,\n date2: Temporal.Instant | Temporal.ZonedDateTime\n): -1 | 0 | 1;\nexport function compareDesc(date1: Comparable, date2: Comparable): -1 | 0 | 1 {\n return compare(date2, date1);\n}\n"],"mappings":";;;;;AAgCO,SAAS,YAAY,OAAmB,OAA+B;AAC5E,SAAO,QAAQ,OAAO,KAAK;AAC7B;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
compare
|
|
3
|
+
} from "./chunk-OMYVTYHI.js";
|
|
4
|
+
|
|
5
|
+
// src/min.ts
|
|
6
|
+
function min(values) {
|
|
7
|
+
if (values.length === 0) {
|
|
8
|
+
throw new RangeError("min requires at least one value");
|
|
9
|
+
}
|
|
10
|
+
return values.reduce((earliest, value) => compare(value, earliest) < 0 ? value : earliest);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
min
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=chunk-YSDLXJHE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/min.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { compare, type Comparable, type Timeline } from './shared/compare';\n\n/**\n * Returns the earliest value in a non-empty array. The value is returned as\n * given, with its type, timezone, and calendar intact. Ties return the first.\n *\n * Timeline values compare by exact instant, PlainDates by date, and\n * PlainTimes by wall-clock time. Mixed domains throw a TypeError.\n *\n * @param values - Values from one domain; at least one is required\n * @returns The earliest value\n * @throws RangeError if values is empty\n *\n * @example\n * ```ts\n * const deadlines = [\n * Temporal.PlainDate.from('2025-03-01'),\n * Temporal.PlainDate.from('2025-01-15')\n * ];\n *\n * min(deadlines); // 2025-01-15\n * ```\n */\nexport function min<T extends Timeline>(values: readonly T[]): T;\nexport function min(values: readonly Temporal.PlainDate[]): Temporal.PlainDate;\nexport function min(values: readonly Temporal.PlainTime[]): Temporal.PlainTime;\nexport function min(values: readonly Comparable[]): Comparable {\n if (values.length === 0) {\n throw new RangeError('min requires at least one value');\n }\n return values.reduce((earliest, value) => (compare(value, earliest) < 0 ? value : earliest));\n}\n"],"mappings":";;;;;AA2BO,SAAS,IAAI,QAA2C;AAC7D,MAAI,OAAO,WAAW,GAAG;AACvB,UAAM,IAAI,WAAW,iCAAiC;AAAA,EACxD;AACA,SAAO,OAAO,OAAO,CAAC,UAAU,UAAW,QAAQ,OAAO,QAAQ,IAAI,IAAI,QAAQ,QAAS;AAC7F;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Temporal
|
|
3
|
+
} from "./chunk-BSVOJYJ7.js";
|
|
4
|
+
|
|
5
|
+
// src/isPlainDateBefore.ts
|
|
6
|
+
function isPlainDateBefore(date1, date2) {
|
|
7
|
+
return Temporal.PlainDate.compare(
|
|
8
|
+
Temporal.PlainDate.prototype.isPrototypeOf(date1) ? date1 : date1.toString(),
|
|
9
|
+
Temporal.PlainDate.prototype.isPrototypeOf(date2) ? date2 : date2.toString()
|
|
10
|
+
) < 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
isPlainDateBefore
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=chunk-ZM32S3YU.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(\n date1: Temporal.PlainDate,\n date2: Temporal.PlainDate\n): boolean {\n return Temporal.PlainDate.compare(date1
|
|
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(\n date1: Temporal.PlainDate,\n date2: Temporal.PlainDate\n): boolean {\n // Only foreign objects need conversion; strings retain their calendar annotations.\n return 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"],"mappings":";;;;;AAoBO,SAAS,kBACd,OACA,OACS;AAET,SAAO,SAAS,UAAU;AAAA,IACxB,SAAS,UAAU,UAAU,cAAc,KAAK,IAAI,QAAQ,MAAM,SAAS;AAAA,IAC3E,SAAS,UAAU,UAAU,cAAc,KAAK,IAAI,QAAQ,MAAM,SAAS;AAAA,EAC7E,IAAI;AACN;","names":[]}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
differenceInMinutes
|
|
3
|
-
} from "./chunk-EMZFQEWM.js";
|
|
4
|
-
import {
|
|
5
|
-
differenceInMonths
|
|
6
|
-
} from "./chunk-CIA46DWB.js";
|
|
7
1
|
import {
|
|
8
2
|
differenceInSeconds
|
|
9
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XSHFR2SX.js";
|
|
10
4
|
import {
|
|
11
5
|
differenceInWeeks
|
|
12
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TU3LNQKW.js";
|
|
13
7
|
import {
|
|
14
8
|
differenceInYears
|
|
15
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LMOAA73F.js";
|
|
16
10
|
import {
|
|
17
11
|
differenceInDays
|
|
18
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JGPTGV5X.js";
|
|
19
13
|
import {
|
|
20
14
|
differenceInHours
|
|
21
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-GU3CZAIN.js";
|
|
16
|
+
import {
|
|
17
|
+
differenceInMinutes
|
|
18
|
+
} from "./chunk-OEPVYNB6.js";
|
|
19
|
+
import {
|
|
20
|
+
differenceInMonths
|
|
21
|
+
} from "./chunk-KZCSP3DU.js";
|
|
22
22
|
import {
|
|
23
23
|
normalizeTemporalInput
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
25
25
|
|
|
26
26
|
// src/intlFormatDistance.ts
|
|
27
27
|
function intlFormatDistance(laterDate, earlierDate, options) {
|
|
@@ -92,4 +92,4 @@ function intlFormatDistance(laterDate, earlierDate, options) {
|
|
|
92
92
|
export {
|
|
93
93
|
intlFormatDistance
|
|
94
94
|
};
|
|
95
|
-
//# sourceMappingURL=chunk-
|
|
95
|
+
//# sourceMappingURL=chunk-ZW32E6EJ.js.map
|
|
@@ -0,0 +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,\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":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizeTemporalInput
|
|
3
|
+
} from "./chunk-Q6QLOUXJ.js";
|
|
4
|
+
import {
|
|
5
|
+
isPlainDate
|
|
6
|
+
} from "./chunk-BSVOJYJ7.js";
|
|
7
|
+
|
|
8
|
+
// src/addMonths.ts
|
|
9
|
+
function addMonths(input, months) {
|
|
10
|
+
if (isPlainDate(input)) {
|
|
11
|
+
return input.add({ months });
|
|
12
|
+
}
|
|
13
|
+
return normalizeTemporalInput(input).add({ months });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
addMonths
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=chunk-ZXKU4SKR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/addMonths.ts"],"sourcesContent":["import { type Temporal, isPlainDate } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * Adds the specified number of months to a datetime or date.\n *\n * Properly handles month-end dates and calendar edge cases through Temporal API.\n * Instant inputs are converted to UTC. For ZonedDateTime inputs, their timezone is preserved.\n *\n * PlainDate inputs stay in calendar space, preserving their calendar without a timezone.\n *\n * @param input - A Temporal.Instant (UTC), Temporal.ZonedDateTime, or Temporal.PlainDate\n * @param months - Number of months to add (can be negative to subtract)\n * @returns PlainDate for a date input; otherwise ZonedDateTime with months added\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00Z');\n * const result = addMonths(instant, 3);\n * // 2025-04-20T12:00:00+00:00[UTC] (3 months later)\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (preserves timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-01-20T15:30:00-05:00[America/New_York]');\n * const result = addMonths(zoned, 6);\n * // 2025-07-20T15:30:00-04:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // Month-end handling\n * const instant = Temporal.Instant.from('2025-01-31T12:00:00Z');\n * const result = addMonths(instant, 1);\n * // 2025-02-28T12:00:00+00:00[UTC] (Jan 31 → Feb 28)\n * ```\n */\nexport function addMonths(input: Temporal.PlainDate, months: number): Temporal.PlainDate;\nexport function addMonths(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n months: number\n): Temporal.ZonedDateTime;\nexport function addMonths(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n months: number\n): Temporal.ZonedDateTime | Temporal.PlainDate {\n if (isPlainDate(input)) {\n return input.add({ months });\n }\n return normalizeTemporalInput(input).add({ months });\n}\n"],"mappings":";;;;;;;;AA4CO,SAAS,UACd,OACA,QAC6C;AAC7C,MAAI,YAAY,KAAK,GAAG;AACtB,WAAO,MAAM,IAAI,EAAE,OAAO,CAAC;AAAA,EAC7B;AACA,SAAO,uBAAuB,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC;AACrD;","names":[]}
|
package/dist/clamp.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Temporal } from './shared/temporal.js';
|
|
2
|
+
import { type Timeline } from './shared/compare.js';
|
|
3
|
+
/**
|
|
4
|
+
* Restricts a value to an inclusive interval. Returns the value itself when it
|
|
5
|
+
* is inside, otherwise the nearer endpoint, unchanged.
|
|
6
|
+
*
|
|
7
|
+
* Timeline values compare by exact instant, PlainDates by date, and
|
|
8
|
+
* PlainTimes by wall-clock time. Mixed domains throw a TypeError.
|
|
9
|
+
*
|
|
10
|
+
* @param value - The value to restrict
|
|
11
|
+
* @param interval - Inclusive bounds from the same domain as value
|
|
12
|
+
* @returns value, interval.start, or interval.end
|
|
13
|
+
* @throws RangeError if interval.start is after interval.end
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const start = Temporal.PlainDate.from('2025-01-01');
|
|
18
|
+
* const end = Temporal.PlainDate.from('2025-01-31');
|
|
19
|
+
*
|
|
20
|
+
* clamp(Temporal.PlainDate.from('2025-02-14'), { start, end }); // 2025-01-31
|
|
21
|
+
* clamp(Temporal.PlainDate.from('2025-01-10'), { start, end }); // 2025-01-10
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function clamp<T extends Timeline, S extends Timeline, E extends Timeline>(value: T, interval: {
|
|
25
|
+
start: S;
|
|
26
|
+
end: E;
|
|
27
|
+
}): T | S | E;
|
|
28
|
+
export declare function clamp(value: Temporal.PlainDate, interval: {
|
|
29
|
+
start: Temporal.PlainDate;
|
|
30
|
+
end: Temporal.PlainDate;
|
|
31
|
+
}): Temporal.PlainDate;
|
|
32
|
+
export declare function clamp(value: Temporal.PlainTime, interval: {
|
|
33
|
+
start: Temporal.PlainTime;
|
|
34
|
+
end: Temporal.PlainTime;
|
|
35
|
+
}): Temporal.PlainTime;
|
|
36
|
+
//# sourceMappingURL=clamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clamp.d.ts","sourceRoot":"","sources":["../src/clamp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAA4B,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE3E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,QAAQ,EAC9E,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,GAAG,EAAE,CAAC,CAAA;CAAE,GAC7B,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACb,wBAAgB,KAAK,CACnB,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,QAAQ,EAAE;IAAE,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC;IAAC,GAAG,EAAE,QAAQ,CAAC,SAAS,CAAA;CAAE,GAC/D,QAAQ,CAAC,SAAS,CAAC;AACtB,wBAAgB,KAAK,CACnB,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,QAAQ,EAAE;IAAE,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC;IAAC,GAAG,EAAE,QAAQ,CAAC,SAAS,CAAA;CAAE,GAC/D,QAAQ,CAAC,SAAS,CAAC"}
|
package/dist/clamp.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Temporal } from './shared/temporal.js';
|
|
2
|
+
import { type Timeline } from './shared/compare.js';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the candidate nearest to the target, or undefined when there are no
|
|
5
|
+
* candidates. Ties return the first. The candidate is returned as given.
|
|
6
|
+
*
|
|
7
|
+
* Timeline values measure exact elapsed time, PlainDates whole days, and
|
|
8
|
+
* PlainTimes time within one day (no wrapping at midnight). Mixed domains throw
|
|
9
|
+
* a TypeError.
|
|
10
|
+
*
|
|
11
|
+
* @param target - The value to measure from
|
|
12
|
+
* @param candidates - Values from the same domain as target
|
|
13
|
+
* @returns The nearest candidate, or undefined if candidates is empty
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const now = Temporal.Instant.from('2025-01-20T12:00:00Z');
|
|
18
|
+
* const slots = [
|
|
19
|
+
* Temporal.Instant.from('2025-01-20T09:00:00Z'),
|
|
20
|
+
* Temporal.Instant.from('2025-01-20T13:30:00Z'),
|
|
21
|
+
* ];
|
|
22
|
+
*
|
|
23
|
+
* closestTo(now, slots); // 2025-01-20T13:30:00Z
|
|
24
|
+
* closestTo(now, []); // undefined
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function closestTo<T extends Timeline>(target: Timeline, candidates: readonly T[]): T | undefined;
|
|
28
|
+
export declare function closestTo(target: Temporal.PlainDate, candidates: readonly Temporal.PlainDate[]): Temporal.PlainDate | undefined;
|
|
29
|
+
export declare function closestTo(target: Temporal.PlainTime, candidates: readonly Temporal.PlainTime[]): Temporal.PlainTime | undefined;
|
|
30
|
+
//# sourceMappingURL=closestTo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closestTo.d.ts","sourceRoot":"","sources":["../src/closestTo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAA+C,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE9F;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,QAAQ,EAC1C,MAAM,EAAE,QAAQ,EAChB,UAAU,EAAE,SAAS,CAAC,EAAE,GACvB,CAAC,GAAG,SAAS,CAAC;AACjB,wBAAgB,SAAS,CACvB,MAAM,EAAE,QAAQ,CAAC,SAAS,EAC1B,UAAU,EAAE,SAAS,QAAQ,CAAC,SAAS,EAAE,GACxC,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC;AAClC,wBAAgB,SAAS,CACvB,MAAM,EAAE,QAAQ,CAAC,SAAS,EAC1B,UAAU,EAAE,SAAS,QAAQ,CAAC,SAAS,EAAE,GACxC,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Temporal } from './shared/temporal.js';
|
|
2
|
+
/**
|
|
3
|
+
* Compares two values for ascending order: -1 if the first is earlier,
|
|
4
|
+
* 1 if it is later, 0 if they are equal. Pass it to `Array#sort`.
|
|
5
|
+
*
|
|
6
|
+
* Timeline values compare by exact instant, PlainDates by date, and
|
|
7
|
+
* PlainTimes by wall-clock time. Mixed domains throw a TypeError.
|
|
8
|
+
*
|
|
9
|
+
* @param date1 - First value in a matching date, time, or timeline pair
|
|
10
|
+
* @param date2 - Second value in the same comparison domain
|
|
11
|
+
* @returns -1, 0, or 1
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const dates = [
|
|
16
|
+
* Temporal.Instant.from('2025-03-01T00:00:00Z'),
|
|
17
|
+
* Temporal.Instant.from('2025-01-01T00:00:00Z'),
|
|
18
|
+
* Temporal.Instant.from('2025-02-01T00:00:00Z'),
|
|
19
|
+
* ];
|
|
20
|
+
*
|
|
21
|
+
* dates.sort(compareAsc);
|
|
22
|
+
* // [2025-01-01, 2025-02-01, 2025-03-01]
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function compareAsc(date1: Temporal.PlainDate, date2: Temporal.PlainDate): -1 | 0 | 1;
|
|
26
|
+
export declare function compareAsc(date1: Temporal.PlainTime, date2: Temporal.PlainTime): -1 | 0 | 1;
|
|
27
|
+
export declare function compareAsc(date1: Temporal.Instant | Temporal.ZonedDateTime, date2: Temporal.Instant | Temporal.ZonedDateTime): -1 | 0 | 1;
|
|
28
|
+
//# sourceMappingURL=compareAsc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compareAsc.d.ts","sourceRoot":"","sources":["../src/compareAsc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7F,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7F,wBAAgB,UAAU,CACxB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EAChD,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Temporal } from './shared/temporal.js';
|
|
2
|
+
/**
|
|
3
|
+
* Compares two values for descending order: -1 if the first is later,
|
|
4
|
+
* 1 if it is earlier, 0 if they are equal. Pass it to `Array#sort`.
|
|
5
|
+
*
|
|
6
|
+
* Timeline values compare by exact instant, PlainDates by date, and
|
|
7
|
+
* PlainTimes by wall-clock time. Mixed domains throw a TypeError.
|
|
8
|
+
*
|
|
9
|
+
* @param date1 - First value in a matching date, time, or timeline pair
|
|
10
|
+
* @param date2 - Second value in the same comparison domain
|
|
11
|
+
* @returns -1, 0, or 1
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const dates = [
|
|
16
|
+
* Temporal.PlainDate.from('2025-01-01'),
|
|
17
|
+
* Temporal.PlainDate.from('2025-03-01'),
|
|
18
|
+
* Temporal.PlainDate.from('2025-02-01'),
|
|
19
|
+
* ];
|
|
20
|
+
*
|
|
21
|
+
* dates.sort(compareDesc);
|
|
22
|
+
* // [2025-03-01, 2025-02-01, 2025-01-01]
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function compareDesc(date1: Temporal.PlainDate, date2: Temporal.PlainDate): -1 | 0 | 1;
|
|
26
|
+
export declare function compareDesc(date1: Temporal.PlainTime, date2: Temporal.PlainTime): -1 | 0 | 1;
|
|
27
|
+
export declare function compareDesc(date1: Temporal.Instant | Temporal.ZonedDateTime, date2: Temporal.Instant | Temporal.ZonedDateTime): -1 | 0 | 1;
|
|
28
|
+
//# sourceMappingURL=compareDesc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compareDesc.d.ts","sourceRoot":"","sources":["../src/compareDesc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC9F,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC9F,wBAAgB,WAAW,CACzB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EAChD,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Temporal } from './shared/temporal.js';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the number of business days (Monday–Friday) from earlierDate up to
|
|
4
|
+
* laterDate: the earlier date counts, the later date does not. Holidays are
|
|
5
|
+
* not considered. Swapping the arguments negates the result.
|
|
6
|
+
*
|
|
7
|
+
* Only calendar dates matter; times of day are ignored. Instant inputs use
|
|
8
|
+
* their UTC date and ZonedDateTime inputs use their own timezone's date.
|
|
9
|
+
* Convert both to one timezone first to count from a single perspective.
|
|
10
|
+
*
|
|
11
|
+
* @param laterDate - The later date
|
|
12
|
+
* @param earlierDate - The earlier date
|
|
13
|
+
* @returns Business days between the dates (negative if laterDate is earlier)
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const friday = Temporal.PlainDate.from('2025-01-24');
|
|
18
|
+
* const nextFriday = Temporal.PlainDate.from('2025-01-31');
|
|
19
|
+
*
|
|
20
|
+
* differenceInBusinessDays(nextFriday, friday); // 5
|
|
21
|
+
* differenceInBusinessDays(friday, nextFriday); // -5
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function differenceInBusinessDays(laterDate: Temporal.PlainDate, earlierDate: Temporal.PlainDate): number;
|
|
25
|
+
export declare function differenceInBusinessDays(laterDate: Temporal.Instant | Temporal.ZonedDateTime, earlierDate: Temporal.Instant | Temporal.ZonedDateTime): number;
|
|
26
|
+
//# sourceMappingURL=differenceInBusinessDays.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"differenceInBusinessDays.d.ts","sourceRoot":"","sources":["../src/differenceInBusinessDays.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAe,MAAM,mBAAmB,CAAC;AAG/D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,QAAQ,CAAC,SAAS,EAC7B,WAAW,EAAE,QAAQ,CAAC,SAAS,GAC9B,MAAM,CAAC;AACV,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EACpD,WAAW,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GACrD,MAAM,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
differenceInBusinessDays
|
|
3
|
+
} from "./chunk-OVBZ2NBB.js";
|
|
4
|
+
import "./chunk-K7CLBBBM.js";
|
|
5
|
+
import "./chunk-Q6QLOUXJ.js";
|
|
6
|
+
import "./chunk-BSVOJYJ7.js";
|
|
7
|
+
export {
|
|
8
|
+
differenceInBusinessDays
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=differenceInBusinessDays.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { Temporal } from './shared/temporal.js';
|
|
2
2
|
import type { DifferenceOptions } from './shared/differenceOptions.js';
|
|
3
3
|
/**
|
|
4
|
-
* Returns the number of days between two datetimes.
|
|
4
|
+
* Returns the number of days between two dates or datetimes.
|
|
5
5
|
* The result is positive if laterDate is after earlierDate, negative if before.
|
|
6
6
|
*
|
|
7
7
|
* This function uses calendar-aware calculation, which means it properly handles
|
|
8
8
|
* DST transitions where days can be 23, 24, or 25 hours long.
|
|
9
9
|
*
|
|
10
|
+
* Two PlainDate inputs return signed whole calendar days without a timezone.
|
|
11
|
+
* Their calendars must match; fractional options do not change date-only results.
|
|
12
|
+
*
|
|
10
13
|
* Instant inputs are converted to UTC for calendar calculations.
|
|
11
14
|
* For ZonedDateTime inputs, their timezone is preserved.
|
|
12
15
|
*
|
|
13
|
-
* @param laterDate - The later
|
|
14
|
-
* @param earlierDate - The earlier
|
|
16
|
+
* @param laterDate - The later PlainDate, Instant or ZonedDateTime
|
|
17
|
+
* @param earlierDate - The earlier value in the same Temporal domain
|
|
15
18
|
* @param options - Optional { fractional } to return the precise value
|
|
16
19
|
* @returns The number of days between the dates, truncated toward zero (pass { fractional: true } for the precise value)
|
|
17
20
|
*
|
|
@@ -41,5 +44,6 @@ import type { DifferenceOptions } from './shared/differenceOptions.js';
|
|
|
41
44
|
* differenceInDays(afterDst, beforeDst); // 2 (calendar days, not 48 hours)
|
|
42
45
|
* ```
|
|
43
46
|
*/
|
|
47
|
+
export declare function differenceInDays(laterDate: Temporal.PlainDate, earlierDate: Temporal.PlainDate, options?: DifferenceOptions): number;
|
|
44
48
|
export declare function differenceInDays(laterDate: Temporal.Instant | Temporal.ZonedDateTime, earlierDate: Temporal.Instant | Temporal.ZonedDateTime, options?: DifferenceOptions): number;
|
|
45
49
|
//# sourceMappingURL=differenceInDays.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"differenceInDays.d.ts","sourceRoot":"","sources":["../src/differenceInDays.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"differenceInDays.d.ts","sourceRoot":"","sources":["../src/differenceInDays.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,QAAQ,CAAC,SAAS,EAC7B,WAAW,EAAE,QAAQ,CAAC,SAAS,EAC/B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,MAAM,CAAC;AACV,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EACpD,WAAW,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EACtD,OAAO,CAAC,EAAE,iBAAiB,GAC1B,MAAM,CAAC"}
|