@gobrand/tiempo 2.6.2 → 2.7.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 (65) hide show
  1. package/dist/{chunk-IBO2U23N.js → chunk-5C3TQSWA.js} +4 -4
  2. package/dist/chunk-BUX26GTD.js +30 -0
  3. package/dist/chunk-BUX26GTD.js.map +1 -0
  4. package/dist/chunk-DKYVFYWM.js +25 -0
  5. package/dist/chunk-DKYVFYWM.js.map +1 -0
  6. package/dist/chunk-G2JUEBC5.js +26 -0
  7. package/dist/chunk-G2JUEBC5.js.map +1 -0
  8. package/dist/{chunk-MGMLT4L6.js → chunk-JA7SVLAF.js} +4 -4
  9. package/dist/chunk-OLEOU3XE.js +28 -0
  10. package/dist/chunk-OLEOU3XE.js.map +1 -0
  11. package/dist/chunk-TNCLJK4Y.js +38 -0
  12. package/dist/chunk-TNCLJK4Y.js.map +1 -0
  13. package/dist/chunk-Y7CIJQ67.js +26 -0
  14. package/dist/chunk-Y7CIJQ67.js.map +1 -0
  15. package/dist/chunk-YQBM63DC.js +57 -0
  16. package/dist/chunk-YQBM63DC.js.map +1 -0
  17. package/dist/eachDayOfInterval.d.ts +69 -0
  18. package/dist/eachDayOfInterval.d.ts.map +1 -0
  19. package/dist/eachDayOfInterval.js +8 -0
  20. package/dist/eachDayOfInterval.js.map +1 -0
  21. package/dist/eachDayOfInterval.test.d.ts +2 -0
  22. package/dist/eachDayOfInterval.test.d.ts.map +1 -0
  23. package/dist/eachHourOfInterval.d.ts +51 -0
  24. package/dist/eachHourOfInterval.d.ts.map +1 -0
  25. package/dist/eachHourOfInterval.js +8 -0
  26. package/dist/eachHourOfInterval.js.map +1 -0
  27. package/dist/eachHourOfInterval.test.d.ts +2 -0
  28. package/dist/eachHourOfInterval.test.d.ts.map +1 -0
  29. package/dist/eachMinuteOfInterval.d.ts +50 -0
  30. package/dist/eachMinuteOfInterval.d.ts.map +1 -0
  31. package/dist/eachMinuteOfInterval.js +8 -0
  32. package/dist/eachMinuteOfInterval.js.map +1 -0
  33. package/dist/eachMinuteOfInterval.test.d.ts +2 -0
  34. package/dist/eachMinuteOfInterval.test.d.ts.map +1 -0
  35. package/dist/eachMonthOfInterval.d.ts +46 -0
  36. package/dist/eachMonthOfInterval.d.ts.map +1 -0
  37. package/dist/eachMonthOfInterval.js +8 -0
  38. package/dist/eachMonthOfInterval.js.map +1 -0
  39. package/dist/eachMonthOfInterval.test.d.ts +2 -0
  40. package/dist/eachMonthOfInterval.test.d.ts.map +1 -0
  41. package/dist/eachWeekOfInterval.d.ts +58 -0
  42. package/dist/eachWeekOfInterval.d.ts.map +1 -0
  43. package/dist/eachWeekOfInterval.js +8 -0
  44. package/dist/eachWeekOfInterval.js.map +1 -0
  45. package/dist/eachWeekOfInterval.test.d.ts +2 -0
  46. package/dist/eachWeekOfInterval.test.d.ts.map +1 -0
  47. package/dist/eachYearOfInterval.d.ts +55 -0
  48. package/dist/eachYearOfInterval.d.ts.map +1 -0
  49. package/dist/eachYearOfInterval.js +8 -0
  50. package/dist/eachYearOfInterval.js.map +1 -0
  51. package/dist/eachYearOfInterval.test.d.ts +2 -0
  52. package/dist/eachYearOfInterval.test.d.ts.map +1 -0
  53. package/dist/index.d.ts +7 -1
  54. package/dist/index.d.ts.map +1 -1
  55. package/dist/index.js +69 -45
  56. package/dist/isFuture.js +2 -2
  57. package/dist/isWithinInterval.js +2 -2
  58. package/dist/simpleFormat.d.ts +48 -37
  59. package/dist/simpleFormat.d.ts.map +1 -1
  60. package/dist/simpleFormat.js +1 -1
  61. package/package.json +1 -1
  62. package/dist/chunk-TFSZ55L7.js +0 -46
  63. package/dist/chunk-TFSZ55L7.js.map +0 -1
  64. /package/dist/{chunk-IBO2U23N.js.map → chunk-5C3TQSWA.js.map} +0 -0
  65. /package/dist/{chunk-MGMLT4L6.js.map → chunk-JA7SVLAF.js.map} +0 -0
