@gobrand/tiempo 2.10.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) hide show
  1. package/dist/addQuarters.d.ts +9 -9
  2. package/dist/addQuarters.d.ts.map +1 -1
  3. package/dist/addQuarters.js +1 -1
  4. package/dist/browserTimezone.d.ts +1 -1
  5. package/dist/chunk-25CVKMFC.js +21 -0
  6. package/dist/chunk-25CVKMFC.js.map +1 -0
  7. package/dist/{chunk-SDJJP4HW.js → chunk-3TS3D7WD.js} +4 -1
  8. package/dist/chunk-3TS3D7WD.js.map +1 -0
  9. package/dist/chunk-5Y5JH32Z.js +16 -0
  10. package/dist/chunk-5Y5JH32Z.js.map +1 -0
  11. package/dist/{chunk-KN45BU3W.js → chunk-7OEGJCW7.js} +10 -3
  12. package/dist/chunk-7OEGJCW7.js.map +1 -0
  13. package/dist/{chunk-XMW72PNW.js → chunk-7SCQV77A.js} +7 -1
  14. package/dist/chunk-7SCQV77A.js.map +1 -0
  15. package/dist/{chunk-5CFWMIHL.js → chunk-BV32K227.js} +7 -1
  16. package/dist/chunk-BV32K227.js.map +1 -0
  17. package/dist/chunk-GR7322AQ.js +20 -0
  18. package/dist/chunk-GR7322AQ.js.map +1 -0
  19. package/dist/chunk-KPB5ENNM.js +25 -0
  20. package/dist/chunk-KPB5ENNM.js.map +1 -0
  21. package/dist/{chunk-PVOGE6ME.js → chunk-MTDZG4HK.js} +4 -1
  22. package/dist/chunk-MTDZG4HK.js.map +1 -0
  23. package/dist/{chunk-SPK7C7RP.js → chunk-OSBVYUOQ.js} +13 -3
  24. package/dist/chunk-OSBVYUOQ.js.map +1 -0
  25. package/dist/{chunk-TGINH5JV.js → chunk-OVSCDXYN.js} +7 -1
  26. package/dist/chunk-OVSCDXYN.js.map +1 -0
  27. package/dist/{chunk-7HUJC5M6.js → chunk-S7L5KBI4.js} +4 -4
  28. package/dist/chunk-UQ2F3I2S.js +19 -0
  29. package/dist/chunk-UQ2F3I2S.js.map +1 -0
  30. package/dist/{chunk-RXTGHEHQ.js → chunk-VQAGV72H.js} +7 -6
  31. package/dist/chunk-VQAGV72H.js.map +1 -0
  32. package/dist/{chunk-VCWP3CZE.js → chunk-YNLBS34B.js} +9 -3
  33. package/dist/chunk-YNLBS34B.js.map +1 -0
  34. package/dist/chunk-YRCFMGBH.js +54 -0
  35. package/dist/chunk-YRCFMGBH.js.map +1 -0
  36. package/dist/differenceInDays.d.ts +2 -2
  37. package/dist/differenceInHours.d.ts +2 -2
  38. package/dist/differenceInMicroseconds.d.ts +1 -1
  39. package/dist/differenceInMilliseconds.d.ts +1 -1
  40. package/dist/differenceInMinutes.d.ts +2 -2
  41. package/dist/differenceInMonths.d.ts +2 -2
  42. package/dist/differenceInNanoseconds.d.ts +1 -1
  43. package/dist/differenceInQuarters.d.ts +13 -17
  44. package/dist/differenceInQuarters.d.ts.map +1 -1
  45. package/dist/differenceInQuarters.js +1 -1
  46. package/dist/differenceInSeconds.d.ts +2 -2
  47. package/dist/differenceInWeeks.d.ts +2 -2
  48. package/dist/differenceInYears.d.ts +2 -2
  49. package/dist/eachDayOfInterval.d.ts +1 -1
  50. package/dist/eachHourOfInterval.d.ts +1 -1
  51. package/dist/eachMinuteOfInterval.d.ts +1 -1
  52. package/dist/eachMonthOfInterval.d.ts +1 -1
  53. package/dist/eachQuarterOfInterval.d.ts +23 -27
  54. package/dist/eachQuarterOfInterval.d.ts.map +1 -1
  55. package/dist/eachQuarterOfInterval.js +1 -1
  56. package/dist/eachWeekOfInterval.d.ts +1 -1
  57. package/dist/eachYearOfInterval.d.ts +1 -1
  58. package/dist/endOfDay.d.ts +2 -2
  59. package/dist/endOfDay.js +2 -2
  60. package/dist/endOfMonth.d.ts +14 -4
  61. package/dist/endOfMonth.d.ts.map +1 -1
  62. package/dist/endOfMonth.js +2 -2
  63. package/dist/endOfQuarter.d.ts +3 -2
  64. package/dist/endOfQuarter.d.ts.map +1 -1
  65. package/dist/endOfQuarter.js +2 -2
  66. package/dist/endOfWeek.d.ts +13 -3
  67. package/dist/endOfWeek.d.ts.map +1 -1
  68. package/dist/endOfWeek.js +1 -1
  69. package/dist/endOfYear.d.ts +14 -4
  70. package/dist/endOfYear.d.ts.map +1 -1
  71. package/dist/endOfYear.js +2 -2
  72. package/dist/format.d.ts +1 -1
  73. package/dist/formatPlainDate.d.ts +1 -1
  74. package/dist/getQuarter.d.ts +8 -25
  75. package/dist/getQuarter.d.ts.map +1 -1
  76. package/dist/getQuarter.js +1 -3
  77. package/dist/index.d.ts +92 -92
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +23 -23
  80. package/dist/isAfter.d.ts +1 -1
  81. package/dist/isBefore.d.ts +1 -1
  82. package/dist/isPlainDateAfter.d.ts +1 -1
  83. package/dist/isPlainDateBefore.d.ts +1 -1
  84. package/dist/isPlainDateEqual.d.ts +1 -1
  85. package/dist/isPlainTimeAfter.d.ts +1 -1
  86. package/dist/isPlainTimeBefore.d.ts +1 -1
  87. package/dist/isPlainTimeEqual.d.ts +1 -1
  88. package/dist/isSameDay.d.ts +1 -1
  89. package/dist/isSameQuarter.d.ts +12 -23
  90. package/dist/isSameQuarter.d.ts.map +1 -1
  91. package/dist/isSameQuarter.js +1 -1
  92. package/dist/isWithinInterval.d.ts +1 -1
  93. package/dist/now.d.ts +2 -2
  94. package/dist/shared/differenceInMilliseconds.d.ts +1 -1
  95. package/dist/shared/isAfter.d.ts +1 -1
  96. package/dist/shared/isBefore.d.ts +1 -1
  97. package/dist/shared/normalizeWithPlainDate.d.ts +1 -1
  98. package/dist/shared/nowZoned.d.ts +1 -1
  99. package/dist/shared/plainDateToZonedDateTime.d.ts +2 -2
  100. package/dist/shared/temporal.d.ts +1 -1
  101. package/dist/simpleFormat.d.ts +2 -2
  102. package/dist/startOfDay.d.ts +2 -2
  103. package/dist/startOfMonth.d.ts +14 -4
  104. package/dist/startOfMonth.d.ts.map +1 -1
  105. package/dist/startOfMonth.js +1 -1
  106. package/dist/startOfQuarter.d.ts +3 -2
  107. package/dist/startOfQuarter.d.ts.map +1 -1
  108. package/dist/startOfQuarter.js +1 -1
  109. package/dist/startOfWeek.d.ts +13 -3
  110. package/dist/startOfWeek.d.ts.map +1 -1
  111. package/dist/startOfWeek.js +1 -1
  112. package/dist/startOfYear.d.ts +14 -4
  113. package/dist/startOfYear.d.ts.map +1 -1
  114. package/dist/startOfYear.js +1 -1
  115. package/dist/subQuarters.d.ts +12 -5
  116. package/dist/subQuarters.d.ts.map +1 -1
  117. package/dist/subQuarters.js +2 -2
  118. package/dist/toInstant.d.ts +27 -0
  119. package/dist/toInstant.d.ts.map +1 -0
  120. package/dist/toInstant.js +8 -0
  121. package/dist/toPlainDate.d.ts +2 -2
  122. package/dist/toPlainTime.d.ts +2 -2
  123. package/dist/toZonedTime.d.ts +2 -2
  124. package/dist/today.d.ts +2 -2
  125. package/dist/types.d.ts +1 -1
  126. package/package.json +5 -3
  127. package/dist/addDays.test.d.ts +0 -2
  128. package/dist/addDays.test.d.ts.map +0 -1
  129. package/dist/addHours.test.d.ts +0 -2
  130. package/dist/addHours.test.d.ts.map +0 -1
  131. package/dist/addMicroseconds.test.d.ts +0 -2
  132. package/dist/addMicroseconds.test.d.ts.map +0 -1
  133. package/dist/addMilliseconds.test.d.ts +0 -2
  134. package/dist/addMilliseconds.test.d.ts.map +0 -1
  135. package/dist/addMinutes.test.d.ts +0 -2
  136. package/dist/addMinutes.test.d.ts.map +0 -1
  137. package/dist/addMonths.test.d.ts +0 -2
  138. package/dist/addMonths.test.d.ts.map +0 -1
  139. package/dist/addNanoseconds.test.d.ts +0 -2
  140. package/dist/addNanoseconds.test.d.ts.map +0 -1
  141. package/dist/addQuarters.test.d.ts +0 -2
  142. package/dist/addQuarters.test.d.ts.map +0 -1
  143. package/dist/addSeconds.test.d.ts +0 -2
  144. package/dist/addSeconds.test.d.ts.map +0 -1
  145. package/dist/addWeeks.test.d.ts +0 -2
  146. package/dist/addWeeks.test.d.ts.map +0 -1
  147. package/dist/addYears.test.d.ts +0 -2
  148. package/dist/addYears.test.d.ts.map +0 -1
  149. package/dist/browserTimezone.test.d.ts +0 -2
  150. package/dist/browserTimezone.test.d.ts.map +0 -1
  151. package/dist/chunk-5CFWMIHL.js.map +0 -1
  152. package/dist/chunk-6UBZ5YB3.js +0 -43
  153. package/dist/chunk-6UBZ5YB3.js.map +0 -1
  154. package/dist/chunk-FYZNOTX3.js +0 -18
  155. package/dist/chunk-FYZNOTX3.js.map +0 -1
  156. package/dist/chunk-KN45BU3W.js.map +0 -1
  157. package/dist/chunk-NOV3D7OM.js +0 -17
  158. package/dist/chunk-NOV3D7OM.js.map +0 -1
  159. package/dist/chunk-PVOGE6ME.js.map +0 -1
  160. package/dist/chunk-RXTGHEHQ.js.map +0 -1
  161. package/dist/chunk-SDJJP4HW.js.map +0 -1
  162. package/dist/chunk-SPK7C7RP.js.map +0 -1
  163. package/dist/chunk-TGINH5JV.js.map +0 -1
  164. package/dist/chunk-VCWP3CZE.js.map +0 -1
  165. package/dist/chunk-VUKOSQWW.js +0 -14
  166. package/dist/chunk-VUKOSQWW.js.map +0 -1
  167. package/dist/chunk-W5YDBBNF.js +0 -13
  168. package/dist/chunk-W5YDBBNF.js.map +0 -1
  169. package/dist/chunk-XMW72PNW.js.map +0 -1
  170. package/dist/chunk-ZEL6JBBH.js +0 -14
  171. package/dist/chunk-ZEL6JBBH.js.map +0 -1
  172. package/dist/differenceInDays.test.d.ts +0 -2
  173. package/dist/differenceInDays.test.d.ts.map +0 -1
  174. package/dist/differenceInHours.test.d.ts +0 -2
  175. package/dist/differenceInHours.test.d.ts.map +0 -1
  176. package/dist/differenceInMicroseconds.test.d.ts +0 -2
  177. package/dist/differenceInMicroseconds.test.d.ts.map +0 -1
  178. package/dist/differenceInMilliseconds.test.d.ts +0 -2
  179. package/dist/differenceInMilliseconds.test.d.ts.map +0 -1
  180. package/dist/differenceInMinutes.test.d.ts +0 -2
  181. package/dist/differenceInMinutes.test.d.ts.map +0 -1
  182. package/dist/differenceInMonths.test.d.ts +0 -2
  183. package/dist/differenceInMonths.test.d.ts.map +0 -1
  184. package/dist/differenceInNanoseconds.test.d.ts +0 -2
  185. package/dist/differenceInNanoseconds.test.d.ts.map +0 -1
  186. package/dist/differenceInQuarters.test.d.ts +0 -2
  187. package/dist/differenceInQuarters.test.d.ts.map +0 -1
  188. package/dist/differenceInSeconds.test.d.ts +0 -2
  189. package/dist/differenceInSeconds.test.d.ts.map +0 -1
  190. package/dist/differenceInWeeks.test.d.ts +0 -2
  191. package/dist/differenceInWeeks.test.d.ts.map +0 -1
  192. package/dist/differenceInYears.test.d.ts +0 -2
  193. package/dist/differenceInYears.test.d.ts.map +0 -1
  194. package/dist/eachDayOfInterval.test.d.ts +0 -2
  195. package/dist/eachDayOfInterval.test.d.ts.map +0 -1
  196. package/dist/eachHourOfInterval.test.d.ts +0 -2
  197. package/dist/eachHourOfInterval.test.d.ts.map +0 -1
  198. package/dist/eachMinuteOfInterval.test.d.ts +0 -2
  199. package/dist/eachMinuteOfInterval.test.d.ts.map +0 -1
  200. package/dist/eachMonthOfInterval.test.d.ts +0 -2
  201. package/dist/eachMonthOfInterval.test.d.ts.map +0 -1
  202. package/dist/eachQuarterOfInterval.test.d.ts +0 -2
  203. package/dist/eachQuarterOfInterval.test.d.ts.map +0 -1
  204. package/dist/eachWeekOfInterval.test.d.ts +0 -2
  205. package/dist/eachWeekOfInterval.test.d.ts.map +0 -1
  206. package/dist/eachYearOfInterval.test.d.ts +0 -2
  207. package/dist/eachYearOfInterval.test.d.ts.map +0 -1
  208. package/dist/endOfDay.test.d.ts +0 -2
  209. package/dist/endOfDay.test.d.ts.map +0 -1
  210. package/dist/endOfMonth.test.d.ts +0 -2
  211. package/dist/endOfMonth.test.d.ts.map +0 -1
  212. package/dist/endOfQuarter.test.d.ts +0 -2
  213. package/dist/endOfQuarter.test.d.ts.map +0 -1
  214. package/dist/endOfWeek.test.d.ts +0 -2
  215. package/dist/endOfWeek.test.d.ts.map +0 -1
  216. package/dist/endOfYear.test.d.ts +0 -2
  217. package/dist/endOfYear.test.d.ts.map +0 -1
  218. package/dist/format.test.d.ts +0 -2
  219. package/dist/format.test.d.ts.map +0 -1
  220. package/dist/formatPlainDate.test.d.ts +0 -2
  221. package/dist/formatPlainDate.test.d.ts.map +0 -1
  222. package/dist/getQuarter.test.d.ts +0 -2
  223. package/dist/getQuarter.test.d.ts.map +0 -1
  224. package/dist/index.test.d.ts +0 -2
  225. package/dist/index.test.d.ts.map +0 -1
  226. package/dist/intlFormatDistance.test.d.ts +0 -2
  227. package/dist/intlFormatDistance.test.d.ts.map +0 -1
  228. package/dist/isAfter.test.d.ts +0 -2
  229. package/dist/isAfter.test.d.ts.map +0 -1
  230. package/dist/isBefore.test.d.ts +0 -2
  231. package/dist/isBefore.test.d.ts.map +0 -1
  232. package/dist/isFuture.test.d.ts +0 -2
  233. package/dist/isFuture.test.d.ts.map +0 -1
  234. package/dist/isPast.test.d.ts +0 -2
  235. package/dist/isPast.test.d.ts.map +0 -1
  236. package/dist/isPlainDateAfter.test.d.ts +0 -2
  237. package/dist/isPlainDateAfter.test.d.ts.map +0 -1
  238. package/dist/isPlainDateBefore.test.d.ts +0 -2
  239. package/dist/isPlainDateBefore.test.d.ts.map +0 -1
  240. package/dist/isPlainDateEqual.test.d.ts +0 -2
  241. package/dist/isPlainDateEqual.test.d.ts.map +0 -1
  242. package/dist/isPlainTimeAfter.test.d.ts +0 -2
  243. package/dist/isPlainTimeAfter.test.d.ts.map +0 -1
  244. package/dist/isPlainTimeBefore.test.d.ts +0 -2
  245. package/dist/isPlainTimeBefore.test.d.ts.map +0 -1
  246. package/dist/isPlainTimeEqual.test.d.ts +0 -2
  247. package/dist/isPlainTimeEqual.test.d.ts.map +0 -1
  248. package/dist/isSameDay.test.d.ts +0 -2
  249. package/dist/isSameDay.test.d.ts.map +0 -1
  250. package/dist/isSameHour.test.d.ts +0 -2
  251. package/dist/isSameHour.test.d.ts.map +0 -1
  252. package/dist/isSameMicrosecond.test.d.ts +0 -2
  253. package/dist/isSameMicrosecond.test.d.ts.map +0 -1
  254. package/dist/isSameMillisecond.test.d.ts +0 -2
  255. package/dist/isSameMillisecond.test.d.ts.map +0 -1
  256. package/dist/isSameMinute.test.d.ts +0 -2
  257. package/dist/isSameMinute.test.d.ts.map +0 -1
  258. package/dist/isSameMonth.test.d.ts +0 -2
  259. package/dist/isSameMonth.test.d.ts.map +0 -1
  260. package/dist/isSameNanosecond.test.d.ts +0 -2
  261. package/dist/isSameNanosecond.test.d.ts.map +0 -1
  262. package/dist/isSameQuarter.test.d.ts +0 -2
  263. package/dist/isSameQuarter.test.d.ts.map +0 -1
  264. package/dist/isSameSecond.test.d.ts +0 -2
  265. package/dist/isSameSecond.test.d.ts.map +0 -1
  266. package/dist/isSameWeek.test.d.ts +0 -2
  267. package/dist/isSameWeek.test.d.ts.map +0 -1
  268. package/dist/isSameYear.test.d.ts +0 -2
  269. package/dist/isSameYear.test.d.ts.map +0 -1
  270. package/dist/isWithinInterval.test.d.ts +0 -2
  271. package/dist/isWithinInterval.test.d.ts.map +0 -1
  272. package/dist/now.test.d.ts +0 -2
  273. package/dist/now.test.d.ts.map +0 -1
  274. package/dist/roundToNearestHour.test.d.ts +0 -2
  275. package/dist/roundToNearestHour.test.d.ts.map +0 -1
  276. package/dist/roundToNearestMinute.test.d.ts +0 -2
  277. package/dist/roundToNearestMinute.test.d.ts.map +0 -1
  278. package/dist/roundToNearestSecond.test.d.ts +0 -2
  279. package/dist/roundToNearestSecond.test.d.ts.map +0 -1
  280. package/dist/shared/temporal.test.d.ts +0 -2
  281. package/dist/shared/temporal.test.d.ts.map +0 -1
  282. package/dist/simpleFormat.test.d.ts +0 -2
  283. package/dist/simpleFormat.test.d.ts.map +0 -1
  284. package/dist/startOfDay.test.d.ts +0 -2
  285. package/dist/startOfDay.test.d.ts.map +0 -1
  286. package/dist/startOfMonth.test.d.ts +0 -2
  287. package/dist/startOfMonth.test.d.ts.map +0 -1
  288. package/dist/startOfQuarter.test.d.ts +0 -2
  289. package/dist/startOfQuarter.test.d.ts.map +0 -1
  290. package/dist/startOfWeek.test.d.ts +0 -2
  291. package/dist/startOfWeek.test.d.ts.map +0 -1
  292. package/dist/startOfYear.test.d.ts +0 -2
  293. package/dist/startOfYear.test.d.ts.map +0 -1
  294. package/dist/subDays.test.d.ts +0 -2
  295. package/dist/subDays.test.d.ts.map +0 -1
  296. package/dist/subHours.test.d.ts +0 -2
  297. package/dist/subHours.test.d.ts.map +0 -1
  298. package/dist/subMicroseconds.test.d.ts +0 -2
  299. package/dist/subMicroseconds.test.d.ts.map +0 -1
  300. package/dist/subMilliseconds.test.d.ts +0 -2
  301. package/dist/subMilliseconds.test.d.ts.map +0 -1
  302. package/dist/subMinutes.test.d.ts +0 -2
  303. package/dist/subMinutes.test.d.ts.map +0 -1
  304. package/dist/subMonths.test.d.ts +0 -2
  305. package/dist/subMonths.test.d.ts.map +0 -1
  306. package/dist/subNanoseconds.test.d.ts +0 -2
  307. package/dist/subNanoseconds.test.d.ts.map +0 -1
  308. package/dist/subQuarters.test.d.ts +0 -2
  309. package/dist/subQuarters.test.d.ts.map +0 -1
  310. package/dist/subSeconds.test.d.ts +0 -2
  311. package/dist/subSeconds.test.d.ts.map +0 -1
  312. package/dist/subWeeks.test.d.ts +0 -2
  313. package/dist/subWeeks.test.d.ts.map +0 -1
  314. package/dist/subYears.test.d.ts +0 -2
  315. package/dist/subYears.test.d.ts.map +0 -1
  316. package/dist/toDate.test.d.ts +0 -2
  317. package/dist/toDate.test.d.ts.map +0 -1
  318. package/dist/toIso.test.d.ts +0 -2
  319. package/dist/toIso.test.d.ts.map +0 -1
  320. package/dist/toIso9075.test.d.ts +0 -2
  321. package/dist/toIso9075.test.d.ts.map +0 -1
  322. package/dist/toPlainDate.test.d.ts +0 -2
  323. package/dist/toPlainDate.test.d.ts.map +0 -1
  324. package/dist/toPlainTime.test.d.ts +0 -2
  325. package/dist/toPlainTime.test.d.ts.map +0 -1
  326. package/dist/toUtc.d.ts +0 -27
  327. package/dist/toUtc.d.ts.map +0 -1
  328. package/dist/toUtc.js +0 -8
  329. package/dist/toUtc.test.d.ts +0 -2
  330. package/dist/toUtc.test.d.ts.map +0 -1
  331. package/dist/toZonedTime.test.d.ts +0 -2
  332. package/dist/toZonedTime.test.d.ts.map +0 -1
  333. package/dist/today.test.d.ts +0 -2
  334. package/dist/today.test.d.ts.map +0 -1
  335. /package/dist/{chunk-7HUJC5M6.js.map → chunk-S7L5KBI4.js.map} +0 -0
  336. /package/dist/{toUtc.js.map → toInstant.js.map} +0 -0
