@gobrand/tiempo 2.10.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addQuarters.d.ts +9 -9
- package/dist/addQuarters.d.ts.map +1 -1
- package/dist/addQuarters.js +1 -1
- package/dist/browserTimezone.d.ts +1 -1
- package/dist/chunk-25CVKMFC.js +21 -0
- package/dist/chunk-25CVKMFC.js.map +1 -0
- package/dist/{chunk-SDJJP4HW.js → chunk-3TS3D7WD.js} +4 -1
- package/dist/chunk-3TS3D7WD.js.map +1 -0
- package/dist/chunk-5Y5JH32Z.js +16 -0
- package/dist/chunk-5Y5JH32Z.js.map +1 -0
- package/dist/{chunk-KN45BU3W.js → chunk-7OEGJCW7.js} +10 -3
- package/dist/chunk-7OEGJCW7.js.map +1 -0
- package/dist/{chunk-XMW72PNW.js → chunk-7SCQV77A.js} +7 -1
- package/dist/chunk-7SCQV77A.js.map +1 -0
- package/dist/{chunk-5CFWMIHL.js → chunk-BV32K227.js} +7 -1
- package/dist/chunk-BV32K227.js.map +1 -0
- package/dist/chunk-GR7322AQ.js +20 -0
- package/dist/chunk-GR7322AQ.js.map +1 -0
- package/dist/chunk-KPB5ENNM.js +25 -0
- package/dist/chunk-KPB5ENNM.js.map +1 -0
- package/dist/{chunk-PVOGE6ME.js → chunk-MTDZG4HK.js} +4 -1
- package/dist/chunk-MTDZG4HK.js.map +1 -0
- package/dist/{chunk-SPK7C7RP.js → chunk-OSBVYUOQ.js} +13 -3
- package/dist/chunk-OSBVYUOQ.js.map +1 -0
- package/dist/{chunk-TGINH5JV.js → chunk-OVSCDXYN.js} +7 -1
- package/dist/chunk-OVSCDXYN.js.map +1 -0
- package/dist/{chunk-7HUJC5M6.js → chunk-S7L5KBI4.js} +4 -4
- package/dist/chunk-UQ2F3I2S.js +19 -0
- package/dist/chunk-UQ2F3I2S.js.map +1 -0
- package/dist/{chunk-RXTGHEHQ.js → chunk-VQAGV72H.js} +7 -6
- package/dist/chunk-VQAGV72H.js.map +1 -0
- package/dist/{chunk-VCWP3CZE.js → chunk-YNLBS34B.js} +9 -3
- package/dist/chunk-YNLBS34B.js.map +1 -0
- package/dist/chunk-YRCFMGBH.js +54 -0
- package/dist/chunk-YRCFMGBH.js.map +1 -0
- package/dist/differenceInDays.d.ts +2 -2
- package/dist/differenceInHours.d.ts +2 -2
- package/dist/differenceInMicroseconds.d.ts +1 -1
- package/dist/differenceInMilliseconds.d.ts +1 -1
- package/dist/differenceInMinutes.d.ts +2 -2
- package/dist/differenceInMonths.d.ts +2 -2
- package/dist/differenceInNanoseconds.d.ts +1 -1
- package/dist/differenceInQuarters.d.ts +13 -17
- package/dist/differenceInQuarters.d.ts.map +1 -1
- package/dist/differenceInQuarters.js +1 -1
- package/dist/differenceInSeconds.d.ts +2 -2
- package/dist/differenceInWeeks.d.ts +2 -2
- package/dist/differenceInYears.d.ts +2 -2
- package/dist/eachDayOfInterval.d.ts +1 -1
- package/dist/eachHourOfInterval.d.ts +1 -1
- package/dist/eachMinuteOfInterval.d.ts +1 -1
- package/dist/eachMonthOfInterval.d.ts +1 -1
- package/dist/eachQuarterOfInterval.d.ts +23 -27
- package/dist/eachQuarterOfInterval.d.ts.map +1 -1
- package/dist/eachQuarterOfInterval.js +1 -1
- package/dist/eachWeekOfInterval.d.ts +1 -1
- package/dist/eachYearOfInterval.d.ts +1 -1
- package/dist/endOfDay.d.ts +2 -2
- package/dist/endOfDay.js +2 -2
- package/dist/endOfMonth.d.ts +14 -4
- package/dist/endOfMonth.d.ts.map +1 -1
- package/dist/endOfMonth.js +2 -2
- package/dist/endOfQuarter.d.ts +3 -2
- package/dist/endOfQuarter.d.ts.map +1 -1
- package/dist/endOfQuarter.js +2 -2
- package/dist/endOfWeek.d.ts +13 -3
- package/dist/endOfWeek.d.ts.map +1 -1
- package/dist/endOfWeek.js +1 -1
- package/dist/endOfYear.d.ts +14 -4
- package/dist/endOfYear.d.ts.map +1 -1
- package/dist/endOfYear.js +2 -2
- package/dist/format.d.ts +1 -1
- package/dist/formatPlainDate.d.ts +1 -1
- package/dist/getQuarter.d.ts +8 -25
- package/dist/getQuarter.d.ts.map +1 -1
- package/dist/getQuarter.js +1 -3
- package/dist/index.d.ts +92 -92
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -23
- package/dist/isAfter.d.ts +1 -1
- package/dist/isBefore.d.ts +1 -1
- package/dist/isPlainDateAfter.d.ts +1 -1
- package/dist/isPlainDateBefore.d.ts +1 -1
- package/dist/isPlainDateEqual.d.ts +1 -1
- package/dist/isPlainTimeAfter.d.ts +1 -1
- package/dist/isPlainTimeBefore.d.ts +1 -1
- package/dist/isPlainTimeEqual.d.ts +1 -1
- package/dist/isSameDay.d.ts +1 -1
- package/dist/isSameQuarter.d.ts +12 -23
- package/dist/isSameQuarter.d.ts.map +1 -1
- package/dist/isSameQuarter.js +1 -1
- package/dist/isWithinInterval.d.ts +1 -1
- package/dist/now.d.ts +2 -2
- package/dist/shared/differenceInMilliseconds.d.ts +1 -1
- package/dist/shared/isAfter.d.ts +1 -1
- package/dist/shared/isBefore.d.ts +1 -1
- package/dist/shared/normalizeWithPlainDate.d.ts +1 -1
- package/dist/shared/nowZoned.d.ts +1 -1
- package/dist/shared/plainDateToZonedDateTime.d.ts +2 -2
- package/dist/shared/temporal.d.ts +1 -1
- package/dist/simpleFormat.d.ts +2 -2
- package/dist/startOfDay.d.ts +2 -2
- package/dist/startOfMonth.d.ts +14 -4
- package/dist/startOfMonth.d.ts.map +1 -1
- package/dist/startOfMonth.js +1 -1
- package/dist/startOfQuarter.d.ts +3 -2
- package/dist/startOfQuarter.d.ts.map +1 -1
- package/dist/startOfQuarter.js +1 -1
- package/dist/startOfWeek.d.ts +13 -3
- package/dist/startOfWeek.d.ts.map +1 -1
- package/dist/startOfWeek.js +1 -1
- package/dist/startOfYear.d.ts +14 -4
- package/dist/startOfYear.d.ts.map +1 -1
- package/dist/startOfYear.js +1 -1
- package/dist/subQuarters.d.ts +12 -5
- package/dist/subQuarters.d.ts.map +1 -1
- package/dist/subQuarters.js +2 -2
- package/dist/toInstant.d.ts +27 -0
- package/dist/toInstant.d.ts.map +1 -0
- package/dist/toInstant.js +8 -0
- package/dist/toPlainDate.d.ts +2 -2
- package/dist/toPlainTime.d.ts +2 -2
- package/dist/toZonedTime.d.ts +2 -2
- package/dist/today.d.ts +2 -2
- package/dist/types.d.ts +1 -1
- package/package.json +5 -3
- package/dist/addDays.test.d.ts +0 -2
- package/dist/addDays.test.d.ts.map +0 -1
- package/dist/addHours.test.d.ts +0 -2
- package/dist/addHours.test.d.ts.map +0 -1
- package/dist/addMicroseconds.test.d.ts +0 -2
- package/dist/addMicroseconds.test.d.ts.map +0 -1
- package/dist/addMilliseconds.test.d.ts +0 -2
- package/dist/addMilliseconds.test.d.ts.map +0 -1
- package/dist/addMinutes.test.d.ts +0 -2
- package/dist/addMinutes.test.d.ts.map +0 -1
- package/dist/addMonths.test.d.ts +0 -2
- package/dist/addMonths.test.d.ts.map +0 -1
- package/dist/addNanoseconds.test.d.ts +0 -2
- package/dist/addNanoseconds.test.d.ts.map +0 -1
- package/dist/addQuarters.test.d.ts +0 -2
- package/dist/addQuarters.test.d.ts.map +0 -1
- package/dist/addSeconds.test.d.ts +0 -2
- package/dist/addSeconds.test.d.ts.map +0 -1
- package/dist/addWeeks.test.d.ts +0 -2
- package/dist/addWeeks.test.d.ts.map +0 -1
- package/dist/addYears.test.d.ts +0 -2
- package/dist/addYears.test.d.ts.map +0 -1
- package/dist/browserTimezone.test.d.ts +0 -2
- package/dist/browserTimezone.test.d.ts.map +0 -1
- package/dist/chunk-5CFWMIHL.js.map +0 -1
- package/dist/chunk-6UBZ5YB3.js +0 -43
- package/dist/chunk-6UBZ5YB3.js.map +0 -1
- package/dist/chunk-FYZNOTX3.js +0 -18
- package/dist/chunk-FYZNOTX3.js.map +0 -1
- package/dist/chunk-KN45BU3W.js.map +0 -1
- package/dist/chunk-NOV3D7OM.js +0 -17
- package/dist/chunk-NOV3D7OM.js.map +0 -1
- package/dist/chunk-PVOGE6ME.js.map +0 -1
- package/dist/chunk-RXTGHEHQ.js.map +0 -1
- package/dist/chunk-SDJJP4HW.js.map +0 -1
- package/dist/chunk-SPK7C7RP.js.map +0 -1
- package/dist/chunk-TGINH5JV.js.map +0 -1
- package/dist/chunk-VCWP3CZE.js.map +0 -1
- package/dist/chunk-VUKOSQWW.js +0 -14
- package/dist/chunk-VUKOSQWW.js.map +0 -1
- package/dist/chunk-W5YDBBNF.js +0 -13
- package/dist/chunk-W5YDBBNF.js.map +0 -1
- package/dist/chunk-XMW72PNW.js.map +0 -1
- package/dist/chunk-ZEL6JBBH.js +0 -14
- package/dist/chunk-ZEL6JBBH.js.map +0 -1
- package/dist/differenceInDays.test.d.ts +0 -2
- package/dist/differenceInDays.test.d.ts.map +0 -1
- package/dist/differenceInHours.test.d.ts +0 -2
- package/dist/differenceInHours.test.d.ts.map +0 -1
- package/dist/differenceInMicroseconds.test.d.ts +0 -2
- package/dist/differenceInMicroseconds.test.d.ts.map +0 -1
- package/dist/differenceInMilliseconds.test.d.ts +0 -2
- package/dist/differenceInMilliseconds.test.d.ts.map +0 -1
- package/dist/differenceInMinutes.test.d.ts +0 -2
- package/dist/differenceInMinutes.test.d.ts.map +0 -1
- package/dist/differenceInMonths.test.d.ts +0 -2
- package/dist/differenceInMonths.test.d.ts.map +0 -1
- package/dist/differenceInNanoseconds.test.d.ts +0 -2
- package/dist/differenceInNanoseconds.test.d.ts.map +0 -1
- package/dist/differenceInQuarters.test.d.ts +0 -2
- package/dist/differenceInQuarters.test.d.ts.map +0 -1
- package/dist/differenceInSeconds.test.d.ts +0 -2
- package/dist/differenceInSeconds.test.d.ts.map +0 -1
- package/dist/differenceInWeeks.test.d.ts +0 -2
- package/dist/differenceInWeeks.test.d.ts.map +0 -1
- package/dist/differenceInYears.test.d.ts +0 -2
- package/dist/differenceInYears.test.d.ts.map +0 -1
- package/dist/eachDayOfInterval.test.d.ts +0 -2
- package/dist/eachDayOfInterval.test.d.ts.map +0 -1
- package/dist/eachHourOfInterval.test.d.ts +0 -2
- package/dist/eachHourOfInterval.test.d.ts.map +0 -1
- package/dist/eachMinuteOfInterval.test.d.ts +0 -2
- package/dist/eachMinuteOfInterval.test.d.ts.map +0 -1
- package/dist/eachMonthOfInterval.test.d.ts +0 -2
- package/dist/eachMonthOfInterval.test.d.ts.map +0 -1
- package/dist/eachQuarterOfInterval.test.d.ts +0 -2
- package/dist/eachQuarterOfInterval.test.d.ts.map +0 -1
- package/dist/eachWeekOfInterval.test.d.ts +0 -2
- package/dist/eachWeekOfInterval.test.d.ts.map +0 -1
- package/dist/eachYearOfInterval.test.d.ts +0 -2
- package/dist/eachYearOfInterval.test.d.ts.map +0 -1
- package/dist/endOfDay.test.d.ts +0 -2
- package/dist/endOfDay.test.d.ts.map +0 -1
- package/dist/endOfMonth.test.d.ts +0 -2
- package/dist/endOfMonth.test.d.ts.map +0 -1
- package/dist/endOfQuarter.test.d.ts +0 -2
- package/dist/endOfQuarter.test.d.ts.map +0 -1
- package/dist/endOfWeek.test.d.ts +0 -2
- package/dist/endOfWeek.test.d.ts.map +0 -1
- package/dist/endOfYear.test.d.ts +0 -2
- package/dist/endOfYear.test.d.ts.map +0 -1
- package/dist/format.test.d.ts +0 -2
- package/dist/format.test.d.ts.map +0 -1
- package/dist/formatPlainDate.test.d.ts +0 -2
- package/dist/formatPlainDate.test.d.ts.map +0 -1
- package/dist/getQuarter.test.d.ts +0 -2
- package/dist/getQuarter.test.d.ts.map +0 -1
- package/dist/index.test.d.ts +0 -2
- package/dist/index.test.d.ts.map +0 -1
- package/dist/intlFormatDistance.test.d.ts +0 -2
- package/dist/intlFormatDistance.test.d.ts.map +0 -1
- package/dist/isAfter.test.d.ts +0 -2
- package/dist/isAfter.test.d.ts.map +0 -1
- package/dist/isBefore.test.d.ts +0 -2
- package/dist/isBefore.test.d.ts.map +0 -1
- package/dist/isFuture.test.d.ts +0 -2
- package/dist/isFuture.test.d.ts.map +0 -1
- package/dist/isPast.test.d.ts +0 -2
- package/dist/isPast.test.d.ts.map +0 -1
- package/dist/isPlainDateAfter.test.d.ts +0 -2
- package/dist/isPlainDateAfter.test.d.ts.map +0 -1
- package/dist/isPlainDateBefore.test.d.ts +0 -2
- package/dist/isPlainDateBefore.test.d.ts.map +0 -1
- package/dist/isPlainDateEqual.test.d.ts +0 -2
- package/dist/isPlainDateEqual.test.d.ts.map +0 -1
- package/dist/isPlainTimeAfter.test.d.ts +0 -2
- package/dist/isPlainTimeAfter.test.d.ts.map +0 -1
- package/dist/isPlainTimeBefore.test.d.ts +0 -2
- package/dist/isPlainTimeBefore.test.d.ts.map +0 -1
- package/dist/isPlainTimeEqual.test.d.ts +0 -2
- package/dist/isPlainTimeEqual.test.d.ts.map +0 -1
- package/dist/isSameDay.test.d.ts +0 -2
- package/dist/isSameDay.test.d.ts.map +0 -1
- package/dist/isSameHour.test.d.ts +0 -2
- package/dist/isSameHour.test.d.ts.map +0 -1
- package/dist/isSameMicrosecond.test.d.ts +0 -2
- package/dist/isSameMicrosecond.test.d.ts.map +0 -1
- package/dist/isSameMillisecond.test.d.ts +0 -2
- package/dist/isSameMillisecond.test.d.ts.map +0 -1
- package/dist/isSameMinute.test.d.ts +0 -2
- package/dist/isSameMinute.test.d.ts.map +0 -1
- package/dist/isSameMonth.test.d.ts +0 -2
- package/dist/isSameMonth.test.d.ts.map +0 -1
- package/dist/isSameNanosecond.test.d.ts +0 -2
- package/dist/isSameNanosecond.test.d.ts.map +0 -1
- package/dist/isSameQuarter.test.d.ts +0 -2
- package/dist/isSameQuarter.test.d.ts.map +0 -1
- package/dist/isSameSecond.test.d.ts +0 -2
- package/dist/isSameSecond.test.d.ts.map +0 -1
- package/dist/isSameWeek.test.d.ts +0 -2
- package/dist/isSameWeek.test.d.ts.map +0 -1
- package/dist/isSameYear.test.d.ts +0 -2
- package/dist/isSameYear.test.d.ts.map +0 -1
- package/dist/isWithinInterval.test.d.ts +0 -2
- package/dist/isWithinInterval.test.d.ts.map +0 -1
- package/dist/now.test.d.ts +0 -2
- package/dist/now.test.d.ts.map +0 -1
- package/dist/roundToNearestHour.test.d.ts +0 -2
- package/dist/roundToNearestHour.test.d.ts.map +0 -1
- package/dist/roundToNearestMinute.test.d.ts +0 -2
- package/dist/roundToNearestMinute.test.d.ts.map +0 -1
- package/dist/roundToNearestSecond.test.d.ts +0 -2
- package/dist/roundToNearestSecond.test.d.ts.map +0 -1
- package/dist/shared/temporal.test.d.ts +0 -2
- package/dist/shared/temporal.test.d.ts.map +0 -1
- package/dist/simpleFormat.test.d.ts +0 -2
- package/dist/simpleFormat.test.d.ts.map +0 -1
- package/dist/startOfDay.test.d.ts +0 -2
- package/dist/startOfDay.test.d.ts.map +0 -1
- package/dist/startOfMonth.test.d.ts +0 -2
- package/dist/startOfMonth.test.d.ts.map +0 -1
- package/dist/startOfQuarter.test.d.ts +0 -2
- package/dist/startOfQuarter.test.d.ts.map +0 -1
- package/dist/startOfWeek.test.d.ts +0 -2
- package/dist/startOfWeek.test.d.ts.map +0 -1
- package/dist/startOfYear.test.d.ts +0 -2
- package/dist/startOfYear.test.d.ts.map +0 -1
- package/dist/subDays.test.d.ts +0 -2
- package/dist/subDays.test.d.ts.map +0 -1
- package/dist/subHours.test.d.ts +0 -2
- package/dist/subHours.test.d.ts.map +0 -1
- package/dist/subMicroseconds.test.d.ts +0 -2
- package/dist/subMicroseconds.test.d.ts.map +0 -1
- package/dist/subMilliseconds.test.d.ts +0 -2
- package/dist/subMilliseconds.test.d.ts.map +0 -1
- package/dist/subMinutes.test.d.ts +0 -2
- package/dist/subMinutes.test.d.ts.map +0 -1
- package/dist/subMonths.test.d.ts +0 -2
- package/dist/subMonths.test.d.ts.map +0 -1
- package/dist/subNanoseconds.test.d.ts +0 -2
- package/dist/subNanoseconds.test.d.ts.map +0 -1
- package/dist/subQuarters.test.d.ts +0 -2
- package/dist/subQuarters.test.d.ts.map +0 -1
- package/dist/subSeconds.test.d.ts +0 -2
- package/dist/subSeconds.test.d.ts.map +0 -1
- package/dist/subWeeks.test.d.ts +0 -2
- package/dist/subWeeks.test.d.ts.map +0 -1
- package/dist/subYears.test.d.ts +0 -2
- package/dist/subYears.test.d.ts.map +0 -1
- package/dist/toDate.test.d.ts +0 -2
- package/dist/toDate.test.d.ts.map +0 -1
- package/dist/toIso.test.d.ts +0 -2
- package/dist/toIso.test.d.ts.map +0 -1
- package/dist/toIso9075.test.d.ts +0 -2
- package/dist/toIso9075.test.d.ts.map +0 -1
- package/dist/toPlainDate.test.d.ts +0 -2
- package/dist/toPlainDate.test.d.ts.map +0 -1
- package/dist/toPlainTime.test.d.ts +0 -2
- package/dist/toPlainTime.test.d.ts.map +0 -1
- package/dist/toUtc.d.ts +0 -27
- package/dist/toUtc.d.ts.map +0 -1
- package/dist/toUtc.js +0 -8
- package/dist/toUtc.test.d.ts +0 -2
- package/dist/toUtc.test.d.ts.map +0 -1
- package/dist/toZonedTime.test.d.ts +0 -2
- package/dist/toZonedTime.test.d.ts.map +0 -1
- package/dist/today.test.d.ts +0 -2
- package/dist/today.test.d.ts.map +0 -1
- /package/dist/{chunk-7HUJC5M6.js.map → chunk-S7L5KBI4.js.map} +0 -0
- /package/dist/{toUtc.js.map → toInstant.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Temporal } from './shared/temporal';
|
|
2
|
-
import type { DifferenceOptions } from './shared/differenceOptions';
|
|
1
|
+
import { Temporal } from './shared/temporal.js';
|
|
2
|
+
import type { DifferenceOptions } from './shared/differenceOptions.js';
|
|
3
3
|
/**
|
|
4
4
|
* Returns the number of minutes between two datetimes.
|
|
5
5
|
* The result is positive if laterDate is after earlierDate, negative if before.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Temporal } from './shared/temporal';
|
|
2
|
-
import type { DifferenceOptions } from './shared/differenceOptions';
|
|
1
|
+
import { Temporal } from './shared/temporal.js';
|
|
2
|
+
import type { DifferenceOptions } from './shared/differenceOptions.js';
|
|
3
3
|
/**
|
|
4
4
|
* Returns the number of months between two datetimes.
|
|
5
5
|
* The result is positive if laterDate is after earlierDate, negative if before.
|
|
@@ -1,37 +1,33 @@
|
|
|
1
1
|
import type { Temporal } from "@js-temporal/polyfill";
|
|
2
|
-
import type { DifferenceOptions } from "./shared/differenceOptions";
|
|
2
|
+
import type { DifferenceOptions } from "./shared/differenceOptions.js";
|
|
3
3
|
/**
|
|
4
|
-
* Returns the number of quarters (3-month blocks) between two datetimes.
|
|
4
|
+
* Returns the number of quarters (3-month blocks) between two datetimes or dates.
|
|
5
5
|
* The result is positive if laterDate is after earlierDate, negative if before.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Uses calendar-aware, elapsed-time calculation (a quarter is three months).
|
|
8
|
+
* Instant inputs are converted to UTC; ZonedDateTime inputs keep their timezone.
|
|
9
|
+
* PlainDate inputs are compared directly — no timezone needed.
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* @param laterDate - The later datetime (Instant or ZonedDateTime)
|
|
14
|
-
* @param earlierDate - The earlier datetime (Instant or ZonedDateTime)
|
|
11
|
+
* @param laterDate - The later Instant or ZonedDateTime
|
|
12
|
+
* @param earlierDate - The earlier Instant or ZonedDateTime
|
|
15
13
|
* @param options - Optional { fractional } to return the precise value
|
|
16
|
-
* @returns The number of quarters
|
|
14
|
+
* @returns The number of quarters, truncated toward zero (pass { fractional: true } for the precise value)
|
|
17
15
|
*
|
|
18
16
|
* @example
|
|
19
17
|
* ```ts
|
|
20
18
|
* const later = Temporal.Instant.from('2025-07-20T12:00:00Z');
|
|
21
19
|
* const earlier = Temporal.Instant.from('2025-01-20T12:00:00Z');
|
|
22
|
-
*
|
|
23
20
|
* differenceInQuarters(later, earlier); // 2
|
|
24
21
|
* ```
|
|
25
22
|
*
|
|
26
23
|
* @example
|
|
27
24
|
* ```ts
|
|
28
|
-
* //
|
|
29
|
-
* const later = Temporal.
|
|
30
|
-
* const earlier = Temporal.
|
|
31
|
-
*
|
|
32
|
-
* differenceInQuarters(later, earlier); // 0
|
|
33
|
-
* differenceInQuarters(later, earlier, { fractional: true }); // ~0.67
|
|
25
|
+
* // PlainDate comparison needs no timezone
|
|
26
|
+
* const later = Temporal.PlainDate.from('2025-07-20');
|
|
27
|
+
* const earlier = Temporal.PlainDate.from('2025-01-20');
|
|
28
|
+
* differenceInQuarters(later, earlier); // 2
|
|
34
29
|
* ```
|
|
35
30
|
*/
|
|
36
31
|
export declare function differenceInQuarters(laterDate: Temporal.Instant | Temporal.ZonedDateTime, earlierDate: Temporal.Instant | Temporal.ZonedDateTime, options?: DifferenceOptions): number;
|
|
32
|
+
export declare function differenceInQuarters(laterDate: Temporal.PlainDate, earlierDate: Temporal.PlainDate, options?: DifferenceOptions): number;
|
|
37
33
|
//# sourceMappingURL=differenceInQuarters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"differenceInQuarters.d.ts","sourceRoot":"","sources":["../src/differenceInQuarters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"differenceInQuarters.d.ts","sourceRoot":"","sources":["../src/differenceInQuarters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,oBAAoB,CAClC,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;AACV,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,QAAQ,CAAC,SAAS,EAC7B,WAAW,EAAE,QAAQ,CAAC,SAAS,EAC/B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,MAAM,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Temporal } from './shared/temporal';
|
|
2
|
-
import type { DifferenceOptions } from './shared/differenceOptions';
|
|
1
|
+
import { Temporal } from './shared/temporal.js';
|
|
2
|
+
import type { DifferenceOptions } from './shared/differenceOptions.js';
|
|
3
3
|
/**
|
|
4
4
|
* Returns the number of seconds between two datetimes.
|
|
5
5
|
* The result is positive if laterDate is after earlierDate, negative if before.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Temporal } from './shared/temporal';
|
|
2
|
-
import type { DifferenceOptions } from './shared/differenceOptions';
|
|
1
|
+
import { Temporal } from './shared/temporal.js';
|
|
2
|
+
import type { DifferenceOptions } from './shared/differenceOptions.js';
|
|
3
3
|
/**
|
|
4
4
|
* Returns the number of weeks between two datetimes.
|
|
5
5
|
* The result is positive if laterDate is after earlierDate, negative if before.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Temporal } from './shared/temporal';
|
|
2
|
-
import type { DifferenceOptions } from './shared/differenceOptions';
|
|
1
|
+
import { Temporal } from './shared/temporal.js';
|
|
2
|
+
import type { DifferenceOptions } from './shared/differenceOptions.js';
|
|
3
3
|
/**
|
|
4
4
|
* Returns the number of years between two datetimes.
|
|
5
5
|
* The result is positive if laterDate is after earlierDate, negative if before.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Temporal } from './shared/temporal';
|
|
1
|
+
import { Temporal } from './shared/temporal.js';
|
|
2
2
|
/**
|
|
3
3
|
* Returns an array of ZonedDateTime objects for each calendar day within the interval.
|
|
4
4
|
* Each element represents the start of day (midnight) in the timezone of the interval start.
|
|
@@ -1,47 +1,43 @@
|
|
|
1
|
-
import { Temporal } from "./shared/temporal";
|
|
1
|
+
import { Temporal } from "./shared/temporal.js";
|
|
2
2
|
/**
|
|
3
|
-
* Returns an array
|
|
4
|
-
*
|
|
5
|
-
* starting month at midnight). The interval is inclusive of both start and end quarters.
|
|
3
|
+
* Returns an array with the start of each quarter within the interval, inclusive
|
|
4
|
+
* of both the start and end quarters.
|
|
6
5
|
*
|
|
7
|
-
* Quarters: Q1 = Jan–Mar, Q2 = Apr–Jun, Q3 = Jul–Sep, Q4 = Oct–Dec.
|
|
6
|
+
* Quarters: Q1 = Jan–Mar, Q2 = Apr–Jun, Q3 = Jul–Sep, Q4 = Oct–Dec. Each element
|
|
7
|
+
* is the first moment of the quarter (1st day of the quarter's starting month at
|
|
8
|
+
* midnight) for Instant/ZonedDateTime inputs, or the first day as a PlainDate for
|
|
9
|
+
* PlainDate inputs.
|
|
8
10
|
*
|
|
9
|
-
* For Instant inputs, UTC is used
|
|
10
|
-
*
|
|
11
|
+
* For Instant inputs, UTC is used. For ZonedDateTime inputs, the timezone of the
|
|
12
|
+
* start date is preserved. PlainDate inputs need no timezone and return PlainDate[].
|
|
11
13
|
*
|
|
12
|
-
* @param interval - The interval with start and end
|
|
13
|
-
* @returns Array of ZonedDateTime at start of each quarter
|
|
14
|
+
* @param interval - The interval with start and end
|
|
15
|
+
* @returns Array of ZonedDateTime (or PlainDate) at the start of each quarter
|
|
14
16
|
*
|
|
15
17
|
* @example
|
|
16
18
|
* ```ts
|
|
17
19
|
* const start = Temporal.ZonedDateTime.from('2025-02-15T10:00:00Z[UTC]');
|
|
18
20
|
* const end = Temporal.ZonedDateTime.from('2025-11-20T14:00:00Z[UTC]');
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* // [
|
|
22
|
-
* // 2025-01-01T00:00:00Z[UTC], // Q1
|
|
23
|
-
* // 2025-04-01T00:00:00Z[UTC], // Q2
|
|
24
|
-
* // 2025-07-01T00:00:00Z[UTC], // Q3
|
|
25
|
-
* // 2025-10-01T00:00:00Z[UTC] // Q4
|
|
26
|
-
* // ]
|
|
21
|
+
* eachQuarterOfInterval({ start, end });
|
|
22
|
+
* // [2025-01-01…, 2025-04-01…, 2025-07-01…, 2025-10-01…]
|
|
27
23
|
* ```
|
|
28
24
|
*
|
|
29
25
|
* @example
|
|
30
26
|
* ```ts
|
|
31
|
-
* //
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* // [
|
|
37
|
-
* // 2024-10-01T00:00:00Z[UTC], // Q4 2024
|
|
38
|
-
* // 2025-01-01T00:00:00Z[UTC], // Q1 2025
|
|
39
|
-
* // 2025-04-01T00:00:00Z[UTC] // Q2 2025
|
|
40
|
-
* // ]
|
|
27
|
+
* // PlainDate interval returns PlainDate quarter starts (no timezone)
|
|
28
|
+
* eachQuarterOfInterval({
|
|
29
|
+
* start: Temporal.PlainDate.from('2025-02-15'),
|
|
30
|
+
* end: Temporal.PlainDate.from('2025-08-20'),
|
|
31
|
+
* });
|
|
32
|
+
* // [2025-01-01, 2025-04-01, 2025-07-01]
|
|
41
33
|
* ```
|
|
42
34
|
*/
|
|
43
35
|
export declare function eachQuarterOfInterval(interval: {
|
|
44
36
|
start: Temporal.Instant | Temporal.ZonedDateTime;
|
|
45
37
|
end: Temporal.Instant | Temporal.ZonedDateTime;
|
|
46
38
|
}): Temporal.ZonedDateTime[];
|
|
39
|
+
export declare function eachQuarterOfInterval(interval: {
|
|
40
|
+
start: Temporal.PlainDate;
|
|
41
|
+
end: Temporal.PlainDate;
|
|
42
|
+
}): Temporal.PlainDate[];
|
|
47
43
|
//# sourceMappingURL=eachQuarterOfInterval.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eachQuarterOfInterval.d.ts","sourceRoot":"","sources":["../src/eachQuarterOfInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"eachQuarterOfInterval.d.ts","sourceRoot":"","sources":["../src/eachQuarterOfInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAK7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE;IAC9C,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC;IACjD,GAAG,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC;CAChD,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC;AAC7B,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE;IAC9C,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC1B,GAAG,EAAE,QAAQ,CAAC,SAAS,CAAC;CACzB,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC"}
|
package/dist/endOfDay.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Temporal } from './shared/temporal';
|
|
2
|
-
import type { Timezone } from './types';
|
|
1
|
+
import { Temporal } from './shared/temporal.js';
|
|
2
|
+
import type { Timezone } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Returns a ZonedDateTime representing the last nanosecond of the day.
|
|
5
5
|
*
|
package/dist/endOfDay.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
endOfDay
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-AVGNRINZ.js";
|
|
3
|
+
} from "./chunk-S7L5KBI4.js";
|
|
5
4
|
import "./chunk-ZOHYNJUD.js";
|
|
5
|
+
import "./chunk-AVGNRINZ.js";
|
|
6
6
|
import "./chunk-L5AMAEWX.js";
|
|
7
7
|
import "./chunk-NTMT5XGC.js";
|
|
8
8
|
import "./chunk-R7ZCA6AQ.js";
|
package/dist/endOfMonth.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Temporal } from './shared/temporal';
|
|
2
|
-
import type { Timezone } from './types';
|
|
1
|
+
import { Temporal } from './shared/temporal.js';
|
|
2
|
+
import type { Timezone } from './types.js';
|
|
3
3
|
/**
|
|
4
|
-
* Returns
|
|
4
|
+
* Returns the last boundary of the month.
|
|
5
|
+
* PlainDate inputs stay in calendar space unless a timezone is provided.
|
|
5
6
|
*
|
|
6
7
|
* @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime
|
|
7
8
|
* @returns ZonedDateTime at the last day of the month at 23:59:59.999999999
|
|
@@ -24,12 +25,21 @@ import type { Timezone } from './types';
|
|
|
24
25
|
*
|
|
25
26
|
* @example
|
|
26
27
|
* ```ts
|
|
27
|
-
* // From PlainDate (
|
|
28
|
+
* // From PlainDate (stays a date)
|
|
29
|
+
* const date = Temporal.PlainDate.from('2025-02-15');
|
|
30
|
+
* const end = endOfMonth(date);
|
|
31
|
+
* // 2025-02-28
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* // From PlainDate with a timezone (returns a ZonedDateTime)
|
|
28
37
|
* const date = Temporal.PlainDate.from('2025-02-15');
|
|
29
38
|
* const end = endOfMonth(date, 'America/New_York');
|
|
30
39
|
* // 2025-02-28T23:59:59.999999999-05:00[America/New_York]
|
|
31
40
|
* ```
|
|
32
41
|
*/
|
|
33
42
|
export declare function endOfMonth(input: Temporal.Instant | Temporal.ZonedDateTime): Temporal.ZonedDateTime;
|
|
43
|
+
export declare function endOfMonth(input: Temporal.PlainDate): Temporal.PlainDate;
|
|
34
44
|
export declare function endOfMonth(input: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;
|
|
35
45
|
//# sourceMappingURL=endOfMonth.d.ts.map
|
package/dist/endOfMonth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endOfMonth.d.ts","sourceRoot":"","sources":["../src/endOfMonth.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"endOfMonth.d.ts","sourceRoot":"","sources":["../src/endOfMonth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,QAAQ,CAAC,aAAa,CAAC;AAC1B,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;AAC1E,wBAAgB,UAAU,CACxB,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,aAAa,CAAC"}
|
package/dist/endOfMonth.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
endOfMonth
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-AVGNRINZ.js";
|
|
3
|
+
} from "./chunk-YNLBS34B.js";
|
|
5
4
|
import "./chunk-ZOHYNJUD.js";
|
|
5
|
+
import "./chunk-AVGNRINZ.js";
|
|
6
6
|
import "./chunk-L5AMAEWX.js";
|
|
7
7
|
import "./chunk-NTMT5XGC.js";
|
|
8
8
|
import "./chunk-R7ZCA6AQ.js";
|
package/dist/endOfQuarter.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Temporal } from "
|
|
2
|
-
import type { Timezone } from "./types";
|
|
1
|
+
import type { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import type { Timezone } from "./types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Returns a ZonedDateTime representing the last moment of the quarter
|
|
5
5
|
* (last day of the quarter's ending month at 23:59:59.999999999).
|
|
@@ -34,5 +34,6 @@ import type { Timezone } from "./types";
|
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
36
|
export declare function endOfQuarter(input: Temporal.Instant | Temporal.ZonedDateTime): Temporal.ZonedDateTime;
|
|
37
|
+
export declare function endOfQuarter(input: Temporal.PlainDate): Temporal.PlainDate;
|
|
37
38
|
export declare function endOfQuarter(input: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;
|
|
38
39
|
//# sourceMappingURL=endOfQuarter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endOfQuarter.d.ts","sourceRoot":"","sources":["../src/endOfQuarter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"endOfQuarter.d.ts","sourceRoot":"","sources":["../src/endOfQuarter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,QAAQ,CAAC,aAAa,CAAC;AAC1B,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;AAC5E,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC"}
|
package/dist/endOfQuarter.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
endOfQuarter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OSBVYUOQ.js";
|
|
4
4
|
import "./chunk-XS2HUADA.js";
|
|
5
|
-
import "./chunk-AVGNRINZ.js";
|
|
6
5
|
import "./chunk-ZOHYNJUD.js";
|
|
6
|
+
import "./chunk-AVGNRINZ.js";
|
|
7
7
|
import "./chunk-L5AMAEWX.js";
|
|
8
8
|
import "./chunk-NTMT5XGC.js";
|
|
9
9
|
import "./chunk-R7ZCA6AQ.js";
|
package/dist/endOfWeek.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Temporal } from '@js-temporal/polyfill';
|
|
2
|
-
import type { Timezone } from './types';
|
|
2
|
+
import type { Timezone } from './types.js';
|
|
3
3
|
/**
|
|
4
|
-
* Returns
|
|
4
|
+
* Returns the last boundary of the week (Sunday).
|
|
5
5
|
* Uses ISO 8601 week definition: weeks end on Sunday.
|
|
6
|
+
* PlainDate inputs stay in calendar space unless a timezone is provided.
|
|
6
7
|
*
|
|
7
8
|
* @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime
|
|
8
9
|
* @returns ZonedDateTime at Sunday 23:59:59.999999999
|
|
@@ -25,12 +26,21 @@ import type { Timezone } from './types';
|
|
|
25
26
|
*
|
|
26
27
|
* @example
|
|
27
28
|
* ```ts
|
|
28
|
-
* // From PlainDate (
|
|
29
|
+
* // From PlainDate (stays a date)
|
|
30
|
+
* const date = Temporal.PlainDate.from('2025-01-22'); // Wednesday
|
|
31
|
+
* const end = endOfWeek(date);
|
|
32
|
+
* // 2025-01-26 (next Sunday)
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* // From PlainDate with a timezone (returns a ZonedDateTime)
|
|
29
38
|
* const date = Temporal.PlainDate.from('2025-01-22'); // Wednesday
|
|
30
39
|
* const end = endOfWeek(date, 'America/New_York');
|
|
31
40
|
* // 2025-01-26T23:59:59.999999999-05:00[America/New_York] (next Sunday)
|
|
32
41
|
* ```
|
|
33
42
|
*/
|
|
34
43
|
export declare function endOfWeek(input: Temporal.Instant | Temporal.ZonedDateTime): Temporal.ZonedDateTime;
|
|
44
|
+
export declare function endOfWeek(input: Temporal.PlainDate): Temporal.PlainDate;
|
|
35
45
|
export declare function endOfWeek(input: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;
|
|
36
46
|
//# sourceMappingURL=endOfWeek.d.ts.map
|
package/dist/endOfWeek.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endOfWeek.d.ts","sourceRoot":"","sources":["../src/endOfWeek.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKxC
|
|
1
|
+
{"version":3,"file":"endOfWeek.d.ts","sourceRoot":"","sources":["../src/endOfWeek.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,QAAQ,CAAC,aAAa,CAAC;AAC1B,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;AACzE,wBAAgB,SAAS,CACvB,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,aAAa,CAAC"}
|
package/dist/endOfWeek.js
CHANGED
package/dist/endOfYear.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Temporal } from './shared/temporal';
|
|
2
|
-
import type { Timezone } from './types';
|
|
1
|
+
import { Temporal } from './shared/temporal.js';
|
|
2
|
+
import type { Timezone } from './types.js';
|
|
3
3
|
/**
|
|
4
|
-
* Returns
|
|
4
|
+
* Returns the last boundary of the year.
|
|
5
|
+
* PlainDate inputs stay in calendar space unless a timezone is provided.
|
|
5
6
|
*
|
|
6
7
|
* @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime
|
|
7
8
|
* @returns ZonedDateTime at the last day of the year at 23:59:59.999999999
|
|
@@ -24,12 +25,21 @@ import type { Timezone } from './types';
|
|
|
24
25
|
*
|
|
25
26
|
* @example
|
|
26
27
|
* ```ts
|
|
27
|
-
* // From PlainDate (
|
|
28
|
+
* // From PlainDate (stays a date)
|
|
29
|
+
* const date = Temporal.PlainDate.from('2025-06-15');
|
|
30
|
+
* const end = endOfYear(date);
|
|
31
|
+
* // 2025-12-31
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* // From PlainDate with a timezone (returns a ZonedDateTime)
|
|
28
37
|
* const date = Temporal.PlainDate.from('2025-06-15');
|
|
29
38
|
* const end = endOfYear(date, 'America/New_York');
|
|
30
39
|
* // 2025-12-31T23:59:59.999999999-05:00[America/New_York]
|
|
31
40
|
* ```
|
|
32
41
|
*/
|
|
33
42
|
export declare function endOfYear(input: Temporal.Instant | Temporal.ZonedDateTime): Temporal.ZonedDateTime;
|
|
43
|
+
export declare function endOfYear(input: Temporal.PlainDate): Temporal.PlainDate;
|
|
34
44
|
export declare function endOfYear(input: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;
|
|
35
45
|
//# sourceMappingURL=endOfYear.d.ts.map
|
package/dist/endOfYear.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endOfYear.d.ts","sourceRoot":"","sources":["../src/endOfYear.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"endOfYear.d.ts","sourceRoot":"","sources":["../src/endOfYear.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,QAAQ,CAAC,aAAa,CAAC;AAC1B,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;AACzE,wBAAgB,SAAS,CACvB,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,aAAa,CAAC"}
|
package/dist/endOfYear.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
endOfYear
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-AVGNRINZ.js";
|
|
3
|
+
} from "./chunk-7OEGJCW7.js";
|
|
5
4
|
import "./chunk-ZOHYNJUD.js";
|
|
5
|
+
import "./chunk-AVGNRINZ.js";
|
|
6
6
|
import "./chunk-L5AMAEWX.js";
|
|
7
7
|
import "./chunk-NTMT5XGC.js";
|
|
8
8
|
import "./chunk-R7ZCA6AQ.js";
|
package/dist/format.d.ts
CHANGED
package/dist/getQuarter.d.ts
CHANGED
|
@@ -1,38 +1,21 @@
|
|
|
1
1
|
import type { Temporal } from "@js-temporal/polyfill";
|
|
2
|
-
import type { Timezone } from "./types";
|
|
3
2
|
/**
|
|
4
|
-
* Returns the quarter (1-4) that a datetime falls in.
|
|
3
|
+
* Returns the quarter (1-4) that a datetime or date falls in.
|
|
5
4
|
*
|
|
6
5
|
* Quarters: Q1 = Jan–Mar, Q2 = Apr–Jun, Q3 = Jul–Sep, Q4 = Oct–Dec.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* A quarter is intrinsic to the calendar date, so no timezone is ever needed.
|
|
8
|
+
* `Instant` inputs are interpreted in UTC; `ZonedDateTime` inputs use their own
|
|
9
|
+
* timezone; `PlainDate` inputs use their calendar month directly.
|
|
11
10
|
*
|
|
12
|
-
* @param input - A Temporal.Instant (UTC) or Temporal.
|
|
11
|
+
* @param input - A Temporal.Instant (UTC), Temporal.ZonedDateTime, or Temporal.PlainDate
|
|
13
12
|
* @returns The quarter number: 1, 2, 3, or 4
|
|
14
13
|
*
|
|
15
14
|
* @example
|
|
16
15
|
* ```ts
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* getQuarter(instant); // 2
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* // From ZonedDateTime (uses its timezone)
|
|
25
|
-
* const zoned = Temporal.ZonedDateTime.from('2025-11-15T15:30:00-05:00[America/New_York]');
|
|
26
|
-
* getQuarter(zoned); // 4
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```ts
|
|
31
|
-
* // From PlainDate (requires timezone)
|
|
32
|
-
* const date = Temporal.PlainDate.from('2025-02-15');
|
|
33
|
-
* getQuarter(date, 'America/New_York'); // 1
|
|
16
|
+
* getQuarter(Temporal.Instant.from('2025-05-15T12:00:00Z')); // 2
|
|
17
|
+
* getQuarter(Temporal.PlainDate.from('2025-11-15')); // 4
|
|
34
18
|
* ```
|
|
35
19
|
*/
|
|
36
|
-
export declare function getQuarter(input: Temporal.Instant | Temporal.ZonedDateTime): 1 | 2 | 3 | 4;
|
|
37
|
-
export declare function getQuarter(input: Temporal.PlainDate, timezone: Timezone): 1 | 2 | 3 | 4;
|
|
20
|
+
export declare function getQuarter(input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate): 1 | 2 | 3 | 4;
|
|
38
21
|
//# sourceMappingURL=getQuarter.d.ts.map
|
package/dist/getQuarter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getQuarter.d.ts","sourceRoot":"","sources":["../src/getQuarter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"getQuarter.d.ts","sourceRoot":"","sources":["../src/getQuarter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAKtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAAG,QAAQ,CAAC,SAAS,GACpE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAGf"}
|
package/dist/getQuarter.js
CHANGED