@@ -0,0 +1,46 @@
1
+ import { Temporal } from '@js-temporal/polyfill';
2
+ /**
3
+ * Returns an array of ZonedDateTime objects for each month within the interval.
4
+ * Each element represents the first moment of the month (day 1 at midnight).
5
+ * The interval is inclusive of both start and end months.
6
+ *
7
+ * For Instant inputs, UTC is used as the timezone.
8
+ * For ZonedDateTime inputs, the timezone of the start date is preserved.
9
+ *
10
+ * @param interval - The interval with start and end datetimes
11
+ * @returns Array of ZonedDateTime at start of each month in the interval
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const start = Temporal.ZonedDateTime.from('2025-01-15T10:00:00Z[UTC]');
16
+ * const end = Temporal.ZonedDateTime.from('2025-04-20T14:00:00Z[UTC]');
17
+ *
18
+ * const months = eachMonthOfInterval({ start, end });
19
+ * // [
20
+ * // 2025-01-01T00:00:00Z[UTC],
21
+ * // 2025-02-01T00:00:00Z[UTC],
22
+ * // 2025-03-01T00:00:00Z[UTC],
23
+ * // 2025-04-01T00:00:00Z[UTC]
24
+ * // ]
25
+ * ```
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * // Cross-year boundary
30
+ * const start = Temporal.ZonedDateTime.from('2024-11-15T00:00:00Z[UTC]');
31
+ * const end = Temporal.ZonedDateTime.from('2025-02-15T00:00:00Z[UTC]');
32
+ *
33
+ * const months = eachMonthOfInterval({ start, end });
34
+ * // [
35
+ * // 2024-11-01T00:00:00Z[UTC],
36
+ * // 2024-12-01T00:00:00Z[UTC],
37
+ * // 2025-01-01T00:00:00Z[UTC],
38
+ * // 2025-02-01T00:00:00Z[UTC]
39
+ * // ]
40
+ * ```
41
+ */
42
+ export declare function eachMonthOfInterval(interval: {
43
+ start: Temporal.Instant | Temporal.ZonedDateTime;
44
+ end: Temporal.Instant | Temporal.ZonedDateTime;
45
+ }): Temporal.ZonedDateTime[];
46
+ //# sourceMappingURL=eachMonthOfInterval.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eachMonthOfInterval.d.ts","sourceRoot":"","sources":["../src/eachMonthOfInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE;IAC5C,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,CAkC3B"}
@@ -0,0 +1,8 @@
1
+ import {
2
+ eachMonthOfInterval
3
+ } from "./chunk-TNCLJK4Y.js";
4
+ import "./chunk-MJSZNWCV.js";
5
+ export {
6
+ eachMonthOfInterval
7
+ };
8
+ //# sourceMappingURL=eachMonthOfInterval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=eachMonthOfInterval.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eachMonthOfInterval.test.d.ts","sourceRoot":"","sources":["../src/eachMonthOfInterval.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,58 @@
1
+ import { Temporal } from '@js-temporal/polyfill';
2
+ /**
3
+ * Returns an array of ZonedDateTime objects for each week within the interval.
4
+ * Each element represents the first moment of the week (Monday at midnight).
5
+ * Uses ISO 8601 week definition: weeks start on Monday.
6
+ * The interval is inclusive of both start and end weeks.
7
+ *
8
+ * For Instant inputs, UTC is used as the timezone.
9
+ * For ZonedDateTime inputs, the timezone of the start date is preserved.
10
+ *
11
+ * @param interval - The interval with start and end datetimes
12
+ * @returns Array of ZonedDateTime at start of each week (Monday) in the interval
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const start = Temporal.ZonedDateTime.from('2025-01-06T10:00:00Z[UTC]'); // Monday
17
+ * const end = Temporal.ZonedDateTime.from('2025-01-22T14:00:00Z[UTC]'); // Wednesday
18
+ *
19
+ * const weeks = eachWeekOfInterval({ start, end });
20
+ * // [
21
+ * // 2025-01-06T00:00:00Z[UTC], // Week 2
22
+ * // 2025-01-13T00:00:00Z[UTC], // Week 3
23
+ * // 2025-01-20T00:00:00Z[UTC] // Week 4
24
+ * // ]
25
+ * ```
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * // Mid-week start
30
+ * const start = Temporal.ZonedDateTime.from('2025-01-08T10:00:00Z[UTC]'); // Wednesday
31
+ * const end = Temporal.ZonedDateTime.from('2025-01-15T14:00:00Z[UTC]'); // Wednesday
32
+ *
33
+ * const weeks = eachWeekOfInterval({ start, end });
34
+ * // [
35
+ * // 2025-01-06T00:00:00Z[UTC], // Monday of week containing Jan 8
36
+ * // 2025-01-13T00:00:00Z[UTC] // Monday of week containing Jan 15
37
+ * // ]
38
+ * ```
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * // Cross-year boundary
43
+ * const start = Temporal.ZonedDateTime.from('2024-12-25T00:00:00Z[UTC]');
44
+ * const end = Temporal.ZonedDateTime.from('2025-01-08T00:00:00Z[UTC]');
45
+ *
46
+ * const weeks = eachWeekOfInterval({ start, end });
47
+ * // [
48
+ * // 2024-12-23T00:00:00Z[UTC], // Monday of week containing Dec 25
49
+ * // 2024-12-30T00:00:00Z[UTC], // Monday of week containing Dec 30
50
+ * // 2025-01-06T00:00:00Z[UTC] // Monday of week containing Jan 8
51
+ * // ]
52
+ * ```
53
+ */
54
+ export declare function eachWeekOfInterval(interval: {
55
+ start: Temporal.Instant | Temporal.ZonedDateTime;
56
+ end: Temporal.Instant | Temporal.ZonedDateTime;
57
+ }): Temporal.ZonedDateTime[];
58
+ //# sourceMappingURL=eachWeekOfInterval.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eachWeekOfInterval.d.ts","sourceRoot":"","sources":["../src/eachWeekOfInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE;IAC3C,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,CAyB3B"}
@@ -0,0 +1,8 @@
1
+ import {
2
+ eachWeekOfInterval
3
+ } from "./chunk-OLEOU3XE.js";
4
+ import "./chunk-MJSZNWCV.js";
5
+ export {
6
+ eachWeekOfInterval
7
+ };
8
+ //# sourceMappingURL=eachWeekOfInterval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=eachWeekOfInterval.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eachWeekOfInterval.test.d.ts","sourceRoot":"","sources":["../src/eachWeekOfInterval.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,55 @@
1
+ import { Temporal } from '@js-temporal/polyfill';
2
+ /**
3
+ * Returns an array of ZonedDateTime objects for each year within the interval.
4
+ * Each element represents the first moment of the year (January 1st at midnight).
5
+ * The interval is inclusive of both start and end years.
6
+ *
7
+ * For Instant inputs, UTC is used as the timezone.
8
+ * For ZonedDateTime inputs, the timezone of the start date is preserved.
9
+ *
10
+ * @param interval - The interval with start and end datetimes
11
+ * @returns Array of ZonedDateTime at start of each year in the interval
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const start = Temporal.ZonedDateTime.from('2022-06-15T10:00:00Z[UTC]');
16
+ * const end = Temporal.ZonedDateTime.from('2025-03-20T14:00:00Z[UTC]');
17
+ *
18
+ * const years = eachYearOfInterval({ start, end });
19
+ * // [
20
+ * // 2022-01-01T00:00:00Z[UTC],
21
+ * // 2023-01-01T00:00:00Z[UTC],
22
+ * // 2024-01-01T00:00:00Z[UTC],
23
+ * // 2025-01-01T00:00:00Z[UTC]
24
+ * // ]
25
+ * ```
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * // Single year
30
+ * const start = Temporal.ZonedDateTime.from('2025-01-15T00:00:00Z[UTC]');
31
+ * const end = Temporal.ZonedDateTime.from('2025-12-31T23:59:59Z[UTC]');
32
+ *
33
+ * const years = eachYearOfInterval({ start, end });
34
+ * // [2025-01-01T00:00:00Z[UTC]]
35
+ * ```
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * // With timezone
40
+ * const start = Temporal.ZonedDateTime.from('2024-01-01T00:00:00-05:00[America/New_York]');
41
+ * const end = Temporal.ZonedDateTime.from('2026-06-15T00:00:00-04:00[America/New_York]');
42
+ *
43
+ * const years = eachYearOfInterval({ start, end });
44
+ * // [
45
+ * // 2024-01-01T00:00:00-05:00[America/New_York],
46
+ * // 2025-01-01T00:00:00-05:00[America/New_York],
47
+ * // 2026-01-01T00:00:00-05:00[America/New_York]
48
+ * // ]
49
+ * ```
50
+ */
51
+ export declare function eachYearOfInterval(interval: {
52
+ start: Temporal.Instant | Temporal.ZonedDateTime;
53
+ end: Temporal.Instant | Temporal.ZonedDateTime;
54
+ }): Temporal.ZonedDateTime[];
55
+ //# sourceMappingURL=eachYearOfInterval.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eachYearOfInterval.d.ts","sourceRoot":"","sources":["../src/eachYearOfInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE;IAC3C,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,CAwB3B"}
@@ -0,0 +1,8 @@
1
+ import {
2
+ eachYearOfInterval
3
+ } from "./chunk-BUX26GTD.js";
4
+ import "./chunk-MJSZNWCV.js";
5
+ export {
6
+ eachYearOfInterval
7
+ };
8
+ //# sourceMappingURL=eachYearOfInterval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=eachYearOfInterval.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eachYearOfInterval.test.d.ts","sourceRoot":"","sources":["../src/eachYearOfInterval.test.ts"],"names":[],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ export { toIso9075, type ToIso9075Options, type Iso9075Representation, type Iso9
9
9
  export { toDate } from './toDate';
