@gobrand/tiempo 2.2.2 → 2.3.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 (245) hide show
  1. package/README.md +286 -12
  2. package/dist/addDays.d.ts +37 -0
  3. package/dist/addDays.d.ts.map +1 -0
  4. package/dist/addDays.js +8 -0
  5. package/dist/addDays.js.map +1 -0
  6. package/dist/addDays.test.d.ts +2 -0
  7. package/dist/addDays.test.d.ts.map +1 -0
  8. package/dist/addHours.d.ts +37 -0
  9. package/dist/addHours.d.ts.map +1 -0
  10. package/dist/addHours.js +8 -0
  11. package/dist/addHours.js.map +1 -0
  12. package/dist/addHours.test.d.ts +2 -0
  13. package/dist/addHours.test.d.ts.map +1 -0
  14. package/dist/addMicroseconds.d.ts +36 -0
  15. package/dist/addMicroseconds.d.ts.map +1 -0
  16. package/dist/addMicroseconds.js +8 -0
  17. package/dist/addMicroseconds.js.map +1 -0
  18. package/dist/addMicroseconds.test.d.ts +2 -0
  19. package/dist/addMicroseconds.test.d.ts.map +1 -0
  20. package/dist/addMilliseconds.d.ts +36 -0
  21. package/dist/addMilliseconds.d.ts.map +1 -0
  22. package/dist/addMilliseconds.js +8 -0
  23. package/dist/addMilliseconds.js.map +1 -0
  24. package/dist/addMilliseconds.test.d.ts +2 -0
  25. package/dist/addMilliseconds.test.d.ts.map +1 -0
  26. package/dist/addMinutes.d.ts +36 -0
  27. package/dist/addMinutes.d.ts.map +1 -0
  28. package/dist/addMinutes.js +8 -0
  29. package/dist/addMinutes.js.map +1 -0
  30. package/dist/addMinutes.test.d.ts +2 -0
  31. package/dist/addMinutes.test.d.ts.map +1 -0
  32. package/dist/addMonths.d.ts +37 -0
  33. package/dist/addMonths.d.ts.map +1 -0
  34. package/dist/addMonths.js +8 -0
  35. package/dist/addMonths.js.map +1 -0
  36. package/dist/addMonths.test.d.ts +2 -0
  37. package/dist/addMonths.test.d.ts.map +1 -0
  38. package/dist/addNanoseconds.d.ts +36 -0
  39. package/dist/addNanoseconds.d.ts.map +1 -0
  40. package/dist/addNanoseconds.js +8 -0
  41. package/dist/addNanoseconds.js.map +1 -0
  42. package/dist/addNanoseconds.test.d.ts +2 -0
  43. package/dist/addNanoseconds.test.d.ts.map +1 -0
  44. package/dist/addSeconds.d.ts +36 -0
  45. package/dist/addSeconds.d.ts.map +1 -0
  46. package/dist/addSeconds.js +8 -0
  47. package/dist/addSeconds.js.map +1 -0
  48. package/dist/addSeconds.test.d.ts +2 -0
  49. package/dist/addSeconds.test.d.ts.map +1 -0
  50. package/dist/addWeeks.d.ts +37 -0
  51. package/dist/addWeeks.d.ts.map +1 -0
  52. package/dist/addWeeks.js +8 -0
  53. package/dist/addWeeks.js.map +1 -0
  54. package/dist/addWeeks.test.d.ts +2 -0
  55. package/dist/addWeeks.test.d.ts.map +1 -0
  56. package/dist/addYears.d.ts +37 -0
  57. package/dist/addYears.d.ts.map +1 -0
  58. package/dist/addYears.js +8 -0
  59. package/dist/addYears.js.map +1 -0
  60. package/dist/addYears.test.d.ts +2 -0
  61. package/dist/addYears.test.d.ts.map +1 -0
  62. package/dist/chunk-2XHAHSB6.js +14 -0
  63. package/dist/chunk-2XHAHSB6.js.map +1 -0
  64. package/dist/chunk-4NJMCCUM.js +14 -0
  65. package/dist/chunk-4NJMCCUM.js.map +1 -0
  66. package/dist/chunk-52NEOY34.js +13 -0
  67. package/dist/chunk-52NEOY34.js.map +1 -0
  68. package/dist/chunk-7ATM7AXL.js +14 -0
  69. package/dist/chunk-7ATM7AXL.js.map +1 -0
  70. package/dist/chunk-A5VVBYNT.js +14 -0
  71. package/dist/chunk-A5VVBYNT.js.map +1 -0
  72. package/dist/chunk-ADQTZVMH.js +15 -0
  73. package/dist/chunk-ADQTZVMH.js.map +1 -0
  74. package/dist/chunk-AHMKY474.js +13 -0
  75. package/dist/chunk-AHMKY474.js.map +1 -0
  76. package/dist/chunk-BH2YB4MV.js +13 -0
  77. package/dist/chunk-BH2YB4MV.js.map +1 -0
  78. package/dist/chunk-BQBLSXK2.js +13 -0
  79. package/dist/chunk-BQBLSXK2.js.map +1 -0
  80. package/dist/chunk-CY746ZUQ.js +15 -0
  81. package/dist/chunk-CY746ZUQ.js.map +1 -0
  82. package/dist/chunk-DT2EWLHU.js +14 -0
  83. package/dist/chunk-DT2EWLHU.js.map +1 -0
  84. package/dist/chunk-EEQ3REET.js +15 -0
  85. package/dist/chunk-EEQ3REET.js.map +1 -0
  86. package/dist/chunk-EYO2ZJLH.js +14 -0
  87. package/dist/chunk-EYO2ZJLH.js.map +1 -0
  88. package/dist/chunk-HDBH7RTY.js +13 -0
  89. package/dist/chunk-HDBH7RTY.js.map +1 -0
  90. package/dist/chunk-ISHZRFVN.js +15 -0
  91. package/dist/chunk-ISHZRFVN.js.map +1 -0
  92. package/dist/chunk-J6G2I2TU.js +13 -0
  93. package/dist/chunk-J6G2I2TU.js.map +1 -0
  94. package/dist/chunk-JOD4ATPE.js +15 -0
  95. package/dist/chunk-JOD4ATPE.js.map +1 -0
  96. package/dist/chunk-L4SVABDH.js +14 -0
  97. package/dist/chunk-L4SVABDH.js.map +1 -0
  98. package/dist/chunk-LDO6PRNJ.js +15 -0
  99. package/dist/chunk-LDO6PRNJ.js.map +1 -0
  100. package/dist/chunk-NRD5HRZV.js +14 -0
  101. package/dist/chunk-NRD5HRZV.js.map +1 -0
  102. package/dist/chunk-PPB62JYV.js +15 -0
  103. package/dist/chunk-PPB62JYV.js.map +1 -0
  104. package/dist/chunk-Q2F3HEXB.js +14 -0
  105. package/dist/chunk-Q2F3HEXB.js.map +1 -0
  106. package/dist/chunk-S63QUP4W.js +15 -0
  107. package/dist/chunk-S63QUP4W.js.map +1 -0
  108. package/dist/chunk-U4RNUZXO.js +13 -0
  109. package/dist/chunk-U4RNUZXO.js.map +1 -0
  110. package/dist/chunk-V27NUBXQ.js +14 -0
  111. package/dist/chunk-V27NUBXQ.js.map +1 -0
  112. package/dist/chunk-VLZ3HQQA.js +15 -0
  113. package/dist/chunk-VLZ3HQQA.js.map +1 -0
  114. package/dist/chunk-WVHAYLBW.js +13 -0
  115. package/dist/chunk-WVHAYLBW.js.map +1 -0
  116. package/dist/chunk-XEDXPI5G.js +94 -0
  117. package/dist/chunk-XEDXPI5G.js.map +1 -0
  118. package/dist/chunk-XW5MLXX5.js +13 -0
  119. package/dist/chunk-XW5MLXX5.js.map +1 -0
  120. package/dist/chunk-YKBP3G7L.js +13 -0
  121. package/dist/chunk-YKBP3G7L.js.map +1 -0
  122. package/dist/index.d.ts +30 -0
  123. package/dist/index.d.ts.map +1 -1
  124. package/dist/index.js +139 -19
  125. package/dist/intlFormatDistance.d.ts +85 -0
  126. package/dist/intlFormatDistance.d.ts.map +1 -0
  127. package/dist/intlFormatDistance.js +15 -0
  128. package/dist/intlFormatDistance.js.map +1 -0
  129. package/dist/intlFormatDistance.test.d.ts +2 -0
  130. package/dist/intlFormatDistance.test.d.ts.map +1 -0
  131. package/dist/isSameHour.d.ts +58 -0
  132. package/dist/isSameHour.d.ts.map +1 -0
  133. package/dist/isSameHour.js +8 -0
  134. package/dist/isSameHour.js.map +1 -0
  135. package/dist/isSameHour.test.d.ts +2 -0
  136. package/dist/isSameHour.test.d.ts.map +1 -0
  137. package/dist/isSameMicrosecond.d.ts +59 -0
  138. package/dist/isSameMicrosecond.d.ts.map +1 -0
  139. package/dist/isSameMicrosecond.js +8 -0
  140. package/dist/isSameMicrosecond.js.map +1 -0
  141. package/dist/isSameMicrosecond.test.d.ts +2 -0
  142. package/dist/isSameMicrosecond.test.d.ts.map +1 -0
  143. package/dist/isSameMillisecond.d.ts +59 -0
  144. package/dist/isSameMillisecond.d.ts.map +1 -0
  145. package/dist/isSameMillisecond.js +8 -0
  146. package/dist/isSameMillisecond.js.map +1 -0
  147. package/dist/isSameMillisecond.test.d.ts +2 -0
  148. package/dist/isSameMillisecond.test.d.ts.map +1 -0
  149. package/dist/isSameMinute.d.ts +58 -0
  150. package/dist/isSameMinute.d.ts.map +1 -0
  151. package/dist/isSameMinute.js +8 -0
  152. package/dist/isSameMinute.js.map +1 -0
  153. package/dist/isSameMinute.test.d.ts +2 -0
  154. package/dist/isSameMinute.test.d.ts.map +1 -0
  155. package/dist/isSameMonth.d.ts +58 -0
  156. package/dist/isSameMonth.d.ts.map +1 -0
  157. package/dist/isSameMonth.js +8 -0
  158. package/dist/isSameMonth.js.map +1 -0
  159. package/dist/isSameMonth.test.d.ts +2 -0
  160. package/dist/isSameMonth.test.d.ts.map +1 -0
  161. package/dist/isSameNanosecond.d.ts +59 -0
  162. package/dist/isSameNanosecond.d.ts.map +1 -0
  163. package/dist/isSameNanosecond.js +8 -0
  164. package/dist/isSameNanosecond.js.map +1 -0
  165. package/dist/isSameNanosecond.test.d.ts +2 -0
  166. package/dist/isSameNanosecond.test.d.ts.map +1 -0
  167. package/dist/isSameSecond.d.ts +59 -0
  168. package/dist/isSameSecond.d.ts.map +1 -0
  169. package/dist/isSameSecond.js +8 -0
  170. package/dist/isSameSecond.js.map +1 -0
  171. package/dist/isSameSecond.test.d.ts +2 -0
  172. package/dist/isSameSecond.test.d.ts.map +1 -0
  173. package/dist/isSameWeek.d.ts +72 -0
  174. package/dist/isSameWeek.d.ts.map +1 -0
  175. package/dist/isSameWeek.js +8 -0
  176. package/dist/isSameWeek.js.map +1 -0
  177. package/dist/isSameWeek.test.d.ts +2 -0
  178. package/dist/isSameWeek.test.d.ts.map +1 -0
  179. package/dist/isSameYear.d.ts +58 -0
  180. package/dist/isSameYear.d.ts.map +1 -0
  181. package/dist/isSameYear.js +8 -0
  182. package/dist/isSameYear.js.map +1 -0
  183. package/dist/isSameYear.test.d.ts +2 -0
  184. package/dist/isSameYear.test.d.ts.map +1 -0
  185. package/dist/subDays.d.ts +20 -0
  186. package/dist/subDays.d.ts.map +1 -0
  187. package/dist/subDays.js +9 -0
  188. package/dist/subDays.js.map +1 -0
  189. package/dist/subDays.test.d.ts +2 -0
  190. package/dist/subDays.test.d.ts.map +1 -0
  191. package/dist/subHours.d.ts +20 -0
  192. package/dist/subHours.d.ts.map +1 -0
  193. package/dist/subHours.js +9 -0
  194. package/dist/subHours.js.map +1 -0
  195. package/dist/subHours.test.d.ts +2 -0
  196. package/dist/subHours.test.d.ts.map +1 -0
  197. package/dist/subMicroseconds.d.ts +19 -0
  198. package/dist/subMicroseconds.d.ts.map +1 -0
  199. package/dist/subMicroseconds.js +9 -0
  200. package/dist/subMicroseconds.js.map +1 -0
  201. package/dist/subMicroseconds.test.d.ts +2 -0
  202. package/dist/subMicroseconds.test.d.ts.map +1 -0
  203. package/dist/subMilliseconds.d.ts +19 -0
  204. package/dist/subMilliseconds.d.ts.map +1 -0
  205. package/dist/subMilliseconds.js +9 -0
  206. package/dist/subMilliseconds.js.map +1 -0
  207. package/dist/subMilliseconds.test.d.ts +2 -0
  208. package/dist/subMilliseconds.test.d.ts.map +1 -0
  209. package/dist/subMinutes.d.ts +19 -0
  210. package/dist/subMinutes.d.ts.map +1 -0
  211. package/dist/subMinutes.js +9 -0
  212. package/dist/subMinutes.js.map +1 -0
  213. package/dist/subMinutes.test.d.ts +2 -0
  214. package/dist/subMinutes.test.d.ts.map +1 -0
  215. package/dist/subMonths.d.ts +20 -0
  216. package/dist/subMonths.d.ts.map +1 -0
  217. package/dist/subMonths.js +9 -0
  218. package/dist/subMonths.js.map +1 -0
  219. package/dist/subMonths.test.d.ts +2 -0
  220. package/dist/subMonths.test.d.ts.map +1 -0
  221. package/dist/subNanoseconds.d.ts +19 -0
  222. package/dist/subNanoseconds.d.ts.map +1 -0
  223. package/dist/subNanoseconds.js +9 -0
  224. package/dist/subNanoseconds.js.map +1 -0
  225. package/dist/subNanoseconds.test.d.ts +2 -0
  226. package/dist/subNanoseconds.test.d.ts.map +1 -0
  227. package/dist/subSeconds.d.ts +19 -0
  228. package/dist/subSeconds.d.ts.map +1 -0
  229. package/dist/subSeconds.js +9 -0
  230. package/dist/subSeconds.js.map +1 -0
  231. package/dist/subSeconds.test.d.ts +2 -0
  232. package/dist/subSeconds.test.d.ts.map +1 -0
  233. package/dist/subWeeks.d.ts +20 -0
  234. package/dist/subWeeks.d.ts.map +1 -0
  235. package/dist/subWeeks.js +9 -0
  236. package/dist/subWeeks.js.map +1 -0
  237. package/dist/subWeeks.test.d.ts +2 -0
  238. package/dist/subWeeks.test.d.ts.map +1 -0
  239. package/dist/subYears.d.ts +20 -0
  240. package/dist/subYears.d.ts.map +1 -0
  241. package/dist/subYears.js +9 -0
  242. package/dist/subYears.js.map +1 -0
  243. package/dist/subYears.test.d.ts +2 -0
  244. package/dist/subYears.test.d.ts.map +1 -0
  245. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,9 +1,3 @@
