@gobrand/tiempo 3.2.0 → 3.2.2
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 +33 -8
- 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.js +3 -3
- 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-C7QA4J6V.js → chunk-7NHKDMBY.js} +2 -2
- 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-DYIISNVW.js → chunk-AWERPSJ5.js} +5 -5
- 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-4FQCY75E.js → chunk-C4LUGHIM.js} +4 -4
- 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-GOJ45AG7.js → chunk-DCQCZCKG.js} +4 -4
- package/dist/{chunk-5WHGX2J3.js → chunk-DEVXW65H.js} +2 -2
- package/dist/{chunk-R6D3Y5NV.js → chunk-DFVLLH5O.js} +2 -2
- 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-DVZDJ5LM.js → chunk-EMLUESE5.js} +5 -5
- 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-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-H43LMOCK.js → chunk-HXB6CDB4.js} +3 -3
- package/dist/{chunk-SHKSAHJO.js → chunk-IOHTFQCP.js} +2 -2
- package/dist/{chunk-7PH5BPMS.js → chunk-IXRFVP3X.js} +2 -2
- package/dist/{chunk-XSHFR2SX.js → chunk-IZPKAMAP.js} +2 -2
- package/dist/{chunk-3XGUCQ2A.js → chunk-JBGAF2FW.js} +2 -2
- package/dist/{chunk-6UBFKQIJ.js → chunk-JDKM6JTT.js} +2 -2
- 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-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-2LT2XOAL.js → chunk-MPJ6UOLX.js} +4 -4
- package/dist/{chunk-2LT2XOAL.js.map → chunk-MPJ6UOLX.js.map} +1 -1
- package/dist/{chunk-JGPTGV5X.js → chunk-MRJNMV4A.js} +3 -3
- package/dist/{chunk-PLPGYCQQ.js → chunk-MYCH45BC.js} +4 -4
- package/dist/{chunk-XMEPH226.js → chunk-MZ26BHHP.js} +3 -3
- 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-ZNRTNR2Q.js → chunk-OJIV6AKO.js} +3 -3
- 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-42IFQS4W.js → chunk-PJABNMRI.js} +3 -3
- package/dist/{chunk-3OOGJRXH.js → chunk-POCGMXLO.js} +2 -2
- 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-4YCEFGZA.js → chunk-QFQHFBN4.js} +3 -3
- 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-OMUK2MOH.js → chunk-RMVIA3NK.js} +2 -2
- package/dist/{chunk-2JXI3CAL.js → chunk-S5CDK44R.js} +4 -4
- package/dist/{chunk-GU3CZAIN.js → chunk-SKHUBXIN.js} +2 -2
- package/dist/{chunk-KZYWHHAQ.js → chunk-SURP2NUP.js} +2 -2
- package/dist/{chunk-IDB3R3G5.js → chunk-TH6YVPP4.js} +3 -3
- 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-IIEHQPKE.js → chunk-UPWUAGEV.js} +6 -6
- 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-U6VFT2A5.js → chunk-X4ULMQ53.js} +2 -2
- package/dist/{chunk-OEPVYNB6.js → chunk-XD4JKMGT.js} +2 -2
- package/dist/{chunk-K7SY2MAX.js → chunk-XEAP4MXS.js} +3 -3
- 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.js +4 -4
- package/dist/differenceInCalendarDays.js +4 -4
- package/dist/differenceInCalendarMonths.js +4 -4
- package/dist/differenceInCalendarQuarters.js +4 -4
- package/dist/differenceInCalendarWeeks.js +4 -4
- package/dist/differenceInCalendarYears.js +4 -4
- 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.js +5 -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.js +5 -5
- package/dist/endOfYear.d.ts.map +1 -1
- package/dist/endOfYear.js +6 -6
- package/dist/format.js +4 -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 -116
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +124 -124
- 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.js +3 -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.js +6 -6
- package/dist/isYesterday.js +6 -6
- package/dist/max.js +3 -3
- package/dist/min.js +3 -3
- package/dist/nextDay.js +3 -3
- package/dist/now.js +2 -2
- package/dist/parse.js +2 -2
- package/dist/previousDay.js +3 -3
- package/dist/roundToNearestHour.js +3 -3
- package/dist/roundToNearestMinute.js +3 -3
- package/dist/roundToNearestSecond.js +3 -3
- package/dist/shared/businessDays.js +3 -3
- package/dist/shared/calendarDates.js +3 -3
- 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/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/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.js +4 -4
- package/dist/startOfYear.d.ts.map +1 -1
- package/dist/startOfYear.js +5 -5
- 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 +48 -26
- package/dist/chunk-4FQCY75E.js.map +0 -1
- package/dist/chunk-4VWUTQKP.js.map +0 -1
- package/dist/chunk-525OLFRD.js.map +0 -1
- package/dist/chunk-6QOLNYFY.js.map +0 -1
- package/dist/chunk-A34P5Z5O.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-CDKIT7D3.js.map +0 -1
- package/dist/chunk-DGUAV5XN.js.map +0 -1
- package/dist/chunk-JA5ER27P.js.map +0 -1
- package/dist/chunk-KYS54PLJ.js.map +0 -1
- package/dist/chunk-LQ3EQYIX.js.map +0 -1
- package/dist/chunk-NMMMAMKP.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-ZNRTNR2Q.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-C7QA4J6V.js.map → chunk-7NHKDMBY.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-DYIISNVW.js.map → chunk-AWERPSJ5.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-GOJ45AG7.js.map → chunk-DCQCZCKG.js.map} +0 -0
- /package/dist/{chunk-5WHGX2J3.js.map → chunk-DEVXW65H.js.map} +0 -0
- /package/dist/{chunk-R6D3Y5NV.js.map → chunk-DFVLLH5O.js.map} +0 -0
- /package/dist/{chunk-DVZDJ5LM.js.map → chunk-EMLUESE5.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-H43LMOCK.js.map → chunk-HXB6CDB4.js.map} +0 -0
- /package/dist/{chunk-SHKSAHJO.js.map → chunk-IOHTFQCP.js.map} +0 -0
- /package/dist/{chunk-7PH5BPMS.js.map → chunk-IXRFVP3X.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-6UBFKQIJ.js.map → chunk-JDKM6JTT.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-PLPGYCQQ.js.map → chunk-MYCH45BC.js.map} +0 -0
- /package/dist/{chunk-XMEPH226.js.map → chunk-MZ26BHHP.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-42IFQS4W.js.map → chunk-PJABNMRI.js.map} +0 -0
- /package/dist/{chunk-3OOGJRXH.js.map → chunk-POCGMXLO.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-4YCEFGZA.js.map → chunk-QFQHFBN4.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-OMUK2MOH.js.map → chunk-RMVIA3NK.js.map} +0 -0
- /package/dist/{chunk-2JXI3CAL.js.map → chunk-S5CDK44R.js.map} +0 -0
- /package/dist/{chunk-GU3CZAIN.js.map → chunk-SKHUBXIN.js.map} +0 -0
- /package/dist/{chunk-KZYWHHAQ.js.map → chunk-SURP2NUP.js.map} +0 -0
- /package/dist/{chunk-IDB3R3G5.js.map → chunk-TH6YVPP4.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-IIEHQPKE.js.map → chunk-UPWUAGEV.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-U6VFT2A5.js.map → chunk-X4ULMQ53.js.map} +0 -0
- /package/dist/{chunk-OEPVYNB6.js.map → chunk-XD4JKMGT.js.map} +0 -0
- /package/dist/{chunk-K7SY2MAX.js.map → chunk-XEAP4MXS.js.map} +0 -0
- /package/dist/{chunk-QZ6WXAUO.js.map → chunk-YPAI5UGF.js.map} +0 -0
- /package/dist/{chunk-HRCTWTP3.js.map → chunk-YSUNJQBP.js.map} +0 -0
- /package/dist/{chunk-JQ4Z4JTW.js.map → chunk-ZMAMJNWT.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/simpleFormat.ts"],"sourcesContent":["import { Temporal, isInstant, isZonedDateTime } from './shared/temporal';\nimport type { Timezone } from './types';\n\ninterface BaseOptions {\n locale?: string;\n timeZone?: Timezone;\n}\n\ninterface DateOnlyOptions extends BaseOptions {\n date: 'compact' | 'auto' | 'full';\n time?: never;\n}\n\ninterface TimeOnlyOptions extends BaseOptions {\n date?: never;\n time: '12h' | '24h' | 'compact';\n}\n\ninterface DateAndTimeOptions extends BaseOptions {\n date: 'compact' | 'auto' | 'full';\n time: '12h' | '24h' | 'compact';\n}\n\nexport type SimpleFormatOptions = DateOnlyOptions | TimeOnlyOptions | DateAndTimeOptions;\n\n/**\n * Format a Temporal date/time in a human-friendly way.\n *\n * Pass `date`, `time`, or both to control what's displayed.\n * At least one of `date` or `time` is required.\n *\n * @param input - A Temporal.Instant, ZonedDateTime, or PlainDate\n * @param options - Format options (at least `date` or `time` required)\n *\n * Date formats:\n * - `'compact'` - \"Dec 23\" (never shows year)\n * - `'auto'` - \"Dec 23\" or \"Dec 23, 2020\" (shows year only if not current year)\n * - `'full'` - \"Dec 23, 2026\" (always shows year)\n *\n * Time formats:\n * - `'12h'` - \"3:30 PM\"\n * - `'24h'` - \"15:30\"\n * - `'compact'` - \"9am\" or \"2:30pm\" (omits minutes when zero, lowercase am/pm)\n *\n * @example\n * ```typescript\n * const zdt = Temporal.ZonedDateTime.from(\"2026-12-23T09:00:00[America/New_York]\");\n * const pastZdt = Temporal.ZonedDateTime.from(\"2020-12-23T14:30:00[America/New_York]\");\n *\n * // Date only\n * simpleFormat(zdt, { date: 'compact' }); // \"Dec 23\"\n * simpleFormat(zdt, { date: 'auto' }); // \"Dec 23\"\n * simpleFormat(pastZdt, { date: 'auto' }); // \"Dec 23, 2020\"\n * simpleFormat(zdt, { date: 'full' }); // \"Dec 23, 2026\"\n *\n * // Time only\n * simpleFormat(zdt, { time: 'compact' }); // \"9am\"\n * simpleFormat(pastZdt, { time: 'compact' }); // \"2:30pm\"\n * simpleFormat(zdt, { time: '12h' }); // \"9:00 AM\"\n * simpleFormat(zdt, { time: '24h' }); // \"09:00\"\n *\n * // Date and time\n * simpleFormat(zdt, { date: 'auto', time: 'compact' }); // \"Dec 23, 9am\"\n * simpleFormat(zdt, { date: 'full', time: '12h' }); // \"Dec 23, 2026, 9:00 AM\"\n *\n * // With Instant (timeZone required)\n * const instant = Temporal.Instant.from(\"2026-12-23T14:00:00Z\");\n * simpleFormat(instant, { date: 'auto', timeZone: 'America/New_York' }); // \"Dec 23\"\n * ```\n */\nexport function simpleFormat(\n input: Temporal.PlainDate | Temporal.ZonedDateTime | Temporal.Instant,\n options: SimpleFormatOptions\n): string {\n const { locale = 'en-US', timeZone } = options;\n const dateFormat = 'date' in options ? options.date : undefined;\n const timeFormat = 'time' in options ? options.time : undefined;\n\n // Convert input to ZonedDateTime for consistent handling\n let zdt: Temporal.ZonedDateTime;\n\n if (isInstant(input)) {\n const tz = timeZone ?? 'UTC';\n zdt = input.toZonedDateTimeISO(tz);\n } else if (isZonedDateTime(input)) {\n if (timeZone) {\n zdt = input.toInstant().toZonedDateTimeISO(timeZone);\n } else {\n zdt = input;\n }\n } else {\n // PlainDate - convert to ZonedDateTime at midnight UTC for formatting\n zdt = input.toZonedDateTime({
|
|
1
|
+
{"version":3,"sources":["../src/simpleFormat.ts"],"sourcesContent":["import { Temporal, isInstant, isZonedDateTime } from './shared/temporal';\nimport type { Timezone } from './types';\n\ninterface BaseOptions {\n locale?: string;\n timeZone?: Timezone;\n}\n\ninterface DateOnlyOptions extends BaseOptions {\n date: 'compact' | 'auto' | 'full';\n time?: never;\n}\n\ninterface TimeOnlyOptions extends BaseOptions {\n date?: never;\n time: '12h' | '24h' | 'compact';\n}\n\ninterface DateAndTimeOptions extends BaseOptions {\n date: 'compact' | 'auto' | 'full';\n time: '12h' | '24h' | 'compact';\n}\n\nexport type SimpleFormatOptions = DateOnlyOptions | TimeOnlyOptions | DateAndTimeOptions;\n\n/**\n * Format a Temporal date/time in a human-friendly way.\n *\n * Pass `date`, `time`, or both to control what's displayed.\n * At least one of `date` or `time` is required.\n *\n * @param input - A Temporal.Instant, ZonedDateTime, or PlainDate\n * @param options - Format options (at least `date` or `time` required)\n *\n * Date formats:\n * - `'compact'` - \"Dec 23\" (never shows year)\n * - `'auto'` - \"Dec 23\" or \"Dec 23, 2020\" (shows year only if not current year)\n * - `'full'` - \"Dec 23, 2026\" (always shows year)\n *\n * Time formats:\n * - `'12h'` - \"3:30 PM\"\n * - `'24h'` - \"15:30\"\n * - `'compact'` - \"9am\" or \"2:30pm\" (omits minutes when zero, lowercase am/pm)\n *\n * @example\n * ```typescript\n * const zdt = Temporal.ZonedDateTime.from(\"2026-12-23T09:00:00[America/New_York]\");\n * const pastZdt = Temporal.ZonedDateTime.from(\"2020-12-23T14:30:00[America/New_York]\");\n *\n * // Date only\n * simpleFormat(zdt, { date: 'compact' }); // \"Dec 23\"\n * simpleFormat(zdt, { date: 'auto' }); // \"Dec 23\"\n * simpleFormat(pastZdt, { date: 'auto' }); // \"Dec 23, 2020\"\n * simpleFormat(zdt, { date: 'full' }); // \"Dec 23, 2026\"\n *\n * // Time only\n * simpleFormat(zdt, { time: 'compact' }); // \"9am\"\n * simpleFormat(pastZdt, { time: 'compact' }); // \"2:30pm\"\n * simpleFormat(zdt, { time: '12h' }); // \"9:00 AM\"\n * simpleFormat(zdt, { time: '24h' }); // \"09:00\"\n *\n * // Date and time\n * simpleFormat(zdt, { date: 'auto', time: 'compact' }); // \"Dec 23, 9am\"\n * simpleFormat(zdt, { date: 'full', time: '12h' }); // \"Dec 23, 2026, 9:00 AM\"\n *\n * // With Instant (timeZone required)\n * const instant = Temporal.Instant.from(\"2026-12-23T14:00:00Z\");\n * simpleFormat(instant, { date: 'auto', timeZone: 'America/New_York' }); // \"Dec 23\"\n * ```\n */\nexport function simpleFormat(\n input: Temporal.PlainDate | Temporal.ZonedDateTime | Temporal.Instant,\n options: SimpleFormatOptions\n): string {\n const { locale = 'en-US', timeZone } = options;\n const dateFormat = 'date' in options ? options.date : undefined;\n const timeFormat = 'time' in options ? options.time : undefined;\n\n // Convert input to ZonedDateTime for consistent handling\n let zdt: Temporal.ZonedDateTime;\n\n if (isInstant(input)) {\n const tz = timeZone ?? 'UTC';\n zdt = input.toZonedDateTimeISO(tz);\n } else if (isZonedDateTime(input)) {\n if (timeZone) {\n zdt = input.toInstant().toZonedDateTimeISO(timeZone);\n } else {\n zdt = input;\n }\n } else {\n // PlainDate - convert to ZonedDateTime at midnight UTC for formatting\n zdt = input.toZonedDateTime({\n timeZone: timeZone ?? 'UTC',\n plainTime: new Temporal.PlainTime()\n });\n }\n\n const parts: string[] = [];\n\n // Format date part\n if (dateFormat) {\n const currentYear = Temporal.Now.plainDateISO().year;\n const showYear =\n dateFormat === 'full' ? true : dateFormat === 'compact' ? false : zdt.year !== currentYear;\n\n const dateOptions: Intl.DateTimeFormatOptions = {\n day: 'numeric',\n month: 'short',\n year: showYear ? 'numeric' : undefined\n };\n\n parts.push(zdt.toLocaleString(locale, dateOptions));\n }\n\n // Format time part\n if (timeFormat) {\n if (timeFormat === 'compact') {\n parts.push(formatCompactTime(zdt));\n } else {\n const timeOptions: Intl.DateTimeFormatOptions = {\n hour: 'numeric',\n minute: '2-digit',\n hour12: timeFormat === '12h'\n };\n parts.push(zdt.toLocaleString(locale, timeOptions));\n }\n }\n\n return parts.join(', ');\n}\n\n/**\n * Format time in compact style: \"9am\" or \"2:30pm\"\n * Omits minutes when they're zero for cleaner display.\n */\nfunction formatCompactTime(zdt: Temporal.ZonedDateTime): string {\n const hour12 = zdt.hour % 12 || 12;\n const ampm = zdt.hour < 12 ? 'am' : 'pm';\n\n if (zdt.minute === 0) {\n return `${hour12}${ampm}`;\n }\n return `${hour12}:${zdt.minute.toString().padStart(2, '0')}${ampm}`;\n}\n"],"mappings":";;;;;;;AAsEO,SAAS,aACd,OACA,SACQ;AACR,QAAM,EAAE,SAAS,SAAS,SAAS,IAAI;AACvC,QAAM,aAAa,UAAU,UAAU,QAAQ,OAAO;AACtD,QAAM,aAAa,UAAU,UAAU,QAAQ,OAAO;AAGtD,MAAI;AAEJ,MAAI,UAAU,KAAK,GAAG;AACpB,UAAM,KAAK,YAAY;AACvB,UAAM,MAAM,mBAAmB,EAAE;AAAA,EACnC,WAAW,gBAAgB,KAAK,GAAG;AACjC,QAAI,UAAU;AACZ,YAAM,MAAM,UAAU,EAAE,mBAAmB,QAAQ;AAAA,IACrD,OAAO;AACL,YAAM;AAAA,IACR;AAAA,EACF,OAAO;AAEL,UAAM,MAAM,gBAAgB;AAAA,MAC1B,UAAU,YAAY;AAAA,MACtB,WAAW,IAAI,SAAS,UAAU;AAAA,IACpC,CAAC;AAAA,EACH;AAEA,QAAM,QAAkB,CAAC;AAGzB,MAAI,YAAY;AACd,UAAM,cAAc,SAAS,IAAI,aAAa,EAAE;AAChD,UAAM,WACJ,eAAe,SAAS,OAAO,eAAe,YAAY,QAAQ,IAAI,SAAS;AAEjF,UAAM,cAA0C;AAAA,MAC9C,KAAK;AAAA,MACL,OAAO;AAAA,MACP,MAAM,WAAW,YAAY;AAAA,IAC/B;AAEA,UAAM,KAAK,IAAI,eAAe,QAAQ,WAAW,CAAC;AAAA,EACpD;AAGA,MAAI,YAAY;AACd,QAAI,eAAe,WAAW;AAC5B,YAAM,KAAK,kBAAkB,GAAG,CAAC;AAAA,IACnC,OAAO;AACL,YAAM,cAA0C;AAAA,QAC9C,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,QAAQ,eAAe;AAAA,MACzB;AACA,YAAM,KAAK,IAAI,eAAe,QAAQ,WAAW,CAAC;AAAA,IACpD;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;AAMA,SAAS,kBAAkB,KAAqC;AAC9D,QAAM,SAAS,IAAI,OAAO,MAAM;AAChC,QAAM,OAAO,IAAI,OAAO,KAAK,OAAO;AAEpC,MAAI,IAAI,WAAW,GAAG;AACpB,WAAO,GAAG,MAAM,GAAG,IAAI;AAAA,EACzB;AACA,SAAO,GAAG,MAAM,IAAI,IAAI,OAAO,SAAS,EAAE,SAAS,GAAG,GAAG,CAAC,GAAG,IAAI;AACnE;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addYears
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YSUNJQBP.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-M4ESIRFH.js";
|
|
7
7
|
|
|
8
8
|
// src/subYears.ts
|
|
9
9
|
function subYears(input, years) {
|
|
@@ -13,4 +13,4 @@ function subYears(input, years) {
|
|
|
13
13
|
export {
|
|
14
14
|
subYears
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-GLKCUJIZ.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/addMinutes.ts
|
|
6
6
|
function addMinutes(input, minutes) {
|
|
@@ -11,4 +11,4 @@ function addMinutes(input, minutes) {
|
|
|
11
11
|
export {
|
|
12
12
|
addMinutes
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-GZKKAIXF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/isAfter.ts"],"sourcesContent":["import type { Temporal } from './temporal';\n\nexport function isAfter(date1: Temporal.ZonedDateTime, date2: Temporal.ZonedDateTime): boolean {\n return date1.epochNanoseconds > date2.epochNanoseconds;\n}\n"],"mappings":";AAEO,SAAS,QAAQ,OAA+B,OAAwC;AAC7F,SAAO,MAAM,mBAAmB,MAAM;AACxC;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTM7YAT4.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-M4ESIRFH.js";
|
|
7
7
|
|
|
8
8
|
// src/differenceInWeeks.ts
|
|
9
9
|
function differenceInWeeks(laterDate, earlierDate, options) {
|
|
@@ -25,4 +25,4 @@ function differenceInWeeks(laterDate, earlierDate, options) {
|
|
|
25
25
|
export {
|
|
26
26
|
differenceInWeeks
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
//# sourceMappingURL=chunk-HMPHUFC6.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isPlainDateAfter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-K6IGDI5W.js";
|
|
4
4
|
import {
|
|
5
5
|
quarterStartMonth
|
|
6
6
|
} from "./chunk-XS2HUADA.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/eachQuarterOfInterval.ts
|
|
16
16
|
function eachQuarterOfInterval(interval) {
|
|
@@ -19,7 +19,11 @@ function eachQuarterOfInterval(interval) {
|
|
|
19
19
|
throw new TypeError("PlainDate intervals require two PlainDate endpoints");
|
|
20
20
|
}
|
|
21
21
|
if (isPlainDateAfter(interval.start, interval.end)) return [];
|
|
22
|
-
return eachQuarterStart(
|
|
22
|
+
return eachQuarterStart(
|
|
23
|
+
interval.start,
|
|
24
|
+
interval.end.withCalendar(interval.start.calendarId),
|
|
25
|
+
(ym) => ym.toPlainDate({ day: 1 })
|
|
26
|
+
);
|
|
23
27
|
}
|
|
24
28
|
const startZoned = normalizeTemporalInput(
|
|
25
29
|
interval.start
|
|
@@ -62,4 +66,4 @@ function eachQuarterStart(start, end, make) {
|
|
|
62
66
|
export {
|
|
63
67
|
eachQuarterOfInterval
|
|
64
68
|
};
|
|
65
|
-
//# sourceMappingURL=chunk-
|
|
69
|
+
//# sourceMappingURL=chunk-HQ7JUUWD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eachQuarterOfInterval.ts"],"sourcesContent":["import { isPlainDateAfter } from './isPlainDateAfter';\nimport { Temporal } from './shared/temporal';\nimport { isPlainDate } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport { quarterStartMonth } from './shared/quarter';\n\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 with the start of each quarter within the interval, inclusive\n * of both the start and end quarters.\n *\n * Quarters: Q1 = Jan–Mar, Q2 = Apr–Jun, Q3 = Jul–Sep, Q4 = Oct–Dec. Each element\n * is the first moment of the quarter (1st day of the quarter's starting month at\n * midnight) for Instant/ZonedDateTime inputs, or the first day as a PlainDate for\n * PlainDate inputs.\n *\n * For Instant inputs, UTC is used. For ZonedDateTime inputs, the timezone of the\n * start date is preserved. PlainDate inputs need no timezone and return PlainDate[].\n *\n * @param interval - The interval with start and end\n * @returns Array of ZonedDateTime (or PlainDate) at the start of each quarter\n *\n * @example\n * ```ts\n * const start = Temporal.ZonedDateTime.from('2025-02-15T10:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-11-20T14:00:00+00:00[UTC]');\n * eachQuarterOfInterval({ start, end });\n * // [2025-01-01…, 2025-04-01…, 2025-07-01…, 2025-10-01…]\n * ```\n *\n * @example\n * ```ts\n * // PlainDate interval returns PlainDate quarter starts (no timezone)\n * eachQuarterOfInterval({\n * start: Temporal.PlainDate.from('2025-02-15'),\n * end: Temporal.PlainDate.from('2025-08-20'),\n * });\n * // [2025-01-01, 2025-04-01, 2025-07-01]\n * ```\n */\nexport function eachQuarterOfInterval(interval: {\n start: Temporal.Instant | Temporal.ZonedDateTime;\n end: Temporal.Instant | Temporal.ZonedDateTime;\n}): Temporal.ZonedDateTime[];\nexport function eachQuarterOfInterval(interval: {\n start: Temporal.PlainDate;\n end: Temporal.PlainDate;\n}): Temporal.PlainDate[];\nexport function eachQuarterOfInterval(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 return eachQuarterStart(\n interval.start,\n interval.end.withCalendar(interval.start.calendarId),\n (ym) => ym.toPlainDate({ day: 1 })\n );\n }\n\n const startZoned = normalizeTemporalInput(\n interval.start as Temporal.Instant | Temporal.ZonedDateTime\n );\n const endZoned = normalizeTemporalInput(\n interval.end as Temporal.Instant | Temporal.ZonedDateTime\n );\n if (startZoned.epochNanoseconds > endZoned.epochNanoseconds) return [];\n const timezone = startZoned.timeZoneId;\n\n return eachQuarterStart(\n startZoned,\n endZoned.withTimeZone(timezone).withCalendar(startZoned.calendarId),\n (ym) =>\n ym.toPlainDate({ day: 1 }).toZonedDateTime({\n timeZone: timezone,\n plainTime: new Temporal.PlainTime()\n })\n );\n}\n\n/**\n * Walks quarter-aligned year-months from start to end (inclusive) and maps each\n * to a result. Both bounds are snapped to their quarter's starting month.\n */\nfunction eachQuarterStart<T>(\n start: { year: number; month: number; calendarId: string },\n end: { year: number; month: number; calendarId: string },\n make: (ym: Temporal.PlainYearMonth) => T\n): T[] {\n const startYearMonth = Temporal.PlainYearMonth.from({\n year: start.year,\n month: quarterStartMonth(start.month),\n calendar: start.calendarId\n });\n const endYearMonth = Temporal.PlainYearMonth.from({\n year: end.year,\n month: quarterStartMonth(end.month),\n calendar: start.calendarId\n });\n\n const out: T[] = [];\n let current = startYearMonth;\n while (Temporal.PlainYearMonth.compare(current, endYearMonth) <= 0) {\n out.push(make(current));\n // A calendar can have thirteen months; realign after crossing its year end.\n const next = current.add({ months: 3 });\n current = next.with({ month: quarterStartMonth(next.month) });\n }\n return out;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkDO,SAAS,sBAAsB,UAGc;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,WAAO;AAAA,MACL,SAAS;AAAA,MACT,SAAS,IAAI,aAAa,SAAS,MAAM,UAAU;AAAA,MACnD,CAAC,OAAO,GAAG,YAAY,EAAE,KAAK,EAAE,CAAC;AAAA,IACnC;AAAA,EACF;AAEA,QAAM,aAAa;AAAA,IACjB,SAAS;AAAA,EACX;AACA,QAAM,WAAW;AAAA,IACf,SAAS;AAAA,EACX;AACA,MAAI,WAAW,mBAAmB,SAAS,iBAAkB,QAAO,CAAC;AACrE,QAAM,WAAW,WAAW;AAE5B,SAAO;AAAA,IACL;AAAA,IACA,SAAS,aAAa,QAAQ,EAAE,aAAa,WAAW,UAAU;AAAA,IAClE,CAAC,OACC,GAAG,YAAY,EAAE,KAAK,EAAE,CAAC,EAAE,gBAAgB;AAAA,MACzC,UAAU;AAAA,MACV,WAAW,IAAI,SAAS,UAAU;AAAA,IACpC,CAAC;AAAA,EACL;AACF;AAMA,SAAS,iBACP,OACA,KACA,MACK;AACL,QAAM,iBAAiB,SAAS,eAAe,KAAK;AAAA,IAClD,MAAM,MAAM;AAAA,IACZ,OAAO,kBAAkB,MAAM,KAAK;AAAA,IACpC,UAAU,MAAM;AAAA,EAClB,CAAC;AACD,QAAM,eAAe,SAAS,eAAe,KAAK;AAAA,IAChD,MAAM,IAAI;AAAA,IACV,OAAO,kBAAkB,IAAI,KAAK;AAAA,IAClC,UAAU,MAAM;AAAA,EAClB,CAAC;AAED,QAAM,MAAW,CAAC;AAClB,MAAI,UAAU;AACd,SAAO,SAAS,eAAe,QAAQ,SAAS,YAAY,KAAK,GAAG;AAClE,QAAI,KAAK,KAAK,OAAO,CAAC;AAEtB,UAAM,OAAO,QAAQ,IAAI,EAAE,QAAQ,EAAE,CAAC;AACtC,cAAU,KAAK,KAAK,EAAE,OAAO,kBAAkB,KAAK,KAAK,EAAE,CAAC;AAAA,EAC9D;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTM7YAT4.js";
|
|
4
4
|
import {
|
|
5
5
|
Temporal,
|
|
6
6
|
isPlainDate
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-M4ESIRFH.js";
|
|
8
8
|
|
|
9
9
|
// src/shared/calendarDates.ts
|
|
10
10
|
function calendarDates(laterDate, earlierDate) {
|
|
@@ -23,4 +23,4 @@ function dateOf(input) {
|
|
|
23
23
|
export {
|
|
24
24
|
calendarDates
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-HXB6CDB4.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/eachMinuteOfInterval.ts
|
|
6
6
|
function eachMinuteOfInterval(interval) {
|
|
@@ -23,4 +23,4 @@ function eachMinuteOfInterval(interval) {
|
|
|
23
23
|
export {
|
|
24
24
|
eachMinuteOfInterval
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-IOHTFQCP.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
calendarDates
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HXB6CDB4.js";
|
|
4
4
|
|
|
5
5
|
// src/differenceInCalendarDays.ts
|
|
6
6
|
function differenceInCalendarDays(laterDate, earlierDate) {
|
|
@@ -11,4 +11,4 @@ function differenceInCalendarDays(laterDate, earlierDate) {
|
|
|
11
11
|
export {
|
|
12
12
|
differenceInCalendarDays
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-IXRFVP3X.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/differenceInSeconds.ts
|
|
6
6
|
function differenceInSeconds(laterDate, earlierDate, options) {
|
|
@@ -13,4 +13,4 @@ function differenceInSeconds(laterDate, earlierDate, options) {
|
|
|
13
13
|
export {
|
|
14
14
|
differenceInSeconds
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-IZPKAMAP.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/isSameMicrosecond.ts
|
|
6
6
|
function isSameMicrosecond(date1, date2) {
|
|
@@ -12,4 +12,4 @@ function isSameMicrosecond(date1, date2) {
|
|
|
12
12
|
export {
|
|
13
13
|
isSameMicrosecond
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-JBGAF2FW.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-M2XB72L5.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeTemporalInput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UTM7YAT4.js";
|
|
7
7
|
|
|
8
8
|
// src/isSameWeek.ts
|
|
9
9
|
function isSameWeek(date1, date2, options) {
|
|
@@ -17,4 +17,4 @@ function isSameWeek(date1, date2, options) {
|
|
|
17
17
|
export {
|
|
18
18
|
isSameWeek
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-JDKM6JTT.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Temporal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-M4ESIRFH.js";
|
|
4
4
|
|
|
5
5
|
// src/isPlainDateAfter.ts
|
|
6
6
|
function isPlainDateAfter(date1, date2) {
|
|
@@ -13,4 +13,4 @@ function isPlainDateAfter(date1, date2) {
|
|
|
13
13
|
export {
|
|
14
14
|
isPlainDateAfter
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-K6IGDI5W.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/isPlainDateAfter.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\n\n/**\n * Returns true if the first plain date is after 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 after 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 * isPlainDateAfter(jan25, jan20); // true\n * isPlainDateAfter(jan20, jan25); // false\n * isPlainDateAfter(jan20, jan20); // false\n * ```\n */\nexport function isPlainDateAfter(
|
|
1
|
+
{"version":3,"sources":["../src/isPlainDateAfter.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\n\n/**\n * Returns true if the first plain date is after 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 after 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 * isPlainDateAfter(jan25, jan20); // true\n * isPlainDateAfter(jan20, jan25); // false\n * isPlainDateAfter(jan20, jan20); // false\n * ```\n */\nexport function isPlainDateAfter(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,iBAAiB,OAA2B,OAAoC;AAE9F,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,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTM7YAT4.js";
|
|
4
4
|
|
|
5
5
|
// src/addMilliseconds.ts
|
|
6
6
|
function addMilliseconds(input, milliseconds) {
|
|
@@ -11,4 +11,4 @@ function addMilliseconds(input, milliseconds) {
|
|
|
11
11
|
export {
|
|
12
12
|
addMilliseconds
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-KISBF5GX.js.map
|
|
@@ -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/eachYearOfInterval.ts
|
|
16
16
|
function eachYearOfInterval(interval) {
|
|
@@ -39,7 +39,12 @@ function eachYearOfInterval(interval) {
|
|
|
39
39
|
const endYear = endInTimezone.year;
|
|
40
40
|
const years = [];
|
|
41
41
|
for (let year = startYear; year <= endYear; year++) {
|
|
42
|
-
const firstOfYear = Temporal.PlainDate.from({
|
|
42
|
+
const firstOfYear = Temporal.PlainDate.from({
|
|
43
|
+
year,
|
|
44
|
+
month: 1,
|
|
45
|
+
day: 1,
|
|
46
|
+
calendar: startZoned.calendarId
|
|
47
|
+
});
|
|
43
48
|
years.push(
|
|
44
49
|
firstOfYear.toZonedDateTime({
|
|
45
50
|
timeZone: timezone,
|
|
@@ -53,4 +58,4 @@ function eachYearOfInterval(interval) {
|
|
|
53
58
|
export {
|
|
54
59
|
eachYearOfInterval
|
|
55
60
|
};
|
|
56
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-KUDGVLQT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/eachYearOfInterval.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 year within the interval.\n * Each element represents the first moment of the year (January 1st at midnight).\n * The interval is inclusive of both start and end years.\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 year in the interval\n *\n * @example\n * ```ts\n * const start = Temporal.ZonedDateTime.from('2022-06-15T10:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-03-20T14:00:00+00:00[UTC]');\n *\n * const years = eachYearOfInterval({ start, end });\n * // [\n * // 2022-01-01T00:00:00+00:00[UTC],\n * // 2023-01-01T00:00:00+00:00[UTC],\n * // 2024-01-01T00:00:00+00:00[UTC],\n * // 2025-01-01T00:00:00+00:00[UTC]\n * // ]\n * ```\n *\n * @example\n * ```ts\n * // Single year\n * const start = Temporal.ZonedDateTime.from('2025-01-15T00:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-12-31T23:59:59+00:00[UTC]');\n *\n * const years = eachYearOfInterval({ start, end });\n * // [2025-01-01T00:00:00+00:00[UTC]]\n * ```\n *\n * @example\n * ```ts\n * // With timezone\n * const start = Temporal.ZonedDateTime.from('2024-01-01T00:00:00-05:00[America/New_York]');\n * const end = Temporal.ZonedDateTime.from('2026-06-15T00:00:00-04:00[America/New_York]');\n *\n * const years = eachYearOfInterval({ start, end });\n * // [\n * // 2024-01-01T00:00:00-05:00[America/New_York],\n * // 2025-01-01T00:00:00-05:00[America/New_York],\n * // 2026-01-01T00:00:00-05:00[America/New_York]\n * // ]\n * ```\n */\nexport function eachYearOfInterval(interval: {\n start: Temporal.PlainDate;\n end: Temporal.PlainDate;\n}): Temporal.PlainDate[];\nexport function eachYearOfInterval(interval: {\n start: Temporal.Instant | Temporal.ZonedDateTime;\n end: Temporal.Instant | Temporal.ZonedDateTime;\n}): Temporal.ZonedDateTime[];\nexport function eachYearOfInterval(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({ month: 1, day: 1 });\n let current = interval.start.with({ month: 1, day: 1 });\n const dates: Temporal.PlainDate[] = [];\n while (isPlainDateBefore(current, last)) {\n dates.push(current);\n current = current.add({ years: 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 const startYear = startZoned.year;\n\n // Get end year in the same timezone\n const endInTimezone = endZoned.withTimeZone(timezone).withCalendar(startZoned.calendarId);\n const endYear = endInTimezone.year;\n\n const years: Temporal.ZonedDateTime[] = [];\n\n for (let year = startYear; year <= endYear; year++) {\n const firstOfYear = Temporal.PlainDate.from({
|
|
1
|
+
{"version":3,"sources":["../src/eachYearOfInterval.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 year within the interval.\n * Each element represents the first moment of the year (January 1st at midnight).\n * The interval is inclusive of both start and end years.\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 year in the interval\n *\n * @example\n * ```ts\n * const start = Temporal.ZonedDateTime.from('2022-06-15T10:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-03-20T14:00:00+00:00[UTC]');\n *\n * const years = eachYearOfInterval({ start, end });\n * // [\n * // 2022-01-01T00:00:00+00:00[UTC],\n * // 2023-01-01T00:00:00+00:00[UTC],\n * // 2024-01-01T00:00:00+00:00[UTC],\n * // 2025-01-01T00:00:00+00:00[UTC]\n * // ]\n * ```\n *\n * @example\n * ```ts\n * // Single year\n * const start = Temporal.ZonedDateTime.from('2025-01-15T00:00:00+00:00[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-12-31T23:59:59+00:00[UTC]');\n *\n * const years = eachYearOfInterval({ start, end });\n * // [2025-01-01T00:00:00+00:00[UTC]]\n * ```\n *\n * @example\n * ```ts\n * // With timezone\n * const start = Temporal.ZonedDateTime.from('2024-01-01T00:00:00-05:00[America/New_York]');\n * const end = Temporal.ZonedDateTime.from('2026-06-15T00:00:00-04:00[America/New_York]');\n *\n * const years = eachYearOfInterval({ start, end });\n * // [\n * // 2024-01-01T00:00:00-05:00[America/New_York],\n * // 2025-01-01T00:00:00-05:00[America/New_York],\n * // 2026-01-01T00:00:00-05:00[America/New_York]\n * // ]\n * ```\n */\nexport function eachYearOfInterval(interval: {\n start: Temporal.PlainDate;\n end: Temporal.PlainDate;\n}): Temporal.PlainDate[];\nexport function eachYearOfInterval(interval: {\n start: Temporal.Instant | Temporal.ZonedDateTime;\n end: Temporal.Instant | Temporal.ZonedDateTime;\n}): Temporal.ZonedDateTime[];\nexport function eachYearOfInterval(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({ month: 1, day: 1 });\n let current = interval.start.with({ month: 1, day: 1 });\n const dates: Temporal.PlainDate[] = [];\n while (isPlainDateBefore(current, last)) {\n dates.push(current);\n current = current.add({ years: 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 const startYear = startZoned.year;\n\n // Get end year in the same timezone\n const endInTimezone = endZoned.withTimeZone(timezone).withCalendar(startZoned.calendarId);\n const endYear = endInTimezone.year;\n\n const years: Temporal.ZonedDateTime[] = [];\n\n for (let year = startYear; year <= endYear; year++) {\n const firstOfYear = Temporal.PlainDate.from({\n year,\n month: 1,\n day: 1,\n calendar: startZoned.calendarId\n });\n years.push(\n firstOfYear.toZonedDateTime({\n timeZone: timezone,\n plainTime: new Temporal.PlainTime()\n })\n );\n }\n\n return years;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoEO,SAAS,mBAAmB,UAGiB;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,OAAO,GAAG,KAAK,EAAE,CAAC;AAC1C,QAAI,UAAU,SAAS,MAAM,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,CAAC;AACtD,UAAM,QAA8B,CAAC;AACrC,WAAO,kBAAkB,SAAS,IAAI,GAAG;AACvC,YAAM,KAAK,OAAO;AAClB,gBAAU,QAAQ,IAAI,EAAE,OAAO,EAAE,CAAC;AAAA,IACpC;AACA,UAAM,KAAK,OAAO;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;AAC5B,QAAM,YAAY,WAAW;AAG7B,QAAM,gBAAgB,SAAS,aAAa,QAAQ,EAAE,aAAa,WAAW,UAAU;AACxF,QAAM,UAAU,cAAc;AAE9B,QAAM,QAAkC,CAAC;AAEzC,WAAS,OAAO,WAAW,QAAQ,SAAS,QAAQ;AAClD,UAAM,cAAc,SAAS,UAAU,KAAK;AAAA,MAC1C;AAAA,MACA,OAAO;AAAA,MACP,KAAK;AAAA,MACL,UAAU,WAAW;AAAA,IACvB,CAAC;AACD,UAAM;AAAA,MACJ,YAAY,gBAAgB;AAAA,QAC1B,UAAU;AAAA,QACV,WAAW,IAAI,SAAS,UAAU;AAAA,MACpC,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTemporalInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTM7YAT4.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-M4ESIRFH.js";
|
|
7
7
|
|
|
8
8
|
// src/addMonths.ts
|
|
9
9
|
function addMonths(input, months) {
|
|
@@ -16,4 +16,4 @@ function addMonths(input, months) {
|
|
|
16
16
|
export {
|
|
17
17
|
addMonths
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
19
|
+
//# sourceMappingURL=chunk-L535UIYN.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeWithPlainDate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QCIY5PSJ.js";
|
|
4
4
|
|
|
5
5
|
// src/startOfDay.ts
|
|
6
6
|
function startOfDay(input, timezone) {
|
|
@@ -11,4 +11,4 @@ function startOfDay(input, timezone) {
|
|
|
11
11
|
export {
|
|
12
12
|
startOfDay
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-L7X3FQZI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/startOfDay.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\nimport type { Timezone } from './types';\nimport { normalizeWithPlainDate } from './shared/normalizeWithPlainDate';\n\n/**\n * Returns a ZonedDateTime representing the first moment of the day (midnight).\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at 00:00:00.000000000\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00Z');\n * const start = startOfDay(instant);\n * // 2025-01-20T00:00:00+00:00[UTC]\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-01-20T15:30:00-05:00[America/New_York]');\n * const start = startOfDay(zoned);\n * // 2025-01-20T00:00:00-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (requires timezone)\n * const date = Temporal.PlainDate.from('2025-01-20');\n * const start = startOfDay(date, 'America/New_York');\n * // 2025-01-20T00:00:00-05:00[America/New_York]\n * ```\n */\nexport function startOfDay(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function startOfDay(
|
|
1
|
+
{"version":3,"sources":["../src/startOfDay.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\nimport type { Timezone } from './types';\nimport { normalizeWithPlainDate } from './shared/normalizeWithPlainDate';\n\n/**\n * Returns a ZonedDateTime representing the first moment of the day (midnight).\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at 00:00:00.000000000\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00Z');\n * const start = startOfDay(instant);\n * // 2025-01-20T00:00:00+00:00[UTC]\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-01-20T15:30:00-05:00[America/New_York]');\n * const start = startOfDay(zoned);\n * // 2025-01-20T00:00:00-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (requires timezone)\n * const date = Temporal.PlainDate.from('2025-01-20');\n * const start = startOfDay(date, 'America/New_York');\n * // 2025-01-20T00:00:00-05:00[America/New_York]\n * ```\n */\nexport function startOfDay(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function startOfDay(input: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;\nexport function startOfDay(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone\n): Temporal.ZonedDateTime {\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n return zonedDateTime.startOfDay();\n}\n"],"mappings":";;;;;AAsCO,SAAS,WACd,OACA,UACwB;AACxB,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,SAAO,cAAc,WAAW;AAClC;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compare
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DAWWOF5W.js";
|
|
4
4
|
|
|
5
5
|
// src/compareDesc.ts
|
|
6
6
|
function compareDesc(date1, date2) {
|
|
@@ -10,4 +10,4 @@ function compareDesc(date1, date2) {
|
|
|
10
10
|
export {
|
|
11
11
|
compareDesc
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-LJMPJUHN.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Temporal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-M4ESIRFH.js";
|
|
4
4
|
|
|
5
5
|
// src/today.ts
|
|
6
6
|
function today(timezone) {
|
|
@@ -10,4 +10,4 @@ function today(timezone) {
|
|
|
10
10
|
export {
|
|
11
11
|
today
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-LKDENGBC.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isInstant
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-M4ESIRFH.js";
|
|
4
4
|
|
|
5
5
|
// src/toIso9075.ts
|
|
6
6
|
function toIso9075(input, options = {}) {
|
|
@@ -30,4 +30,4 @@ function pad(n) {
|
|
|
30
30
|
export {
|
|
31
31
|
toIso9075
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-LL7XWZGU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/toIso9075.ts"],"sourcesContent":["import { type Temporal, isInstant } from './shared/temporal';\n\nexport type Iso9075Mode = 'utc' | 'local';\nexport type Iso9075Representation = 'complete' | 'date' | 'time';\n\nexport interface ToIso9075Options {\n /**\n * Which time to output.\n * - 'utc' (default): convert to UTC before formatting\n * - 'local': use the local time of the ZonedDateTime\n */\n mode?: Iso9075Mode;\n /**\n * What to include in the output.\n * - 'complete' (default): date and time (2019-09-18 19:00:52)\n * - 'date': date only (2019-09-18)\n * - 'time': time only (19:00:52)\n */\n representation?: Iso9075Representation;\n}\n\n/**\n * Convert a Temporal.Instant to an ISO 9075 (SQL) formatted string in UTC.\n */\nexport function toIso9075(\n input: Temporal.Instant,\n options?: Omit<ToIso9075Options, 'mode'>\n): string;\n\n/**\n * Convert a Temporal.ZonedDateTime to an ISO 9075 (SQL) formatted string.\n *\n * @param input - A Temporal.ZonedDateTime\n * @param options - Format options\n *\n * @example\n * ```typescript\n * const zoned = Temporal.ZonedDateTime.from(\"2025-01-20T15:00:00-05:00[America/New_York]\");\n *\n * toIso9075(zoned); // \"2025-01-20 20:00:00\" (UTC, default)\n * toIso9075(zoned, { mode: 'utc' }); // \"2025-01-20 20:00:00\"\n * toIso9075(zoned, { mode: 'local' }); // \"2025-01-20 15:00:00\"\n * toIso9075(zoned, { representation: 'date' }); // \"2025-01-20\"\n * toIso9075(zoned, { representation: 'time' }); // \"20:00:00\"\n * ```\n */\nexport function toIso9075(input: Temporal.ZonedDateTime, options?: ToIso9075Options): string;\n\nexport function toIso9075(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n options: ToIso9075Options = {}\n): string {\n const { mode = 'utc', representation = 'complete' } = options;\n\n let zdt: Temporal.ZonedDateTime;\n\n if (isInstant(input)) {\n zdt = input.toZonedDateTimeISO('UTC');\n } else {\n // ZonedDateTime: apply mode\n zdt = mode === 'utc' ? input.toInstant().toZonedDateTimeISO('UTC') : input;\n }\n\n const year = zdt.year;\n const month = zdt.month;\n const day = zdt.day;\n const hour = zdt.hour;\n const minute = zdt.minute;\n const second = zdt.second;\n\n const datePart = `${year}-${pad(month)}-${pad(day)}`;\n const timePart = `${pad(hour)}:${pad(minute)}:${pad(second)}`;\n\n if (representation === 'date') return datePart;\n if (representation === 'time') return timePart;\n return `${datePart} ${timePart}`;\n}\n\nfunction pad(n: number): string {\n return n.toString().padStart(2, '0');\n}\n"],"mappings":";;;;;AAgDO,SAAS,UACd,OACA,UAA4B,CAAC,GACrB;AACR,QAAM,EAAE,OAAO,OAAO,iBAAiB,WAAW,IAAI;AAEtD,MAAI;AAEJ,MAAI,UAAU,KAAK,GAAG;AACpB,UAAM,MAAM,mBAAmB,KAAK;AAAA,EACtC,OAAO;AAEL,UAAM,SAAS,QAAQ,MAAM,UAAU,EAAE,mBAAmB,KAAK,IAAI;AAAA,EACvE;AAEA,QAAM,OAAO,IAAI;AACjB,QAAM,QAAQ,IAAI;AAClB,QAAM,MAAM,IAAI;AAChB,QAAM,OAAO,IAAI;AACjB,QAAM,SAAS,IAAI;AACnB,QAAM,SAAS,IAAI;AAEnB,QAAM,WAAW,GAAG,IAAI,IAAI,IAAI,KAAK,CAAC,IAAI,IAAI,GAAG,CAAC;AAClD,QAAM,WAAW,GAAG,IAAI,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC;AAE3D,MAAI,mBAAmB,OAAQ,QAAO;AACtC,MAAI,mBAAmB,OAAQ,QAAO;AACtC,SAAO,GAAG,QAAQ,IAAI,QAAQ;AAChC;AAEA,SAAS,IAAI,GAAmB;AAC9B,SAAO,EAAE,SAAS,EAAE,SAAS,GAAG,GAAG;AACrC;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isDaysFromToday
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OZ5APQB7.js";
|
|
4
4
|
|
|
5
5
|
// src/isYesterday.ts
|
|
6
6
|
function isYesterday(date, timezone) {
|
|
@@ -10,4 +10,4 @@ function isYesterday(date, timezone) {
|
|
|
10
10
|
export {
|
|
11
11
|
isYesterday
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-LTYIPGQD.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/roundToNearestSecond.ts
|
|
6
6
|
var MODE_TO_ROUNDING_MODE = {
|
|
@@ -22,4 +22,4 @@ function roundToNearestSecond(input, options) {
|
|
|
22
22
|
export {
|
|
23
23
|
roundToNearestSecond
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-LXAT3CDM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/roundToNearestSecond.ts"],"sourcesContent":["import type { Temporal } from './shared/temporal';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\n\n/**\n * Options for rounding to nearest second.\n */\nexport interface RoundToNearestSecondOptions {\n /**\n * The rounding mode to use.\n *\n * Given time 14:37:42.300:\n * - `'round'` → 14:37:42 (300ms < 500, rounds DOWN to nearest)\n * - `'ceil'` → 14:37:43 (always rounds UP to next second)\n * - `'floor'` → 14:37:42 (always rounds DOWN to current second)\n *\n * Given time 14:37:42 with nearestTo: 10:\n * - `'round'` → 14:37:40 (42 is closer to 40 than 50)\n * - `'ceil'` → 14:37:50 (always rounds UP to next 10-sec mark)\n * - `'floor'` → 14:37:40 (always rounds DOWN to current 10-sec mark)\n *\n * @default 'round'\n */\n mode?: 'round' | 'ceil' | 'floor';\n /**\n * Round to the nearest N seconds. Must divide evenly into 60.\n * Valid values: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30\n * @example nearestTo: 10 rounds to 10-second marks (00, 10, 20, 30, 40, 50)\n */\n nearestTo?: 1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30;\n}\n\nconst MODE_TO_ROUNDING_MODE = {\n round: 'halfExpand',\n ceil: 'ceil',\n floor: 'floor'\n} as const;\n\n/**\n * Rounds a datetime to the nearest second boundary.\n *\n * ## Mode comparison (given 14:37:42.567)\n *\n * ```\n * :42 ─────────────────●─────────────── :43\n * .567\n *\n * 'round' → :43 (nearest second - 567ms >= 500)\n * 'ceil' → :43 (next second - always up)\n * 'floor' → :42 (current second - 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 second boundary\n *\n * @example\n * ```ts\n * const time = Temporal.ZonedDateTime.from('2025-01-20T14:37:42.567[America/New_York]');\n *\n * roundToNearestSecond(time); // → 14:37:43 (567ms >= 500)\n * roundToNearestSecond(time, { mode: 'ceil' }); // → 14:37:43 (always up)\n * roundToNearestSecond(time, { mode: 'floor' }); // → 14:37:42 (always down)\n * ```\n *\n * @example\n * ```ts\n * // 10-second intervals\n * const time = Temporal.ZonedDateTime.from('2025-01-20T14:37:42[America/New_York]');\n *\n * roundToNearestSecond(time, { nearestTo: 10 }); // → 14:37:40 (nearest)\n * roundToNearestSecond(time, { mode: 'ceil', nearestTo: 10 }); // → 14:37:50 (next 10s)\n * roundToNearestSecond(time, { mode: 'floor', nearestTo: 10 }); // → 14:37:40 (current 10s)\n * ```\n *\n * @example\n * ```ts\n * // Remove sub-second precision for logging\n * const logTime = Temporal.ZonedDateTime.from('2025-01-20T14:37:42.123456789[UTC]');\n * roundToNearestSecond(logTime, { mode: 'floor' });\n * // → 14:37:42.000000000 (clean timestamp)\n * ```\n */\nexport function roundToNearestSecond(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n options?: RoundToNearestSecondOptions\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: 'second',\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;AA+CO,SAAS,qBACd,OACA,SACwB;AACxB,QAAM,gBAAgB,uBAAuB,KAAK;AAClD,QAAM,OAAO,SAAS,QAAQ;AAC9B,QAAM,YAAY,SAAS,aAAa;AAExC,SAAO,cAAc,MAAM;AAAA,IACzB,cAAc;AAAA,IACd,cAAc,sBAAsB,IAAI;AAAA,IACxC,mBAAmB;AAAA,EACrB,CAAC;AACH;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addMonths
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-L535UIYN.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlainDate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-M4ESIRFH.js";
|
|
7
7
|
|
|
8
8
|
// src/subMonths.ts
|
|
9
9
|
function subMonths(input, months) {
|
|
@@ -13,4 +13,4 @@ function subMonths(input, months) {
|
|
|
13
13
|
export {
|
|
14
14
|
subMonths
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-LY7IXVZO.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/differenceInMicroseconds.ts
|
|
6
6
|
function differenceInMicroseconds(laterDate, earlierDate) {
|
|
@@ -13,4 +13,4 @@ function differenceInMicroseconds(laterDate, earlierDate) {
|
|
|
13
13
|
export {
|
|
14
14
|
differenceInMicroseconds
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-M2QFNUJF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/temporal.ts"],"sourcesContent":["import { Temporal as PolyfillTemporal } from '@js-temporal/polyfill';\n\n/**\n * @internal\n * Single source of the Temporal implementation.\n *\n * Shipping behavior is unchanged: production code always resolves to\n * `@js-temporal/polyfill`. Native-first was reverted because tiempo passes\n * caller-provided Temporal objects into methods that may require matching\n * implementations. Timeline comparisons use epoch nanoseconds; calendar differences bridge\n * implementations with canonical strings. Conversion and interval input boundaries are\n * audited as well. Runtime support and declaration migration still gate removal\n * of the bundled polyfill; constructor identity is not uniform across outputs.\n *\n * For tests only, `TIEMPO_TEMPORAL` selects the implementation so the same\n * suite runs against both the polyfill and the runtime's native `Temporal`:\n * - `TIEMPO_TEMPORAL=polyfill` forces the polyfill (any Node version).\n * - `TIEMPO_TEMPORAL=native` uses `globalThis.Temporal` (Node >= 26).\n * - unset defaults to the polyfill, matching shipped behavior.\n * Tests import `Temporal` from here so both lib and test objects come from the\n * same implementation. timelineInterop.test.ts separately covers native,\n * polyfill and mixed timeline inputs against both selections.\n *\n * Import `Temporal` from here so the implementation choice stays in one place.\n */\nconst useNative =\n typeof process !== 'undefined' &&\n process.env?.TIEMPO_TEMPORAL === 'native' &&\n 'Temporal' in globalThis;\n\nexport const Temporal = useNative\n ? (globalThis as unknown as { Temporal: typeof PolyfillTemporal }).Temporal\n : PolyfillTemporal;\n\n/**\n * @internal\n * Type-side of `Temporal`, merged with the runtime value above so a single\n * `import { Temporal } from './shared/temporal'` serves both `Temporal.from(...)`\n * (value) and `: Temporal.ZonedDateTime` (type). Types are identical across\n * implementations and erased at build, so they always come from the polyfill.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace Temporal {\n // Add new Temporal.* member types here the first time they are referenced\n // from this module. Omissions fail loudly at typecheck, never silently.\n export type Instant = PolyfillTemporal.Instant;\n export type ZonedDateTime = PolyfillTemporal.ZonedDateTime;\n export type PlainDate = PolyfillTemporal.PlainDate;\n export type PlainDateLike = PolyfillTemporal.PlainDateLike;\n export type PlainDateTime = PolyfillTemporal.PlainDateTime;\n export type PlainTime = PolyfillTemporal.PlainTime;\n export type PlainTimeLike = PolyfillTemporal.PlainTimeLike;\n export type PlainYearMonth = PolyfillTemporal.PlainYearMonth;\n}\n\n/**\n * @internal\n * Implementation-agnostic type guards. The Temporal spec requires every\n * implementation to set `Symbol.toStringTag`, so these work regardless of which\n * implementation produced the object.\n */\nfunction brand(value: unknown): string | undefined {\n return typeof value === 'object' && value !== null\n ? (value as { [Symbol.toStringTag]?: string })[Symbol.toStringTag]\n : undefined;\n}\n\nexport function isInstant(value: unknown): value is Temporal.Instant {\n return brand(value) === 'Temporal.Instant';\n}\n\nexport function isZonedDateTime(value: unknown): value is Temporal.ZonedDateTime {\n return brand(value) === 'Temporal.ZonedDateTime';\n}\n\nexport function isPlainDate(value: unknown): value is Temporal.PlainDate {\n return brand(value) === 'Temporal.PlainDate';\n}\n\nexport function isPlainTime(value: unknown): value is Temporal.PlainTime {\n return brand(value) === 'Temporal.PlainTime';\n}\n"],"mappings":";AAAA,SAAS,YAAY,wBAAwB;AAyB7C,IAAM,YACJ,OAAO,YAAY,eACnB,QAAQ,KAAK,oBAAoB,YACjC,cAAc;AAET,IAAM,WAAW,YACnB,WAAgE,WACjE;AA6BJ,SAAS,MAAM,OAAoC;AACjD,SAAO,OAAO,UAAU,YAAY,UAAU,OACzC,MAA4C,OAAO,WAAW,IAC/D;AACN;AAEO,SAAS,UAAU,OAA2C;AACnE,SAAO,MAAM,KAAK,MAAM;AAC1B;AAEO,SAAS,gBAAgB,OAAiD;AAC/E,SAAO,MAAM,KAAK,MAAM;AAC1B;AAEO,SAAS,YAAY,OAA6C;AACvE,SAAO,MAAM,KAAK,MAAM;AAC1B;AAEO,SAAS,YAAY,OAA6C;AACvE,SAAO,MAAM,KAAK,MAAM;AAC1B;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isDaysFromToday
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OZ5APQB7.js";
|
|
4
4
|
|
|
5
5
|
// src/isTomorrow.ts
|
|
6
6
|
function isTomorrow(date, timezone) {
|
|
@@ -10,4 +10,4 @@ function isTomorrow(date, timezone) {
|
|
|
10
10
|
export {
|
|
11
11
|
isTomorrow
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-MLD3VIOP.js.map
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
} from "./chunk-HH2HTC44.js";
|
|
4
4
|
import {
|
|
5
5
|
formatPlainDate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YN3Z5H5O.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeTemporalInput
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UTM7YAT4.js";
|
|
10
10
|
import {
|
|
11
11
|
isInstant,
|
|
12
12
|
isPlainDate
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-M4ESIRFH.js";
|
|
14
14
|
|
|
15
15
|
// src/format.ts
|
|
16
16
|
function format(input, formatStr, options = {}) {
|
|
@@ -247,4 +247,4 @@ function isAm(period) {
|
|
|
247
247
|
export {
|
|
248
248
|
format
|
|
249
249
|
};
|
|
250
|
-
//# sourceMappingURL=chunk-
|
|
250
|
+
//# sourceMappingURL=chunk-MPJ6UOLX.js.map
|