10
10
  export { format, type FormatOptions } from './format';
11
11
  export { formatPlainDate, type FormatPlainDateOptions } from './formatPlainDate';
12
- export { simpleFormat } from './simpleFormat';
12
+ export { simpleFormat, type SimpleFormatOptions } from './simpleFormat';
13
13
  export { today } from './today';
14
14
  export { now } from './now';
15
15
  export { startOfDay } from './startOfDay';
@@ -43,6 +43,12 @@ export { endOfYear } from './endOfYear';
43
43
  export { isBefore } from './isBefore';
44
44
  export { isAfter } from './isAfter';
45
45
  export { isWithinInterval } from './isWithinInterval';
46
+ export { eachDayOfInterval } from './eachDayOfInterval';
47
+ export { eachHourOfInterval } from './eachHourOfInterval';
48
+ export { eachMinuteOfInterval } from './eachMinuteOfInterval';
49
+ export { eachMonthOfInterval } from './eachMonthOfInterval';
50
+ export { eachWeekOfInterval } from './eachWeekOfInterval';
51
+ export { eachYearOfInterval } from './eachYearOfInterval';
46
52
  export { isFuture } from './isFuture';
47
53
  export { isPast } from './isPast';
48
54
  export { isSameDay } from './isSameDay';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"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,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -1,9 +1,3 @@