1
- import {
2
- startOfWeek
3
- } from "./chunk-2WMXB7QL.js";
4
- import {
5
- startOfYear
6
- } from "./chunk-YR2UCUIT.js";
7
1
  import {
8
2
  toUtc
9
3
  } from "./chunk-GPAFAHKJ.js";
@@ -16,6 +10,84 @@ import {
16
10
  import {
17
11
  today
18
12
  } from "./chunk-67QHALIG.js";
13
+ import {
14
+ subMicroseconds
15
+ } from "./chunk-BQBLSXK2.js";
16
+ import {
17
+ subMilliseconds
18
+ } from "./chunk-HDBH7RTY.js";
19
+ import {
20
+ subMinutes
21
+ } from "./chunk-J6G2I2TU.js";
22
+ import {
23
+ subMonths
24
+ } from "./chunk-52NEOY34.js";
25
+ import {
26
+ subNanoseconds
27
+ } from "./chunk-WVHAYLBW.js";
28
+ import {
29
+ subSeconds
30
+ } from "./chunk-BH2YB4MV.js";
31
+ import {
32
+ subWeeks
33
+ } from "./chunk-U4RNUZXO.js";
34
+ import {
35
+ subYears
36
+ } from "./chunk-AHMKY474.js";
37
+ import {
38
+ isSameYear
39
+ } from "./chunk-VLZ3HQQA.js";
40
+ import {
41
+ now
42
+ } from "./chunk-3YGPHHB6.js";
43
+ import {
44
+ startOfDay
45
+ } from "./chunk-TW5EV3DH.js";
46
+ import {
47
+ startOfMonth
48
+ } from "./chunk-TU2UNOOW.js";
49
+ import {
50
+ startOfWeek
51
+ } from "./chunk-2WMXB7QL.js";
52
+ import {
53
+ startOfYear
54
+ } from "./chunk-YR2UCUIT.js";
55
+ import {
56
+ subDays
57
+ } from "./chunk-YKBP3G7L.js";
58
+ import {
59
+ subHours
60
+ } from "./chunk-XW5MLXX5.js";
61
+ import {
62
+ isSameHour
63
+ } from "./chunk-EEQ3REET.js";
64
+ import {
65
+ isSameMicrosecond
66
+ } from "./chunk-PPB62JYV.js";
67
+ import {
68
+ isSameMillisecond
69
+ } from "./chunk-ISHZRFVN.js";
70
+ import {
71
+ isSameMinute
72
+ } from "./chunk-LDO6PRNJ.js";
73
+ import {
74
+ isSameMonth
75
+ } from "./chunk-ADQTZVMH.js";
76
+ import {
77
+ isSameNanosecond
78
+ } from "./chunk-S63QUP4W.js";
79
+ import {
80
+ isSameSecond
81
+ } from "./chunk-CY746ZUQ.js";
82
+ import {
83
+ isSameWeek
84
+ } from "./chunk-JOD4ATPE.js";
85
+ import {
86
+ format
87
+ } from "./chunk-2G5RJGPR.js";
88
+ import {
89
+ intlFormatDistance
90
+ } from "./chunk-XEDXPI5G.js";
19
91
  import {
20
92
  isAfter
21
93
  } from "./chunk-BBNNR2QH.js";
@@ -32,14 +104,11 @@ import {
32
104
  isSameDay
33
105
  } from "./chunk-RW3C2677.js";
34
106
  import {
35
- now
36
- } from "./chunk-3YGPHHB6.js";
37
- import {
38
- startOfDay
39
- } from "./chunk-TW5EV3DH.js";
107
+ differenceInNanoseconds
108
+ } from "./chunk-OABS374T.js";
40
109
  import {
41
- startOfMonth
42
- } from "./chunk-TU2UNOOW.js";
110
+ differenceInSeconds
111
+ } from "./chunk-ZHRMURYP.js";
43
112
  import {
44
113
  differenceInWeeks
45
114
  } from "./chunk-PVAOUYXF.js";
