@gobrand/tiempo 2.5.3 → 2.6.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.
Files changed (104) hide show
  1. package/dist/chunk-7GEIOKVQ.js +19 -0
  2. package/dist/chunk-7GEIOKVQ.js.map +1 -0
  3. package/dist/chunk-EZ7NVTZI.js +21 -0
  4. package/dist/chunk-EZ7NVTZI.js.map +1 -0
  5. package/dist/chunk-GFWC7CHD.js +21 -0
  6. package/dist/chunk-GFWC7CHD.js.map +1 -0
  7. package/dist/{chunk-XDVUGTUV.js → chunk-GLGAVKGV.js} +7 -3
  8. package/dist/chunk-GLGAVKGV.js.map +1 -0
  9. package/dist/chunk-HFQUXON5.js +41 -0
  10. package/dist/chunk-HFQUXON5.js.map +1 -0
  11. package/dist/chunk-ID52RFFD.js +19 -0
  12. package/dist/chunk-ID52RFFD.js.map +1 -0
  13. package/dist/chunk-JHRXY36W.js +25 -0
  14. package/dist/chunk-JHRXY36W.js.map +1 -0
  15. package/dist/chunk-JNA3AFOC.js +13 -0
  16. package/dist/chunk-JNA3AFOC.js.map +1 -0
  17. package/dist/chunk-MMI2HHT7.js +25 -0
  18. package/dist/chunk-MMI2HHT7.js.map +1 -0
  19. package/dist/chunk-PWISCOZV.js +23 -0
  20. package/dist/chunk-PWISCOZV.js.map +1 -0
  21. package/dist/chunk-UJW2FPI4.js +25 -0
  22. package/dist/chunk-UJW2FPI4.js.map +1 -0
  23. package/dist/chunk-UJWM2BV2.js +41 -0
  24. package/dist/chunk-UJWM2BV2.js.map +1 -0
  25. package/dist/chunk-X26WIJ6L.js +24 -0
  26. package/dist/chunk-X26WIJ6L.js.map +1 -0
  27. package/dist/chunk-XPJFOBPW.js +24 -0
  28. package/dist/chunk-XPJFOBPW.js.map +1 -0
  29. package/dist/endOfDay.d.ts +5 -4
  30. package/dist/endOfDay.d.ts.map +1 -1
  31. package/dist/endOfDay.js +2 -1
  32. package/dist/endOfMonth.d.ts +7 -6
  33. package/dist/endOfMonth.d.ts.map +1 -1
  34. package/dist/endOfMonth.js +2 -1
  35. package/dist/endOfWeek.d.ts +7 -6
  36. package/dist/endOfWeek.d.ts.map +1 -1
  37. package/dist/endOfWeek.js +2 -1
  38. package/dist/endOfYear.d.ts +6 -5
  39. package/dist/endOfYear.d.ts.map +1 -1
  40. package/dist/endOfYear.js +2 -1
  41. package/dist/index.d.ts +3 -0
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +43 -30
  44. package/dist/roundToNearestHour.d.ts +77 -0
  45. package/dist/roundToNearestHour.d.ts.map +1 -0
  46. package/dist/roundToNearestHour.js +8 -0
  47. package/dist/roundToNearestHour.js.map +1 -0
  48. package/dist/roundToNearestHour.test.d.ts +2 -0
  49. package/dist/roundToNearestHour.test.d.ts.map +1 -0
  50. package/dist/roundToNearestMinute.d.ts +76 -0
  51. package/dist/roundToNearestMinute.d.ts.map +1 -0
  52. package/dist/roundToNearestMinute.js +8 -0
  53. package/dist/roundToNearestMinute.js.map +1 -0
  54. package/dist/roundToNearestMinute.test.d.ts +2 -0
  55. package/dist/roundToNearestMinute.test.d.ts.map +1 -0
  56. package/dist/roundToNearestSecond.d.ts +75 -0
  57. package/dist/roundToNearestSecond.d.ts.map +1 -0
  58. package/dist/roundToNearestSecond.js +8 -0
  59. package/dist/roundToNearestSecond.js.map +1 -0
  60. package/dist/roundToNearestSecond.test.d.ts +2 -0
  61. package/dist/roundToNearestSecond.test.d.ts.map +1 -0
  62. package/dist/shared/plainDateToZonedDateTime.d.ts +9 -0
  63. package/dist/shared/plainDateToZonedDateTime.d.ts.map +1 -0
  64. package/dist/shared/plainDateToZonedDateTime.js +7 -0
  65. package/dist/shared/plainDateToZonedDateTime.js.map +1 -0
  66. package/dist/startOfDay.d.ts +6 -5
  67. package/dist/startOfDay.d.ts.map +1 -1
  68. package/dist/startOfDay.js +2 -1
  69. package/dist/startOfMonth.d.ts +6 -5
  70. package/dist/startOfMonth.d.ts.map +1 -1
  71. package/dist/startOfMonth.js +2 -1
  72. package/dist/startOfWeek.d.ts +7 -6
  73. package/dist/startOfWeek.d.ts.map +1 -1
  74. package/dist/startOfWeek.js +2 -1
  75. package/dist/startOfYear.d.ts +6 -5
  76. package/dist/startOfYear.d.ts.map +1 -1
  77. package/dist/startOfYear.js +2 -1
  78. package/dist/toPlainDate.d.ts +14 -7
  79. package/dist/toPlainDate.d.ts.map +1 -1
  80. package/dist/toPlainDate.js +1 -1
  81. package/dist/toPlainTime.d.ts +15 -7
  82. package/dist/toPlainTime.d.ts.map +1 -1
  83. package/dist/toPlainTime.js +1 -1
  84. package/dist/types.d.ts.map +1 -1
  85. package/package.json +1 -1
  86. package/dist/chunk-2WMXB7QL.js +0 -17
  87. package/dist/chunk-2WMXB7QL.js.map +0 -1
  88. package/dist/chunk-CUMB4776.js +0 -18
  89. package/dist/chunk-CUMB4776.js.map +0 -1
  90. package/dist/chunk-G45S5B4O.js +0 -25
  91. package/dist/chunk-G45S5B4O.js.map +0 -1
  92. package/dist/chunk-GM6RNAYE.js +0 -19
  93. package/dist/chunk-GM6RNAYE.js.map +0 -1
  94. package/dist/chunk-TU2UNOOW.js +0 -15
  95. package/dist/chunk-TU2UNOOW.js.map +0 -1
  96. package/dist/chunk-TW5EV3DH.js +0 -14
  97. package/dist/chunk-TW5EV3DH.js.map +0 -1
  98. package/dist/chunk-UCCWUJ2K.js +0 -25
  99. package/dist/chunk-UCCWUJ2K.js.map +0 -1
  100. package/dist/chunk-XDVUGTUV.js.map +0 -1
  101. package/dist/chunk-XVJJR7H6.js +0 -20
  102. package/dist/chunk-XVJJR7H6.js.map +0 -1
  103. package/dist/chunk-YR2UCUIT.js +0 -15
  104. package/dist/chunk-YR2UCUIT.js.map +0 -1
