esday 1.0.1 → 1.1.1

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 (368) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +5 -1
  3. package/chunks/{DXFoLbHM.js → 9Re3Ck2t.js} +1 -2
  4. package/chunks/{CeKusvtV.js → BfEWL_VC.js} +0 -1
  5. package/chunks/{oiGWnahC.js → Bk-WlP29.js} +20 -35
  6. package/chunks/{DuRKUq5K.js → BtFAvcS3.js} +1 -2
  7. package/chunks/BzQsG1-n.js +473 -0
  8. package/chunks/DBmUXISx.d.ts +3 -0
  9. package/chunks/{DMdr1ZL1.js → DLzmBvJ7.js} +2 -3
  10. package/chunks/{DIG_UBsE.js → DThHId1s.js} +3 -4
  11. package/chunks/{BB5OVV-y.d.ts → MfctHIHI.d.ts} +0 -8
  12. package/chunks/RZP9wuxV.js +452 -0
  13. package/chunks/{i3oEJgL3.js → SIX-1Rv6.js} +1 -2
  14. package/index.d.ts +2 -2
  15. package/index.js +1 -2
  16. package/locales/af.d.ts +3 -2
  17. package/locales/af.js +1 -2
  18. package/locales/am.d.ts +3 -2
  19. package/locales/am.js +1 -2
  20. package/locales/ar-dz.d.ts +0 -2
  21. package/locales/ar-dz.js +1 -2
  22. package/locales/ar-iq.d.ts +0 -2
  23. package/locales/ar-iq.js +1 -2
  24. package/locales/ar-kw.d.ts +0 -2
  25. package/locales/ar-kw.js +1 -2
  26. package/locales/ar-ly.d.ts +0 -2
  27. package/locales/ar-ly.js +1 -2
  28. package/locales/ar-ma.d.ts +0 -2
  29. package/locales/ar-ma.js +1 -2
  30. package/locales/ar-sa.d.ts +0 -2
  31. package/locales/ar-sa.js +1 -2
  32. package/locales/ar-tn.d.ts +0 -2
  33. package/locales/ar-tn.js +1 -2
  34. package/locales/ar.d.ts +3 -2
  35. package/locales/ar.js +1 -2
  36. package/locales/az.d.ts +3 -2
  37. package/locales/az.js +1 -2
  38. package/locales/be.d.ts +3 -2
  39. package/locales/be.js +1 -2
  40. package/locales/bg.d.ts +3 -2
  41. package/locales/bg.js +1 -2
  42. package/locales/bi.d.ts +3 -2
  43. package/locales/bi.js +1 -2
  44. package/locales/bm.d.ts +3 -2
  45. package/locales/bm.js +1 -2
  46. package/locales/bn-bd.d.ts +0 -2
  47. package/locales/bn-bd.js +2 -3
  48. package/locales/bn.d.ts +3 -2
  49. package/locales/bn.js +1 -2
  50. package/locales/bo.d.ts +3 -2
  51. package/locales/bo.js +1 -2
  52. package/locales/br.d.ts +3 -2
  53. package/locales/br.js +1 -2
  54. package/locales/bs.d.ts +3 -2
  55. package/locales/bs.js +1 -2
  56. package/locales/ca.d.ts +3 -2
  57. package/locales/ca.js +4 -5
  58. package/locales/cs.d.ts +3 -2
  59. package/locales/cs.js +1 -2
  60. package/locales/cv.d.ts +3 -2
  61. package/locales/cv.js +1 -2
  62. package/locales/cy.d.ts +3 -2
  63. package/locales/cy.js +1 -2
  64. package/locales/da.d.ts +3 -2
  65. package/locales/da.js +1 -2
  66. package/locales/de-at.d.ts +0 -2
  67. package/locales/de-at.js +2 -3
  68. package/locales/de-ch.d.ts +0 -2
  69. package/locales/de-ch.js +2 -3
  70. package/locales/de.d.ts +3 -2
  71. package/locales/de.js +1 -2
  72. package/locales/dv.d.ts +3 -2
  73. package/locales/dv.js +1 -2
  74. package/locales/el.d.ts +3 -2
  75. package/locales/el.js +1 -2
  76. package/locales/en-au.d.ts +0 -2
  77. package/locales/en-au.js +1 -2
  78. package/locales/en-ca.d.ts +0 -2
  79. package/locales/en-ca.js +1 -2
  80. package/locales/en-gb.d.ts +0 -2
  81. package/locales/en-gb.js +1 -2
  82. package/locales/en-ie.d.ts +0 -2
  83. package/locales/en-ie.js +1 -2
  84. package/locales/en-il.d.ts +0 -2
  85. package/locales/en-il.js +1 -2
  86. package/locales/en-in.d.ts +0 -2
  87. package/locales/en-in.js +1 -2
  88. package/locales/en-nz.d.ts +0 -2
  89. package/locales/en-nz.js +1 -2
  90. package/locales/en-sg.d.ts +0 -2
  91. package/locales/en-sg.js +1 -2
  92. package/locales/en-tt.d.ts +0 -2
  93. package/locales/en-tt.js +1 -2
  94. package/locales/en-us.d.ts +0 -2
  95. package/locales/en-us.js +1 -2
  96. package/locales/en.d.ts +4 -2
  97. package/locales/en.js +1 -2
  98. package/locales/eo.d.ts +3 -2
  99. package/locales/eo.js +1 -2
  100. package/locales/es-do.d.ts +0 -2
  101. package/locales/es-do.js +2 -3
  102. package/locales/es-mx.d.ts +0 -2
  103. package/locales/es-mx.js +2 -3
  104. package/locales/es-pr.d.ts +0 -2
  105. package/locales/es-pr.js +2 -3
  106. package/locales/es-us.d.ts +0 -2
  107. package/locales/es-us.js +2 -3
  108. package/locales/es.d.ts +3 -2
  109. package/locales/es.js +1 -2
  110. package/locales/et.d.ts +3 -2
  111. package/locales/et.js +1 -2
  112. package/locales/eu.d.ts +3 -2
  113. package/locales/eu.js +1 -2
  114. package/locales/fa.d.ts +3 -2
  115. package/locales/fa.js +1 -2
  116. package/locales/fi.d.ts +3 -2
  117. package/locales/fi.js +1 -2
  118. package/locales/fil.d.ts +3 -2
  119. package/locales/fil.js +1 -2
  120. package/locales/fo.d.ts +3 -2
  121. package/locales/fo.js +1 -2
  122. package/locales/fr-ca.d.ts +0 -2
  123. package/locales/fr-ca.js +2 -3
  124. package/locales/fr-ch.d.ts +0 -2
  125. package/locales/fr-ch.js +2 -3
  126. package/locales/fr.d.ts +3 -2
  127. package/locales/fr.js +1 -2
  128. package/locales/fy.d.ts +3 -2
  129. package/locales/fy.js +1 -2
  130. package/locales/ga.d.ts +3 -2
  131. package/locales/ga.js +1 -2
  132. package/locales/gd.d.ts +3 -2
  133. package/locales/gd.js +1 -2
  134. package/locales/gl.d.ts +3 -2
  135. package/locales/gl.js +1 -2
  136. package/locales/gom-deva.d.ts +3 -2
  137. package/locales/gom-deva.js +1 -2
  138. package/locales/gom-latn.d.ts +3 -2
  139. package/locales/gom-latn.js +1 -2
  140. package/locales/gu.d.ts +3 -2
  141. package/locales/gu.js +1 -2
  142. package/locales/he.d.ts +3 -2
  143. package/locales/he.js +1 -2
  144. package/locales/hi.d.ts +3 -2
  145. package/locales/hi.js +1 -2
  146. package/locales/hr.d.ts +3 -2
  147. package/locales/hr.js +1 -2
  148. package/locales/ht.d.ts +3 -2
  149. package/locales/ht.js +1 -2
  150. package/locales/hu.d.ts +3 -2
  151. package/locales/hu.js +1 -2
  152. package/locales/hy-am.d.ts +3 -2
  153. package/locales/hy-am.js +1 -2
  154. package/locales/id.d.ts +3 -2
  155. package/locales/id.js +2 -3
  156. package/locales/is.d.ts +3 -2
  157. package/locales/is.js +1 -2
  158. package/locales/it-ch.d.ts +0 -2
  159. package/locales/it-ch.js +2 -3
  160. package/locales/it.d.ts +3 -2
  161. package/locales/it.js +1 -2
  162. package/locales/ja.d.ts +6 -2
  163. package/locales/ja.js +1 -2
  164. package/locales/jv.d.ts +3 -2
  165. package/locales/jv.js +1 -2
  166. package/locales/ka.d.ts +3 -2
  167. package/locales/ka.js +3 -4
  168. package/locales/kk.d.ts +3 -2
  169. package/locales/kk.js +1 -2
  170. package/locales/km.d.ts +3 -2
  171. package/locales/km.js +1 -2
  172. package/locales/kn.d.ts +3 -2
  173. package/locales/kn.js +1 -2
  174. package/locales/ko.d.ts +3 -2
  175. package/locales/ko.js +1 -2
  176. package/locales/ku.d.ts +3 -2
  177. package/locales/ku.js +1 -2
  178. package/locales/ky.d.ts +3 -2
  179. package/locales/ky.js +1 -2
  180. package/locales/lb.d.ts +3 -2
  181. package/locales/lb.js +1 -2
  182. package/locales/lo.d.ts +3 -2
  183. package/locales/lo.js +1 -2
  184. package/locales/lt.d.ts +3 -2
  185. package/locales/lt.js +1 -2
  186. package/locales/lv.d.ts +3 -2
  187. package/locales/lv.js +1 -2
  188. package/locales/me.d.ts +3 -2
  189. package/locales/me.js +1 -2
  190. package/locales/mi.d.ts +0 -2
  191. package/locales/mi.js +1 -2
  192. package/locales/mk.d.ts +0 -2
  193. package/locales/mk.js +1 -2
  194. package/locales/ml.d.ts +0 -2
  195. package/locales/ml.js +1 -2
  196. package/locales/mn.d.ts +0 -2
  197. package/locales/mn.js +1 -2
  198. package/locales/mr.d.ts +3 -2
  199. package/locales/mr.js +3 -8
  200. package/locales/ms-my.d.ts +0 -2
  201. package/locales/ms-my.js +2 -3
  202. package/locales/ms.d.ts +3 -2
  203. package/locales/ms.js +1 -2
  204. package/locales/mt.d.ts +3 -2
  205. package/locales/mt.js +1 -2
  206. package/locales/my.d.ts +3 -2
  207. package/locales/my.js +1 -2
  208. package/locales/nb.d.ts +3 -2
  209. package/locales/nb.js +1 -2
  210. package/locales/ne.d.ts +3 -2
  211. package/locales/ne.js +1 -2
  212. package/locales/nl-be.d.ts +0 -2
  213. package/locales/nl-be.js +4 -5
  214. package/locales/nl.d.ts +3 -2
  215. package/locales/nl.js +1 -2
  216. package/locales/nn.d.ts +3 -2
  217. package/locales/nn.js +1 -2
  218. package/locales/oc-lnc.d.ts +3 -2
  219. package/locales/oc-lnc.js +1 -2
  220. package/locales/pa-in.d.ts +3 -2
  221. package/locales/pa-in.js +1 -2
  222. package/locales/pl.d.ts +3 -2
  223. package/locales/pl.js +2 -3
  224. package/locales/pt-br.d.ts +0 -2
  225. package/locales/pt-br.js +2 -3
  226. package/locales/pt.d.ts +3 -2
  227. package/locales/pt.js +1 -2
  228. package/locales/rn.d.ts +3 -2
  229. package/locales/rn.js +1 -2
  230. package/locales/ro.d.ts +3 -2
  231. package/locales/ro.js +1 -2
  232. package/locales/ru.d.ts +6 -2
  233. package/locales/ru.js +1 -2
  234. package/locales/rw.d.ts +3 -2
  235. package/locales/rw.js +1 -2
  236. package/locales/sd.d.ts +3 -2
  237. package/locales/sd.js +1 -2
  238. package/locales/se.d.ts +3 -2
  239. package/locales/se.js +1 -2
  240. package/locales/si.d.ts +3 -2
  241. package/locales/si.js +1 -2
  242. package/locales/sk.d.ts +3 -2
  243. package/locales/sk.js +1 -2
  244. package/locales/sl.d.ts +3 -2
  245. package/locales/sl.js +1 -2
  246. package/locales/sq.d.ts +3 -2
  247. package/locales/sq.js +1 -2
  248. package/locales/sr-cyrl.d.ts +0 -2
  249. package/locales/sr-cyrl.js +2 -3
  250. package/locales/sr.d.ts +3 -2
  251. package/locales/sr.js +1 -2
  252. package/locales/ss.d.ts +3 -2
  253. package/locales/ss.js +1 -2
  254. package/locales/sv-fi.d.ts +0 -2
  255. package/locales/sv-fi.js +2 -3
  256. package/locales/sv.d.ts +3 -2
  257. package/locales/sv.js +2 -3
  258. package/locales/sw.d.ts +3 -2
  259. package/locales/sw.js +3 -4
  260. package/locales/ta.d.ts +3 -2
  261. package/locales/ta.js +1 -2
  262. package/locales/te.d.ts +3 -2
  263. package/locales/te.js +1 -2
  264. package/locales/tet.d.ts +3 -2
  265. package/locales/tet.js +1 -2
  266. package/locales/tg.d.ts +3 -2
  267. package/locales/tg.js +1 -2
  268. package/locales/th.d.ts +3 -2
  269. package/locales/th.js +1 -2
  270. package/locales/tk.d.ts +3 -2
  271. package/locales/tk.js +1 -2
  272. package/locales/tl-ph.d.ts +3 -2
  273. package/locales/tl-ph.js +1 -2
  274. package/locales/tlh.d.ts +3 -2
  275. package/locales/tlh.js +1 -2
  276. package/locales/tr.d.ts +3 -2
  277. package/locales/tr.js +1 -2
  278. package/locales/tzl.d.ts +3 -2
  279. package/locales/tzl.js +1 -2
  280. package/locales/tzm-latn.d.ts +0 -2
  281. package/locales/tzm-latn.js +2 -3
  282. package/locales/tzm.d.ts +3 -2
  283. package/locales/tzm.js +1 -2
  284. package/locales/ug-cn.d.ts +3 -2
  285. package/locales/ug-cn.js +1 -2
  286. package/locales/uk.d.ts +0 -2
  287. package/locales/uk.js +2 -3
  288. package/locales/ur.d.ts +3 -2
  289. package/locales/ur.js +1 -2
  290. package/locales/uz-latn.d.ts +0 -2
  291. package/locales/uz-latn.js +3 -4
  292. package/locales/uz.d.ts +3 -2
  293. package/locales/uz.js +1 -2
  294. package/locales/vi.d.ts +3 -2
  295. package/locales/vi.js +1 -2
  296. package/locales/x-pseudo.d.ts +4 -2
  297. package/locales/x-pseudo.js +1 -2
  298. package/locales/yo.d.ts +3 -2
  299. package/locales/yo.js +1 -2
  300. package/locales/zh-cn.d.ts +0 -2
  301. package/locales/zh-cn.js +2 -3
  302. package/locales/zh-hk.d.ts +0 -2
  303. package/locales/zh-hk.js +2 -3
  304. package/locales/zh-mo.d.ts +0 -2
  305. package/locales/zh-mo.js +2 -3
  306. package/locales/zh-tw.d.ts +0 -2
  307. package/locales/zh-tw.js +2 -3
  308. package/locales/zh.d.ts +6 -2
  309. package/locales/zh.js +1 -2
  310. package/package.json +25 -21
  311. package/plugins/advancedFormat/index.d.ts +6 -3
  312. package/plugins/advancedFormat/index.js +2 -3
  313. package/plugins/advancedParse/index.d.ts +20 -3
  314. package/plugins/advancedParse/index.js +6 -8
  315. package/plugins/calendar/index.d.ts +8 -3
  316. package/plugins/calendar/index.js +1 -2
  317. package/plugins/dayOfYear/index.d.ts +1 -3
  318. package/plugins/dayOfYear/index.js +1 -2
  319. package/plugins/duration/index.d.ts +14 -8
  320. package/plugins/duration/index.js +1 -473
  321. package/plugins/index.d.ts +28 -0
  322. package/plugins/index.js +28 -0
  323. package/plugins/isBetween/index.d.ts +1 -3
  324. package/plugins/isBetween/index.js +2 -3
  325. package/plugins/isLeapYear/index.d.ts +1 -3
  326. package/plugins/isLeapYear/index.js +1 -2
  327. package/plugins/isSameOrAfter/index.d.ts +1 -3
  328. package/plugins/isSameOrAfter/index.js +1 -2
  329. package/plugins/isSameOrBefore/index.d.ts +1 -3
  330. package/plugins/isSameOrBefore/index.js +1 -2
  331. package/plugins/isToday/index.d.ts +1 -3
  332. package/plugins/isToday/index.js +2 -3
  333. package/plugins/isTomorrow/index.d.ts +1 -3
  334. package/plugins/isTomorrow/index.js +2 -3
  335. package/plugins/isYesterday/index.d.ts +1 -3
  336. package/plugins/isYesterday/index.js +2 -3
  337. package/plugins/isoWeek/index.d.ts +12 -3
  338. package/plugins/isoWeek/index.js +5 -6
  339. package/plugins/locale/index.d.ts +30 -21
  340. package/plugins/locale/index.js +4 -5
  341. package/plugins/localeData/index.d.ts +9 -3
  342. package/plugins/localeData/index.js +3 -6
  343. package/plugins/localizedFormat/index.d.ts +6 -3
  344. package/plugins/localizedFormat/index.js +3 -4
  345. package/plugins/localizedParse/index.d.ts +26 -3
  346. package/plugins/localizedParse/index.js +2 -3
  347. package/plugins/minMax/index.d.ts +1 -3
  348. package/plugins/minMax/index.js +2 -3
  349. package/plugins/objectSupport/index.d.ts +10 -3
  350. package/plugins/objectSupport/index.js +6 -9
  351. package/plugins/pluralGetSet/index.d.ts +8 -3
  352. package/plugins/pluralGetSet/index.js +1 -2
  353. package/plugins/quarterOfYear/index.d.ts +6 -3
  354. package/plugins/quarterOfYear/index.js +4 -5
  355. package/plugins/relativeTime/index.d.ts +22 -8
  356. package/plugins/relativeTime/index.js +7 -6
  357. package/plugins/timezone/index.d.ts +17 -3
  358. package/plugins/timezone/index.js +1 -454
  359. package/plugins/toArray/index.d.ts +1 -3
  360. package/plugins/toArray/index.js +1 -2
  361. package/plugins/toObject/index.d.ts +1 -3
  362. package/plugins/toObject/index.js +1 -2
  363. package/plugins/utc/index.d.ts +11 -3
  364. package/plugins/utc/index.js +8 -9
  365. package/plugins/week/index.d.ts +12 -3
  366. package/plugins/week/index.js +6 -7
  367. package/LICENSE +0 -21
  368. package/chunks/CBlQG2yl.d.ts +0 -5