@@ -60,8 +129,11 @@ import {
60
129
  } from "./chunk-XDVUGTUV.js";
61
130
  import "./chunk-AVGNRINZ.js";
62
131
  import {
63
- format
64
- } from "./chunk-2G5RJGPR.js";
132
+ addWeeks
133
+ } from "./chunk-DT2EWLHU.js";
134
+ import {
135
+ addYears
136
+ } from "./chunk-Q2F3HEXB.js";
65
137
  import {
66
138
  differenceInDays
67
139
  } from "./chunk-6IP245MS.js";
@@ -81,13 +153,41 @@ import {
81
153
  differenceInMonths
82
154
  } from "./chunk-BIAPE4MR.js";
83
155
  import {
84
- differenceInNanoseconds
85
- } from "./chunk-OABS374T.js";
156
+ addDays
157
+ } from "./chunk-L4SVABDH.js";
86
158
  import {
87
- differenceInSeconds
88
- } from "./chunk-ZHRMURYP.js";
159
+ addHours
160
+ } from "./chunk-4NJMCCUM.js";
161
+ import {
162
+ addMicroseconds
163
+ } from "./chunk-V27NUBXQ.js";
164
+ import {
165
+ addMilliseconds
166
+ } from "./chunk-A5VVBYNT.js";
167
+ import {
168
+ addMinutes
169
+ } from "./chunk-2XHAHSB6.js";
170
+ import {
171
+ addMonths
172
+ } from "./chunk-7ATM7AXL.js";
173
+ import {
174
+ addNanoseconds
175
+ } from "./chunk-EYO2ZJLH.js";
176
+ import {
177
+ addSeconds
178
+ } from "./chunk-NRD5HRZV.js";
89
179
  import "./chunk-MJSZNWCV.js";