@@ -1,4 +1,5 @@
1
- import type { Temporal } from '@js-temporal/polyfill';
1
+ import { Temporal } from '@js-temporal/polyfill';
2
+ import type { Timezone } from './types';
2
3
  /**
3
4
  * Returns a ZonedDateTime representing the last moment of the year (last day at 23:59:59.999999999).
4
5
  *
@@ -23,12 +24,12 @@ import type { Temporal } from '@js-temporal/polyfill';
23
24
  *
24
25
  * @example
25
26
  * ```ts
26
- * // Need a different timezone? Convert first
27
- * const instant = Temporal.Instant.from('2025-06-15T12:00:00Z');
28
- * const nyTime = instant.toZonedDateTimeISO('America/New_York');
29
- * const end = endOfYear(nyTime);
27
+ * // From PlainDate (requires timezone)
28
+ * const date = Temporal.PlainDate.from('2025-06-15');
29
+ * const end = endOfYear(date, 'America/New_York');
30
30
  * // 2025-12-31T23:59:59.999999999-05:00[America/New_York]
31
31
  * ```
32
32
  */
33
33
  export declare function endOfYear(input: Temporal.Instant | Temporal.ZonedDateTime): Temporal.ZonedDateTime;
34
+ export declare function endOfYear(input: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;
34
35
  //# sourceMappingURL=endOfYear.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"endOfYear.d.ts","sourceRoot":"","sources":["../src/endOfYear.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,QAAQ,CAAC,aAAa,CAWxB"}
1
+ {"version":3,"file":"endOfYear.d.ts","sourceRoot":"","sources":["../src/endOfYear.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,QAAQ,CAAC,aAAa,CAAC;AAC1B,wBAAgB,SAAS,CACvB,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,aAAa,CAAC"}
package/dist/endOfYear.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  endOfYear
3
- } from "./chunk-XDVUGTUV.js";
3
+ } from "./chunk-GLGAVKGV.js";
4
4
  import "./chunk-AVGNRINZ.js";