1
- import {
2
- toIso9075
3
- } from "./chunk-DFLGGK4F.js";
4
- import {
5
- toPlainDate
6
- } from "./chunk-HFQUXON5.js";
7
1
  import {
8
2
  toPlainTime
9
3
  } from "./chunk-UJWM2BV2.js";
@@ -16,12 +10,6 @@ import {
16
10
  import {
17
11
  today
18
12
  } from "./chunk-KZB6NERH.js";
19
- import {
20
- subMonths
21
- } from "./chunk-52NEOY34.js";
22
- import {
23
- subNanoseconds
24
- } from "./chunk-WVHAYLBW.js";
25
13
  import {
26
14
  subSeconds
27
15
  } from "./chunk-BH2YB4MV.js";
@@ -38,11 +26,11 @@ import {
38
26
  toIso
39
27
  } from "./chunk-BSV32PSO.js";
40
28
  import {
41
- startOfMonth
42
- } from "./chunk-HLGMUTFK.js";
29
+ toIso9075
30
+ } from "./chunk-DFLGGK4F.js";
43
31
  import {
44
- startOfWeek
45
- } from "./chunk-EZ7NVTZI.js";
32
+ toPlainDate
33
+ } from "./chunk-HFQUXON5.js";
46
34
  import {
47
35
  startOfYear
48
36
  } from "./chunk-3TSFIPUR.js";
