esday 0.5.0 → 0.6.3

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 (382) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/LICENSE +21 -21
  3. package/README.md +63 -51
  4. package/chunks/AyQQ6US-.js +84 -0
  5. package/chunks/{Y32qdU_5.js → BkjWOpMU.js} +7 -1
  6. package/chunks/{MtjcOKi-.d.ts → C5qDMHT5.d.ts} +2 -2
  7. package/chunks/{DqhiVwLi.d.ts → CODi8AFH.d.ts} +63 -35
  8. package/chunks/CXWzCl3n.js +481 -0
  9. package/chunks/{BRRrAbUl.js → CdvTtmWL.js} +2 -2
  10. package/chunks/{DXHbH1CI.js → Shk32pTP.js} +1 -1
  11. package/chunks/{Cb5SvF6r.js → v_QBn7Xm.js} +1 -1
  12. package/chunks/xt8C2lbv.js +38 -0
  13. package/index.d.ts +3 -3
  14. package/index.js +1 -571
  15. package/locales/af.d.ts +1 -3
  16. package/locales/af.js +4 -2
  17. package/locales/am.d.ts +1 -3
  18. package/locales/am.js +4 -2
  19. package/locales/ar-dz.d.ts +1 -3
  20. package/locales/ar-dz.js +7 -9
  21. package/locales/ar-iq.d.ts +1 -3
  22. package/locales/ar-iq.js +7 -9
  23. package/locales/ar-kw.d.ts +1 -3
  24. package/locales/ar-kw.js +7 -9
  25. package/locales/ar-ly.d.ts +1 -3
  26. package/locales/ar-ly.js +7 -9
  27. package/locales/ar-ma.d.ts +1 -3
  28. package/locales/ar-ma.js +7 -9
  29. package/locales/ar-sa.d.ts +1 -3
  30. package/locales/ar-sa.js +7 -9
  31. package/locales/ar-tn.d.ts +1 -3
  32. package/locales/ar-tn.js +7 -9
  33. package/locales/ar.d.ts +1 -3
  34. package/locales/ar.js +197 -2
  35. package/locales/az.d.ts +1 -3
  36. package/locales/az.js +4 -2
  37. package/locales/be.d.ts +1 -3
  38. package/locales/be.js +55 -59
  39. package/locales/bg.d.ts +1 -3
  40. package/locales/bg.js +4 -2
  41. package/locales/bi.d.ts +1 -3
  42. package/locales/bi.js +4 -2
  43. package/locales/bm.d.ts +1 -3
  44. package/locales/bm.js +4 -2
  45. package/locales/bn-bd.d.ts +1 -3
  46. package/locales/bn-bd.js +7 -9
  47. package/locales/bn.d.ts +1 -3
  48. package/locales/bn.js +136 -2
  49. package/locales/bo.d.ts +1 -3
  50. package/locales/bo.js +4 -2
  51. package/locales/br.d.ts +1 -3
  52. package/locales/br.js +10 -9
  53. package/locales/bs.d.ts +1 -3
  54. package/locales/bs.js +4 -2
  55. package/locales/ca.d.ts +1 -3
  56. package/locales/ca.js +35 -36
  57. package/locales/cs.d.ts +1 -3
  58. package/locales/cs.js +38 -34
  59. package/locales/cv.d.ts +1 -3
  60. package/locales/cv.js +4 -2
  61. package/locales/cy.d.ts +1 -3
  62. package/locales/cy.js +4 -2
  63. package/locales/da.d.ts +1 -3
  64. package/locales/da.js +4 -2
  65. package/locales/de-at.d.ts +1 -3
  66. package/locales/de-at.js +7 -9
  67. package/locales/de-ch.d.ts +1 -3
  68. package/locales/de-ch.js +7 -9
  69. package/locales/de.d.ts +1 -3
  70. package/locales/de.js +130 -2
  71. package/locales/dv.d.ts +1 -3
  72. package/locales/dv.js +4 -2
  73. package/locales/el.d.ts +1 -3
  74. package/locales/el.js +4 -2
  75. package/locales/en-au.d.ts +1 -3
  76. package/locales/en-au.js +7 -8
  77. package/locales/en-ca.d.ts +1 -3
  78. package/locales/en-ca.js +7 -8
  79. package/locales/en-gb.d.ts +1 -3
  80. package/locales/en-gb.js +9 -8
  81. package/locales/en-ie.d.ts +1 -3
  82. package/locales/en-ie.js +7 -8
  83. package/locales/en-il.d.ts +1 -3
  84. package/locales/en-il.js +7 -8
  85. package/locales/en-in.d.ts +1 -3
  86. package/locales/en-in.js +7 -8
  87. package/locales/en-nz.d.ts +1 -3
  88. package/locales/en-nz.js +7 -8
  89. package/locales/en-sg.d.ts +1 -3
  90. package/locales/en-sg.js +7 -8
  91. package/locales/en-tt.d.ts +1 -3
  92. package/locales/en-tt.js +7 -8
  93. package/locales/en-us.d.ts +1 -3
  94. package/locales/en-us.js +7 -8
  95. package/locales/en.d.ts +1 -3
  96. package/locales/en.js +116 -2
  97. package/locales/eo.d.ts +1 -3
  98. package/locales/eo.js +4 -2
  99. package/locales/es-do.d.ts +1 -3
  100. package/locales/es-do.js +7 -9
  101. package/locales/es-mx.d.ts +1 -3
  102. package/locales/es-mx.js +7 -9
  103. package/locales/es-pr.d.ts +1 -3
  104. package/locales/es-pr.js +7 -9
  105. package/locales/es-us.d.ts +1 -3
  106. package/locales/es-us.js +7 -9
  107. package/locales/es.d.ts +1 -3
  108. package/locales/es.js +117 -2
  109. package/locales/et.d.ts +1 -3
  110. package/locales/et.js +6 -2
  111. package/locales/eu.d.ts +1 -3
  112. package/locales/eu.js +4 -2
  113. package/locales/fa.d.ts +1 -3
  114. package/locales/fa.js +4 -2
  115. package/locales/fi.d.ts +1 -3
  116. package/locales/fi.js +8 -2
  117. package/locales/fil.d.ts +1 -3
  118. package/locales/fil.js +4 -2
  119. package/locales/fo.d.ts +1 -3
  120. package/locales/fo.js +4 -2
  121. package/locales/fr-ca.d.ts +1 -3
  122. package/locales/fr-ca.js +7 -9
  123. package/locales/fr-ch.d.ts +1 -3
  124. package/locales/fr-ch.js +7 -9
  125. package/locales/fr.d.ts +1 -3
  126. package/locales/fr.js +109 -2
  127. package/locales/fy.d.ts +1 -3
  128. package/locales/fy.js +4 -2
  129. package/locales/ga.d.ts +1 -3
  130. package/locales/ga.js +4 -2
  131. package/locales/gd.d.ts +1 -3
  132. package/locales/gd.js +4 -2
  133. package/locales/gl.d.ts +1 -3
  134. package/locales/gl.js +4 -2
  135. package/locales/gom-deva.d.ts +1 -3
  136. package/locales/gom-deva.js +34 -32
  137. package/locales/gom-latn.d.ts +1 -3
  138. package/locales/gom-latn.js +34 -32
  139. package/locales/gu.d.ts +1 -3
  140. package/locales/gu.js +4 -2
  141. package/locales/he.d.ts +1 -3
  142. package/locales/he.js +8 -5
  143. package/locales/hi.d.ts +1 -3
  144. package/locales/hi.js +34 -35
  145. package/locales/hr.d.ts +1 -3
  146. package/locales/hr.js +10 -4
  147. package/locales/ht.d.ts +1 -3
  148. package/locales/ht.js +4 -2
  149. package/locales/hu.d.ts +1 -3
  150. package/locales/hu.js +6 -2
  151. package/locales/hy-am.d.ts +1 -3
  152. package/locales/hy-am.js +34 -35
  153. package/locales/id.d.ts +1 -3
  154. package/locales/id.js +4 -2
  155. package/locales/is.d.ts +1 -3
  156. package/locales/is.js +14 -2
  157. package/locales/it-ch.d.ts +1 -3
  158. package/locales/it-ch.js +4 -9
  159. package/locales/it.d.ts +1 -3
  160. package/locales/it.js +120 -2
  161. package/locales/ja.d.ts +1 -4
  162. package/locales/ja.js +4 -2
  163. package/locales/jv.d.ts +1 -3
  164. package/locales/jv.js +4 -2
  165. package/locales/ka.d.ts +1 -3
  166. package/locales/ka.js +25 -26
  167. package/locales/kk.d.ts +1 -3
  168. package/locales/kk.js +4 -2
  169. package/locales/km.d.ts +1 -3
  170. package/locales/km.js +4 -2
  171. package/locales/kn.d.ts +1 -3
  172. package/locales/kn.js +4 -2
  173. package/locales/ko.d.ts +1 -3
  174. package/locales/ko.js +5 -3
  175. package/locales/ku.d.ts +1 -3
  176. package/locales/ku.js +4 -2
  177. package/locales/ky.d.ts +1 -3
  178. package/locales/ky.js +4 -2
  179. package/locales/lb.d.ts +1 -3
  180. package/locales/lb.js +5 -2
  181. package/locales/lo.d.ts +1 -3
  182. package/locales/lo.js +4 -2
  183. package/locales/lt.d.ts +1 -3
  184. package/locales/lt.js +4 -2
  185. package/locales/lv.d.ts +1 -3
  186. package/locales/lv.js +4 -2
  187. package/locales/me.d.ts +1 -3
  188. package/locales/me.js +33 -33
  189. package/locales/mi.d.ts +1 -3
  190. package/locales/mi.js +4 -2
  191. package/locales/mk.d.ts +1 -3
  192. package/locales/mk.js +4 -2
  193. package/locales/ml.d.ts +1 -3
  194. package/locales/ml.js +4 -2
  195. package/locales/mn.d.ts +1 -3
  196. package/locales/mn.js +37 -16
  197. package/locales/mr.d.ts +1 -3
  198. package/locales/mr.js +16 -2
  199. package/locales/ms-my.d.ts +1 -3
  200. package/locales/ms-my.js +7 -9
  201. package/locales/ms.d.ts +1 -3
  202. package/locales/ms.js +107 -2
  203. package/locales/mt.d.ts +1 -3
  204. package/locales/mt.js +4 -2
  205. package/locales/my.d.ts +1 -3
  206. package/locales/my.js +4 -2
  207. package/locales/nb.d.ts +1 -3
  208. package/locales/nb.js +4 -2
  209. package/locales/ne.d.ts +1 -3
  210. package/locales/ne.js +4 -2
  211. package/locales/nl-be.d.ts +1 -3
  212. package/locales/nl-be.js +7 -9
  213. package/locales/nl.d.ts +1 -3
  214. package/locales/nl.js +107 -2
  215. package/locales/nn.d.ts +1 -3
  216. package/locales/nn.js +4 -2
  217. package/locales/oc-lnc.d.ts +1 -3
  218. package/locales/oc-lnc.js +35 -36
  219. package/locales/pa-in.d.ts +1 -3
  220. package/locales/pa-in.js +4 -2
  221. package/locales/pl.d.ts +1 -3
  222. package/locales/pl.js +5 -2
  223. package/locales/pt-br.d.ts +1 -3
  224. package/locales/pt-br.js +7 -9
  225. package/locales/pt.d.ts +1 -3
  226. package/locales/pt.js +109 -2
  227. package/locales/rn.d.ts +1 -3
  228. package/locales/rn.js +4 -2
  229. package/locales/ro.d.ts +1 -3
  230. package/locales/ro.js +4 -2
  231. package/locales/ru.d.ts +1 -4
  232. package/locales/ru.js +83 -82
  233. package/locales/rw.d.ts +1 -3
  234. package/locales/rw.js +4 -2
  235. package/locales/sd.d.ts +1 -3
  236. package/locales/sd.js +4 -2
  237. package/locales/se.d.ts +1 -3
  238. package/locales/se.js +4 -2
  239. package/locales/si.d.ts +1 -3
  240. package/locales/si.js +4 -2
  241. package/locales/sk.d.ts +1 -3
  242. package/locales/sk.js +8 -2
  243. package/locales/sl.d.ts +1 -3
  244. package/locales/sl.js +8 -2
  245. package/locales/sq.d.ts +1 -3
  246. package/locales/sq.js +4 -2
  247. package/locales/sr-cyrl.d.ts +1 -3
  248. package/locales/sr-cyrl.js +16 -15
  249. package/locales/sr.d.ts +1 -3
  250. package/locales/sr.js +185 -2
  251. package/locales/ss.d.ts +1 -3
  252. package/locales/ss.js +4 -2
  253. package/locales/sv-fi.d.ts +1 -3
  254. package/locales/sv-fi.js +7 -9
  255. package/locales/sv.d.ts +1 -3
  256. package/locales/sv.js +110 -2
  257. package/locales/sw.d.ts +1 -3
  258. package/locales/sw.js +4 -2
  259. package/locales/ta.d.ts +1 -3
  260. package/locales/ta.js +4 -2
  261. package/locales/te.d.ts +1 -3
  262. package/locales/te.js +4 -2
  263. package/locales/tet.d.ts +1 -3
  264. package/locales/tet.js +5 -4
  265. package/locales/tg.d.ts +1 -3
  266. package/locales/tg.js +34 -35
  267. package/locales/th.d.ts +1 -3
  268. package/locales/th.js +4 -2
  269. package/locales/tk.d.ts +1 -3
  270. package/locales/tk.js +5 -4
  271. package/locales/tl-ph.d.ts +1 -3
  272. package/locales/tl-ph.js +4 -2
  273. package/locales/tlh.d.ts +1 -3
  274. package/locales/tlh.js +5 -2
  275. package/locales/tr.d.ts +1 -3
  276. package/locales/tr.js +5 -4
  277. package/locales/tzl.d.ts +1 -3
  278. package/locales/tzl.js +4 -2
  279. package/locales/tzm-latn.d.ts +1 -3
  280. package/locales/tzm-latn.js +9 -9
  281. package/locales/tzm.d.ts +1 -3
  282. package/locales/tzm.js +107 -2
  283. package/locales/ug-cn.d.ts +1 -3
  284. package/locales/ug-cn.js +4 -2
  285. package/locales/uk.d.ts +1 -3
  286. package/locales/uk.js +37 -32
  287. package/locales/ur.d.ts +1 -3
  288. package/locales/ur.js +4 -2
  289. package/locales/uz-latn.d.ts +1 -3
  290. package/locales/uz-latn.js +9 -9
  291. package/locales/uz.d.ts +1 -3
  292. package/locales/uz.js +107 -2
  293. package/locales/vi.d.ts +1 -3
  294. package/locales/vi.js +4 -2
  295. package/locales/x-pseudo.d.ts +1 -3
  296. package/locales/x-pseudo.js +5 -4
  297. package/locales/yo.d.ts +1 -3
  298. package/locales/yo.js +4 -2
  299. package/locales/zh-cn.d.ts +1 -3
  300. package/locales/zh-cn.js +7 -9
  301. package/locales/zh-hk.d.ts +1 -3
  302. package/locales/zh-hk.js +7 -9
  303. package/locales/zh-mo.d.ts +1 -3
  304. package/locales/zh-mo.js +7 -9
  305. package/locales/zh-tw.d.ts +1 -3
  306. package/locales/zh-tw.js +7 -9
  307. package/locales/zh.d.ts +1 -4
  308. package/locales/zh.js +128 -2
  309. package/package.json +29 -23
  310. package/plugins/advancedFormat/index.d.ts +1 -3
  311. package/plugins/advancedFormat/index.js +4 -6
  312. package/plugins/advancedParse/index.d.ts +1 -3
  313. package/plugins/advancedParse/index.js +21 -20
  314. package/plugins/calendar/index.d.ts +2 -4
  315. package/plugins/calendar/index.js +1 -2
  316. package/plugins/dayOfYear/index.d.ts +1 -2
  317. package/plugins/dayOfYear/index.js +1 -2
  318. package/plugins/duration/index.d.ts +78 -0
  319. package/plugins/duration/index.js +477 -0
  320. package/plugins/isBetween/index.d.ts +1 -2
  321. package/plugins/isBetween/index.js +2 -3
  322. package/plugins/isLeapYear/index.d.ts +1 -2
  323. package/plugins/isLeapYear/index.js +1 -2
  324. package/plugins/isSameOrAfter/index.d.ts +1 -2
  325. package/plugins/isSameOrAfter/index.js +1 -2
  326. package/plugins/isSameOrBefore/index.d.ts +1 -2
  327. package/plugins/isSameOrBefore/index.js +1 -2
  328. package/plugins/isToday/index.d.ts +1 -2
  329. package/plugins/isToday/index.js +2 -3
  330. package/plugins/isTomorrow/index.d.ts +1 -2
  331. package/plugins/isTomorrow/index.js +2 -3
  332. package/plugins/isYesterday/index.d.ts +1 -2
  333. package/plugins/isYesterday/index.js +2 -3
  334. package/plugins/isoWeek/index.d.ts +1 -3
  335. package/plugins/isoWeek/index.js +13 -25
  336. package/plugins/locale/index.d.ts +103 -3
  337. package/plugins/locale/index.js +140 -6
  338. package/plugins/localeData/index.d.ts +1 -3
  339. package/plugins/localeData/index.js +18 -11
  340. package/plugins/localizedFormat/index.d.ts +1 -3
  341. package/plugins/localizedFormat/index.js +5 -10
  342. package/plugins/localizedParse/index.d.ts +1 -3
  343. package/plugins/localizedParse/index.js +40 -22
  344. package/plugins/minMax/index.d.ts +1 -2
  345. package/plugins/minMax/index.js +2 -3
  346. package/plugins/objectSupport/index.d.ts +1 -3
  347. package/plugins/objectSupport/index.js +33 -38
  348. package/plugins/pluralGetSet/index.d.ts +1 -3
  349. package/plugins/pluralGetSet/index.js +1 -2
  350. package/plugins/quarterOfYear/index.d.ts +1 -3
  351. package/plugins/quarterOfYear/index.js +11 -18
  352. package/plugins/relativeTime/index.d.ts +32 -44
  353. package/plugins/relativeTime/index.js +124 -91
  354. package/plugins/timezone/index.d.ts +6 -0
  355. package/plugins/timezone/index.js +456 -0
  356. package/plugins/toArray/index.d.ts +1 -2
  357. package/plugins/toArray/index.js +1 -2
  358. package/plugins/toObject/index.d.ts +1 -2
  359. package/plugins/toObject/index.js +1 -2
  360. package/plugins/utc/index.d.ts +1 -2
  361. package/plugins/utc/index.js +37 -39
  362. package/plugins/week/index.d.ts +1 -3
  363. package/plugins/week/index.js +17 -27
  364. package/chunks/B5f9poqo.js +0 -120
  365. package/chunks/BDssPbM_.js +0 -106
  366. package/chunks/BXRGSAJG.js +0 -128
  367. package/chunks/BeVgU2nj.js +0 -188
  368. package/chunks/BtmEtAW3.js +0 -43
  369. package/chunks/CQ57zhVp.js +0 -106
  370. package/chunks/CQJ0-ZuR.js +0 -106
  371. package/chunks/CWqzr5E5.js +0 -108
  372. package/chunks/Cg4ZI9v8.js +0 -180
  373. package/chunks/CoBtJ4c1.js +0 -144
  374. package/chunks/D009Z-ld.js +0 -109
  375. package/chunks/DMtTiWuY.js +0 -127
  376. package/chunks/Dixb5KKs.js +0 -116
  377. package/chunks/DjY7KvwG.js +0 -28
  378. package/chunks/GjKpN6U-.js +0 -135
  379. package/chunks/St35qgL0.d.ts +0 -103
  380. package/chunks/br7kModF.js +0 -110
  381. package/chunks/l2Rxo2H0.js +0 -106
  382. package/chunks/tfkJ5D3p.js +0 -115
