chronos-date 1.0.2 → 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.
- package/dist/basic-DqKyujoj.mjs +382 -0
- package/dist/basic-DsQqC5nZ.cjs +466 -0
- package/dist/constants.cjs +43 -1
- package/dist/constants.d.cts +17 -1
- package/dist/constants.d.mts +17 -1
- package/dist/constants.mjs +21 -1
- package/dist/convert-DbgntRVW.cjs +49 -0
- package/dist/convert-mMaI4YP0.mjs +38 -0
- package/dist/greet-D07t2_e6.mjs +51 -0
- package/dist/greet-hjVsd2dt.cjs +56 -0
- package/dist/guards.cjs +140 -1
- package/dist/guards.d.cts +18 -2
- package/dist/guards.d.mts +18 -2
- package/dist/guards.mjs +131 -1
- package/dist/helpers-CQzi908i.cjs +278 -0
- package/dist/helpers-DEf4sevD.mjs +201 -0
- package/dist/index.cjs +1477 -1
- package/dist/index.d.cts +18 -2
- package/dist/index.d.mts +18 -2
- package/dist/index.mjs +1474 -1
- package/dist/non-primitives-D9zxCwX8.cjs +68 -0
- package/dist/non-primitives-DBtomDty.mjs +38 -0
- package/dist/plugins/banglaPlugin.cjs +137 -1
- package/dist/plugins/banglaPlugin.d.cts +19 -3
- package/dist/plugins/banglaPlugin.d.mts +19 -3
- package/dist/plugins/banglaPlugin.mjs +136 -1
- package/dist/plugins/businessPlugin.cjs +134 -1
- package/dist/plugins/businessPlugin.d.cts +17 -1
- package/dist/plugins/businessPlugin.d.mts +17 -1
- package/dist/plugins/businessPlugin.mjs +133 -1
- package/dist/plugins/dateRangePlugin.cjs +62 -1
- package/dist/plugins/dateRangePlugin.d.cts +19 -3
- package/dist/plugins/dateRangePlugin.d.mts +19 -3
- package/dist/plugins/dateRangePlugin.mjs +61 -1
- package/dist/plugins/dayPartPlugin.cjs +42 -1
- package/dist/plugins/dayPartPlugin.d.cts +17 -1
- package/dist/plugins/dayPartPlugin.d.mts +17 -1
- package/dist/plugins/dayPartPlugin.mjs +41 -1
- package/dist/plugins/durationPlugin.cjs +107 -1
- package/dist/plugins/durationPlugin.d.cts +17 -1
- package/dist/plugins/durationPlugin.d.mts +17 -1
- package/dist/plugins/durationPlugin.mjs +106 -1
- package/dist/plugins/fromNowPlugin.cjs +96 -1
- package/dist/plugins/fromNowPlugin.d.cts +17 -1
- package/dist/plugins/fromNowPlugin.d.mts +17 -1
- package/dist/plugins/fromNowPlugin.mjs +95 -1
- package/dist/plugins/greetingPlugin.cjs +35 -1
- package/dist/plugins/greetingPlugin.d.cts +17 -1
- package/dist/plugins/greetingPlugin.d.mts +17 -1
- package/dist/plugins/greetingPlugin.mjs +34 -1
- package/dist/plugins/palindromePlugin.cjs +38 -1
- package/dist/plugins/palindromePlugin.d.cts +17 -1
- package/dist/plugins/palindromePlugin.d.mts +17 -1
- package/dist/plugins/palindromePlugin.mjs +37 -1
- package/dist/plugins/relativeTimePlugin.cjs +90 -1
- package/dist/plugins/relativeTimePlugin.d.cts +17 -1
- package/dist/plugins/relativeTimePlugin.d.mts +17 -1
- package/dist/plugins/relativeTimePlugin.mjs +89 -1
- package/dist/plugins/roundPlugin.cjs +85 -1
- package/dist/plugins/roundPlugin.d.cts +17 -1
- package/dist/plugins/roundPlugin.d.mts +17 -1
- package/dist/plugins/roundPlugin.mjs +84 -1
- package/dist/plugins/seasonPlugin.cjs +47 -1
- package/dist/plugins/seasonPlugin.d.cts +17 -1
- package/dist/plugins/seasonPlugin.d.mts +17 -1
- package/dist/plugins/seasonPlugin.mjs +46 -1
- package/dist/plugins/timeZonePlugin.cjs +155 -1
- package/dist/plugins/timeZonePlugin.d.cts +17 -1
- package/dist/plugins/timeZonePlugin.d.mts +17 -1
- package/dist/plugins/timeZonePlugin.mjs +154 -1
- package/dist/plugins/zodiacPlugin.cjs +67 -1
- package/dist/plugins/zodiacPlugin.d.cts +17 -1
- package/dist/plugins/zodiacPlugin.d.mts +17 -1
- package/dist/plugins/zodiacPlugin.mjs +66 -1
- package/dist/primitives-CtuSNmV7.cjs +65 -0
- package/dist/primitives-dXzXlzJw.mjs +35 -0
- package/dist/seasons-B7kK88zq.cjs +434 -0
- package/dist/{seasons-CioTH5Dm.d.mts → seasons-B_kjFWIX.d.mts} +16 -0
- package/dist/{seasons-CsVeJ27s.d.cts → seasons-CpUn45n6.d.cts} +16 -0
- package/dist/seasons-Cq3ah3pV.mjs +368 -0
- package/dist/timezone-BNnHFgki.cjs +5625 -0
- package/dist/timezone-Db2CeL32.mjs +5589 -0
- package/dist/{types-B2fgrJ86.d.mts → types-Cb4gxrgJ.d.mts} +29 -15
- package/dist/{types-DPTQ_yLx.d.cts → types-CdmsXbU_.d.cts} +29 -15
- package/dist/types.cjs +16 -0
- package/dist/types.d.cts +18 -2
- package/dist/types.d.mts +18 -2
- package/dist/types.mjs +17 -1
- package/dist/utilities-BGX8dviZ.mjs +257 -0
- package/dist/utilities-BKtVo78T.mjs +59 -0
- package/dist/utilities-CpF3uys3.cjs +88 -0
- package/dist/utilities-D47SN9EZ.cjs +334 -0
- package/dist/utils.cjs +92 -1
- package/dist/utils.d.cts +20 -4
- package/dist/utils.d.mts +20 -4
- package/dist/utils.mjs +60 -1
- package/package.json +10 -4
- package/dist/basic-CKxaRSHQ.cjs +0 -1
- package/dist/basic-e46DaNAi.mjs +0 -1
- package/dist/convert-Bmp63ats.mjs +0 -1
- package/dist/convert-DrLrcgqz.cjs +0 -1
- package/dist/greet-BBsrvmkn.mjs +0 -1
- package/dist/greet-C-6mruI9.cjs +0 -1
- package/dist/helpers-DGzYnP81.cjs +0 -1
- package/dist/helpers-N1X_Rj_V.mjs +0 -1
- package/dist/non-primitives-B2EE6D6s.mjs +0 -1
- package/dist/non-primitives-Bu3a4WL4.cjs +0 -1
- package/dist/primitives-Cxss_JVF.mjs +0 -1
- package/dist/primitives-Db2FUp4e.cjs +0 -1
- package/dist/seasons-ChAIVphi.mjs +0 -1
- package/dist/seasons-oABOhHcX.cjs +0 -1
- package/dist/timezone-B10UItNO.mjs +0 -1
- package/dist/timezone-CWxbK_7I.cjs +0 -1
- package/dist/utilities-B8dOAQVD.cjs +0 -1
- package/dist/utilities-BJE06bms.mjs +0 -1
- package/dist/utilities-D2-p26DX.cjs +0 -1
- package/dist/utilities-DV_ohS37.mjs +0 -1
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 - present Nazmul Hassan
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
//#region src/constants/seasons.ts
|
|
18
|
+
/** Western Seasons */
|
|
19
|
+
const DEFAULT_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
20
|
+
{
|
|
21
|
+
name: "Spring",
|
|
22
|
+
boundary: {
|
|
23
|
+
startMonth: 2,
|
|
24
|
+
endMonth: 4
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "Summer",
|
|
29
|
+
boundary: {
|
|
30
|
+
startMonth: 5,
|
|
31
|
+
endMonth: 7
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "Autumn",
|
|
36
|
+
boundary: {
|
|
37
|
+
startMonth: 8,
|
|
38
|
+
endMonth: 10
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "Winter",
|
|
43
|
+
boundary: {
|
|
44
|
+
startMonth: 11,
|
|
45
|
+
endMonth: 1
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]);
|
|
49
|
+
/**Default Bangladeshi Seasons */
|
|
50
|
+
const BANGLADESH_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
51
|
+
{
|
|
52
|
+
name: "Grisma (Summer)",
|
|
53
|
+
boundary: {
|
|
54
|
+
startDate: "04-15",
|
|
55
|
+
endDate: "06-14"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "Barsa (Monsoon)",
|
|
60
|
+
boundary: {
|
|
61
|
+
startDate: "06-15",
|
|
62
|
+
endDate: "08-14"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "Sarat (Autumn)",
|
|
67
|
+
boundary: {
|
|
68
|
+
startDate: "08-15",
|
|
69
|
+
endDate: "10-14"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "Hemanta (Late-Autumn)",
|
|
74
|
+
boundary: {
|
|
75
|
+
startDate: "10-15",
|
|
76
|
+
endDate: "12-14"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "Shhit (Winter)",
|
|
81
|
+
boundary: {
|
|
82
|
+
startDate: "12-15",
|
|
83
|
+
endDate: "02-14"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "Basanta (Spring)",
|
|
88
|
+
boundary: {
|
|
89
|
+
startDate: "02-15",
|
|
90
|
+
endDate: "04-14"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
]);
|
|
94
|
+
/** Indian Seasons */
|
|
95
|
+
const INDIA_IMD_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
96
|
+
{
|
|
97
|
+
name: "Winter",
|
|
98
|
+
boundary: {
|
|
99
|
+
startMonth: 0,
|
|
100
|
+
endMonth: 1
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "Pre-Monsoon",
|
|
105
|
+
boundary: {
|
|
106
|
+
startMonth: 2,
|
|
107
|
+
endMonth: 4
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "Monsoon",
|
|
112
|
+
boundary: {
|
|
113
|
+
startMonth: 5,
|
|
114
|
+
endMonth: 8
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "Post-Monsoon",
|
|
119
|
+
boundary: {
|
|
120
|
+
startMonth: 9,
|
|
121
|
+
endMonth: 10
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "Cool Season",
|
|
126
|
+
boundary: {
|
|
127
|
+
startMonth: 11,
|
|
128
|
+
endMonth: 11
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
]);
|
|
132
|
+
/** Indian Vedic Seasons */
|
|
133
|
+
const INDIA_VEDIC_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
134
|
+
{
|
|
135
|
+
name: "Shishir (Winter)",
|
|
136
|
+
boundary: {
|
|
137
|
+
startDate: "12-15",
|
|
138
|
+
endDate: "02-14"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "Vasanta (Spring)",
|
|
143
|
+
boundary: {
|
|
144
|
+
startDate: "02-15",
|
|
145
|
+
endDate: "04-14"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "Grishma (Summer)",
|
|
150
|
+
boundary: {
|
|
151
|
+
startDate: "04-15",
|
|
152
|
+
endDate: "06-14"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "Varsha (Monsoon)",
|
|
157
|
+
boundary: {
|
|
158
|
+
startDate: "06-15",
|
|
159
|
+
endDate: "08-14"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "Sharad (Autumn)",
|
|
164
|
+
boundary: {
|
|
165
|
+
startDate: "08-15",
|
|
166
|
+
endDate: "10-14"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: "Hemant (Late-Autumn)",
|
|
171
|
+
boundary: {
|
|
172
|
+
startDate: "10-15",
|
|
173
|
+
endDate: "12-14"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
]);
|
|
177
|
+
/** Indian Tamil Seasons */
|
|
178
|
+
const INDIA_TAMIL_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
179
|
+
{
|
|
180
|
+
name: "Ilavenil (Mid-Summer)",
|
|
181
|
+
boundary: {
|
|
182
|
+
startMonth: 4,
|
|
183
|
+
endMonth: 5
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "Mutuvenil (Peak-Summer)",
|
|
188
|
+
boundary: {
|
|
189
|
+
startMonth: 6,
|
|
190
|
+
endMonth: 7
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: "Kaar (Monsoon)",
|
|
195
|
+
boundary: {
|
|
196
|
+
startMonth: 7,
|
|
197
|
+
endMonth: 9
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: "Koothir (Autumn)",
|
|
202
|
+
boundary: {
|
|
203
|
+
startMonth: 9,
|
|
204
|
+
endMonth: 10
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
name: "Munpani (Early-Winter)",
|
|
209
|
+
boundary: {
|
|
210
|
+
startMonth: 10,
|
|
211
|
+
endMonth: 0
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: "Pinpani (Late-Winter)",
|
|
216
|
+
boundary: {
|
|
217
|
+
startMonth: 0,
|
|
218
|
+
endMonth: 2
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
]);
|
|
222
|
+
/** Philippines Seasons */
|
|
223
|
+
const PHILIPPINES_SEASONS = /* @__PURE__ */ Object.freeze([{
|
|
224
|
+
name: "Dry Season",
|
|
225
|
+
boundary: {
|
|
226
|
+
startMonth: 11,
|
|
227
|
+
endMonth: 4
|
|
228
|
+
}
|
|
229
|
+
}, {
|
|
230
|
+
name: "Wet Season",
|
|
231
|
+
boundary: {
|
|
232
|
+
startMonth: 5,
|
|
233
|
+
endMonth: 10
|
|
234
|
+
}
|
|
235
|
+
}]);
|
|
236
|
+
/** US Academic Seasons */
|
|
237
|
+
const US_ACADEMIC_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
238
|
+
{
|
|
239
|
+
name: "Spring",
|
|
240
|
+
boundary: {
|
|
241
|
+
startDate: "01-10",
|
|
242
|
+
endDate: "05-15"
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
name: "Summer",
|
|
247
|
+
boundary: {
|
|
248
|
+
startDate: "05-16",
|
|
249
|
+
endDate: "08-15"
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
name: "Fall",
|
|
254
|
+
boundary: {
|
|
255
|
+
startDate: "08-16",
|
|
256
|
+
endDate: "12-20"
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
name: "Winter Break",
|
|
261
|
+
boundary: {
|
|
262
|
+
startDate: "12-21",
|
|
263
|
+
endDate: "01-09"
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
]);
|
|
267
|
+
/** Japanese Seasons */
|
|
268
|
+
const JAPAN_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
269
|
+
{
|
|
270
|
+
name: "Haru (Spring)",
|
|
271
|
+
boundary: {
|
|
272
|
+
startDate: "03-01",
|
|
273
|
+
endDate: "05-31"
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
name: "Natsu (Summer)",
|
|
278
|
+
boundary: {
|
|
279
|
+
startDate: "06-01",
|
|
280
|
+
endDate: "08-31"
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
name: "Aki (Autumn)",
|
|
285
|
+
boundary: {
|
|
286
|
+
startDate: "09-01",
|
|
287
|
+
endDate: "11-30"
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: "Fuyu (Winter)",
|
|
292
|
+
boundary: {
|
|
293
|
+
startDate: "12-01",
|
|
294
|
+
endDate: "02-28"
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
]);
|
|
298
|
+
/** Australian Seasons */
|
|
299
|
+
const AUSTRALIA_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
300
|
+
{
|
|
301
|
+
name: "Summer",
|
|
302
|
+
boundary: {
|
|
303
|
+
startMonth: 11,
|
|
304
|
+
endMonth: 1
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: "Autumn",
|
|
309
|
+
boundary: {
|
|
310
|
+
startMonth: 2,
|
|
311
|
+
endMonth: 4
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
name: "Winter",
|
|
316
|
+
boundary: {
|
|
317
|
+
startMonth: 5,
|
|
318
|
+
endMonth: 7
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
name: "Spring",
|
|
323
|
+
boundary: {
|
|
324
|
+
startMonth: 8,
|
|
325
|
+
endMonth: 10
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
]);
|
|
329
|
+
/** Ethiopian Seasons */
|
|
330
|
+
const ETHIOPIA_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
331
|
+
{
|
|
332
|
+
name: "Bega (Dry)",
|
|
333
|
+
boundary: {
|
|
334
|
+
startMonth: 10,
|
|
335
|
+
endMonth: 1
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
name: "Belg (Short Rain)",
|
|
340
|
+
boundary: {
|
|
341
|
+
startMonth: 2,
|
|
342
|
+
endMonth: 4
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
name: "Kiremt (Main Rain)",
|
|
347
|
+
boundary: {
|
|
348
|
+
startMonth: 5,
|
|
349
|
+
endMonth: 9
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
]);
|
|
353
|
+
/** All the Season Presets for `new Chronos.season()` method */
|
|
354
|
+
const SEASON_PRESETS = /* @__PURE__ */ Object.freeze({
|
|
355
|
+
default: DEFAULT_SEASONS,
|
|
356
|
+
bangladesh: BANGLADESH_SEASONS,
|
|
357
|
+
india: INDIA_IMD_SEASONS,
|
|
358
|
+
tamil: INDIA_TAMIL_SEASONS,
|
|
359
|
+
vedic: INDIA_VEDIC_SEASONS,
|
|
360
|
+
philippines: PHILIPPINES_SEASONS,
|
|
361
|
+
academic_us: US_ACADEMIC_SEASONS,
|
|
362
|
+
japan: JAPAN_SEASONS,
|
|
363
|
+
australia: AUSTRALIA_SEASONS,
|
|
364
|
+
ethiopia: ETHIOPIA_SEASONS
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
//#endregion
|
|
368
|
+
export { INDIA_IMD_SEASONS as a, JAPAN_SEASONS as c, US_ACADEMIC_SEASONS as d, ETHIOPIA_SEASONS as i, PHILIPPINES_SEASONS as l, BANGLADESH_SEASONS as n, INDIA_TAMIL_SEASONS as o, DEFAULT_SEASONS as r, INDIA_VEDIC_SEASONS as s, AUSTRALIA_SEASONS as t, SEASON_PRESETS as u };
|