5
+ import "./chunk-JNA3AFOC.js";
5
6
  import "./chunk-MJSZNWCV.js";
6
7
  export {
7
8
  endOfYear
package/dist/index.d.ts CHANGED
@@ -64,6 +64,9 @@ export { differenceInDays } from './differenceInDays';
64
64
  export { differenceInWeeks } from './differenceInWeeks';
65
65
  export { differenceInMonths } from './differenceInMonths';
66
66
  export { differenceInYears } from './differenceInYears';
67
+ export { roundToNearestHour, type RoundToNearestHourOptions, } from './roundToNearestHour';
68
+ export { roundToNearestMinute, type RoundToNearestMinuteOptions, } from './roundToNearestMinute';
69
+ export { roundToNearestSecond, type RoundToNearestSecondOptions, } from './roundToNearestSecond';
67
70
  export { intlFormatDistance, type IntlFormatDistanceOptions, } from './intlFormatDistance';
68
71
  export { isPlainDateBefore } from './isPlainDateBefore';
69
72
  export { isPlainDateAfter } from './isPlainDateAfter';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO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MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -1,9 +1,27 @@
1
+ import {
2
+ toPlainDate
3
+ } from "./chunk-HFQUXON5.js";
4
+ import {
5
+ toPlainTime
6
+ } from "./chunk-UJWM2BV2.js";
7
+ import {
8
+ toUtc
9
+ } from "./chunk-BW5SFCKS.js";
1
10
  import {
2
11
  toZonedTime
3
12
  } from "./chunk-MXQFENCR.js";
4
13
  import {
5
14
  today
6
15
  } from "./chunk-KZB6NERH.js";
16
+ import {
17
+ subNanoseconds
18
+ } from "./chunk-WVHAYLBW.js";
19
+ import {
20
+ subSeconds
21
+ } from "./chunk-BH2YB4MV.js";
22
+ import {
23
+ subWeeks
24
+ } from "./chunk-U4RNUZXO.js";
7
25
  import {
8
26
  subYears
9
27
  } from "./chunk-AHMKY474.js";
@@ -17,14 +35,14 @@ import {
17
35
  toIso9075
18
36
  } from "./chunk-DFLGGK4F.js";
19
37
  import {
20
- toPlainDate
21
- } from "./chunk-UCCWUJ2K.js";
38
+ startOfWeek
39
+ } from "./chunk-EZ7NVTZI.js";
22
40
  import {
23
- toPlainTime
24
- } from "./chunk-G45S5B4O.js";
41
+ startOfYear
42
+ } from "./chunk-ID52RFFD.js";
25
43
  import {
26
- toUtc
27
- } from "./chunk-BW5SFCKS.js";
44
+ subDays
45
+ } from "./chunk-YKBP3G7L.js";
28
46
  import {
29
47
  subHours
30
48
  } from "./chunk-XW5MLXX5.js";
@@ -40,39 +58,30 @@ import {
40
58
  import {
41
59
  subMonths
42
60
  } from "./chunk-52NEOY34.js";
43
- import {
44
- subNanoseconds
45
- } from "./chunk-WVHAYLBW.js";
46
- import {
47
- subSeconds
48
- } from "./chunk-BH2YB4MV.js";
49
- import {
50
- subWeeks
51
- } from "./chunk-U4RNUZXO.js";
52
61
  import {
53
62
  isSameYear
54
63
  } from "./chunk-VLZ3HQQA.js";
55
64
  import {
56
65
  now
57
66
  } from "./chunk-FSD3DDFC.js";
67
+ import {
68
+ roundToNearestHour
69
+ } from "./chunk-MMI2HHT7.js";
70
+ import {
71
+ roundToNearestMinute
72
+ } from "./chunk-UJW2FPI4.js";
73
+ import {
74
+ roundToNearestSecond
75
+ } from "./chunk-JHRXY36W.js";
58
76
  import {
59
77
  simpleFormat
60
78
  } from "./chunk-TFSZ55L7.js";
61
79
  import {
62
80
  startOfDay
63
- } from "./chunk-TW5EV3DH.js";
81
+ } from "./chunk-GFWC7CHD.js";
64
82
  import {
65
83
  startOfMonth
66
- } from "./chunk-TU2UNOOW.js";
67
- import {
68
- startOfWeek
69
- } from "./chunk-2WMXB7QL.js";
70
- import {
71
- startOfYear
72
- } from "./chunk-YR2UCUIT.js";
73
- import {
74
- subDays
75
- } from "./chunk-YKBP3G7L.js";
84
+ } from "./chunk-7GEIOKVQ.js";
76
85
  import {
77
86
  isSameHour
78
87
  } from "./chunk-EEQ3REET.js";