package/locales/zh.js CHANGED
@@ -1,3 +1,129 @@
1
- import { zh_default } from "../chunks/BXRGSAJG.js";
1
+ //#region src/locales/zh.ts
2
+ const localeZh = {
3
+ name: "zh",
4
+ weekdays: [
5
+ "星期日",
6
+ "星期一",
7
+ "星期二",
8
+ "星期三",
9
+ "星期四",
10
+ "星期五",
11
+ "星期六"
12
+ ],
13
+ weekdaysShort: [
14
+ "周日",
15
+ "周一",
16
+ "周二",
17
+ "周三",
18
+ "周四",
19
+ "周五",
20
+ "周六"
21
+ ],
22
+ weekdaysMin: [
23
+ "日",
24
+ "一",
25
+ "二",
26
+ "三",
27
+ "四",
28
+ "五",
29
+ "六"
30
+ ],
31
+ months: [
32
+ "一月",
33
+ "二月",
34
+ "三月",
35
+ "四月",
36
+ "五月",
37
+ "六月",
38
+ "七月",
39
+ "八月",
40
+ "九月",
41
+ "十月",
42
+ "十一月",
43
+ "十二月"
44
+ ],
45
+ monthsShort: [
46
+ "1月",
47
+ "2月",
48
+ "3月",
49
+ "4月",
50
+ "5月",
51
+ "6月",
52
+ "7月",
53
+ "8月",
54
+ "9月",
55
+ "10月",
56
+ "11月",
57
+ "12月"
58
+ ],
59
+ dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/,
60
+ ordinal: (number, period) => {
61
+ switch (period ?? "") {
62
+ case "d":
63
+ case "D":
64
+ case "DDD": return `${number}日`;
65
+ case "M": return `${number}月`;
66
+ case "w":
67
+ case "W": return `${number}周`;
68
+ default: return number.toString();
69
+ }
70
+ },
71
+ weekStart: 1,
72
+ yearStart: 4,
73
+ formats: {
74
+ LT: "HH:mm",
75
+ LTS: "HH:mm:ss",
76
+ L: "YYYY/MM/DD",
77
+ LL: "YYYY年M月D日",
78
+ LLL: "YYYY年M月D日Ah点mm分",
79
+ LLLL: "YYYY年M月D日ddddAh点mm分",
80
+ l: "YYYY/M/D",
81
+ ll: "YYYY年M月D日",
82
+ lll: "YYYY年M月D日 HH:mm",
83
+ llll: "YYYY年M月D日dddd HH:mm"
84
+ },
85
+ calendar: {
86
+ sameDay: "[今天]LT",
87
+ nextDay: "[明天]LT",
88
+ nextWeek(refDate) {
89
+ if (refDate?.week?.() !== this.week?.()) return "[下]dddLT";
90
+ return "[本]dddLT";
91
+ },
92
+ lastDay: "[昨天]LT",
93
+ lastWeek(refDate) {
94
+ if (this.week?.() !== refDate?.week?.()) return "[上]dddLT";
95
+ return "[本]dddLT";
96
+ },
97
+ sameElse: "L"
98
+ },
99
+ relativeTime: {
100
+ future: "%s后",
101
+ past: "%s前",
102
+ s: "几秒",
103
+ ss: "%d 秒",
104
+ m: "1 分钟",
105
+ mm: "%d 分钟",
106
+ h: "1 小时",
107
+ hh: "%d 小时",
108
+ d: "1 天",
109
+ dd: "%d 天",
110
+ w: "1 周",
111
+ ww: "%d 周",
112
+ M: "1 个月",
113
+ MM: "%d 个月",
114
+ y: "1 年",
115
+ yy: "%d 年"
116
+ },
117
+ meridiem: (hour, minute) => {
118
+ const hm = hour * 100 + minute;
119
+ if (hm < 600) return "凌晨";
120
+ if (hm < 900) return "早上";
121
+ if (hm < 1100) return "上午";
122
+ if (hm < 1300) return "中午";
123
+ if (hm < 1800) return "下午";
124
+ return "晚上";
125
+ }
126
+ };
2
127
 