@@ -62,11 +50,11 @@ import {
62
50
  subMinutes
63
51
  } from "./chunk-J6G2I2TU.js";
64
52
  import {
65
- isSameYear
66
- } from "./chunk-VLZ3HQQA.js";
53
+ subMonths
54
+ } from "./chunk-52NEOY34.js";
67
55
  import {
68
- isWithinInterval
69
- } from "./chunk-IBO2U23N.js";
56
+ subNanoseconds
57
+ } from "./chunk-WVHAYLBW.js";
70
58
  import {
71
59
  now
72
60
  } from "./chunk-FSD3DDFC.js";
@@ -81,16 +69,16 @@ import {
81
69
  } from "./chunk-JHRXY36W.js";
82
70
  import {
83
71
  simpleFormat
84
- } from "./chunk-TFSZ55L7.js";
72
+ } from "./chunk-YQBM63DC.js";
85
73
  import {
86
74
  startOfDay
87
75
  } from "./chunk-YIT6EMBC.js";
88
76
  import {
89
- isSameHour
90
- } from "./chunk-EEQ3REET.js";
77
+ startOfMonth
78
+ } from "./chunk-HLGMUTFK.js";
91
79
  import {
92
- isSameMicrosecond
93
- } from "./chunk-PPB62JYV.js";
80
+ startOfWeek
81
+ } from "./chunk-EZ7NVTZI.js";
94
82
  import {
95
83
  isSameMillisecond
96
84
  } from "./chunk-ISHZRFVN.js";
@@ -110,11 +98,11 @@ import {
110
98
  isSameWeek
111
99
  } from "./chunk-JOD4ATPE.js";
112
100
  import {
113
- isPast
114
- } from "./chunk-UBY22QWM.js";
101
+ isSameYear
102
+ } from "./chunk-VLZ3HQQA.js";
115
103
  import {
116
- isPlainDateAfter
117
- } from "./chunk-BPZ7BRJW.js";
104
+ isWithinInterval
105
+ } from "./chunk-5C3TQSWA.js";
118
106
  import {
119
107
  isPlainDateBefore
120
108
  } from "./chunk-4E7OGJ3F.js";
@@ -134,11 +122,11 @@ import {
134
122
  isSameDay
135
123
  } from "./chunk-RW3C2677.js";
136
124
  import {
137
- endOfYear
138
- } from "./chunk-776JOVV6.js";
125
+ isSameHour
126
+ } from "./chunk-EEQ3REET.js";
139
127
  import {
140
- format
141
- } from "./chunk-ZC6KWXCW.js";
128
+ isSameMicrosecond
129
+ } from "./chunk-PPB62JYV.js";
142
130
  import {
143
131
  formatPlainDate
144
132
  } from "./chunk-3A6X6WV5.js";