@@ -1,454 +1 @@
1
- import { f as constants_default } from "../../chunks/CeKusvtV.js";
2
- import { n as isEmptyObject, r as isObject } from "../../chunks/DuRKUq5K.js";
3
- import { n as normalizeUnitWithPlurals } from "../../chunks/DMdr1ZL1.js";
4
- import { t as esday } from "../../chunks/oiGWnahC.js";
5
- //#region src/plugins/timezone/timezone-util.ts
6
- /**
7
- * Cache for Intl.DateTimeFormat instances for formatting date and time
8
- * used to improve performance.
9
- * The key is a combination of timezone and timeZoneName.
10
- */
11
- const dtfCacheDateTime = {};
12
- const dtfCacheTimezoneName = {};
13
- const TzDefaultTimezoneLocale = "en-US";
14
- /**
15
- * Get a cached or newly created Intl.DateTimeFormat instance for date/time formats.
16
- *
17
- * This function caches Intl.DateTimeFormat objects since their creation
18
- * is relatively slow. It returns a formatter configured for date and time values
19
- * using the given timezone.
20
- *
21
- * @param timezone - The IANA timezone identifier (e.g., "Asia/Shanghai").
22
- * @returns A cached or new Intl.DateTimeFormat instance.
23
- */
24
- function getDateTimeFormat(timezone) {
25
- const formatOptions = {
26
- hour12: false,
27
- hourCycle: "h23",
28
- year: "numeric",
29
- month: "2-digit",
30
- day: "2-digit",
31
- hour: "2-digit",
32
- minute: "2-digit",
33
- second: "2-digit",
34
- weekday: "short"
35
- };
36
- if (timezone.length > 0) formatOptions["timeZone"] = timezone;
37
- const key = `${timezone}|formatDateTime`;
38
- let dtf = dtfCacheDateTime[key];
39
- if (!dtf) {
40
- dtf = new Intl.DateTimeFormat("en-US", formatOptions);
41
- dtfCacheDateTime[key] = dtf;
42
- }
43
- return dtf;
44
- }
45
- /**
46
- * Get a cached or newly created Intl.DateTimeFormat instance for timezone name formats.
47
- *
48
- * This function caches Intl.DateTimeFormat objects since their creation
49
- * is relatively slow. It returns a formatter configured for timezone names using
50
- * the given timezone and locale name.
51
- *
52
- * @param timezone - The IANA timezone identifier (e.g., "Asia/Shanghai").
53
- * @param localeName - Optional settings for the name of the locale to use.
54
- * @returns A cached or new Intl.DateTimeFormat instance.
55
- */
56
- function getTimezoneNameFormat(timezone, localeName = TzDefaultTimezoneLocale) {
57
- const formatOptions = {
58
- year: "numeric",
59
- month: "2-digit",
60
- timeZoneName: "short"
61
- };
62
- if (timezone.length > 0) formatOptions["timeZone"] = timezone;
63
- const key = `${timezone}|localeName|timezoneName`;
64
- let dtf = dtfCacheTimezoneName[key];
65
- if (!dtf) {
66
- dtf = new Intl.DateTimeFormat(localeName, formatOptions);
67
- dtfCacheTimezoneName[key] = dtf;
68
- }
69
- return dtf;
70
- }
71
- //#endregion
72
- //#region src/plugins/timezone/index.ts
73
- /**
74
- * timezone plugin
75
- *
76
- * This plugin adds the 'tz' method to the EsDay class.
77
- * This plugin adds the 'tz' method/object to the esday class with the methods 'setDefault', 'getDefault' and 'guess'.
78
- *
79
- * This plugin adds the formatting tokens 'z' and 'Z' to EsDay.
80
- *
81
- * This plugin requires the 'utc' plugin.
82
- * When parsing with a locale then the 'advancedParse' plugin, the 'localizedParse' plugin
83
- * and at least one registered locale.
84
- * This plugin can handle the 'locale' plugin.
85
- *
86
- * esday parameters in '$conf' defined in timezone plugin:
87
- * timezone name of the timezone of this instance
88
- */
89
- const UNIT_ARRAY_MAP = {
90
- year: 0,
91
- month: 1,
92
- date: 2,
93
- hour: 3,
94
- minute: 4,
95
- second: 5
96
- };
97
- const maxDstDiff = 7200 * 1e3;
98
- const typeToPos = {
99
- year: 0,
100
- month: 1,
101
- day: 2,
102
- hour: 3,
103
- minute: 4,
104
- second: 5
105
- };
106
- const matchContainsOffset = /^(\d{4})[-/](\d{1,2})[-/](\d{0,2}).*(([+-]\d\d:?(\d\d)?)$|Z$)/;
107
- /**
108
- * Generate formatted date parts for a given timestamp and timezone.
109
- *
110
- * This function creates a Date object from the given timestamp,
111
- * retrieves a cached or new Intl.DateTimeFormat instance using
112
- * the provided timezone and returns the formatted parts
113
- * (year, month, day-of-month, hour, minute, second, weekday)
114
- *
115
- * @param timestamp - The timestamp in milliseconds since the Unix epoch.
116
- * @param timezone - The IANA timezone identifier (e.g., "Asia/Shanghai").
117
- * @returns An array of formatted date parts.
118
- */
119
- function makeFormatPartsDateTime(timestamp, timezone) {
120
- const dtf = getDateTimeFormat(timezone);
121
- const date = new Date(timestamp);
122
- return dtf.formatToParts(date);
123
- }
124
- /**
125
- * Do we have to convert parsed instance to another timezone?
126
- * @param input - input value to be parsed by plugin timezone
127
- * @returns true: result of parsing of input value must be converted to timezone
128
- */
129
- function convertRequired(input) {
130
- const requiresObjectSupport = isObject(input) && !(input instanceof Date) && input !== null && !isEmptyObject(input);
131
- return typeof input !== "string" && !Array.isArray(input) && !requiresObjectSupport;
132
- }
133
- /**
134
- * Convert en-US short weekday names to a number using values like Date.getDay() does.
135
- * @param shortWeekdayName - short weekday name (in locale en-US)
136
- * @returns - number indicating the weekday (0=Sunday, 1=Monday, ...)
137
- */
138
- function weekdayNameToNumber(shortWeekdayName) {
139
- switch (shortWeekdayName) {
140
- case "Sun": return 0;
141
- case "Mon": return 1;
142
- case "Tue": return 2;
143
- case "Wed": return 3;
144
- case "Thu": return 4;
145
- case "Fri": return 5;
146
- case "Sat": return 6;
147
- /* v8 ignore next -- @preserve */
148
- default: return -1;
149
- }
150
- }
151
- /**
152
- * Get the date components (year, month, day ...) of the given timestamp,
153
- * if formatted in the given timezone.
154
- * The function returns an array with the values for
155
- * [year, month, day-of-month, hour, minute, second, weekday].
156
- * 'month' is 1..12; 'day-of-month' is 1..31, 'weekday' is 0..6.
157
- * @param timestamp - timestamp to convert
158
- * @param timezone - timezone to use for formatting
159
- * @returns array of numbers with the date components of the timestamp in the timezone
160
- */
161
- function timestampToDateTimeComponents(timestamp, timezone) {
162
- const formatResult = makeFormatPartsDateTime(timestamp, timezone);
163
- const filled = [];
164
- let weekdayNumber = -1;
165
- for (let i = 0; i < formatResult.length; i += 1) {
166
- const { type, value } = formatResult[i];
167
- if (type === "weekday") {
168
- weekdayNumber = weekdayNameToNumber(value);
169
- continue;
170
- }
171
- const pos = typeToPos[type];
172
- if (pos >= 0) filled[pos] = Number.parseInt(value, 10);
173
- filled[6] = weekdayNumber;
174
- }
175
- return filled;
176
- }
177
- /**
178
- * Get the formatted timezone name of the given timestamp, if formatted in
179
- * the given timezone.
180
- * The function returns the short name of the timezone using the given locale.
181
- * 'month' is 1..12; 'day-of-month' is 1..31, 'weekday' is 0..6.
182
- * @param timestamp - timestamp to convert
183
- * @param timezone - timezone to use for conversion
184
- * @param timezone - timezone to use for conversion
185
- * @returns array of numbers with the date components of the timestamp in the timezone
186
- */
187
- function timestampToTimezoneName(timestamp, timezone, locale) {
188
- const dtf = getTimezoneNameFormat(timezone, locale);
189
- const date = new Date(timestamp);
190
- const formatResult = dtf.formatToParts(date);
191
- let timezoneNameShort = timezone;
192
- /* istanbul ignore else -- @preserve */
193
- if (formatResult.length >= 4 && formatResult[4].type === "timeZoneName") timezoneNameShort = formatResult[4].value;
194
- return timezoneNameShort;
195
- }
196
- /**
197
- * Calculate the new basic values for year, month etc. when using the "set" method.
198
- * These values must be adjusted to the current timezone.
199
- * @param dateComponents - array with the components of the formatted timestamp (year, month, ...)
200
- * @param currentMs - milliseconds of the current timestamp (0..999)
201
- * @param unit - normalized unit to set
202
- * @param values - value to set (or values, if applicable e.g. for year)
203
- * @returns literal object with year, month etc. after setting the new value(s)
204
- */
205
- function calculateBaseComponentsForSet(dateComponents, currentMs, unit, values) {
206
- let year = dateComponents[0];
207
- let month = dateComponents[1] - 1;
208
- let day = dateComponents[2];
209
- let hour = dateComponents[3];
210
- let minute = dateComponents[4];
211
- let second = dateComponents[5];
212
- let ms = currentMs;
213
- const mainValue = values[0];
214
- if (unit === constants_default.YEAR) {
215
- year = mainValue;
216
- if (values.length > 1) month = values[1];
217
- if (values.length > 2) day = values[2];
218
- } else if (unit === constants_default.MONTH) {
219
- month = mainValue;
220
- if (values.length > 1) day = values[1];
221
- } else if (unit === constants_default.DAY) {
222
- const currentWeekday = dateComponents[6];
223
- day += mainValue - currentWeekday;
224
- } else if (unit === constants_default.DAY_OF_MONTH) day = mainValue;
225
- else if (unit === constants_default.HOUR) hour = mainValue;
226
- else if (unit === constants_default.MIN) minute = mainValue;
227
- else if (unit === constants_default.SECOND) second = mainValue;
228
- else if (unit === constants_default.MS) ms = mainValue;
229
- if (unit === constants_default.YEAR || unit === constants_default.MONTH) {
230
- const lastDay = new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
231
- if (day > lastDay) day = lastDay;
232
- }
233
- let valuesIndex = 1;
234
- if (unit === constants_default.HOUR && values.length > valuesIndex) minute = values[valuesIndex++];
235
- if ((unit === constants_default.HOUR || unit === constants_default.MIN) && values.length > valuesIndex) second = values[valuesIndex++];
236
- if ((unit === constants_default.HOUR || unit === constants_default.MIN || unit === constants_default.SECOND) && values.length > valuesIndex) ms = values[valuesIndex++];
237
- return {
238
- year,
239
- month,
240
- day,
241
- hour,
242
- minute,
243
- second,
244
- ms
245
- };
246
- }
247
- /**
248
- * Gets the timezone of the given date formatted in the short form (e.g. 'PST')
249
- * @param sourceDate - date to format the timezone for
250
- * @returns the short form of the timezone of the given sourceDate
251
- */
252
- function formatTimezoneShort(sourceDate) {
253
- const timezone = sourceDate.tz();
254
- const localeName = sourceDate.locale?.() ?? esday.locale?.();
255
- return timestampToTimezoneName(sourceDate.valueOf(), timezone, localeName);
256
- }
257
- const timezonePLugin = (_, dayClass, esdayFactory) => {
258
- const noTimezone = "";
259
- let defaultTimezone;
260
- /**
261
- * Get timezone offset for timestamp in given timezone
262
- * @param timestamp - timestamp to use
263
- * @param timezone - timezone to calculate offset for
264
- * @returns utc offset for timestamp in given timezone
265
- */
266
- const tzOffset = (timestamp, timezone) => {
267
- const filled = timestampToDateTimeComponents(timestamp, timezone);
268
- const utcString = `${filled[0]}-${filled[1]}-${filled[2]} ${filled[3]}:${filled[4]}:${filled[5]}:000`;
269
- const utcTs = esdayFactory.utc(utcString).valueOf();
270
- let timestampAsEpoch = timestamp.valueOf();
271
- const msOfTimestamp = timestampAsEpoch % 1e3;
272
- timestampAsEpoch -= msOfTimestamp;
273
- return (utcTs - timestampAsEpoch) / (60 * 1e3);
274
- };
275
- /**
276
- * Move to the earlier date in an DST overlap, if we are in an overlap. Otherwise return input date.
277
- * The return value is an literal object in the form of {timestampFixed, tzOffsetFixed, isInOverlap}.
278
- * @param timestampOriginal - timestamp to be fixed
279
- * @param tzOffsetOriginal - tzOffset of timestampOriginal
280
- * @param timezone - timezone to use
281
- * @returns literal object containing fixed date (or original date, if we are not in an overlap)
282
- */
283
- const fixOverlap = (timestampOriginal, tzOffsetOriginal, timezone) => {
284
- let timestampFixed = timestampOriginal;
285
- let tzOffsetFixed = tzOffsetOriginal;
286
- let isInOverlap = false;
287
- const tzOffsetPreDst = tzOffset(timestampOriginal - maxDstDiff, timezone);
288
- if (tzOffsetPreDst > tzOffsetOriginal) {
289
- timestampFixed = timestampOriginal - (tzOffsetPreDst - tzOffsetOriginal) * 60 * 1e3;
290
- tzOffsetFixed = tzOffset(timestampFixed, timezone);
291
- if (tzOffsetFixed === tzOffsetOriginal) {
292
- timestampFixed = timestampOriginal;
293
- tzOffsetFixed = tzOffsetOriginal;
294
- } else isInOverlap = true;
295
- }
296
- return {
297
- timestampFixed,
298
- tzOffsetFixed,
299
- isInOverlap
300
- };
301
- };
302
- /**
303
- * Change the timestamp and timezone offset of a timestamp to change the timezone while keeping the time value.
304
- * @param timestampOriginal - timestamp to fix the offset for, if necessary
305
- * @param tzOffsetSource - tzOffset of the originalTimestamp in the source timezone
306
- * @param tzOffsetTarget - tzOffset of the originalTimestamp in the target timezone
307
- * @param tzTarget - timezone to use
308
- * @returns array with updated timestamp and fixed offset
309
- */
310
- const fixOffsetConvert = (timestampOriginal, tzOffsetSource, tzOffsetTarget, tzTarget) => {
311
- const timestampGuess1 = timestampOriginal - (tzOffsetTarget - tzOffsetSource) * 60 * 1e3;
312
- const tzOffsetGuess1 = tzOffset(timestampGuess1, tzTarget);
313
- if (tzOffsetGuess1 === tzOffsetTarget) {
314
- const { timestampFixed, tzOffsetFixed } = fixOverlap(timestampGuess1, tzOffsetGuess1, tzTarget);
315
- return [timestampFixed, tzOffsetFixed];
316
- }
317
- const timestampGuess2 = timestampGuess1 - (tzOffsetGuess1 - tzOffsetTarget) * 60 * 1e3;
318
- const tzOffsetGuess2 = tzOffset(timestampGuess2, tzTarget);
319
- if (tzOffsetGuess2 === tzOffsetGuess1) return [timestampGuess2, tzOffsetGuess2];
320
- else if (tzOffsetGuess1 < tzOffsetTarget) return [timestampGuess2, tzOffsetGuess2];
321
- else return [timestampGuess1, tzOffsetGuess1];
322
- };
323
- esdayFactory.tz = (input, ...others) => {
324
- let timezone = defaultTimezone;
325
- if (others.length > 0) timezone = others.pop();
326
- const parsedInput = esdayFactory.utc(input, ...others);
327
- if (!parsedInput.isValid()) return parsedInput;
328
- const offsetParsedInput = tzOffset(parsedInput.valueOf(), timezone ?? noTimezone);
329
- if (convertRequired(input) || typeof input === "string" && matchContainsOffset.test(input)) return parsedInput.tz(timezone);
330
- const [targetTimestamp, targetOffset] = fixOffsetConvert(parsedInput.valueOf(), 0, offsetParsedInput, timezone ?? noTimezone);
331
- const result = esdayFactory.utc(targetTimestamp, ...others);
332
- result["$conf"].utcOffset = targetOffset;
333
- result["$conf"].localOffset = -1 * result.toDate().getTimezoneOffset();
334
- result["$conf"].utc = targetOffset === 0;
335
- if (result["$conf"].localeName !== void 0 && parsedInput["$conf"].localeName !== void 0) result["$conf"].localeName = parsedInput["$conf"].localeName;
336
- result["$conf"].timezone = timezone;
337
- return result;
338
- };
339
- esdayFactory.tz.guess = () => Intl.DateTimeFormat().resolvedOptions().timeZone;
340
- esdayFactory.tz.setDefault = (timezone) => {
341
- defaultTimezone = timezone;
342
- };
343
- esdayFactory.tz.getDefault = () => {
344
- return defaultTimezone;
345
- };
346
- const proto = dayClass.prototype;
347
- proto.tz = function(timezone, keepLocalTime) {
348
- if (timezone === void 0) return this["$conf"].timezone;
349
- const result = this.clone();
350
- const tzOffsetTarget = tzOffset(this.valueOf(), timezone);
351
- const localOffset = -1 * this.toDate().getTimezoneOffset();
352
- result["$conf"].localOffset = localOffset;
353
- result["$conf"].utcOffset = tzOffsetTarget;
354
- result["$conf"].utc = tzOffsetTarget === 0;
355
- result["$conf"].timezone = timezone;
356
- if (keepLocalTime) {
357
- const timestampSource = result.valueOf();
358
- let tzOffsetSource = 0;
359
- if (!this["$conf"].utc) tzOffsetSource = this["$conf"].timezone ? Number(this["$conf"].utcOffset) : localOffset;
360
- const [timestampFixed, tzOffsetFixed] = fixOffsetConvert(timestampSource, tzOffsetSource, tzOffsetTarget, timezone);
361
- result["$conf"].utcOffset = tzOffsetFixed;
362
- result["$conf"].utc = tzOffsetFixed === 0;
363
- if (timestampSource !== timestampFixed) result.$d = new Date(timestampFixed);
364
- }
365
- return result;
366
- };
367
- const oldValueOf = proto.valueOf;
368
- proto.valueOf = function() {
369
- if (this["$conf"]?.timezone) return this.$d.valueOf();
370
- return oldValueOf.call(this);
371
- };
372
- const oldGet = proto.get;
373
- proto.get = function(unit) {
374
- const normalizedUnit = normalizeUnitWithPlurals(unit);
375
- if (normalizedUnit === constants_default.QUARTER || normalizedUnit === constants_default.WEEK || normalizedUnit === constants_default.ISOWEEK || this["$conf"]?.utc) return oldGet.call(this, unit);
376
- if (this["$conf"]?.timezone) {
377
- const timezone = this["$conf"].timezone;
378
- const dateComponents = timestampToDateTimeComponents(this.valueOf(), timezone);
379
- if (normalizedUnit === constants_default.MS) return this["$d"].getUTCMilliseconds();
380
- else if (normalizedUnit === constants_default.MONTH) return dateComponents[1] - 1;
381
- else if (normalizedUnit === constants_default.DAY) return dateComponents[6];
382
- else return dateComponents[UNIT_ARRAY_MAP[normalizedUnit]];
383
- }
384
- return oldGet.call(this, unit);
385
- };
386
- const old$set = proto["$set"];
387
- proto["$set"] = function(unit, values) {
388
- if (isObject(unit)) return old$set.call(this, unit, values);
389
- const timezone = this["$conf"]?.timezone;
390
- if (!timezone) return old$set.call(this, unit, values);
391
- const normalizedUnit = normalizeUnitWithPlurals(unit);
392
- const { year, month, day, hour, minute, second, ms } = calculateBaseComponentsForSet(timestampToDateTimeComponents(this.valueOf(), timezone), this.valueOf() % 1e3, normalizedUnit, values);
393
- const utcAsLocal = Date.UTC(year, month, day, hour, minute, second, ms);
394
- const [timestampFixed, tzOffsetFixed] = fixOffsetConvert(utcAsLocal, 0, tzOffset(utcAsLocal, timezone), timezone);
395
- this.$d = new Date(timestampFixed);
396
- this["$conf"].utcOffset = tzOffsetFixed;
397
- this["$conf"].localOffset = -1 * this.$d.getTimezoneOffset();
398
- this["$conf"].utc = tzOffsetFixed === 0;
399
- return this;
400
- };
401
- const oldStartOf = dayClass.prototype.startOf;
402
- proto.startOf = function(units) {
403
- if (!this["$conf"]?.["timezone"]) return oldStartOf.call(this, units);
404
- const withoutTz = esdayFactory(this.format("YYYY-MM-DD HH:mm:ss:SSS"));
405
- return oldStartOf.call(withoutTz, units).tz(this["$conf"]["timezone"], true);
406
- };
407
- const oldEndOf = dayClass.prototype.endOf;
408
- proto.endOf = function(units) {
409
- if (!this["$conf"]?.["timezone"]) return oldEndOf.call(this, units);
410
- const withoutTz = esdayFactory(this.format("YYYY-MM-DD HH:mm:ss:SSS"));
411
- return oldEndOf.call(withoutTz, units).tz(this["$conf"]["timezone"], true);
412
- };
413
- const oldAdd = proto.add;
414
- proto.add = function(value, unit) {
415
- if (isObject(value) || unit === void 0) return oldAdd.call(this, value, unit);
416
- const newValue = oldAdd.call(this, value, unit);
417
- if (!this["$conf"].timezone) return newValue;
418
- const timezone = this["$conf"]["timezone"];
419
- const timestamp = newValue.valueOf();
420
- const tzOldOffset = tzOffset(timestamp, timezone);
421
- const normalizedUnit = normalizeUnitWithPlurals(unit);
422
- const timeUnits = [
423
- constants_default.HOUR,
424
- constants_default.MIN,
425
- constants_default.SECOND,
426
- constants_default.MS
427
- ];
428
- const { isInOverlap } = fixOverlap(timestamp, tzOldOffset, timezone);
429
- if (timeUnits.includes(normalizedUnit) && isInOverlap) {
430
- newValue["$conf"].utcOffset = tzOldOffset;
431
- newValue["$conf"].utc = tzOldOffset === 0;
432
- return newValue;
433
- }
434
- const [timestampFixed, tzOffsetFixed] = fixOffsetConvert(timestamp, tzOldOffset, tzOffset(timestamp, timezone), timezone);
435
- newValue.$d = new Date(timestampFixed);
436
- newValue["$conf"].utcOffset = tzOffsetFixed;
437
- newValue["$conf"].localOffset = -1 * newValue.$d.getTimezoneOffset();
438
- newValue["$conf"].utc = tzOffsetFixed === 0;
439
- return newValue;
440
- };
441
- const oldSubtract = proto.subtract;
442
- proto.subtract = function(value, unit) {
443
- if (isObject(value) || unit === void 0) return oldSubtract.call(this, value, unit);
444
- if (this["$conf"].timezone) return proto.add.call(this, -value, unit);
445
- return oldSubtract.call(this, value, unit);
446
- };
447
- const additionalTokens = {
448
- z: formatTimezoneShort,
449
- zz: formatTimezoneShort
450
- };
451
- esdayFactory.addFormatTokenDefinitions(additionalTokens);
452
- };
453
- //#endregion
454
- export { timezonePLugin as default };
1
+ export { t as default } from "../../chunks/RZP9wuxV.js";
@@ -1,10 +1,8 @@
1
- import { s as EsDayPlugin } from "../../chunks/BB5OVV-y.js";
2
- //#region src/plugins/toArray/index.d.ts
1
+ import { s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
3
2
  declare module 'esday' {
4
3
  interface EsDay {
5
4
  toArray: () => [number, number, number, number, number, number, number];
6
5
  }
7
6
  }
8
7
  declare const toArrayPlugin: EsDayPlugin<{}>;
9
- //#endregion
10
8
  export { toArrayPlugin as default };
@@ -1,4 +1,4 @@
1
- //#region src/plugins/toArray/index.ts
1
+ // src/plugins/toArray/index.ts
2
2
  const toArrayPlugin = (_, dayClass) => {
3
3
  dayClass.prototype.toArray = function() {
4
4
  return [
@@ -12,5 +12,4 @@ const toArrayPlugin = (_, dayClass) => {
12
12
  ];
13
13
  };
14
14
  };
15
- //#endregion
16
15
  export { toArrayPlugin as default };
@@ -1,5 +1,4 @@
1
- import { s as EsDayPlugin } from "../../chunks/BB5OVV-y.js";
2
- //#region src/plugins/toObject/index.d.ts
1
+ import { s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
3
2
  declare module 'esday' {
4
3
  interface EsDay {
5
4
  toObject: () => {
@@ -14,5 +13,4 @@ declare module 'esday' {
14
13
  }
15
14
  }
16
15
  declare const toObjectPlugin: EsDayPlugin<{}>;
17
- //#endregion
18
16
  export { toObjectPlugin as default };
@@ -1,4 +1,4 @@
1
- //#region src/plugins/toObject/index.ts
1
+ // src/plugins/toObject/index.ts
2
2
  const toObjectPlugin = (_, dayClass) => {
3
3
  dayClass.prototype.toObject = function() {
4
4
  return {
@@ -12,5 +12,4 @@ const toObjectPlugin = (_, dayClass) => {
12
12
  };
13
13
  };
14
14
  };
15
- //#endregion
16
15
  export { toObjectPlugin as default };
@@ -1,5 +1,14 @@
1
- import { g as SimpleType, i as DateType, s as EsDayPlugin } from "../../chunks/BB5OVV-y.js";
2
- //#region src/plugins/utc/index.d.ts
1
+ /**
2
+ * utc plugin
3
+ *
4
+ * when utc mode is enabled, get and set methods will use UTC time
5
+ *
6
+ * new esday parameters in '$conf':
7
+ * utc utc mode (true / false)
8
+ * utcOffset utcOffset to use for this esday instance
9
+ * localOffset local timezone offset (as internal Date - $d - is always in local timezone)
10
+ */
11
+ import { g as SimpleType, i as DateType, s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
3
12
  declare module 'esday' {
4
13
  interface EsDay {
5
14
  utc: (keepLocalTime?: boolean) => EsDay;
@@ -18,5 +27,4 @@ declare module 'esday' {
18
27
  }
19
28
  }
20
29
  declare const utcPlugin: EsDayPlugin<{}>;
21
- //#endregion
22
30
  export { utcPlugin as default };
@@ -1,9 +1,9 @@
1
- import { f as constants_default } from "../../chunks/CeKusvtV.js";
2
- import { a as isUndefined, r as isObject } from "../../chunks/DuRKUq5K.js";
3
- import { n as normalizeUnitWithPlurals } from "../../chunks/DMdr1ZL1.js";
4
- import { a as setUnitInDateUTC, n as getUnitInDateUTC } from "../../chunks/DIG_UBsE.js";
5
- import { t as createInstanceFromExist } from "../../chunks/i3oEJgL3.js";
6
- //#region src/plugins/utc/index.ts
1
+ import { f as constants_default } from "../../chunks/BfEWL_VC.js";
2
+ import { t as createInstanceFromExist } from "../../chunks/SIX-1Rv6.js";
3
+ import { a as setUnitInDateUTC, n as getUnitInDateUTC } from "../../chunks/DThHId1s.js";
4
+ import { a as isUndefined, r as isObject } from "../../chunks/BtFAvcS3.js";
5
+ import { n as normalizeUnitWithPlurals } from "../../chunks/DLzmBvJ7.js";
6
+ // src/plugins/utc/index.ts
7
7
  const REGEX_VALID_OFFSET_FORMAT = /[+-]\d\d(?::?\d\d)?/g;
8
8
  const REGEX_OFFSET_HOURS_MINUTES_FORMAT = /[+-]|\d\d/g;
9
9
  function offsetFromString(value = "") {
@@ -67,8 +67,8 @@ function addUtc(that, value, units) {
67
67
  case constants_default.SECOND:
68
68
  case constants_default.MS: {
69
69
  const step = {
70
- minute: 60 * 1e3,
71
- hour: 3600 * 1e3,
70
+ minute: 6e4,
71
+ hour: 36e5,
72
72
  second: 1e3
73
73
  }[unit] || 1;
74
74
  const nextTimeStamp = $d.getTime() + value * step;
@@ -186,5 +186,4 @@ const utcPlugin = (_, dayClass, dayFactory) => {
186
186
  return oldSubtract.call(this, value, unit);
187
187
  };
188
188
  };
189
- //#endregion
190
189
  export { utcPlugin as default };
@@ -1,5 +1,15 @@
1
- import { s as EsDayPlugin } from "../../chunks/BB5OVV-y.js";
2
- //#region src/plugins/week/index.d.ts
1
+ /**
2
+ * week plugin
3
+ *
4
+ * This plugin adds 'week', 'weeks', 'weekday', 'weekYear', 'weeksInYear'
5
+ * and week related formatting and parsing tokens to EsDay.
6
+ *
7
+ * This plugin requires the 'locale' plugin and a locale to be loaded.
8
+ * For the 'wo' formatting token, the 'localizedFormat' plugin is required too.
9
+ *
10
+ * To use the parsing tokens, the plugin AdvancedParse is required.
11
+ */
12
+ import { s as EsDayPlugin } from "../../chunks/MfctHIHI.js";
3
13
  declare module 'esday' {
4
14
  interface EsDay {
5
15
  week(): number;
@@ -14,5 +24,4 @@ declare module 'esday' {
14
24
  }
15
25
  }
16
26
  declare const weekPlugin: EsDayPlugin<{}>;
17
- //#endregion
18
27
  export { weekPlugin as default };
@@ -1,9 +1,9 @@
1
- import { f as constants_default } from "../../chunks/CeKusvtV.js";
2
- import { a as isUndefined, r as isObject, t as isArray } from "../../chunks/DuRKUq5K.js";
3
- import { n as normalizeUnitWithPlurals } from "../../chunks/DMdr1ZL1.js";
4
- import { t as createInstanceFromExist } from "../../chunks/i3oEJgL3.js";
5
- import { n as padStart } from "../../chunks/DXFoLbHM.js";
6
- //#region src/plugins/week/index.ts
1
+ import { f as constants_default } from "../../chunks/BfEWL_VC.js";
2
+ import { t as createInstanceFromExist } from "../../chunks/SIX-1Rv6.js";
3
+ import { a as isUndefined, r as isObject, t as isArray } from "../../chunks/BtFAvcS3.js";
4
+ import { n as normalizeUnitWithPlurals } from "../../chunks/DLzmBvJ7.js";
5
+ import { n as padStart } from "../../chunks/9Re3Ck2t.js";
6
+ // src/plugins/week/index.ts
7
7
  const match1to2NoLeadingZero = /^[1-9]\d?/;
8
8
  const match1 = /\d/;
9
9
  const match2 = /\d\d/;
@@ -344,5 +344,4 @@ const weekPlugin = (_, dayClass, dayFactory) => {
344
344
  };
345
345
  dayFactory.addParseTokenDefinitions?.(parseTokensDefinitions);
346
346
  };
347
- //#endregion
348
347
  export { weekPlugin as default };
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 gmero
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,5 +0,0 @@
1
- import { a as EsDayFactory } from "./BB5OVV-y.js";
2
- //#region src/core/factory.d.ts
3
- declare const esday: EsDayFactory;
4
- //#endregion
5
- export { esday as t };