3
- export { zh_default as default };
128
+ //#endregion
129
+ export { localeZh as default };
package/package.json CHANGED
@@ -1,17 +1,22 @@
1
1
  {
2
2
  "name": "esday",
3
3
  "type": "module",
4
- "version": "0.5.0",
4
+ "version": "0.6.3",
5
5
  "description": "A simple date library fully written in TypeScript",
6
6
  "license": "MIT",
7
- "homepage": "https://github.com/g-mero/esday",
7
+ "homepage": "https://github.com/BePo65/esday",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "https://github.com/g-mero/esday"
10
+ "url": "https://github.com/BePo65/esday"
11
11
  },
12
12
  "bugs": {
13
- "url": "https://github.com/g-mero/esday/issues"
13
+ "url": "https://github.com/BePo65/esday/issues"
14
14
  },
15
+ "author": "BePo65 (https://github.com/BePo65)",
16
+ "contributors": [
17
+ "g-mero (https://github.com/g-mero)",
18
+ "Olexandr88 <radole1203@gmail.com> (https://github.com/Olexandr88)"
19
+ ],
15
20
  "keywords": [
16
21
  "dayjs",
17
22
  "date",
@@ -47,27 +52,28 @@
47
52
  "*"
48
53
  ],
49
54
  "devDependencies": {
50
- "@biomejs/biome": "2.1.2",
51
- "@commitlint/cli": "^19.8.1",
52
- "@commitlint/config-conventional": "^19.8.1",
53
- "@playwright/test": "~1.54.2",
54
- "@types/node": "^24.2.0",
55
- "@vitest/browser": "3.2.4",
56
- "@vitest/coverage-v8": "3.2.4",
57
- "@vitest/ui": "3.2.4",
58
- "commit-and-tag-version": "^12.5.2",
59
- "cpy-cli": "^5.0.0",
60
- "dompurify": "^3.2.6",
55
+ "@biomejs/biome": "2.4.4",
56
+ "@commitlint/cli": "^20.4.2",
57
+ "@commitlint/config-conventional": "^20.4.2",
58
+ "@playwright/test": "~1.58.2",
59
+ "@types/node": "^25.3.0",
60
+ "@vitest/browser-playwright": "^4.0.18",
61
+ "@vitest/coverage-v8": "4.0.18",
62
+ "@vitest/ui": "4.0.18",
63
+ "commit-and-tag-version": "^12.6.1",
64
+ "cpy-cli": "^7.0.0",
65
+ "dompurify": "^3.3.1",
61
66
  "husky": "^9.1.7",
62
- "jsdom": "^26.1.0",
63
- "marked": "^16.1.2",
67
+ "jsdom": "^28.1.0",
68
+ "marked": "^17.0.3",
69
+ "moment-timezone": "^0.6.0",
64
70
  "moment": "^2.30.1",
65
- "playwright": "~1.54.2",
66
- "tsdown": "^0.13.3",
67
- "typescript": "^5.9.2",
68
- "ultracite": "5.1.2",
69
- "vite": "^7.0.6",
70
- "vitest": "3.2.4"
71
+ "playwright": "~1.58.2",
72
+ "tsdown": "^0.20.3",
73
+ "typescript": "^5.9.3",
74
+ "ultracite": "7.2.3",
75
+ "vite": "^7.3.1",
76
+ "vitest": "4.0.18"
71
77
  },