90
180
  export {
181
+ addDays,
182
+ addHours,
183
+ addMicroseconds,
184
+ addMilliseconds,
185
+ addMinutes,
186
+ addMonths,
187
+ addNanoseconds,
188
+ addSeconds,
189
+ addWeeks,
190
+ addYears,
91
191
  differenceInDays,
92
192
  differenceInHours,
93
193
  differenceInMicroseconds,
@@ -103,16 +203,36 @@ export {
103
203
  endOfWeek,
104
204
  endOfYear,
105
205
  format,
206
+ intlFormatDistance,
106
207
  isAfter,
107
208
  isBefore,
108
209
  isFuture,
109
210
  isPast,
110
211
  isSameDay,
212
+ isSameHour,
213
+ isSameMicrosecond,
214
+ isSameMillisecond,
215
+ isSameMinute,
216
+ isSameMonth,
217
+ isSameNanosecond,
218
+ isSameSecond,
219
+ isSameWeek,
220
+ isSameYear,
111
221
  now,
112
222
  startOfDay,
113
223
  startOfMonth,
114
224
  startOfWeek,
115
225
  startOfYear,
226
+ subDays,
227
+ subHours,
228
+ subMicroseconds,
229
+ subMilliseconds,
230
+ subMinutes,
231
+ subMonths,
232
+ subNanoseconds,
233
+ subSeconds,
234
+ subWeeks,
235
+ subYears,
116
236
  toUtc,
117
237
  toUtcString,
118
238
  toZonedTime,
@@ -0,0 +1,85 @@
1
+ import type { Temporal } from '@js-temporal/polyfill';
2
+ export interface IntlFormatDistanceOptions {
3
+ /**
4
+ * The unit to force formatting in. If not specified, the unit will be automatically selected.
5
+ */
6
+ unit?: Intl.RelativeTimeFormatUnit;
7
+ /**
8
+ * The locale to use for formatting. Defaults to the system locale.
9
+ */
10
+ locale?: string | string[];
11
+ /**
12
+ * The locale matching algorithm to use.
13
+ */
14
+ localeMatcher?: 'best fit' | 'lookup';
15
+ /**
16
+ * Whether to use numeric values always, or use special strings like "yesterday", "tomorrow", etc.
17
+ * Defaults to 'auto'.
18
+ */
19
+ numeric?: 'always' | 'auto';
20
+ /**
21
+ * The formatting style to use.
22
+ */
23
+ style?: 'long' | 'short' | 'narrow';
24
+ }
25
+ /**
26
+ * Formats the distance between two dates as a human-readable, internationalized string.
27
+ *
28
+ * The function automatically picks the most appropriate unit based on the distance between dates.
29
+ * For example, if the distance is a few hours, it returns "in X hours". If the distance is a few
30
+ * months, it returns "in X months".
31
+ *
32
+ * You can force a specific unit using the `options.unit` parameter.
33
+ *
34
+ * @param laterDate - The later date to compare
35
+ * @param earlierDate - The earlier date to compare with
36
+ * @param options - Formatting options
37
+ * @returns The formatted distance string
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * const later = Temporal.Instant.from('2024-01-01T12:00:00Z');
42
+ * const earlier = Temporal.Instant.from('2024-01-01T11:00:00Z');
43
+ *
44
+ * intlFormatDistance(later, earlier);
45
+ * // => 'in 1 hour'
46
+ *
47
+ * intlFormatDistance(earlier, later);
48
+ * // => '1 hour ago'
49
+ * ```
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * // Force a specific unit
54
+ * const later = Temporal.Instant.from('2025-01-01T00:00:00Z');
55
+ * const earlier = Temporal.Instant.from('2024-01-01T00:00:00Z');
56
+ *
57
+ * intlFormatDistance(later, earlier, { unit: 'quarter' });
58
+ * // => 'in 4 quarters'
59
+ * ```
60
+ *
61
+ * @example
62
+ * ```typescript
63
+ * // Use a different locale
64
+ * const later = Temporal.Instant.from('2024-01-01T12:00:00Z');
65
+ * const earlier = Temporal.Instant.from('2024-01-01T11:00:00Z');
66
+ *
67
+ * intlFormatDistance(later, earlier, { locale: 'es' });
68
+ * // => 'dentro de 1 hora'
69
+ * ```
70
+ *
71
+ * @example
72
+ * ```typescript
73
+ * // Use numeric: 'always' to avoid special strings
74
+ * const later = Temporal.Instant.from('2024-01-02T00:00:00Z');
75
+ * const earlier = Temporal.Instant.from('2024-01-01T00:00:00Z');
76
+ *
77
+ * intlFormatDistance(later, earlier, { numeric: 'auto' });
78
+ * // => 'tomorrow'
79
+ *
80
+ * intlFormatDistance(later, earlier, { numeric: 'always' });
81
+ * // => 'in 1 day'
82
+ * ```
83
+ */
84
+ export declare function intlFormatDistance(laterDate: Temporal.Instant | Temporal.ZonedDateTime, earlierDate: Temporal.Instant | Temporal.ZonedDateTime, options?: IntlFormatDistanceOptions): string;
85
+ //# sourceMappingURL=intlFormatDistance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intlFormatDistance.d.ts","sourceRoot":"","sources":["../src/intlFormatDistance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAUtD,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC,sBAAsB,CAAC;IACnC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B;;OAEG;IACH,aAAa,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IACtC;;;OAGG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EACpD,WAAW,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EACtD,OAAO,CAAC,EAAE,yBAAyB,GAClC,MAAM,CAuER"}
@@ -0,0 +1,15 @@
1
+ import {
2
+ intlFormatDistance
3
+ } from "./chunk-XEDXPI5G.js";
4
+ import "./chunk-ZHRMURYP.js";
5
+ import "./chunk-PVAOUYXF.js";
6
+ import "./chunk-CHW2EN2O.js";
7
+ import "./chunk-6IP245MS.js";
8
+ import "./chunk-PIDXROVB.js";
9
+ import "./chunk-RJY62CDU.js";
10
+ import "./chunk-BIAPE4MR.js";
11
+ import "./chunk-MJSZNWCV.js";
12
+ export {
13
+ intlFormatDistance
14
+ };
15
+ //# sourceMappingURL=intlFormatDistance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=intlFormatDistance.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intlFormatDistance.test.d.ts","sourceRoot":"","sources":["../src/intlFormatDistance.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,58 @@
1
+ import type { Temporal } from '@js-temporal/polyfill';
2
+ /**
3
+ * Returns true if both datetimes fall in the same hour.
4
+ * Compares the year, month, day, and hour fields directly.
5
+ *
6
+ * Instant inputs are converted to UTC. For ZonedDateTime inputs, their
7
+ * timezone is preserved. Convert to a common timezone before calling if
8
+ * you need to compare from a specific perspective.
9
+ *
10
+ * @param date1 - First datetime (Instant or ZonedDateTime)
11
+ * @param date2 - Second datetime (Instant or ZonedDateTime)
12
+ * @returns true if both dates are in the same hour, false otherwise
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * // Same timezone, same hour
17
+ * const start = Temporal.ZonedDateTime.from('2025-01-20T14:00:00Z[UTC]');
18
+ * const end = Temporal.ZonedDateTime.from('2025-01-20T14:59:59.999Z[UTC]');
19
+ *
20
+ * isSameHour(start, end); // true
21
+ * ```
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * // Same timezone, different hours
26
+ * const hour14 = Temporal.ZonedDateTime.from('2025-01-20T14:59:59Z[UTC]');
27
+ * const hour15 = Temporal.ZonedDateTime.from('2025-01-20T15:00:00Z[UTC]');
28
+ *
29
+ * isSameHour(hour14, hour15); // false
30
+ * ```
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * // Different timezones - compares their local hours
35
+ * const ny = Temporal.ZonedDateTime.from('2025-01-20T14:30:00-05:00[America/New_York]');
36
+ * const tokyo = Temporal.ZonedDateTime.from('2025-01-21T04:30:00+09:00[Asia/Tokyo]');
37
+ *
38
+ * // Same instant, different local hours from each person's perspective
39
+ * isSameHour(ny, tokyo); // false (14:xx in NY, 04:xx in Tokyo)
40
+ *
41
+ * // Convert to UTC to compare in UTC timezone
42
+ * isSameHour(ny.withTimeZone('UTC'), tokyo.withTimeZone('UTC')); // true (both 19:xx in UTC)
43
+ *
44
+ * // Convert to NY timezone to compare from NY perspective
45
+ * isSameHour(ny, tokyo.withTimeZone('America/New_York')); // true (both 14:xx in NY)
46
+ * ```
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * // Instant inputs are converted to UTC
51
+ * const instant1 = Temporal.Instant.from('2025-01-20T14:15:30Z');
52
+ * const instant2 = Temporal.Instant.from('2025-01-20T14:45:50Z');
53
+ *
54
+ * isSameHour(instant1, instant2); // true (both 14:xx in UTC)
55
+ * ```
56
+ */
57
+ export declare function isSameHour(date1: Temporal.Instant | Temporal.ZonedDateTime, date2: Temporal.Instant | Temporal.ZonedDateTime): boolean;
58
+ //# sourceMappingURL=isSameHour.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isSameHour.d.ts","sourceRoot":"","sources":["../src/isSameHour.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EAChD,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,OAAO,CAUT"}
@@ -0,0 +1,8 @@
1
+ import {
2
+ isSameHour
3
+ } from "./chunk-EEQ3REET.js";
4
+ import "./chunk-MJSZNWCV.js";
5
+ export {
6
+ isSameHour
7
+ };
8
+ //# sourceMappingURL=isSameHour.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=isSameHour.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isSameHour.test.d.ts","sourceRoot":"","sources":["../src/isSameHour.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,59 @@
1
+ import type { Temporal } from '@js-temporal/polyfill';
2
+ /**
3
+ * Returns true if both datetimes fall in the same microsecond.
4
+ * Compares the year, month, day, hour, minute, second, millisecond, and microsecond fields directly.
5
+ * Ignores sub-microsecond precision (nanoseconds).
6
+ *
7
+ * Instant inputs are converted to UTC. For ZonedDateTime inputs, their
8
+ * timezone is preserved. Convert to a common timezone before calling if
9
+ * you need to compare from a specific perspective.
10
+ *
11
+ * @param date1 - First datetime (Instant or ZonedDateTime)
12
+ * @param date2 - Second datetime (Instant or ZonedDateTime)
13
+ * @returns true if both dates are in the same microsecond, false otherwise
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * // Same timezone, same microsecond
18
+ * const time1 = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123456Z[UTC]');
19
+ * const time2 = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123456999Z[UTC]');
20
+ *
21
+ * isSameMicrosecond(time1, time2); // true
22
+ * ```
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * // Same timezone, different microseconds
27
+ * const us456 = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123456Z[UTC]');
28
+ * const us457 = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123457Z[UTC]');
29
+ *
30
+ * isSameMicrosecond(us456, us457); // false
31
+ * ```
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * // Different timezones - compares their local microseconds
36
+ * const ny = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123456-05:00[America/New_York]');
37
+ * const tokyo = Temporal.ZonedDateTime.from('2025-01-21T04:30:45.987654+09:00[Asia/Tokyo]');
38
+ *
39
+ * // Same instant, different local microseconds from each person's perspective
40
+ * isSameMicrosecond(ny, tokyo); // false (14:30:45.123456 in NY, 04:30:45.987654 in Tokyo)
41
+ *
42
+ * // Convert to UTC to compare in UTC timezone
43
+ * isSameMicrosecond(ny.withTimeZone('UTC'), tokyo.withTimeZone('UTC')); // true (both 19:30:45.123456 in UTC)
44
+ *
45
+ * // Convert to NY timezone to compare from NY perspective
46
+ * isSameMicrosecond(ny, tokyo.withTimeZone('America/New_York')); // true (both 14:30:45.123456 in NY)
47
+ * ```
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * // Instant inputs are converted to UTC
52
+ * const instant1 = Temporal.Instant.from('2025-01-20T14:30:45.123456789Z');
53
+ * const instant2 = Temporal.Instant.from('2025-01-20T14:30:45.123456999Z');
54
+ *
55
+ * isSameMicrosecond(instant1, instant2); // true (both 14:30:45.123456 in UTC)
56
+ * ```
57
+ */
58
+ export declare function isSameMicrosecond(date1: Temporal.Instant | Temporal.ZonedDateTime, date2: Temporal.Instant | Temporal.ZonedDateTime): boolean;
59
+ //# sourceMappingURL=isSameMicrosecond.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isSameMicrosecond.d.ts","sourceRoot":"","sources":["../src/isSameMicrosecond.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EAChD,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,OAAO,CAcT"}
@@ -0,0 +1,8 @@
1
+ import {
2
+ isSameMicrosecond
3
+ } from "./chunk-PPB62JYV.js";
4
+ import "./chunk-MJSZNWCV.js";
5
+ export {
6
+ isSameMicrosecond
7
+ };
8
+ //# sourceMappingURL=isSameMicrosecond.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=isSameMicrosecond.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isSameMicrosecond.test.d.ts","sourceRoot":"","sources":["../src/isSameMicrosecond.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,59 @@
1
+ import type { Temporal } from '@js-temporal/polyfill';
2
+ /**
3
+ * Returns true if both datetimes fall in the same millisecond.
4
+ * Compares the year, month, day, hour, minute, second, and millisecond fields directly.
5
+ * Ignores sub-millisecond precision (microseconds, nanoseconds).
6
+ *
7
+ * Instant inputs are converted to UTC. For ZonedDateTime inputs, their
8
+ * timezone is preserved. Convert to a common timezone before calling if
9
+ * you need to compare from a specific perspective.
10
+ *
11
+ * @param date1 - First datetime (Instant or ZonedDateTime)
12
+ * @param date2 - Second datetime (Instant or ZonedDateTime)
13
+ * @returns true if both dates are in the same millisecond, false otherwise
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * // Same timezone, same millisecond
18
+ * const time1 = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123Z[UTC]');
19
+ * const time2 = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123999Z[UTC]');
20
+ *
21
+ * isSameMillisecond(time1, time2); // true
22
+ * ```
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * // Same timezone, different milliseconds
27
+ * const ms123 = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123Z[UTC]');
28
+ * const ms124 = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.124Z[UTC]');
29
+ *
30
+ * isSameMillisecond(ms123, ms124); // false
31
+ * ```
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * // Different timezones - compares their local milliseconds
36
+ * const ny = Temporal.ZonedDateTime.from('2025-01-20T14:30:45.123-05:00[America/New_York]');
37
+ * const tokyo = Temporal.ZonedDateTime.from('2025-01-21T04:30:45.987+09:00[Asia/Tokyo]');
38
+ *
39
+ * // Same instant, different local milliseconds from each person's perspective
40
+ * isSameMillisecond(ny, tokyo); // false (14:30:45.123 in NY, 04:30:45.987 in Tokyo)
41
+ *
42
+ * // Convert to UTC to compare in UTC timezone
43
+ * isSameMillisecond(ny.withTimeZone('UTC'), tokyo.withTimeZone('UTC')); // true (both 19:30:45.123 in UTC)
44
+ *
45
+ * // Convert to NY timezone to compare from NY perspective
46
+ * isSameMillisecond(ny, tokyo.withTimeZone('America/New_York')); // true (both 14:30:45.123 in NY)
47
+ * ```
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * // Instant inputs are converted to UTC
52
+ * const instant1 = Temporal.Instant.from('2025-01-20T14:30:45.123456Z');
53
+ * const instant2 = Temporal.Instant.from('2025-01-20T14:30:45.123999Z');
54
+ *
55
+ * isSameMillisecond(instant1, instant2); // true (both 14:30:45.123 in UTC)
56
+ * ```
57
+ */
58
+ export declare function isSameMillisecond(date1: Temporal.Instant | Temporal.ZonedDateTime, date2: Temporal.Instant | Temporal.ZonedDateTime): boolean;
59
+ //# sourceMappingURL=isSameMillisecond.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isSameMillisecond.d.ts","sourceRoot":"","sources":["../src/isSameMillisecond.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EAChD,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,OAAO,CAaT"}
@@ -0,0 +1,8 @@
1
+ import {
2
+ isSameMillisecond
3
+ } from "./chunk-ISHZRFVN.js";
4
+ import "./chunk-MJSZNWCV.js";
5
+ export {
6
+ isSameMillisecond
7
+ };
8
+ //# sourceMappingURL=isSameMillisecond.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=isSameMillisecond.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isSameMillisecond.test.d.ts","sourceRoot":"","sources":["../src/isSameMillisecond.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,58 @@
1
+ import type { Temporal } from '@js-temporal/polyfill';
2
+ /**
3
+ * Returns true if both datetimes fall in the same minute.
4
+ * Compares the year, month, day, hour, and minute fields directly.
5
+ *
6
+ * Instant inputs are converted to UTC. For ZonedDateTime inputs, their
7
+ * timezone is preserved. Convert to a common timezone before calling if
8
+ * you need to compare from a specific perspective.
9
+ *
10
+ * @param date1 - First datetime (Instant or ZonedDateTime)
11
+ * @param date2 - Second datetime (Instant or ZonedDateTime)
12
+ * @returns true if both dates are in the same minute, false otherwise
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * // Same timezone, same minute
17
+ * const start = Temporal.ZonedDateTime.from('2025-01-20T14:30:00Z[UTC]');
18
+ * const end = Temporal.ZonedDateTime.from('2025-01-20T14:30:59.999Z[UTC]');
19
+ *
20
+ * isSameMinute(start, end); // true
21
+ * ```
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * // Same timezone, different minutes
26
+ * const min30 = Temporal.ZonedDateTime.from('2025-01-20T14:30:59Z[UTC]');
27
+ * const min31 = Temporal.ZonedDateTime.from('2025-01-20T14:31:00Z[UTC]');
28
+ *
29
+ * isSameMinute(min30, min31); // false
30
+ * ```
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * // Different timezones - compares their local minutes
35
+ * const ny = Temporal.ZonedDateTime.from('2025-01-20T14:30:45-05:00[America/New_York]');
36
+ * const tokyo = Temporal.ZonedDateTime.from('2025-01-21T04:30:45+09:00[Asia/Tokyo]');
37
+ *
38
+ * // Same instant, different local minutes from each person's perspective
39
+ * isSameMinute(ny, tokyo); // false (14:30:xx in NY, 04:30:xx in Tokyo)
40
+ *
41
+ * // Convert to UTC to compare in UTC timezone
42
+ * isSameMinute(ny.withTimeZone('UTC'), tokyo.withTimeZone('UTC')); // true (both 19:30:xx in UTC)
43
+ *
44
+ * // Convert to NY timezone to compare from NY perspective
45
+ * isSameMinute(ny, tokyo.withTimeZone('America/New_York')); // true (both 14:30:xx in NY)
46
+ * ```
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * // Instant inputs are converted to UTC
51
+ * const instant1 = Temporal.Instant.from('2025-01-20T14:30:15Z');
52
+ * const instant2 = Temporal.Instant.from('2025-01-20T14:30:45Z');
53
+ *
54
+ * isSameMinute(instant1, instant2); // true (both 14:30:xx in UTC)
55
+ * ```
56
+ */
57
+ export declare function isSameMinute(date1: Temporal.Instant | Temporal.ZonedDateTime, date2: Temporal.Instant | Temporal.ZonedDateTime): boolean;
58
+ //# sourceMappingURL=isSameMinute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isSameMinute.d.ts","sourceRoot":"","sources":["../src/isSameMinute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EAChD,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,OAAO,CAWT"}
@@ -0,0 +1,8 @@
1
+ import {
2
+ isSameMinute
3
+ } from "./chunk-LDO6PRNJ.js";
4
+ import "./chunk-MJSZNWCV.js";
5
+ export {
6
+ isSameMinute
7
+ };
8
+ //# sourceMappingURL=isSameMinute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=isSameMinute.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isSameMinute.test.d.ts","sourceRoot":"","sources":["../src/isSameMinute.test.ts"],"names":[],"mappings":""}