@@ -1,5 +1,5 @@
1
- import { Temporal } from "./shared/temporal";
2
- import type { Timezone } from "./types";
1
+ import type { Temporal } from "@js-temporal/polyfill";
2
+ import type { Timezone } from "./types.js";
3
3
  /**
4
4
  * Returns a ZonedDateTime representing the first moment of the quarter
5
5
  * (first day of the quarter's starting month at midnight).
@@ -34,5 +34,6 @@ import type { Timezone } from "./types";
34
34
  * ```
35
35
  */
36
36
  export declare function startOfQuarter(input: Temporal.Instant | Temporal.ZonedDateTime): Temporal.ZonedDateTime;
37
+ export declare function startOfQuarter(input: Temporal.PlainDate): Temporal.PlainDate;
37
38
  export declare function startOfQuarter(input: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;
38
39
  //# sourceMappingURL=startOfQuarter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"startOfQuarter.d.ts","sourceRoot":"","sources":["../src/startOfQuarter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,QAAQ,CAAC,aAAa,CAAC;AAC1B,wBAAgB,cAAc,CAC5B,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,aAAa,CAAC"}
1
+ {"version":3,"file":"startOfQuarter.d.ts","sourceRoot":"","sources":["../src/startOfQuarter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,QAAQ,CAAC,aAAa,CAAC;AAC1B,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;AAC9E,wBAAgB,cAAc,CAC5B,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,aAAa,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  startOfQuarter
3
- } from "./chunk-XMW72PNW.js";
3
+ } from "./chunk-7SCQV77A.js";
4
4
  import "./chunk-XS2HUADA.js";
5
5
  import "./chunk-ZOHYNJUD.js";
6
6
  import "./chunk-L5AMAEWX.js";
@@ -1,8 +1,9 @@
1
1
  import type { Temporal } from '@js-temporal/polyfill';
2
- import type { Timezone } from './types';
2
+ import type { Timezone } from './types.js';
3
3
  /**
4
- * Returns a ZonedDateTime representing the first moment of the week (Monday at midnight).
4
+ * Returns the first boundary of the week (Monday).
5
5
  * Uses ISO 8601 week definition: weeks start on Monday.
6
+ * PlainDate inputs stay in calendar space unless a timezone is provided.
6
7
  *
7
8
  * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime
8
9
  * @returns ZonedDateTime at Monday 00:00:00.000000000
@@ -25,12 +26,21 @@ import type { Timezone } from './types';
25
26
  *
26
27
  * @example
27
28
  * ```ts
28
- * // From PlainDate (requires timezone)
29
+ * // From PlainDate (stays a date)
30
+ * const date = Temporal.PlainDate.from('2025-01-22'); // Wednesday
31
+ * const start = startOfWeek(date);
32
+ * // 2025-01-20 (previous Monday)
33
+ * ```
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * // From PlainDate with a timezone (returns a ZonedDateTime)
29
38
  * const date = Temporal.PlainDate.from('2025-01-22'); // Wednesday
30
39
  * const start = startOfWeek(date, 'America/New_York');
31
40
  * // 2025-01-20T00:00:00-05:00[America/New_York] (previous Monday)
32
41
  * ```
33
42
  */
34
43
  export declare function startOfWeek(input: Temporal.Instant | Temporal.ZonedDateTime): Temporal.ZonedDateTime;
44
+ export declare function startOfWeek(input: Temporal.PlainDate): Temporal.PlainDate;
35
45
  export declare function startOfWeek(input: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;
36
46
  //# sourceMappingURL=startOfWeek.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"startOfWeek.d.ts","sourceRoot":"","sources":["../src/startOfWeek.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,QAAQ,CAAC,aAAa,CAAC;AAC1B,wBAAgB,WAAW,CACzB,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,aAAa,CAAC"}
1
+ {"version":3,"file":"startOfWeek.d.ts","sourceRoot":"","sources":["../src/startOfWeek.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,QAAQ,CAAC,aAAa,CAAC;AAC1B,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;AAC3E,wBAAgB,WAAW,CACzB,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,aAAa,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  startOfWeek
3
- } from "./chunk-SDJJP4HW.js";
3
+ } from "./chunk-3TS3D7WD.js";
4
4
  import "./chunk-L5AMAEWX.js";
5
5
  import "./chunk-NTMT5XGC.js";
6
6
  import "./chunk-R7ZCA6AQ.js";
@@ -1,7 +1,8 @@
1
- import { Temporal } from './shared/temporal';
2
- import type { Timezone } from './types';
1
+ import { Temporal } from './shared/temporal.js';
2
+ import type { Timezone } from './types.js';
3
3
  /**
4
- * Returns a ZonedDateTime representing the first moment of the year (January 1 at midnight).
4
+ * Returns the first boundary of the year.
5
+ * PlainDate inputs stay in calendar space unless a timezone is provided.
5
6
  *
6
7
  * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime
7
8
  * @returns ZonedDateTime at January 1st at 00:00:00.000000000
@@ -24,12 +25,21 @@ import type { Timezone } from './types';
24
25
  *
25
26
  * @example
26
27
  * ```ts
27
- * // From PlainDate (requires timezone)
28
+ * // From PlainDate (stays a date)
29
+ * const date = Temporal.PlainDate.from('2025-06-15');
30
+ * const start = startOfYear(date);
31
+ * // 2025-01-01
32
+ * ```
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * // From PlainDate with a timezone (returns a ZonedDateTime)
28
37
  * const date = Temporal.PlainDate.from('2025-06-15');
29
38
  * const start = startOfYear(date, 'America/New_York');
30
39
  * // 2025-01-01T00:00:00-05:00[America/New_York]
31
40
  * ```
32
41
  */
33
42
  export declare function startOfYear(input: Temporal.Instant | Temporal.ZonedDateTime): Temporal.ZonedDateTime;
43
+ export declare function startOfYear(input: Temporal.PlainDate): Temporal.PlainDate;
34
44
  export declare function startOfYear(input: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;
35
45
  //# sourceMappingURL=startOfYear.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"startOfYear.d.ts","sourceRoot":"","sources":["../src/startOfYear.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,QAAQ,CAAC,aAAa,CAAC;AAC1B,wBAAgB,WAAW,CACzB,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,aAAa,CAAC"}
1
+ {"version":3,"file":"startOfYear.d.ts","sourceRoot":"","sources":["../src/startOfYear.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAC/C,QAAQ,CAAC,aAAa,CAAC;AAC1B,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;AAC3E,wBAAgB,WAAW,CACzB,KAAK,EAAE,QAAQ,CAAC,SAAS,EACzB,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CAAC,aAAa,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  startOfYear
3
- } from "./chunk-TGINH5JV.js";
3
+ } from "./chunk-OVSCDXYN.js";
4
4
  import "./chunk-ZOHYNJUD.js";
5
5
  import "./chunk-L5AMAEWX.js";
6
6
  import "./chunk-NTMT5XGC.js";
@@ -1,20 +1,27 @@
1
1
  import type { Temporal } from "@js-temporal/polyfill";
2
2
  /**
3
- * Subtracts the specified number of quarters (3-month blocks) from a datetime.
3
+ * Subtracts the specified number of quarters (3-month blocks) from a datetime or date.
4
4
  *
5
- * This is a convenience wrapper around addQuarters with negated value.
6
- * Properly handles month-end dates and calendar edge cases through Temporal API.
5
+ * This is a convenience wrapper around addQuarters with the count negated.
6
+ * PlainDate inputs stay in calendar space and return a PlainDate.
7
7
  *
8
8
  * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime
9
9
  * @param quarters - Number of quarters to subtract
10
- * @returns ZonedDateTime with quarters subtracted, in the same timezone as input
10
+ * @returns A ZonedDateTime (for Instant/ZonedDateTime) with the quarters subtracted
11
11
  *
12
12
  * @example
13
13
  * ```ts
14
14
  * const instant = Temporal.Instant.from('2025-07-20T12:00:00Z');
15
- * const result = subQuarters(instant, 2);
15
+ * subQuarters(instant, 2);
16
16
  * // 2025-01-20T12:00:00Z[UTC] (6 months earlier)
17
17
  * ```
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * subQuarters(Temporal.PlainDate.from('2025-07-20'), 1);
22
+ * // 2025-04-20
23
+ * ```
18
24
  */
19
25
  export declare function subQuarters(input: Temporal.Instant | Temporal.ZonedDateTime, quarters: number): Temporal.ZonedDateTime;
26
+ export declare function subQuarters(input: Temporal.PlainDate, quarters: number): Temporal.PlainDate;
20
27
  //# sourceMappingURL=subQuarters.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subQuarters.d.ts","sourceRoot":"","sources":["../src/subQuarters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EAChD,QAAQ,EAAE,MAAM,GACf,QAAQ,CAAC,aAAa,CAExB"}
1
+ {"version":3,"file":"subQuarters.d.ts","sourceRoot":"","sources":["../src/subQuarters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EAChD,QAAQ,EAAE,MAAM,GACf,QAAQ,CAAC,aAAa,CAAC;AAC1B,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  subQuarters
3
- } from "./chunk-W5YDBBNF.js";
4
- import "./chunk-ZEL6JBBH.js";
3
+ } from "./chunk-5Y5JH32Z.js";
4
+ import "./chunk-UQ2F3I2S.js";
5
5
  import "./chunk-NTMT5XGC.js";
6
6
  import "./chunk-R7ZCA6AQ.js";
7
7
  export {
@@ -0,0 +1,27 @@
1
+ import { Temporal } from './shared/temporal.js';
2
+ /**
3
+ * Converts a timeline representation to a Temporal.Instant.
4
+ *
5
+ * Instant inputs are returned unchanged. ZonedDateTime inputs preserve their
6
+ * exact moment while dropping timezone and calendar context.
7
+ *
8
+ * @param input - An Instant, ZonedDateTime, UTC ISO string, Unix timestamp, or Date
9
+ * @returns A timezone-independent Temporal.Instant
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * const instant = toInstant('2025-01-20T20:00:00Z');
14
+ * // 2025-01-20T20:00:00Z
15
+ * ```
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * const zoned = Temporal.ZonedDateTime.from(
20
+ * '2025-01-20T15:00:00-05:00[America/New_York]'
21
+ * );
22
+ * const instant = toInstant(zoned);
23
+ * // 2025-01-20T20:00:00Z
24
+ * ```
25
+ */
26
+ export declare function toInstant(input: string | number | Date | Temporal.Instant | Temporal.ZonedDateTime): Temporal.Instant;
27
+ //# sourceMappingURL=toInstant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toInstant.d.ts","sourceRoot":"","sources":["../src/toInstant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,mBAAmB,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GACxE,QAAQ,CAAC,OAAO,CAclB"}
@@ -0,0 +1,8 @@
1
+ import {
2
+ toInstant
3
+ } from "./chunk-VQAGV72H.js";
4
+ import "./chunk-R7ZCA6AQ.js";
5
+ export {
6
+ toInstant
7
+ };
8
+ //# sourceMappingURL=toInstant.js.map
@@ -1,5 +1,5 @@
1
- import { Temporal } from './shared/temporal';
2
- import type { Timezone } from './types';
1
+ import { Temporal } from './shared/temporal.js';
2
+ import type { Timezone } from './types.js';
3
3
  /**
4
4
  * Parse a plain date or extract the calendar date from a datetime.
5
5
  *
@@ -1,5 +1,5 @@
1
- import { Temporal } from './shared/temporal';
2
- import type { Timezone } from './types';
1
+ import { Temporal } from './shared/temporal.js';
2
+ import type { Timezone } from './types.js';
3
3
  /**
4
4
  * Parse a plain time or extract the wall-clock time from a datetime.
5
5
  *
@@ -1,5 +1,5 @@
1
- import { Temporal } from './shared/temporal';
2
- import type { Timezone } from './types';
1
+ import { Temporal } from './shared/temporal.js';
2
+ import type { Timezone } from './types.js';
3
3
  /**
4
4
  * Convert a UTC ISO string, Unix timestamp, Date, Instant, or ZonedDateTime to a ZonedDateTime in the specified timezone.
5
5
  *
package/dist/today.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Temporal } from './shared/temporal';
2
- import type { Timezone } from './types';
1
+ import { Temporal } from './shared/temporal.js';
2
+ import type { Timezone } from './types.js';
3
3
  /**
4
4
  * Get today's date in the specified timezone.
5
5
  *
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { IANATimezone } from './types/iana-timezones';
1
+ import type { IANATimezone } from './types/iana-timezones.js';
2
2
  /**
3
3
  * Timezone identifier.
4
4
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gobrand/tiempo",
3
- "version": "2.10.0",
4
- "description": "Lightweight utility functions for converting between UTC and timezone-aware datetimes using the Temporal API",
3
+ "version": "3.0.0",
4
+ "description": "Lightweight timezone-safe date and time utilities built on the Temporal API",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -31,9 +31,11 @@
31
31
  "homepage": "https://eng.gobrand.app/tiempo",
32
32
  "scripts": {
33
33
  "generate:timezones": "tsx scripts/generate-timezone-types.ts",
34
+ "generate:matrix": "tsx scripts/generate-capability-matrix.ts",
34
35
  "generate:docs": "tsx scripts/generate-docs.ts",
35
- "build": "pnpm generate:timezones && pnpm generate:docs && tsup && tsc --emitDeclarationOnly",
36
+ "build": "pnpm generate:timezones && pnpm generate:matrix && pnpm generate:docs && tsup && tsc -p tsconfig.build.json --emitDeclarationOnly && tsx scripts/fix-declaration-imports.ts && pnpm smoke:package",
36
37
  "clean": "git clean -xdf .cache .turbo dist node_modules tsconfig.tsbuildinfo",
38
+ "smoke:package": "tsc -p smoke/tsconfig.json && tsx smoke/consumer.ts",
37
39
  "test": "vitest",
38
40
  "typecheck": "tsc --noEmit",
39
41
  "release": "bash scripts/release.sh"
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=addDays.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addDays.test.d.ts","sourceRoot":"","sources":["../src/addDays.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=addHours.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addHours.test.d.ts","sourceRoot":"","sources":["../src/addHours.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=addMicroseconds.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addMicroseconds.test.d.ts","sourceRoot":"","sources":["../src/addMicroseconds.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=addMilliseconds.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addMilliseconds.test.d.ts","sourceRoot":"","sources":["../src/addMilliseconds.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=addMinutes.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addMinutes.test.d.ts","sourceRoot":"","sources":["../src/addMinutes.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=addMonths.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addMonths.test.d.ts","sourceRoot":"","sources":["../src/addMonths.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=addNanoseconds.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addNanoseconds.test.d.ts","sourceRoot":"","sources":["../src/addNanoseconds.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=addQuarters.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addQuarters.test.d.ts","sourceRoot":"","sources":["../src/addQuarters.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=addSeconds.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addSeconds.test.d.ts","sourceRoot":"","sources":["../src/addSeconds.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=addWeeks.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addWeeks.test.d.ts","sourceRoot":"","sources":["../src/addWeeks.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=addYears.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addYears.test.d.ts","sourceRoot":"","sources":["../src/addYears.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=browserTimezone.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browserTimezone.test.d.ts","sourceRoot":"","sources":["../src/browserTimezone.test.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/startOfMonth.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\nimport type { Timezone } from './types';\nimport { normalizeWithPlainDate } from './shared/normalizeWithPlainDate';\n\n/**\n * Returns a ZonedDateTime representing the first moment of the month (day 1 at midnight).\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at the 1st day of the month at 00:00:00.000000000\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-01-15T12:00:00Z');\n * const start = startOfMonth(instant);\n * // 2025-01-01T00:00:00Z[UTC]\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-01-15T15:30:00-05:00[America/New_York]');\n * const start = startOfMonth(zoned);\n * // 2025-01-01T00:00:00-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (requires timezone)\n * const date = Temporal.PlainDate.from('2025-01-15');\n * const start = startOfMonth(date, 'America/New_York');\n * // 2025-01-01T00:00:00-05:00[America/New_York]\n * ```\n */\nexport function startOfMonth(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function startOfMonth(\n input: Temporal.PlainDate,\n timezone: Timezone\n): Temporal.ZonedDateTime;\nexport function startOfMonth(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone\n): Temporal.ZonedDateTime {\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n const firstDay = zonedDateTime.with({ day: 1 });\n return firstDay.startOfDay();\n}\n"],"mappings":";;;;;AAyCO,SAAS,aACd,OACA,UACwB;AACxB,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,QAAM,WAAW,cAAc,KAAK,EAAE,KAAK,EAAE,CAAC;AAC9C,SAAO,SAAS,WAAW;AAC7B;","names":[]}
@@ -1,43 +0,0 @@
1
- import {
2
- quarterStartMonth
3
- } from "./chunk-XS2HUADA.js";
4
- import {
5
- normalizeTemporalInput
6
- } from "./chunk-NTMT5XGC.js";
7
- import {
8
- Temporal
9
- } from "./chunk-R7ZCA6AQ.js";
10
-
11
- // src/eachQuarterOfInterval.ts
12
- function eachQuarterOfInterval(interval) {
13
- const startZoned = normalizeTemporalInput(interval.start);
14
- const endZoned = normalizeTemporalInput(interval.end);
15
- const timezone = startZoned.timeZoneId;
16
- const startYearMonth = Temporal.PlainYearMonth.from({
17
- year: startZoned.year,
18
- month: quarterStartMonth(startZoned.month)
19
- });
20
- const endInTimezone = endZoned.withTimeZone(timezone);
21
- const endYearMonth = Temporal.PlainYearMonth.from({
22
- year: endInTimezone.year,
23
- month: quarterStartMonth(endInTimezone.month)
24
- });
25
- const quarters = [];
26
- let current = startYearMonth;
27
- while (Temporal.PlainYearMonth.compare(current, endYearMonth) <= 0) {
28
- const firstOfQuarter = current.toPlainDate({ day: 1 });
29
- quarters.push(
30
- firstOfQuarter.toZonedDateTime({
31
- timeZone: timezone,
32
- plainTime: new Temporal.PlainTime()
33
- })
34
- );
35
- current = current.add({ months: 3 });
36
- }
37
- return quarters;
38
- }
39
-
40
- export {
41
- eachQuarterOfInterval
42
- };
43
- //# sourceMappingURL=chunk-6UBZ5YB3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/eachQuarterOfInterval.ts"],"sourcesContent":["import { Temporal } from \"./shared/temporal\";\nimport { normalizeTemporalInput } from \"./shared/normalizeTemporalInput\";\nimport { quarterStartMonth } from \"./shared/quarter\";\n\n/**\n * Returns an array of ZonedDateTime objects for each quarter within the interval.\n * Each element represents the first moment of the quarter (day 1 of the quarter's\n * starting month at midnight). The interval is inclusive of both start and end quarters.\n *\n * Quarters: Q1 = Jan–Mar, Q2 = Apr–Jun, Q3 = Jul–Sep, Q4 = Oct–Dec.\n *\n * For Instant inputs, UTC is used as the timezone.\n * For ZonedDateTime inputs, the timezone of the start date is preserved.\n *\n * @param interval - The interval with start and end datetimes\n * @returns Array of ZonedDateTime at start of each quarter in the interval\n *\n * @example\n * ```ts\n * const start = Temporal.ZonedDateTime.from('2025-02-15T10:00:00Z[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-11-20T14:00:00Z[UTC]');\n *\n * const quarters = eachQuarterOfInterval({ start, end });\n * // [\n * // 2025-01-01T00:00:00Z[UTC], // Q1\n * // 2025-04-01T00:00:00Z[UTC], // Q2\n * // 2025-07-01T00:00:00Z[UTC], // Q3\n * // 2025-10-01T00:00:00Z[UTC] // Q4\n * // ]\n * ```\n *\n * @example\n * ```ts\n * // Cross-year boundary\n * const start = Temporal.ZonedDateTime.from('2024-11-15T00:00:00Z[UTC]');\n * const end = Temporal.ZonedDateTime.from('2025-05-15T00:00:00Z[UTC]');\n *\n * const quarters = eachQuarterOfInterval({ start, end });\n * // [\n * // 2024-10-01T00:00:00Z[UTC], // Q4 2024\n * // 2025-01-01T00:00:00Z[UTC], // Q1 2025\n * // 2025-04-01T00:00:00Z[UTC] // Q2 2025\n * // ]\n * ```\n */\nexport function eachQuarterOfInterval(interval: {\n start: Temporal.Instant | Temporal.ZonedDateTime;\n end: Temporal.Instant | Temporal.ZonedDateTime;\n}): Temporal.ZonedDateTime[] {\n const startZoned = normalizeTemporalInput(interval.start);\n const endZoned = normalizeTemporalInput(interval.end);\n\n const timezone = startZoned.timeZoneId;\n\n // Start of the starting quarter\n const startYearMonth = Temporal.PlainYearMonth.from({\n year: startZoned.year,\n month: quarterStartMonth(startZoned.month),\n });\n\n // Start of the ending quarter in the same timezone\n const endInTimezone = endZoned.withTimeZone(timezone);\n const endYearMonth = Temporal.PlainYearMonth.from({\n year: endInTimezone.year,\n month: quarterStartMonth(endInTimezone.month),\n });\n\n const quarters: Temporal.ZonedDateTime[] = [];\n let current = startYearMonth;\n\n while (Temporal.PlainYearMonth.compare(current, endYearMonth) <= 0) {\n const firstOfQuarter = current.toPlainDate({ day: 1 });\n quarters.push(\n firstOfQuarter.toZonedDateTime({\n timeZone: timezone,\n plainTime: new Temporal.PlainTime(),\n }),\n );\n current = current.add({ months: 3 });\n }\n\n return quarters;\n}\n"],"mappings":";;;;;;;;;;;AA6CO,SAAS,sBAAsB,UAGT;AAC3B,QAAM,aAAa,uBAAuB,SAAS,KAAK;AACxD,QAAM,WAAW,uBAAuB,SAAS,GAAG;AAEpD,QAAM,WAAW,WAAW;AAG5B,QAAM,iBAAiB,SAAS,eAAe,KAAK;AAAA,IAClD,MAAM,WAAW;AAAA,IACjB,OAAO,kBAAkB,WAAW,KAAK;AAAA,EAC3C,CAAC;AAGD,QAAM,gBAAgB,SAAS,aAAa,QAAQ;AACpD,QAAM,eAAe,SAAS,eAAe,KAAK;AAAA,IAChD,MAAM,cAAc;AAAA,IACpB,OAAO,kBAAkB,cAAc,KAAK;AAAA,EAC9C,CAAC;AAED,QAAM,WAAqC,CAAC;AAC5C,MAAI,UAAU;AAEd,SAAO,SAAS,eAAe,QAAQ,SAAS,YAAY,KAAK,GAAG;AAClE,UAAM,iBAAiB,QAAQ,YAAY,EAAE,KAAK,EAAE,CAAC;AACrD,aAAS;AAAA,MACP,eAAe,gBAAgB;AAAA,QAC7B,UAAU;AAAA,QACV,WAAW,IAAI,SAAS,UAAU;AAAA,MACpC,CAAC;AAAA,IACH;AACA,cAAU,QAAQ,IAAI,EAAE,QAAQ,EAAE,CAAC;AAAA,EACrC;AAEA,SAAO;AACT;","names":[]}
@@ -1,18 +0,0 @@
1
- import {
2
- quarterOfMonth
3
- } from "./chunk-XS2HUADA.js";
4
- import {
5
- normalizeTemporalInput
6
- } from "./chunk-NTMT5XGC.js";
7
-
8
- // src/isSameQuarter.ts
9
- function isSameQuarter(date1, date2) {
10
- const zoned1 = normalizeTemporalInput(date1);
11
- const zoned2 = normalizeTemporalInput(date2);
12
- return zoned1.year === zoned2.year && quarterOfMonth(zoned1.month) === quarterOfMonth(zoned2.month);
13
- }
14
-
15
- export {
16
- isSameQuarter
17
- };
18
- //# sourceMappingURL=chunk-FYZNOTX3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/isSameQuarter.ts"],"sourcesContent":["import type { Temporal } from \"@js-temporal/polyfill\";\nimport { normalizeTemporalInput } from \"./shared/normalizeTemporalInput\";\nimport { quarterOfMonth } from \"./shared/quarter\";\n\n/**\n * Returns true if both datetimes fall in the same calendar quarter and year.\n *\n * Quarters: Q1 = Jan–Mar, Q2 = Apr–Jun, Q3 = Jul–Sep, Q4 = Oct–Dec.\n *\n * Instant inputs are converted to UTC. For ZonedDateTime inputs, their\n * timezone is preserved. Convert to a common timezone before calling if\n * you need to compare from a specific perspective.\n *\n * @param date1 - First datetime (Instant or ZonedDateTime)\n * @param date2 - Second datetime (Instant or ZonedDateTime)\n * @returns true if both dates are in the same calendar quarter, false otherwise\n *\n * @example\n * ```ts\n * // Same quarter (Q1 2025)\n * const jan = Temporal.ZonedDateTime.from('2025-01-15T08:00:00Z[UTC]');\n * const mar = Temporal.ZonedDateTime.from('2025-03-31T23:59:59Z[UTC]');\n *\n * isSameQuarter(jan, mar); // true\n * ```\n *\n * @example\n * ```ts\n * // Different quarters\n * const mar = Temporal.ZonedDateTime.from('2025-03-31T23:59:59Z[UTC]');\n * const apr = Temporal.ZonedDateTime.from('2025-04-01T00:00:00Z[UTC]');\n *\n * isSameQuarter(mar, apr); // false (Q1 vs Q2)\n * ```\n *\n * @example\n * ```ts\n * // Same quarter number, different years\n * const q1of2024 = Temporal.ZonedDateTime.from('2024-02-15T00:00:00Z[UTC]');\n * const q1of2025 = Temporal.ZonedDateTime.from('2025-02-15T00:00:00Z[UTC]');\n *\n * isSameQuarter(q1of2024, q1of2025); // false (different years)\n * ```\n */\nexport function isSameQuarter(\n date1: Temporal.Instant | Temporal.ZonedDateTime,\n date2: Temporal.Instant | Temporal.ZonedDateTime,\n): boolean {\n const zoned1 = normalizeTemporalInput(date1);\n const zoned2 = normalizeTemporalInput(date2);\n\n return (\n zoned1.year === zoned2.year && quarterOfMonth(zoned1.month) === quarterOfMonth(zoned2.month)\n );\n}\n"],"mappings":";;;;;;;;AA4CO,SAAS,cACd,OACA,OACS;AACT,QAAM,SAAS,uBAAuB,KAAK;AAC3C,QAAM,SAAS,uBAAuB,KAAK;AAE3C,SACE,OAAO,SAAS,OAAO,QAAQ,eAAe,OAAO,KAAK,MAAM,eAAe,OAAO,KAAK;AAE/F;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/endOfYear.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\nimport type { Timezone } from './types';\nimport { getEndOfDay } from './shared/endOfDay';\nimport { normalizeWithPlainDate } from './shared/normalizeWithPlainDate';\n\n/**\n * Returns a ZonedDateTime representing the last moment of the year (last day at 23:59:59.999999999).\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at the last day of the year at 23:59:59.999999999\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-06-15T12:00:00Z');\n * const end = endOfYear(instant);\n * // 2025-12-31T23:59:59.999999999Z[UTC]\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-06-15T15:30:00-05:00[America/New_York]');\n * const end = endOfYear(zoned);\n * // 2025-12-31T23:59:59.999999999-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (requires timezone)\n * const date = Temporal.PlainDate.from('2025-06-15');\n * const end = endOfYear(date, 'America/New_York');\n * // 2025-12-31T23:59:59.999999999-05:00[America/New_York]\n * ```\n */\nexport function endOfYear(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function endOfYear(\n input: Temporal.PlainDate,\n timezone: Timezone\n): Temporal.ZonedDateTime;\nexport function endOfYear(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone\n): Temporal.ZonedDateTime {\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n const lastMonth = zonedDateTime.with({ month: zonedDateTime.monthsInYear });\n const lastDay = lastMonth.with({ day: lastMonth.daysInMonth });\n return getEndOfDay(lastDay);\n}\n"],"mappings":";;;;;;;;AA0CO,SAAS,UACd,OACA,UACwB;AACxB,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,QAAM,YAAY,cAAc,KAAK,EAAE,OAAO,cAAc,aAAa,CAAC;AAC1E,QAAM,UAAU,UAAU,KAAK,EAAE,KAAK,UAAU,YAAY,CAAC;AAC7D,SAAO,YAAY,OAAO;AAC5B;","names":[]}
@@ -1,17 +0,0 @@
1
- import {
2
- quarterOfMonth
3
- } from "./chunk-XS2HUADA.js";
4
- import {
5
- normalizeWithPlainDate
6
- } from "./chunk-ZOHYNJUD.js";
7
-
8
- // src/getQuarter.ts
9
- function getQuarter(input, timezone) {
10
- const zonedDateTime = normalizeWithPlainDate(input, timezone);
11
- return quarterOfMonth(zonedDateTime.month);
12
- }
13
-
14
- export {
15
- getQuarter
16
- };
17
- //# sourceMappingURL=chunk-NOV3D7OM.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/getQuarter.ts"],"sourcesContent":["import type { Temporal } from \"@js-temporal/polyfill\";\nimport type { Timezone } from \"./types\";\nimport { normalizeWithPlainDate } from \"./shared/normalizeWithPlainDate\";\nimport { quarterOfMonth } from \"./shared/quarter\";\n\n/**\n * Returns the quarter (1-4) that a datetime falls in.\n *\n * Quarters: Q1 = Jan–Mar, Q2 = Apr–Jun, Q3 = Jul–Sep, Q4 = Oct–Dec.\n *\n * Instant inputs are interpreted in UTC. For ZonedDateTime inputs, their\n * timezone is used. For PlainDate inputs, a timezone is required for a\n * consistent input contract (the quarter itself is timezone-independent).\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns The quarter number: 1, 2, 3, or 4\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-05-15T12:00:00Z');\n * getQuarter(instant); // 2\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-11-15T15:30:00-05:00[America/New_York]');\n * getQuarter(zoned); // 4\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (requires timezone)\n * const date = Temporal.PlainDate.from('2025-02-15');\n * getQuarter(date, 'America/New_York'); // 1\n * ```\n */\nexport function getQuarter(input: Temporal.Instant | Temporal.ZonedDateTime): 1 | 2 | 3 | 4;\nexport function getQuarter(input: Temporal.PlainDate, timezone: Timezone): 1 | 2 | 3 | 4;\nexport function getQuarter(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone,\n): 1 | 2 | 3 | 4 {\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n return quarterOfMonth(zonedDateTime.month);\n}\n"],"mappings":";;;;;;;;AAwCO,SAAS,WACd,OACA,UACe;AACf,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,SAAO,eAAe,cAAc,KAAK;AAC3C;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/endOfWeek.ts"],"sourcesContent":["import { isPlainDate } from './shared/temporal';\nimport type { Temporal } from '@js-temporal/polyfill';\nimport type { Timezone } from './types';\nimport { getEndOfDay } from './shared/endOfDay';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport { plainDateToZonedDateTime } from './shared/plainDateToZonedDateTime';\n\n/**\n * Returns a ZonedDateTime representing the last moment of the week (Sunday at 23:59:59.999999999).\n * Uses ISO 8601 week definition: weeks end on Sunday.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at Sunday 23:59:59.999999999\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00Z'); // Monday\n * const end = endOfWeek(instant);\n * // 2025-01-26T23:59:59.999999999Z[UTC] (next Sunday)\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-01-22T15:30:00-05:00[America/New_York]'); // Wednesday\n * const end = endOfWeek(zoned);\n * // 2025-01-26T23:59:59.999999999-05:00[America/New_York] (next Sunday)\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (requires timezone)\n * const date = Temporal.PlainDate.from('2025-01-22'); // Wednesday\n * const end = endOfWeek(date, 'America/New_York');\n * // 2025-01-26T23:59:59.999999999-05:00[America/New_York] (next Sunday)\n * ```\n */\nexport function endOfWeek(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function endOfWeek(\n input: Temporal.PlainDate,\n timezone: Timezone\n): Temporal.ZonedDateTime;\nexport function endOfWeek(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone\n): Temporal.ZonedDateTime {\n const zonedDateTime =\n isPlainDate(input)\n ? plainDateToZonedDateTime(input, timezone!)\n : normalizeTemporalInput(input);\n\n // Get the day of week (1 = Monday, 7 = Sunday in ISO 8601)\n const dayOfWeek = zonedDateTime.dayOfWeek;\n\n // Calculate days to add to get to Sunday\n const daysToAdd = 7 - dayOfWeek;\n\n // Go to Sunday, then get end of that day\n const sunday = zonedDateTime.add({ days: daysToAdd });\n\n return getEndOfDay(sunday);\n}\n"],"mappings":";;;;;;;;;;;;;;AA6CO,SAAS,UACd,OACA,UACwB;AACxB,QAAM,gBACJ,YAAY,KAAK,IACb,yBAAyB,OAAO,QAAS,IACzC,uBAAuB,KAAK;AAGlC,QAAM,YAAY,cAAc;AAGhC,QAAM,YAAY,IAAI;AAGtB,QAAM,SAAS,cAAc,IAAI,EAAE,MAAM,UAAU,CAAC;AAEpD,SAAO,YAAY,MAAM;AAC3B;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/toUtc.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\n\n/**\n * Convert a UTC ISO string, Unix timestamp, Date, or ZonedDateTime to a Temporal.Instant (UTC).\n *\n * @param input - A UTC ISO 8601 string, Unix timestamp (milliseconds), Date object, or Temporal.ZonedDateTime\n * @returns A Temporal.Instant representing the same moment in UTC\n *\n * @example\n * ```typescript\n * // From ISO string\n * const instant = toUtc(\"2025-01-20T20:00:00.000Z\");\n *\n * // From Unix timestamp (milliseconds since epoch)\n * const instant2 = toUtc(1737403200000);\n *\n * // From Date (e.g., from Drizzle ORM)\n * const date = new Date(\"2025-01-20T20:00:00.000Z\");\n * const instant3 = toUtc(date);\n *\n * // From ZonedDateTime\n * const zoned = Temporal.ZonedDateTime.from(\"2025-01-20T15:00:00-05:00[America/New_York]\");\n * const instant4 = toUtc(zoned);\n * // All represent the same UTC moment: 2025-01-20T20:00:00Z\n * ```\n */\nexport function toUtc(\n input: string | number | Date | Temporal.ZonedDateTime\n): Temporal.Instant {\n if (typeof input === 'string') {\n return Temporal.Instant.from(input);\n }\n\n if (typeof input === 'number') {\n return Temporal.Instant.fromEpochMilliseconds(input);\n }\n\n if (input instanceof Date) {\n return Temporal.Instant.from(input.toISOString());\n }\n\n return input.toInstant();\n}\n"],"mappings":";;;;;AA0BO,SAAS,MACd,OACkB;AAClB,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,SAAS,QAAQ,KAAK,KAAK;AAAA,EACpC;AAEA,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,SAAS,QAAQ,sBAAsB,KAAK;AAAA,EACrD;AAEA,MAAI,iBAAiB,MAAM;AACzB,WAAO,SAAS,QAAQ,KAAK,MAAM,YAAY,CAAC;AAAA,EAClD;AAEA,SAAO,MAAM,UAAU;AACzB;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/startOfWeek.ts"],"sourcesContent":["import { isPlainDate } from './shared/temporal';\nimport type { Temporal } from '@js-temporal/polyfill';\nimport type { Timezone } from './types';\nimport { normalizeTemporalInput } from './shared/normalizeTemporalInput';\nimport { plainDateToZonedDateTime } from './shared/plainDateToZonedDateTime';\n\n/**\n * Returns a ZonedDateTime representing the first moment of the week (Monday at midnight).\n * Uses ISO 8601 week definition: weeks start on Monday.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at Monday 00:00:00.000000000\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-01-20T12:00:00Z'); // Monday\n * const start = startOfWeek(instant);\n * // 2025-01-20T00:00:00Z[UTC] (same day, it's already Monday)\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-01-22T15:30:00-05:00[America/New_York]'); // Wednesday\n * const start = startOfWeek(zoned);\n * // 2025-01-20T00:00:00-05:00[America/New_York] (previous Monday)\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (requires timezone)\n * const date = Temporal.PlainDate.from('2025-01-22'); // Wednesday\n * const start = startOfWeek(date, 'America/New_York');\n * // 2025-01-20T00:00:00-05:00[America/New_York] (previous Monday)\n * ```\n */\nexport function startOfWeek(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function startOfWeek(\n input: Temporal.PlainDate,\n timezone: Timezone\n): Temporal.ZonedDateTime;\nexport function startOfWeek(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone\n): Temporal.ZonedDateTime {\n const zonedDateTime =\n isPlainDate(input)\n ? plainDateToZonedDateTime(input, timezone!)\n : normalizeTemporalInput(input);\n\n // Get the day of week (1 = Monday, 7 = Sunday in ISO 8601)\n const dayOfWeek = zonedDateTime.dayOfWeek;\n\n // Calculate days to subtract to get to Monday\n const daysToSubtract = dayOfWeek - 1;\n\n // Go to Monday, then get start of that day\n const monday = zonedDateTime.subtract({ days: daysToSubtract });\n\n return monday.startOfDay();\n}\n"],"mappings":";;;;;;;;;;;AA4CO,SAAS,YACd,OACA,UACwB;AACxB,QAAM,gBACJ,YAAY,KAAK,IACb,yBAAyB,OAAO,QAAS,IACzC,uBAAuB,KAAK;AAGlC,QAAM,YAAY,cAAc;AAGhC,QAAM,iBAAiB,YAAY;AAGnC,QAAM,SAAS,cAAc,SAAS,EAAE,MAAM,eAAe,CAAC;AAE9D,SAAO,OAAO,WAAW;AAC3B;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/endOfQuarter.ts"],"sourcesContent":["import { Temporal } from \"./shared/temporal\";\nimport type { Timezone } from \"./types\";\nimport { getEndOfDay } from \"./shared/endOfDay\";\nimport { normalizeWithPlainDate } from \"./shared/normalizeWithPlainDate\";\nimport { quarterStartMonth } from \"./shared/quarter\";\n\n/**\n * Returns a ZonedDateTime representing the last moment of the quarter\n * (last day of the quarter's ending month at 23:59:59.999999999).\n *\n * Quarters: Q1 = Jan–Mar, Q2 = Apr–Jun, Q3 = Jul–Sep, Q4 = Oct–Dec.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at the last day of the quarter at 23:59:59.999999999\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-05-15T12:00:00Z');\n * const end = endOfQuarter(instant);\n * // 2025-06-30T23:59:59.999999999Z[UTC]\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-02-15T15:30:00-05:00[America/New_York]');\n * const end = endOfQuarter(zoned);\n * // 2025-03-31T23:59:59.999999999-04:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (requires timezone)\n * const date = Temporal.PlainDate.from('2025-11-15');\n * const end = endOfQuarter(date, 'America/New_York');\n * // 2025-12-31T23:59:59.999999999-05:00[America/New_York]\n * ```\n */\nexport function endOfQuarter(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n): Temporal.ZonedDateTime;\nexport function endOfQuarter(input: Temporal.PlainDate, timezone: Timezone): Temporal.ZonedDateTime;\nexport function endOfQuarter(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone,\n): Temporal.ZonedDateTime {\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n const endMonth = zonedDateTime.with({\n month: quarterStartMonth(zonedDateTime.month) + 2,\n day: 1,\n });\n const lastDay = endMonth.with({ day: endMonth.daysInMonth });\n return getEndOfDay(lastDay);\n}\n"],"mappings":";;;;;;;;;;;AA2CO,SAAS,aACd,OACA,UACwB;AACxB,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,QAAM,WAAW,cAAc,KAAK;AAAA,IAClC,OAAO,kBAAkB,cAAc,KAAK,IAAI;AAAA,IAChD,KAAK;AAAA,EACP,CAAC;AACD,QAAM,UAAU,SAAS,KAAK,EAAE,KAAK,SAAS,YAAY,CAAC;AAC3D,SAAO,YAAY,OAAO;AAC5B;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/startOfYear.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\nimport type { Timezone } from './types';\nimport { normalizeWithPlainDate } from './shared/normalizeWithPlainDate';\n\n/**\n * Returns a ZonedDateTime representing the first moment of the year (January 1 at midnight).\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at January 1st at 00:00:00.000000000\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-06-15T12:00:00Z');\n * const start = startOfYear(instant);\n * // 2025-01-01T00:00:00Z[UTC]\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-06-15T15:30:00-05:00[America/New_York]');\n * const start = startOfYear(zoned);\n * // 2025-01-01T00:00:00-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (requires timezone)\n * const date = Temporal.PlainDate.from('2025-06-15');\n * const start = startOfYear(date, 'America/New_York');\n * // 2025-01-01T00:00:00-05:00[America/New_York]\n * ```\n */\nexport function startOfYear(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function startOfYear(\n input: Temporal.PlainDate,\n timezone: Timezone\n): Temporal.ZonedDateTime;\nexport function startOfYear(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone\n): Temporal.ZonedDateTime {\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n const firstDay = zonedDateTime.with({ month: 1, day: 1 });\n return firstDay.startOfDay();\n}\n"],"mappings":";;;;;AAyCO,SAAS,YACd,OACA,UACwB;AACxB,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,QAAM,WAAW,cAAc,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,CAAC;AACxD,SAAO,SAAS,WAAW;AAC7B;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/endOfMonth.ts"],"sourcesContent":["import { Temporal } from './shared/temporal';\nimport type { Timezone } from './types';\nimport { getEndOfDay } from './shared/endOfDay';\nimport { normalizeWithPlainDate } from './shared/normalizeWithPlainDate';\n\n/**\n * Returns a ZonedDateTime representing the last moment of the month (last day at 23:59:59.999999999).\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @returns ZonedDateTime at the last day of the month at 23:59:59.999999999\n *\n * @example\n * ```ts\n * // From Instant (always UTC)\n * const instant = Temporal.Instant.from('2025-01-15T12:00:00Z');\n * const end = endOfMonth(instant);\n * // 2025-01-31T23:59:59.999999999Z[UTC]\n * ```\n *\n * @example\n * ```ts\n * // From ZonedDateTime (uses its timezone)\n * const zoned = Temporal.ZonedDateTime.from('2025-02-15T15:30:00-05:00[America/New_York]');\n * const end = endOfMonth(zoned);\n * // 2025-02-28T23:59:59.999999999-05:00[America/New_York]\n * ```\n *\n * @example\n * ```ts\n * // From PlainDate (requires timezone)\n * const date = Temporal.PlainDate.from('2025-02-15');\n * const end = endOfMonth(date, 'America/New_York');\n * // 2025-02-28T23:59:59.999999999-05:00[America/New_York]\n * ```\n */\nexport function endOfMonth(\n input: Temporal.Instant | Temporal.ZonedDateTime\n): Temporal.ZonedDateTime;\nexport function endOfMonth(\n input: Temporal.PlainDate,\n timezone: Timezone\n): Temporal.ZonedDateTime;\nexport function endOfMonth(\n input: Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate,\n timezone?: Timezone\n): Temporal.ZonedDateTime {\n const zonedDateTime = normalizeWithPlainDate(input, timezone!);\n const lastDay = zonedDateTime.with({ day: zonedDateTime.daysInMonth });\n return getEndOfDay(lastDay);\n}\n"],"mappings":";;;;;;;;AA0CO,SAAS,WACd,OACA,UACwB;AACxB,QAAM,gBAAgB,uBAAuB,OAAO,QAAS;AAC7D,QAAM,UAAU,cAAc,KAAK,EAAE,KAAK,cAAc,YAAY,CAAC;AACrE,SAAO,YAAY,OAAO;AAC5B;","names":[]}
@@ -1,14 +0,0 @@
1
- import {
2
- differenceInMonths
3
- } from "./chunk-CIA46DWB.js";
4
-
5
- // src/differenceInQuarters.ts
6
- function differenceInQuarters(laterDate, earlierDate, options) {
7
- const quarters = differenceInMonths(laterDate, earlierDate, { fractional: true }) / 3;
8
- return options?.fractional ? quarters : Math.trunc(quarters);
9
- }
10
-
11
- export {
12
- differenceInQuarters
13
- };
14
- //# sourceMappingURL=chunk-VUKOSQWW.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/differenceInQuarters.ts"],"sourcesContent":["import type { Temporal } from \"@js-temporal/polyfill\";\nimport { differenceInMonths } from \"./differenceInMonths\";\nimport type { DifferenceOptions } from \"./shared/differenceOptions\";\n\n/**\n * Returns the number of quarters (3-month blocks) between two datetimes.\n * The result is positive if laterDate is after earlierDate, negative if before.\n *\n * This function uses calendar-aware calculation, which means it properly handles\n * months with different numbers of days (28, 29, 30, or 31).\n *\n * Instant inputs are converted to UTC for calendar calculations.\n * For ZonedDateTime inputs, their timezone is preserved.\n *\n * @param laterDate - The later datetime (Instant or ZonedDateTime)\n * @param earlierDate - The earlier datetime (Instant or ZonedDateTime)\n * @param options - Optional { fractional } to return the precise value\n * @returns The number of quarters between the dates, truncated toward zero (pass { fractional: true } for the precise value)\n *\n * @example\n * ```ts\n * const later = Temporal.Instant.from('2025-07-20T12:00:00Z');\n * const earlier = Temporal.Instant.from('2025-01-20T12:00:00Z');\n *\n * differenceInQuarters(later, earlier); // 2\n * ```\n *\n * @example\n * ```ts\n * // Pass { fractional: true } for partial-unit precision\n * const later = Temporal.Instant.from('2025-03-20T12:00:00Z');\n * const earlier = Temporal.Instant.from('2025-01-20T12:00:00Z');\n *\n * differenceInQuarters(later, earlier); // 0\n * differenceInQuarters(later, earlier, { fractional: true }); // ~0.67\n * ```\n */\nexport function differenceInQuarters(\n laterDate: Temporal.Instant | Temporal.ZonedDateTime,\n earlierDate: Temporal.Instant | Temporal.ZonedDateTime,\n options?: DifferenceOptions,\n): number {\n // A quarter is three months, so reuse the month difference and divide by 3.\n const quarters = differenceInMonths(laterDate, earlierDate, { fractional: true }) / 3;\n return options?.fractional ? quarters : Math.trunc(quarters);\n}\n"],"mappings":";;;;;AAqCO,SAAS,qBACd,WACA,aACA,SACQ;AAER,QAAM,WAAW,mBAAmB,WAAW,aAAa,EAAE,YAAY,KAAK,CAAC,IAAI;AACpF,SAAO,SAAS,aAAa,WAAW,KAAK,MAAM,QAAQ;AAC7D;","names":[]}
@@ -1,13 +0,0 @@
1
- import {
2
- addQuarters
3
- } from "./chunk-ZEL6JBBH.js";
4
-
5
- // src/subQuarters.ts
6
- function subQuarters(input, quarters) {
7
- return addQuarters(input, -quarters);
8
- }
9
-
10
- export {
11
- subQuarters
12
- };
13
- //# sourceMappingURL=chunk-W5YDBBNF.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/subQuarters.ts"],"sourcesContent":["import type { Temporal } from \"@js-temporal/polyfill\";\nimport { addQuarters } from \"./addQuarters\";\n\n/**\n * Subtracts the specified number of quarters (3-month blocks) from a datetime.\n *\n * This is a convenience wrapper around addQuarters with negated value.\n * Properly handles month-end dates and calendar edge cases through Temporal API.\n *\n * @param input - A Temporal.Instant (UTC) or Temporal.ZonedDateTime\n * @param quarters - Number of quarters to subtract\n * @returns ZonedDateTime with quarters subtracted, in the same timezone as input\n *\n * @example\n * ```ts\n * const instant = Temporal.Instant.from('2025-07-20T12:00:00Z');\n * const result = subQuarters(instant, 2);\n * // 2025-01-20T12:00:00Z[UTC] (6 months earlier)\n * ```\n */\nexport function subQuarters(\n input: Temporal.Instant | Temporal.ZonedDateTime,\n quarters: number,\n): Temporal.ZonedDateTime {\n return addQuarters(input, -quarters);\n}\n"],"mappings":";;;;;AAoBO,SAAS,YACd,OACA,UACwB;AACxB,SAAO,YAAY,OAAO,CAAC,QAAQ;AACrC;","names":[]}