72
78
  "commit-and-tag-version": {
73
79
  "packageFiles": [
@@ -1,8 +1,6 @@
1
- import { EsDayPlugin } from "../../chunks/DqhiVwLi.js";
2
- import "../../chunks/MtjcOKi-.js";
1
+ import { o as EsDayPlugin } from "../../chunks/CODi8AFH.js";
3
2
 
4
3
  //#region src/plugins/advancedFormat/index.d.ts
5
-
6
4
  declare const advancedFormatPlugin: EsDayPlugin<{}>;
7
5
  //#endregion
8
6
  export { advancedFormatPlugin as default };
@@ -1,8 +1,8 @@
1
- import { padStart, padZoneStr } from "../../chunks/BRRrAbUl.js";
1
+ import { n as padStart, r as padZoneStr } from "../../chunks/CdvTtmWL.js";
2
2
 
3
3
  //#region src/plugins/advancedFormat/index.ts
4
4
  const advancedFormatPlugin = (_, _dayClass, dayFactory) => {
5
- const additionalTokens = {
5
+ dayFactory.addFormatTokenDefinitions({
6
6
  d: (sourceDate) => sourceDate.day().toString(),
7
7
  S: (sourceDate) => padStart(sourceDate.millisecond(), 3, "0").slice(0, 1),
8
8
  SS: (sourceDate) => padStart(sourceDate.millisecond(), 3, "0").slice(0, 2),
@@ -11,10 +11,8 @@ const advancedFormatPlugin = (_, _dayClass, dayFactory) => {
11
11
  x: (sourceDate) => sourceDate.valueOf().toString(),
12
12
  k: (sourceDate) => (sourceDate.hour() !== 0 ? sourceDate.hour() : 24).toString(),
13
13
  kk: (sourceDate) => padStart(sourceDate.hour() !== 0 ? sourceDate.hour() : 24, 2, "0")
14
- };
15
- dayFactory.addFormatTokenDefinitions(additionalTokens);
14
+ });
16
15
  };
17
- var advancedFormat_default = advancedFormatPlugin;
18
16
 
19
17
  //#endregion
20
- export { advancedFormat_default as default };
18
+ export { advancedFormatPlugin as default };
@@ -1,8 +1,6 @@
1
- import { EsDayPlugin } from "../../chunks/DqhiVwLi.js";
2
- import "../../chunks/MtjcOKi-.js";
1
+ import { o as EsDayPlugin } from "../../chunks/CODi8AFH.js";
3
2
 
4
3
  //#region src/plugins/advancedParse/index.d.ts
5
-
6
4
  declare const advancedParsePlugin: EsDayPlugin<{}>;
7
5
  //#endregion
8
6
  export { advancedParsePlugin as default };
@@ -1,5 +1,5 @@
1
- import { constants_default } from "../../chunks/Y32qdU_5.js";
2
- import { isArray, isString, isUndefined, isValidDate } from "../../chunks/Cb5SvF6r.js";
1
+ import { p as constants_default } from "../../chunks/BkjWOpMU.js";
2
+ import { a as isUndefined, i as isString, o as isValidDate, t as isArray } from "../../chunks/v_QBn7Xm.js";
3
3
 
4
4
  //#region src/plugins/advancedParse/index.ts
5
5
  /**
@@ -30,8 +30,7 @@ const parseTokensDefinitions = {};
30
30
  * @returns converted 4-digit year
31
31
  */
32
32
  function parseTwoDigitYear(input) {
33
- const inputLimited = input.slice(0, 2);
34
- const year = +inputLimited;
33
+ const year = +input.slice(0, 2);
35
34
  return year + (year > 68 ? 1900 : 2e3);
36
35
  }
37
36
  function parseFourDigitYear(input) {
@@ -57,7 +56,7 @@ function offsetFromString(offset) {
57
56
  */
58
57
  function addInput(property) {
59
58
  return (parsedElements, input) => {
60
- if (property !== "afternoon") parsedElements[property] = +input;
59
+ parsedElements[property] = +input;
61
60
  };
62
61
  }
63
62
  /**
@@ -129,7 +128,7 @@ function makeParser(format, isStrict) {
129
128
  const postParseHandler = parseTo?.[3];
130
129
  if (postParseHandler !== void 0 && !postParseHandlers.includes(postParseHandler)) postParseHandlers.push(postParseHandler);
131
130
  }
132
- const parser = (input, isStrict$1, parseOptions) => {
131
+ const parser = (input, isStrict, parseOptions) => {
133
132
  let unusedTokens = 0;
134
133
  let separatorsMatch = true;
135
134
  const parsedDateElements = {};
@@ -141,7 +140,7 @@ function makeParser(format, isStrict) {
141
140
  const token = parsingDefinitions[i];
142
141
  if (isString(token)) {
143
142
  const separatorLength = token.length;
144
- if (isStrict$1 && separatorsMatch) separatorsMatch && (separatorsMatch = input.substring(0, separatorLength) === token);
143
+ if (isStrict && separatorsMatch) separatorsMatch && (separatorsMatch = input.substring(0, separatorLength) === token);
145
144
  input = input.slice(separatorLength);
146
145
  } else {
147
146
  const { regex, updater } = token;
@@ -154,13 +153,12 @@ function makeParser(format, isStrict) {
154
153
  }
155
154
  }
156
155
  }
157
- const result = {
156
+ return {
158
157
  dateElements: parsedDateElements,
159
158
  charsLeftOver: input.length,
160
159
  unusedTokens,
161
160
  separatorsMatch
162
161
  };
163
- return result;
164
162
  };
165
163
  function postParser(parsedDate, parsedElements, parseOptions) {
166
164
  let modifiedParsedDate = parsedDate;
@@ -230,7 +228,7 @@ const advancedParsePlugin = (_, dayClass, dayFactory) => {
230
228
  * value to an object containing all the date&time elements (year,
231
229
  * month, day, ...).
232
230
  */
233
- const parseTokensDefinitions$1 = {
231
+ const parseTokensDefinitions = {
234
232
  Q: [
235
233
  match1,
236
234
  match1,
@@ -353,7 +351,7 @@ const advancedParsePlugin = (_, dayClass, dayFactory) => {
353
351
  }
354
352
  ]
355
353
  };
356
- dayFactory.addParseTokenDefinitions(parseTokensDefinitions$1);
354
+ dayFactory.addParseTokenDefinitions(parseTokensDefinitions);
357
355
  const oldParse = proto["$parse"];
358
356
  proto["$parse"] = function(d) {
359
357
  var _this$$conf;
@@ -368,8 +366,8 @@ const advancedParsePlugin = (_, dayClass, dayFactory) => {
368
366
  if (isString(d) && !isUndefined(format)) {
369
367
  if (isString(format)) {
370
368
  const parsingResult = parseFormattedInput.call(this, d, format, isStrict, parseOptions);
371
- this["$d"] = parsingResult.date;
372
- if (isStrict && (parsingResult.charsLeftOver > 0 || parsingResult.unusedTokens > 0 || !parsingResult.separatorsMatch)) this["$d"] = invalidDate;
369
+ this.$d = parsingResult.date;
370
+ if (isStrict && (parsingResult.charsLeftOver > 0 || parsingResult.unusedTokens > 0 || !parsingResult.separatorsMatch)) this.$d = invalidDate;
373
371
  } else if (isArray(format)) {
374
372
  let bestDate = invalidDate;
375
373
  let scoreToBeat = 0;
@@ -384,23 +382,26 @@ const advancedParsePlugin = (_, dayClass, dayFactory) => {
384
382
  currentScore += parsingResult.charsLeftOver;
385
383
  currentScore += parsingResult.unusedTokens * 10;
386
384
  if (bestFormatIsValid) {
387
- if (validFormatFound && !isUndefined(scoreToBeat) && currentScore < scoreToBeat) {
385
+ if (validFormatFound && currentScore < scoreToBeat) {
388
386
  scoreToBeat = currentScore;
389
387
  bestDate = parsingResult.date;
390
388
  }
391
- } else if (isUndefined(scoreToBeat) || currentScore < scoreToBeat || validFormatFound) {
389
+ } else if (validFormatFound) {
392
390
  scoreToBeat = currentScore;
393
391
  bestDate = parsingResult.date;
394
- if (validFormatFound) bestFormatIsValid = true;
392
+ bestFormatIsValid = true;
395
393
  }
396
394
  }
397
- this["$d"] = bestDate;
395
+ this.$d = bestDate;
396
+ if (Object.keys(this["$conf"].parseOptions).length) delete this["$conf"].parseOptions;
398
397
  }
399
- } else oldParse.call(this, d);
398
+ } else {
399
+ oldParse.call(this, d);
400
+ if (Object.keys(this["$conf"].parseOptions).length) delete this["$conf"].parseOptions;
401
+ }
400
402
  };
401
403
  dateFromDateComponents = proto["dateFromDateComponents"];
402
404
  };
403
- var advancedParse_default = advancedParsePlugin;
404
405
 
405
406
  //#endregion
406
- export { advancedParse_default as default };
407
+ export { advancedParsePlugin as default };
@@ -1,9 +1,7 @@
1
- import { EsDayPlugin } from "../../chunks/DqhiVwLi.js";
2
- import "../../chunks/MtjcOKi-.js";
3
- import { CalendarPartial } from "../../chunks/St35qgL0.js";
1
+ import { o as EsDayPlugin } from "../../chunks/CODi8AFH.js";
2
+ import { CalendarPartial } from "../locale/index.js";
4
3
 
5
4
  //#region src/plugins/calendar/index.d.ts
6
-
7
5
  declare module 'esday' {
8
6
  interface EsDay {
9
7
  calendar(referenceDate?: EsDay | null, formats?: CalendarPartial): string;
@@ -27,7 +27,6 @@ const calendarPlugin = (_, dayClass, dayFactory) => {
27
27
  return this.format(currentFormat);
28
28
  };
29
29
  };
30
- var calendar_default = calendarPlugin;
31
30
 
32
31
  //#endregion
33
- export { calendar_default as default };
32
+ export { calendarPlugin as default };
@@ -1,5 +1,4 @@
1
- import { EsDayPlugin } from "../../chunks/DqhiVwLi.js";
2
- import "../../chunks/MtjcOKi-.js";
1
+ import { o as EsDayPlugin } from "../../chunks/CODi8AFH.js";
3
2
 
4
3
  //#region src/plugins/dayOfYear/index.d.ts
5
4
  declare module 'esday' {
@@ -6,7 +6,6 @@ const dayOfYearPlugin = (_, dayClass, dayFactory) => {
6
6
  return input === void 0 ? dayOfYear : this.add(input - dayOfYear, "day");
7
7
  };
8
8
  };
9
- var dayOfYear_default = dayOfYearPlugin;
10
9
 
11
10
  //#endregion
12
- export { dayOfYear_default as default };
11
+ export { dayOfYearPlugin as default };
@@ -0,0 +1,78 @@
1
+ import { E as UnitIsoWeeks, I as UnitTypePlurals, S as UnitDates, o as EsDayPlugin } from "../../chunks/CODi8AFH.js";
2
+ import { Locale } from "../locale/index.js";
3
+ import { ThresholdRelativeTime } from "../relativeTime/index.js";
4
+
5
+ //#region src/plugins/duration/index.d.ts
6
+ declare module 'esday' {
7
+ interface EsDayFactory {
8
+ duration(): Duration;
9
+ duration(input: string): Duration;
10
+ duration(input: string, unit: UnitTypeDuration): Duration;
11
+ duration(input: number): Duration;
12
+ duration(input: number, unit: UnitTypeDuration): Duration;
13
+ duration(input: Duration): Duration;
14
+ duration(input: object): Duration;
15
+ duration(input: string | number | object | Duration | null, unit?: UnitTypeDuration): Duration;
16
+ isDuration(d?: any): d is Duration;
17
+ }
18
+ }
19
+ type UnitTypeDuration = Exclude<UnitTypePlurals, UnitIsoWeeks | UnitDates>;
20
+ type UnitsObjectTypeDuration = {
21
+ years?: number | string;
22
+ quarters?: number | string;
23
+ months?: number | string;
24
+ weeks?: number | string;
25
+ days?: number | string;
26
+ hours?: number | string;
27
+ minutes?: number | string;
28
+ seconds?: number | string;
29
+ milliseconds?: number | string;
30
+ };
31
+ type DurationBase = {
32
+ milliseconds: number;
33
+ days: number;
34
+ months: number;
35
+ };
36
+ interface Duration {
37
+ clone(): Duration;
38
+ humanize(): string;
39
+ humanize(withSuffix: boolean): string;
40
+ humanize(thresholds: ThresholdRelativeTime): string;
41
+ humanize(withSuffix: boolean, thresholds: ThresholdRelativeTime): string;
42
+ as(unit: UnitTypeDuration): number;
43
+ get(unit: UnitTypeDuration): number;
44
+ milliseconds(): number;
45
+ asMilliseconds(): number;
46
+ seconds(): number;
47
+ asSeconds(): number;
48
+ minutes(): number;
49
+ asMinutes(): number;
50
+ hours(): number;
51
+ asHours(): number;
52
+ days(): number;
53
+ asDays(): number;
54
+ weeks(): number;
55
+ asWeeks(): number;
56
+ months(): number;
57
+ asMonths(): number;
58
+ quarters(): number;
59
+ asQuarters(): number;
60
+ years(): number;
61
+ asYears(): number;
62
+ add(input: number | UnitsObjectTypeDuration | Duration, unit?: UnitTypeDuration): Duration;
63
+ subtract(input: number | UnitsObjectTypeDuration | Duration, unit?: UnitTypeDuration): Duration;
64
+ locale(): string;
65
+ locale(locale: string): Duration;
66
+ localeObject(): Locale;
67
+ valueOf(): number;
68
+ durationBase(): DurationBase;
69
+ format(formatStr?: string): string;
70
+ toString(): string;
71
+ toISOString(): string;
72
+ toJSON(): string;
73
+ asStringifiedJSON(): string;
74
+ isValid(): boolean;
75
+ }
76
+ declare const durationPlugin: EsDayPlugin<{}>;
77
+ //#endregion
78
+ export { Duration, DurationBase, UnitTypeDuration, UnitsObjectTypeDuration, durationPlugin as default };