@@ -151,12 +139,45 @@ import {
151
139
  import {
152
140
  isBefore
153
141
  } from "./chunk-ZDA7GSWU.js";
154
- import "./chunk-WUAIUEH7.js";
155
142
  import {
156
143
  isFuture
157
- } from "./chunk-MGMLT4L6.js";
158
- import "./chunk-QFNGYTTH.js";
144
+ } from "./chunk-JA7SVLAF.js";
159
145
  import "./chunk-WY63VEXE.js";
146
+ import {
147
+ isPast
148
+ } from "./chunk-UBY22QWM.js";
149
+ import "./chunk-WUAIUEH7.js";
150
+ import "./chunk-QFNGYTTH.js";
151
+ import {
152
+ isPlainDateAfter
153
+ } from "./chunk-BPZ7BRJW.js";
154
+ import {
155
+ eachMonthOfInterval
156
+ } from "./chunk-TNCLJK4Y.js";
157
+ import {
158
+ eachWeekOfInterval
159
+ } from "./chunk-OLEOU3XE.js";
160
+ import {
161
+ eachYearOfInterval
162
+ } from "./chunk-BUX26GTD.js";
163
+ import {
164
+ endOfDay
165
+ } from "./chunk-HOCNCQTC.js";
166
+ import {
167
+ endOfMonth
168
+ } from "./chunk-OQ4CWKJT.js";
169
+ import {
170
+ endOfWeek
171
+ } from "./chunk-X26WIJ6L.js";
172
+ import {
173
+ endOfYear
174
+ } from "./chunk-776JOVV6.js";
175
+ import "./chunk-KGVUENQO.js";
176
+ import "./chunk-AVGNRINZ.js";
177
+ import "./chunk-JNA3AFOC.js";
178
+ import {
179
+ format
180
+ } from "./chunk-ZC6KWXCW.js";
160
181
  import {
161
182
  differenceInMonths
162
183
  } from "./chunk-BIAPE4MR.js";
@@ -173,17 +194,14 @@ import {
173
194
  differenceInYears
174
195
  } from "./chunk-CHW2EN2O.js";
175
196
  import {
176
- endOfDay
177
- } from "./chunk-HOCNCQTC.js";
197
+ eachDayOfInterval
198
+ } from "./chunk-DKYVFYWM.js";
178
199
  import {
179
- endOfMonth
180
- } from "./chunk-OQ4CWKJT.js";
181
- import "./chunk-KGVUENQO.js";
200
+ eachHourOfInterval
201
+ } from "./chunk-Y7CIJQ67.js";
182
202
  import {
183
- endOfWeek
184
- } from "./chunk-X26WIJ6L.js";
185
- import "./chunk-AVGNRINZ.js";
186
- import "./chunk-JNA3AFOC.js";
203
+ eachMinuteOfInterval
204
+ } from "./chunk-G2JUEBC5.js";
187
205
  import {
188
206
  addWeeks
189
207
  } from "./chunk-DT2EWLHU.js";
@@ -256,6 +274,12 @@ export {
256
274
  differenceInSeconds,
257
275
  differenceInWeeks,
258
276
  differenceInYears,
277
+ eachDayOfInterval,
278
+ eachHourOfInterval,
279
+ eachMinuteOfInterval,
280
+ eachMonthOfInterval,
281
+ eachWeekOfInterval,
282
+ eachYearOfInterval,
259
283
  endOfDay,
260
284
  endOfMonth,
261
285
  endOfWeek,
package/dist/isFuture.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  isFuture
3
- } from "./chunk-MGMLT4L6.js";
4
- import "./chunk-QFNGYTTH.js";
3
+ } from "./chunk-JA7SVLAF.js";
5
4
  import "./chunk-WY63VEXE.js";
5
+ import "./chunk-QFNGYTTH.js";
6
6
  import "./chunk-MJSZNWCV.js";