@@ -123,7 +132,7 @@ import {
123
132
  } from "./chunk-RW3C2677.js";
124
133
  import {
125
134
  endOfYear
126
- } from "./chunk-XDVUGTUV.js";
135
+ } from "./chunk-GLGAVKGV.js";
127
136
  import {
128
137
  format
129
138
  } from "./chunk-ZC6KWXCW.js";
@@ -159,14 +168,15 @@ import {
159
168
  } from "./chunk-CHW2EN2O.js";
160
169
  import {
161
170
  endOfDay
162
- } from "./chunk-CUMB4776.js";
171
+ } from "./chunk-XPJFOBPW.js";
163
172
  import {
164
173
  endOfMonth
165
- } from "./chunk-GM6RNAYE.js";
174
+ } from "./chunk-PWISCOZV.js";
166
175
  import {
167
176
  endOfWeek
168
- } from "./chunk-XVJJR7H6.js";
177
+ } from "./chunk-X26WIJ6L.js";
169
178
  import "./chunk-AVGNRINZ.js";
179
+ import "./chunk-JNA3AFOC.js";
170
180
  import {
171
181
  addWeeks
172
182
  } from "./chunk-DT2EWLHU.js";
@@ -266,6 +276,9 @@ export {
266
276
  isSameWeek,
267
277
  isSameYear,
268
278
  now,
279
+ roundToNearestHour,
280
+ roundToNearestMinute,
281
+ roundToNearestSecond,
269
282
  simpleFormat,
270
283
  startOfDay,
271
284
  startOfMonth,
@@ -0,0 +1,77 @@
1
+ import type { Temporal } from '@js-temporal/polyfill';
2
+ /**
3
+ * Options for rounding to nearest hour.
4
+ */
5
+ export interface RoundToNearestHourOptions {
6
+ /**
7
+ * The rounding mode to use.
8
+ *
9
+ * Given time 14:20:
10
+ * - `'round'` → 14:00 (20 min < 30, rounds DOWN to nearest)
11
+ * - `'ceil'` → 15:00 (always rounds UP to next hour)
12
+ * - `'floor'` → 14:00 (always rounds DOWN to current hour)
13
+ *
14
+ * Given time 14:40:
15
+ * - `'round'` → 15:00 (40 min >= 30, rounds UP to nearest)
16
+ * - `'ceil'` → 15:00 (always rounds UP to next hour)
17
+ * - `'floor'` → 14:00 (always rounds DOWN to current hour)
18
+ *
19
+ * @default 'round'
20
+ */
21
+ mode?: 'round' | 'ceil' | 'floor';
22
+ /**
23
+ * Round to the nearest N hours. Must divide evenly into 24.
24
+ * Valid values: 1, 2, 3, 4, 6, 8, 12
25
+ * @example nearestTo: 6 rounds to 00:00, 06:00, 12:00, or 18:00
26
+ */
27
+ nearestTo?: 1 | 2 | 3 | 4 | 6 | 8 | 12;
28
+ }
29
+ /**
30
+ * Rounds a datetime to the nearest hour boundary.
31
+ *
32
+ * ## Mode comparison (given 14:20)
33
+ *
34
+ * ```
35
+ * 14:00 ─────────────●───────────────── 15:00
36
+ * 14:20
37
+ *
38
+ * 'round' → 14:00 (nearest hour - 20 min < 30)
39
+ * 'ceil' → 15:00 (next hour - always up)
40
+ * 'floor' → 14:00 (current hour - always down)
41
+ * ```
42
+ *
43
+ * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime
44
+ * @param options - Rounding options
45
+ * @returns ZonedDateTime rounded to the hour boundary
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const time = Temporal.ZonedDateTime.from('2025-01-20T14:20:00[America/New_York]');
50
+ *
51
+ * roundToNearestHour(time); // → 14:00 (nearest)
52
+ * roundToNearestHour(time, { mode: 'ceil' }); // → 15:00 (always up)
53
+ * roundToNearestHour(time, { mode: 'floor' }); // → 14:00 (always down)
54
+ * ```
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * // With 37 minutes (past the halfway point)
59
+ * const time = Temporal.ZonedDateTime.from('2025-01-20T14:37:00[America/New_York]');
60
+ *
61
+ * roundToNearestHour(time); // → 15:00 (nearest - 37 >= 30)
62
+ * roundToNearestHour(time, { mode: 'ceil' }); // → 15:00 (always up)
63
+ * roundToNearestHour(time, { mode: 'floor' }); // → 14:00 (always down)
64
+ * ```
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * // Round to 6-hour blocks (shift scheduling)
69
+ * const time = Temporal.ZonedDateTime.from('2025-01-20T14:00:00[America/New_York]');
70
+ *
71
+ * roundToNearestHour(time, { nearestTo: 6 }); // → 12:00
72
+ * roundToNearestHour(time, { mode: 'ceil', nearestTo: 6 }); // → 18:00
73
+ * roundToNearestHour(time, { mode: 'floor', nearestTo: 6 }); // → 12:00
74
+ * ```
75
+ */
76
+ export declare function roundToNearestHour(input: Temporal.Instant | Temporal.ZonedDateTime, options?: RoundToNearestHourOptions): Temporal.ZonedDateTime;
77
+ //# sourceMappingURL=roundToNearestHour.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roundToNearestHour.d.ts","sourceRoot":"","sources":["../src/roundToNearestHour.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;;;;;;;;;;;OAcG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAClC;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;CACxC;AAQD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EAChD,OAAO,CAAC,EAAE,yBAAyB,GAClC,QAAQ,CAAC,aAAa,CAUxB"}
@@ -0,0 +1,8 @@
1
+ import {
2
+ roundToNearestHour
3
+ } from "./chunk-MMI2HHT7.js";
4
+ import "./chunk-MJSZNWCV.js";
5
+ export {
6
+ roundToNearestHour
7
+ };
8
+ //# sourceMappingURL=roundToNearestHour.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=roundToNearestHour.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roundToNearestHour.test.d.ts","sourceRoot":"","sources":["../src/roundToNearestHour.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,76 @@
1
+ import type { Temporal } from '@js-temporal/polyfill';
2
+ /**
3
+ * Options for rounding to nearest minute.
4
+ */
5
+ export interface RoundToNearestMinuteOptions {
6
+ /**
7
+ * The rounding mode to use.
8
+ *
9
+ * Given time 14:37:20:
10
+ * - `'round'` → 14:37 (20 sec < 30, rounds DOWN to nearest)
11
+ * - `'ceil'` → 14:38 (always rounds UP to next minute)
12
+ * - `'floor'` → 14:37 (always rounds DOWN to current minute)
13
+ *
14
+ * Given time 14:37:00 with nearestTo: 15:
15
+ * - `'round'` → 14:30 (37 is closer to 30 than 45)
16
+ * - `'ceil'` → 14:45 (always rounds UP to next 15-min slot)
17
+ * - `'floor'` → 14:30 (always rounds DOWN to current 15-min slot)
18
+ *
19
+ * @default 'round'
20
+ */
21
+ mode?: 'round' | 'ceil' | 'floor';
22
+ /**
23
+ * Round to the nearest N minutes. Must divide evenly into 60.
24
+ * Valid values: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30
25
+ * @example nearestTo: 15 rounds to quarter-hour marks (00, 15, 30, 45)
26
+ */
27
+ nearestTo?: 1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30;
28
+ }
29
+ /**
30
+ * Rounds a datetime to the nearest minute boundary.
31
+ *
32
+ * ## Mode comparison (given 14:37 with 15-min slots)
33
+ *
34
+ * ```
35
+ * 14:30 ─────────●───────────────────── 14:45
36
+ * 14:37
37
+ *
38
+ * 'round' → 14:30 (nearest slot - 37 is closer to 30 than 45)
39
+ * 'ceil' → 14:45 (next slot - always up)
40
+ * 'floor' → 14:30 (current slot - always down)
41
+ * ```
42
+ *
43
+ * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime
44
+ * @param options - Rounding options
45
+ * @returns ZonedDateTime rounded to the minute boundary
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * // 15-minute booking slots at 14:37
50
+ * const time = Temporal.ZonedDateTime.from('2025-01-20T14:37:00[America/New_York]');
51
+ *
52
+ * roundToNearestMinute(time, { nearestTo: 15 }); // → 14:30 (nearest)
53
+ * roundToNearestMinute(time, { mode: 'ceil', nearestTo: 15 }); // → 14:45 (next slot)
54
+ * roundToNearestMinute(time, { mode: 'floor', nearestTo: 15 }); // → 14:30 (current slot)
55
+ * ```
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * // Basic minute rounding (no slots)
60
+ * const time = Temporal.ZonedDateTime.from('2025-01-20T14:37:42[America/New_York]');
61
+ *
62
+ * roundToNearestMinute(time); // → 14:38 (42 sec >= 30)
63
+ * roundToNearestMinute(time, { mode: 'ceil' }); // → 14:38 (always up)
64
+ * roundToNearestMinute(time, { mode: 'floor' }); // → 14:37 (always down)
65
+ * ```
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * // Billing: round up to 30-minute increments
70
+ * const sessionEnd = Temporal.ZonedDateTime.from('2025-01-20T11:07:00[America/New_York]');
71
+ * roundToNearestMinute(sessionEnd, { mode: 'ceil', nearestTo: 30 });
72
+ * // → 11:30 (bill for 30 mins even though session was 7 mins)
73
+ * ```
74
+ */
75
+ export declare function roundToNearestMinute(input: Temporal.Instant | Temporal.ZonedDateTime, options?: RoundToNearestMinuteOptions): Temporal.ZonedDateTime;
76
+ //# sourceMappingURL=roundToNearestMinute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roundToNearestMinute.d.ts","sourceRoot":"","sources":["../src/roundToNearestMinute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;;;;;;;;;;OAcG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAClC;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;CAC5D;AAQD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EAChD,OAAO,CAAC,EAAE,2BAA2B,GACpC,QAAQ,CAAC,aAAa,CAUxB"}
@@ -0,0 +1,8 @@
1
+ import {
2
+ roundToNearestMinute
3
+ } from "./chunk-UJW2FPI4.js";
4
+ import "./chunk-MJSZNWCV.js";
5
+ export {
6
+ roundToNearestMinute
7
+ };
8
+ //# sourceMappingURL=roundToNearestMinute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=roundToNearestMinute.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roundToNearestMinute.test.d.ts","sourceRoot":"","sources":["../src/roundToNearestMinute.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,75 @@
1
+ import type { Temporal } from '@js-temporal/polyfill';
2
+ /**
3
+ * Options for rounding to nearest second.
4
+ */
5
+ export interface RoundToNearestSecondOptions {
6
+ /**
7
+ * The rounding mode to use.
8
+ *
9
+ * Given time 14:37:42.300:
10
+ * - `'round'` → 14:37:42 (300ms < 500, rounds DOWN to nearest)
11
+ * - `'ceil'` → 14:37:43 (always rounds UP to next second)
12
+ * - `'floor'` → 14:37:42 (always rounds DOWN to current second)
13
+ *
14
+ * Given time 14:37:42 with nearestTo: 10:
15
+ * - `'round'` → 14:37:40 (42 is closer to 40 than 50)
16
+ * - `'ceil'` → 14:37:50 (always rounds UP to next 10-sec mark)
17
+ * - `'floor'` → 14:37:40 (always rounds DOWN to current 10-sec mark)
18
+ *
19
+ * @default 'round'
20
+ */
21
+ mode?: 'round' | 'ceil' | 'floor';
22
+ /**
23
+ * Round to the nearest N seconds. Must divide evenly into 60.
24
+ * Valid values: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30
25
+ * @example nearestTo: 10 rounds to 10-second marks (00, 10, 20, 30, 40, 50)
26
+ */
27
+ nearestTo?: 1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30;
28
+ }
29
+ /**
30
+ * Rounds a datetime to the nearest second boundary.
31
+ *
32
+ * ## Mode comparison (given 14:37:42.567)
33
+ *
34
+ * ```
35
+ * :42 ─────────────────●─────────────── :43
36
+ * .567
37
+ *
38
+ * 'round' → :43 (nearest second - 567ms >= 500)
39
+ * 'ceil' → :43 (next second - always up)
40
+ * 'floor' → :42 (current second - always down)
41
+ * ```
42
+ *
43
+ * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime
44
+ * @param options - Rounding options
45
+ * @returns ZonedDateTime rounded to the second boundary
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const time = Temporal.ZonedDateTime.from('2025-01-20T14:37:42.567[America/New_York]');
50
+ *
51
+ * roundToNearestSecond(time); // → 14:37:43 (567ms >= 500)
52
+ * roundToNearestSecond(time, { mode: 'ceil' }); // → 14:37:43 (always up)
53
+ * roundToNearestSecond(time, { mode: 'floor' }); // → 14:37:42 (always down)
54
+ * ```
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * // 10-second intervals
59
+ * const time = Temporal.ZonedDateTime.from('2025-01-20T14:37:42[America/New_York]');
60
+ *
61
+ * roundToNearestSecond(time, { nearestTo: 10 }); // → 14:37:40 (nearest)
62
+ * roundToNearestSecond(time, { mode: 'ceil', nearestTo: 10 }); // → 14:37:50 (next 10s)
63
+ * roundToNearestSecond(time, { mode: 'floor', nearestTo: 10 }); // → 14:37:40 (current 10s)
64
+ * ```
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * // Remove sub-second precision for logging
69
+ * const logTime = Temporal.ZonedDateTime.from('2025-01-20T14:37:42.123456789[UTC]');
70
+ * roundToNearestSecond(logTime, { mode: 'floor' });
71
+ * // → 14:37:42.000000000 (clean timestamp)
72
+ * ```
73
+ */
74
+ export declare function roundToNearestSecond(input: Temporal.Instant | Temporal.ZonedDateTime, options?: RoundToNearestSecondOptions): Temporal.ZonedDateTime;
75
+ //# sourceMappingURL=roundToNearestSecond.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roundToNearestSecond.d.ts","sourceRoot":"","sources":["../src/roundToNearestSecond.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;;;;;;;;;;OAcG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAClC;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;CAC5D;AAQD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EAChD,OAAO,CAAC,EAAE,2BAA2B,GACpC,QAAQ,CAAC,aAAa,CAUxB"}
@@ -0,0 +1,8 @@
1
+ import {
2
+ roundToNearestSecond
3
+ } from "./chunk-JHRXY36W.js";
4
+ import "./chunk-MJSZNWCV.js";
5
+ export {
6
+ roundToNearestSecond
7
+ };
8
+ //# sourceMappingURL=roundToNearestSecond.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=roundToNearestSecond.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roundToNearestSecond.test.d.ts","sourceRoot":"","sources":["../src/roundToNearestSecond.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { Temporal } from '@js-temporal/polyfill';
2
+ import type { Timezone } from '../types';
3
+ /**
4
+ * @internal
5
+ * Converts a PlainDate to a ZonedDateTime at midnight in the specified timezone.
6
+ * This is an internal helper - do not use directly.
7
+ */
8
+ export declare function plainDateToZonedDateTime(date: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;
9
+ //# sourceMappingURL=plainDateToZonedDateTime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plainDateToZonedDateTime.d.ts","sourceRoot":"","sources":["../../src/shared/plainDateToZonedDateTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,QAAQ,CAAC,SAAS,EACxB,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,aAAa,CAKxB"}
@@ -0,0 +1,7 @@
1
+ import {
2
+ plainDateToZonedDateTime
3
+ } from "../chunk-JNA3AFOC.js";
4
+ export {
5
+ plainDateToZonedDateTime
6
+ };
7
+ //# sourceMappingURL=plainDateToZonedDateTime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,5 @@
1
- import type { Temporal } from '@js-temporal/polyfill';
1
+ import { Temporal } from '@js-temporal/polyfill';
2
+ import type { Timezone } from './types';
2
3
  /**
3
4
  * Returns a ZonedDateTime representing the first moment of the day (midnight).
4
5
  *
@@ -23,12 +24,12 @@ import type { Temporal } from '@js-temporal/polyfill';
23
24
  *
24
25
  * @example
25
26
  * ```ts
26
- * // Need a different timezone? Convert first
27
- * const instant = Temporal.Instant.from('2025-01-20T12:00:00Z');
28
- * const nyTime = instant.toZonedDateTimeISO('America/New_York');
29
- * const start = startOfDay(nyTime);
27
+ * // From PlainDate (requires timezone)
28
+ * const date = Temporal.PlainDate.from('2025-01-20');
29
+ * const start = startOfDay(date, 'America/New_York');
30
30
  * // 2025-01-20T00:00:00-05:00[America/New_York]
31
31
  * ```
32
32
  */
33
33
  export declare function startOfDay(input: Temporal.Instant | Temporal.ZonedDateTime): Temporal.ZonedDateTime;
34
+ export declare function startOfDay(input: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;
34
35
  //# sourceMappingURL=startOfDay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"startOfDay.d.ts","sourceRoot":"","sources":["../src/startOfDay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,QAAQ,CAAC,aAAa,CAIxB"}
1
+ {"version":3,"file":"startOfDay.d.ts","sourceRoot":"","sources":["../src/startOfDay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,QAAQ,CAAC,aAAa,CAAC;AAC1B,wBAAgB,UAAU,CACxB,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,aAAa,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  startOfDay
3
- } from "./chunk-TW5EV3DH.js";
3
+ } from "./chunk-GFWC7CHD.js";
4
+ import "./chunk-JNA3AFOC.js";
4
5
  import "./chunk-MJSZNWCV.js";
5
6
  export {
6
7
  startOfDay
@@ -1,4 +1,5 @@
1
- import type { Temporal } from '@js-temporal/polyfill';
1
+ import { Temporal } from '@js-temporal/polyfill';
2
+ import type { Timezone } from './types';
2
3
  /**
3
4
  * Returns a ZonedDateTime representing the first moment of the month (day 1 at midnight).
4
5
  *
@@ -23,12 +24,12 @@ import type { Temporal } from '@js-temporal/polyfill';
23
24
  *
24
25
  * @example
25
26
  * ```ts
26
- * // Need a different timezone? Convert first
27
- * const instant = Temporal.Instant.from('2025-01-15T12:00:00Z');
28
- * const nyTime = instant.toZonedDateTimeISO('America/New_York');
29
- * const start = startOfMonth(nyTime);
27
+ * // From PlainDate (requires timezone)
28
+ * const date = Temporal.PlainDate.from('2025-01-15');
29
+ * const start = startOfMonth(date, 'America/New_York');
30
30
  * // 2025-01-01T00:00:00-05:00[America/New_York]
31
31
  * ```
32
32
  */
33
33
  export declare function startOfMonth(input: Temporal.Instant | Temporal.ZonedDateTime): Temporal.ZonedDateTime;
34
+ export declare function startOfMonth(input: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;
34
35
  //# sourceMappingURL=startOfMonth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"startOfMonth.d.ts","sourceRoot":"","sources":["../src/startOfMonth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,QAAQ,CAAC,aAAa,CAOxB"}
1
+ {"version":3,"file":"startOfMonth.d.ts","sourceRoot":"","sources":["../src/startOfMonth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,QAAQ,CAAC,aAAa,CAAC;AAC1B,wBAAgB,YAAY,CAC1B,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,aAAa,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  startOfMonth
3
- } from "./chunk-TU2UNOOW.js";
3
+ } from "./chunk-7GEIOKVQ.js";
4
+ import "./chunk-JNA3AFOC.js";
4
5
  import "./chunk-MJSZNWCV.js";
5
6
  export {
6
7
  startOfMonth
@@ -1,4 +1,5 @@
1
- import type { Temporal } from '@js-temporal/polyfill';
1
+ import { Temporal } from '@js-temporal/polyfill';
2
+ import type { Timezone } from './types';
2
3
  /**
3
4
  * Returns a ZonedDateTime representing the first moment of the week (Monday at midnight).
4
5
  * Uses ISO 8601 week definition: weeks start on Monday.
@@ -24,12 +25,12 @@ import type { Temporal } from '@js-temporal/polyfill';
24
25
  *
25
26
  * @example
26
27
  * ```ts
27
- * // Need a different timezone? Convert first
28
- * const instant = Temporal.Instant.from('2025-01-22T12:00:00Z');
29
- * const nyTime = instant.toZonedDateTimeISO('America/New_York');
30
- * const start = startOfWeek(nyTime);
31
- * // 2025-01-20T00:00:00-05:00[America/New_York]
28
+ * // From PlainDate (requires timezone)
29
+ * const date = Temporal.PlainDate.from('2025-01-22'); // Wednesday
30
+ * const start = startOfWeek(date, 'America/New_York');
31
+ * // 2025-01-20T00:00:00-05:00[America/New_York] (previous Monday)
32
32
  * ```
33
33
  */
34
34
  export declare function startOfWeek(input: Temporal.Instant | Temporal.ZonedDateTime): Temporal.ZonedDateTime;
35
+ export declare function startOfWeek(input: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;
35
36
  //# sourceMappingURL=startOfWeek.d.ts.map