7
7
  export {
8
8
  isFuture
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  isWithinInterval
3
- } from "./chunk-IBO2U23N.js";
4
- import "./chunk-WUAIUEH7.js";
3
+ } from "./chunk-5C3TQSWA.js";
5
4
  import "./chunk-WY63VEXE.js";
5
+ import "./chunk-WUAIUEH7.js";
6
6
  import "./chunk-MJSZNWCV.js";
7
7
  export {
8
8
  isWithinInterval
@@ -1,56 +1,67 @@
1
1
  import { Temporal } from '@js-temporal/polyfill';
2
2
  import type { Timezone } from './types';
3
- interface PlainDateOptions {
3
+ interface BaseOptions {
4
4
  locale?: string;
5
- year?: 'auto' | 'always' | 'never';
6
- }
7
- interface ZonedDateTimeOptions {
8
- locale?: string;
9
- time?: '12h' | '24h';
10
5
  timeZone?: Timezone;
11
- year?: 'auto' | 'always' | 'never';
12
6
  }
13
- interface InstantOptions {
14
- locale?: string;
15
- time?: '12h' | '24h';
16
- timeZone: Timezone;
17
- year?: 'auto' | 'always' | 'never';
7
+ interface DateOnlyOptions extends BaseOptions {
8
+ date: 'compact' | 'auto' | 'full';
9
+ time?: never;
10
+ }
11
+ interface TimeOnlyOptions extends BaseOptions {
12
+ date?: never;
13
+ time: '12h' | '24h' | 'compact';
14
+ }
15
+ interface DateAndTimeOptions extends BaseOptions {
16
+ date: 'compact' | 'auto' | 'full';
17
+ time: '12h' | '24h' | 'compact';
18
18
  }
19
+ export type SimpleFormatOptions = DateOnlyOptions | TimeOnlyOptions | DateAndTimeOptions;
19
20
  /**
20
- * Format a Temporal date in a human-friendly way: "Dec 23" or "Dec 23, 2020"
21
+ * Format a Temporal date/time in a human-friendly way.
21
22
  *
22
- * By default (year: 'auto'), shows the year only if the date is not in the current year.
23
- * Use year: 'always' to always show the year, or year: 'never' to always hide it.
24
- * Optionally includes time in 12-hour or 24-hour format.
23
+ * Pass `date`, `time`, or both to control what's displayed.
24
+ * At least one of `date` or `time` is required.
25
+ *
26
+ * @param input - A Temporal.Instant, ZonedDateTime, or PlainDate
27
+ * @param options - Format options (at least `date` or `time` required)
28
+ *
29
+ * Date formats:
30
+ * - `'compact'` - "Dec 23" (never shows year)
31
+ * - `'auto'` - "Dec 23" or "Dec 23, 2020" (shows year only if not current year)
32
+ * - `'full'` - "Dec 23, 2026" (always shows year)
33
+ *
34
+ * Time formats:
35
+ * - `'12h'` - "3:30 PM"
36
+ * - `'24h'` - "15:30"
37
+ * - `'compact'` - "9am" or "2:30pm" (omits minutes when zero, lowercase am/pm)
25
38
  *
26
39
  * @example
27
40
  * ```typescript
28
- * // Assuming current year is 2026
29
- * const date2026 = Temporal.ZonedDateTime.from("2026-12-23T15:30:00[America/New_York]");
30
- * const date2020 = Temporal.ZonedDateTime.from("2020-12-23T15:30:00[America/New_York]");
41
+ * const zdt = Temporal.ZonedDateTime.from("2026-12-23T09:00:00[America/New_York]");
42
+ * const pastZdt = Temporal.ZonedDateTime.from("2020-12-23T14:30:00[America/New_York]");
31
43
  *
32
- * simpleFormat(date2026); // "Dec 23"
33
- * simpleFormat(date2020); // "Dec 23, 2020"
34
- * simpleFormat(date2026, { time: '12h' }); // "Dec 23, 3:30 PM"
35
- * simpleFormat(date2026, { time: '24h' }); // "Dec 23, 15:30"
44
+ * // Date only
45
+ * simpleFormat(zdt, { date: 'compact' }); // "Dec 23"
46
+ * simpleFormat(zdt, { date: 'auto' }); // "Dec 23"
47
+ * simpleFormat(pastZdt, { date: 'auto' }); // "Dec 23, 2020"
48
+ * simpleFormat(zdt, { date: 'full' }); // "Dec 23, 2026"
36
49
  *
37
- * // Control year display
38
- * simpleFormat(date2026, { year: 'always' }); // "Dec 23, 2026"
39
- * simpleFormat(date2020, { year: 'never' }); // "Dec 23"
40
- * simpleFormat(date2020, { year: 'auto' }); // "Dec 23, 2020" (default behavior)
50
+ * // Time only
51
+ * simpleFormat(zdt, { time: 'compact' }); // "9am"
52
+ * simpleFormat(pastZdt, { time: 'compact' }); // "2:30pm"
53
+ * simpleFormat(zdt, { time: '12h' }); // "9:00 AM"
54
+ * simpleFormat(zdt, { time: '24h' }); // "09:00"
41
55
  *
42
- * // With Instant (timeZone required)
43
- * const instant = Temporal.Instant.from("2026-12-23T20:30:00Z");
44
- * simpleFormat(instant, { timeZone: 'America/New_York' }); // "Dec 23"
45
- * simpleFormat(instant, { timeZone: 'America/New_York', time: '12h' }); // "Dec 23, 3:30 PM"
56
+ * // Date and time
57
+ * simpleFormat(zdt, { date: 'auto', time: 'compact' }); // "Dec 23, 9am"
58
+ * simpleFormat(zdt, { date: 'full', time: '12h' }); // "Dec 23, 2026, 9:00 AM"
46
59
  *
47
- * // With PlainDate (no time option)
48
- * const plain = Temporal.PlainDate.from("2020-12-23");
49
- * simpleFormat(plain); // "Dec 23, 2020"
60
+ * // With Instant (timeZone required)
61
+ * const instant = Temporal.Instant.from("2026-12-23T14:00:00Z");
62
+ * simpleFormat(instant, { date: 'auto', timeZone: 'America/New_York' }); // "Dec 23"
50
63
  * ```
51
64
  */
52
- export declare function simpleFormat(input: Temporal.PlainDate, options?: PlainDateOptions): string;
53
- export declare function simpleFormat(input: Temporal.ZonedDateTime, options?: ZonedDateTimeOptions): string;
54
- export declare function simpleFormat(input: Temporal.Instant, options: InstantOptions): string;
65
+ export declare function simpleFormat(input: Temporal.PlainDate | Temporal.ZonedDateTime | Temporal.Instant, options: SimpleFormatOptions): string;
55
66
  export {};
56
67
  //# sourceMappingURL=simpleFormat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"simpleFormat.d.ts","sourceRoot":"","sources":["../src/simpleFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAA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B,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,UAAU,eAAgB,SAAQ,WAAW;IAC3C,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,IAAI,CAAC,EAAE,KAAK,CAAC;CACd;AAED,UAAU,eAAgB,SAAQ,WAAW;IAC3C,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,SAAS,CAAC;CACjC;AAED,UAAU,kBAAmB,SAAQ,WAAW;IAC9C,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,SAAS,CAAC;CACjC;AAED,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG,eAAe,GAAG,kBAAkB,CAAC;AAEzF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,aAAa,GAAG,QAAQ,CAAC,OAAO,EACrE,OAAO,EAAE,mBAAmB,GAC3B,MAAM,CAsDR"}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  simpleFormat
3
- } from "./chunk-TFSZ55L7.js";
3
+ } from "./chunk-YQBM63DC.js";
4
4
  export {
5
5
  simpleFormat
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gobrand/tiempo",
3
- "version": "2.6.2",
3
+ "version": "2.7.0",
4
4
  "description": "Lightweight utility functions for converting between UTC and timezone-aware datetimes using the Temporal API",
5
5
  "private": false,
6
6
  "publishConfig": {