nhb-toolbox 4.12.10 → 4.12.12
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/CHANGELOG.md +8 -0
- package/README.md +16 -14
- package/dist/cjs/date/Chronos.js +80 -20
- package/dist/cjs/date/constants.js +4 -1
- package/dist/cjs/date/seasons.js +156 -0
- package/dist/dts/date/Chronos.d.ts +30 -6
- package/dist/dts/date/Chronos.d.ts.map +1 -1
- package/dist/dts/date/constants.d.ts +5 -3
- package/dist/dts/date/constants.d.ts.map +1 -1
- package/dist/dts/date/guards.d.ts +2 -2
- package/dist/dts/date/guards.d.ts.map +1 -1
- package/dist/dts/date/seasons.d.ts +74 -0
- package/dist/dts/date/seasons.d.ts.map +1 -0
- package/dist/dts/date/types.d.ts +50 -15
- package/dist/dts/date/types.d.ts.map +1 -1
- package/dist/dts/date/utils.d.ts +4 -4
- package/dist/dts/date/utils.d.ts.map +1 -1
- package/dist/esm/date/Chronos.js +80 -20
- package/dist/esm/date/constants.js +3 -0
- package/dist/esm/date/seasons.js +153 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,14 @@ All notable changes to this package will be documented in this file.
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [4.12.12] - 2025-05-30
|
|
10
|
+
|
|
11
|
+
### 🕧 Updates in Chronos
|
|
12
|
+
|
|
13
|
+
- Added new method `season` to get the name of the season for current Chronos instance. It has configurable options.
|
|
14
|
+
- All `Chronos` methods that use `#format` method internally now accepts escape tokens and new token `ZZ` is introduced to include timezone offset (or Z for UTC time) in the formatted date string.
|
|
15
|
+
- Updated some type names such as `Hours` ➡️ `ClockHour`, `Minutes` ➡️ `ClockMinute`, `Time` ➡️ `ClockTIme` etc. But the core definitions remain the same.
|
|
16
|
+
|
|
9
17
|
## [4.12.10] - 2025-05-30
|
|
10
18
|
|
|
11
19
|
### 🕧 New Chronos Methods
|
package/README.md
CHANGED
|
@@ -98,8 +98,8 @@ Blazing-fast array searching with binary search, fuzzy matching, and smart cachi
|
|
|
98
98
|
const productFinder = new Finder(products);
|
|
99
99
|
|
|
100
100
|
const laptop = productFinder.findOne('laptop', 'category', {
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
fuzzy: true,
|
|
102
|
+
caseInsensitive: false,
|
|
103
103
|
});
|
|
104
104
|
```
|
|
105
105
|
|
|
@@ -111,10 +111,10 @@ const laptop = productFinder.findOne('laptop', 'category', {
|
|
|
111
111
|
|
|
112
112
|
```typescript
|
|
113
113
|
generateRandomID({
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
prefix: 'user',
|
|
115
|
+
timeStamp: true,
|
|
116
|
+
length: 12,
|
|
117
|
+
caseOption: 'upper',
|
|
118
118
|
}); // "USER-171234567890-AB3C4D5E6F7G"
|
|
119
119
|
```
|
|
120
120
|
|
|
@@ -140,10 +140,10 @@ Clean and normalize strings/objects by trimming whitespace, removing empty value
|
|
|
140
140
|
|
|
141
141
|
```typescript
|
|
142
142
|
const user = {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
name: ' John Doe ',
|
|
144
|
+
age: null,
|
|
145
|
+
address: { city: ' NYC ', zip: '' },
|
|
146
|
+
tags: [],
|
|
147
147
|
};
|
|
148
148
|
|
|
149
149
|
sanitizeData(user, { ignoreNullish: true, ignoreEmpty: true });
|
|
@@ -206,9 +206,9 @@ getNumbersInRange('prime', { min: 10, max: 30, getAsString: true });
|
|
|
206
206
|
```typescript
|
|
207
207
|
// Calculate percentage change
|
|
208
208
|
calculatePercentage({
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
mode: 'get-change-percent',
|
|
210
|
+
oldValue: 100,
|
|
211
|
+
newValue: 150,
|
|
212
212
|
}); // 50 (50% increase)
|
|
213
213
|
```
|
|
214
214
|
|
|
@@ -247,11 +247,13 @@ debounceAction(fetchResults, 300);
|
|
|
247
247
|
|
|
248
248
|
[Full Documentation →](https://nhb-toolbox.vercel.app/docs/utilities/misc/debounceAction)
|
|
249
249
|
|
|
250
|
+
> These utilities represent just a portion of the comprehensive `toolbox`. Each is designed with production-grade reliability and developer experience in mind. Explore more in the [full documentation](https://nhb-toolbox.vercel.app). All the utilities and classes are categorized.
|
|
251
|
+
|
|
250
252
|
---
|
|
251
253
|
|
|
252
254
|
## License
|
|
253
255
|
|
|
254
|
-
This project is licensed under the [Apache License 2.0](
|
|
256
|
+
This project is licensed under the [Apache License 2.0](LICENSE) with the following additional requirement:
|
|
255
257
|
|
|
256
258
|
**Additional Requirement:**
|
|
257
259
|
|
package/dist/cjs/date/Chronos.js
CHANGED
|
@@ -7,6 +7,7 @@ const convert_1 = require("../string/convert");
|
|
|
7
7
|
const guards_1 = require("../string/guards");
|
|
8
8
|
const constants_1 = require("./constants");
|
|
9
9
|
const guards_2 = require("./guards");
|
|
10
|
+
const seasons_1 = require("./seasons");
|
|
10
11
|
const utils_1 = require("./utils");
|
|
11
12
|
/**
|
|
12
13
|
* * Creates a new immutable `Chronos` instance.
|
|
@@ -182,6 +183,7 @@ class Chronos {
|
|
|
182
183
|
const milliseconds = useUTC ?
|
|
183
184
|
this.#date.getUTCMilliseconds()
|
|
184
185
|
: this.#date.getMilliseconds();
|
|
186
|
+
const timeZone = useUTC ? 'Z' : this.getTimeZoneOffset();
|
|
185
187
|
const dateComponents = {
|
|
186
188
|
YYYY: String(year),
|
|
187
189
|
YY: String(year).slice(-2),
|
|
@@ -209,27 +211,28 @@ class Chronos {
|
|
|
209
211
|
mss: String(milliseconds).padStart(3, '0'),
|
|
210
212
|
a: hours < 12 ? 'am' : 'pm',
|
|
211
213
|
A: hours < 12 ? 'AM' : 'PM',
|
|
214
|
+
ZZ: timeZone,
|
|
212
215
|
};
|
|
216
|
+
const tokenRegex = new RegExp(`^(${constants_1.sortedFormats.join('|')})`);
|
|
213
217
|
let result = '';
|
|
214
218
|
let i = 0;
|
|
215
|
-
while (i < format
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
const nextOk = i + token?.length >= format?.length ||
|
|
224
|
-
/[^a-zA-Z0-9]/.test(next);
|
|
225
|
-
if (ahead === token && prevOk && nextOk) {
|
|
226
|
-
result += dateComponents[token];
|
|
227
|
-
i += token?.length;
|
|
228
|
-
matched = true;
|
|
229
|
-
break;
|
|
219
|
+
while (i < format.length) {
|
|
220
|
+
// Handle [escaped literal]
|
|
221
|
+
if (format[i] === '[') {
|
|
222
|
+
const end = format.indexOf(']', i);
|
|
223
|
+
if (end !== -1) {
|
|
224
|
+
result += format.slice(i + 1, end);
|
|
225
|
+
i = end + 1;
|
|
226
|
+
continue;
|
|
230
227
|
}
|
|
231
228
|
}
|
|
232
|
-
|
|
229
|
+
// Try to match a format token
|
|
230
|
+
const match = tokenRegex.exec(format.slice(i));
|
|
231
|
+
if (match) {
|
|
232
|
+
result += dateComponents[match[0]];
|
|
233
|
+
i += match[0].length;
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
233
236
|
result += format[i];
|
|
234
237
|
i++;
|
|
235
238
|
}
|
|
@@ -408,11 +411,21 @@ class Chronos {
|
|
|
408
411
|
return this.#date.getTime();
|
|
409
412
|
}
|
|
410
413
|
/**
|
|
411
|
-
* @instance Formats the date into a custom string format (local time).
|
|
414
|
+
* @instance Formats the current date into a custom string format (local time by default).
|
|
415
|
+
*
|
|
416
|
+
* @param format - The desired format string (Default: `dd, mmm DD, YYYY HH:mm:ss` → e.g., `Sun, Apr 06, 2025 16:11:55`).
|
|
417
|
+
*
|
|
418
|
+
* - To output raw text (i.e., not interpreted as a date token), wrap it in square brackets.
|
|
419
|
+
* - For example, `[Today is] ddd` results in `Today is Sunday`, and `YYYY[ year]` results in `2025 year`.
|
|
420
|
+
*
|
|
421
|
+
* - Supported format tokens include: `YYYY`, `YY`, `MMMM`, `MMM`, `MM`, `M`, `DD`, `D`, `dd`, `ddd`, `Do`, `HH`, `H`, `hh`, `h`, `mm`, `m`, `ss`, `s`, `mss`, `a`, `A`, and `ZZ`.
|
|
422
|
+
* - *Any token not wrapped in brackets will be parsed and replaced with its corresponding date component.*
|
|
412
423
|
*
|
|
413
|
-
* @param
|
|
414
|
-
*
|
|
415
|
-
*
|
|
424
|
+
* @param useUTC - Optional boolean to format the date using UTC time.
|
|
425
|
+
* When `true`, it behaves like `formatUTC()` and outputs time based on UTC offset. Defaults to `false`.
|
|
426
|
+
*
|
|
427
|
+
* @returns Formatted date string using the specified format.
|
|
428
|
+
* Uses local time by default unless `useUTC` is set to `true`.
|
|
416
429
|
*/
|
|
417
430
|
format(format, useUTC = false) {
|
|
418
431
|
return this.#format(format ?? 'dd, mmm DD, YYYY HH:mm:ss', useUTC);
|
|
@@ -424,6 +437,7 @@ class Chronos {
|
|
|
424
437
|
*
|
|
425
438
|
* @param format - The desired format string. Defaults to `'dd, mmm DD, YYYY HH:mm:ss'`
|
|
426
439
|
* (e.g., `'Sun, Apr 06, 2025 16:11:55'`).
|
|
440
|
+
*
|
|
427
441
|
* @param useUTC - If `true`, formats the date in UTC (equivalent to `formatUTC()`);
|
|
428
442
|
* defaults to `false` (local time).
|
|
429
443
|
* @returns A formatted date string in the specified format
|
|
@@ -435,6 +449,13 @@ class Chronos {
|
|
|
435
449
|
* @instance Formats the date into a custom string format (UTC time).
|
|
436
450
|
*
|
|
437
451
|
* @param format - The desired format (Default format is `dd, mmm DD, YYYY HH:mm:ss:mss` = `Sun, Apr 06, 2025 16:11:55:379`).
|
|
452
|
+
*
|
|
453
|
+
* - To output raw text (i.e., not interpreted as a date token), wrap it in square brackets.
|
|
454
|
+
* - For example, `[Today is] ddd` results in `Today is Sunday`, and `YYYY[ year]` results in `2025 year`.
|
|
455
|
+
*
|
|
456
|
+
* - Supported format tokens include: `YYYY`, `YY`, `MMMM`, `MMM`, `MM`, `M`, `DD`, `D`, `dd`, `ddd`, `Do`, `HH`, `H`, `hh`, `h`, `mm`, `m`, `ss`, `s`, `mss`, `a`, `A`, and `ZZ`.
|
|
457
|
+
* - *Any token not wrapped in brackets will be parsed and replaced with its corresponding date component.*
|
|
458
|
+
*
|
|
438
459
|
* @returns Formatted date string in desired format (UTC time).
|
|
439
460
|
*/
|
|
440
461
|
formatUTC(format = 'dd, mmm DD, YYYY HH:mm:ss:mss') {
|
|
@@ -1382,6 +1403,45 @@ class Chronos {
|
|
|
1382
1403
|
}
|
|
1383
1404
|
return 'Capricorn';
|
|
1384
1405
|
}
|
|
1406
|
+
/**
|
|
1407
|
+
* @instance Returns the current season name based on optional season rules or presets.
|
|
1408
|
+
* @param options Configuration with optional custom seasons or preset name.
|
|
1409
|
+
* @returns The name of the season the current date falls under.
|
|
1410
|
+
*/
|
|
1411
|
+
season(options) {
|
|
1412
|
+
const { preset = 'default' } = options ?? {};
|
|
1413
|
+
const seasonSet = options?.seasons ?? seasons_1.SEASON_PRESETS[preset];
|
|
1414
|
+
const dateStr = this.#format('MM-DD');
|
|
1415
|
+
for (const { name, boundary } of seasonSet) {
|
|
1416
|
+
if ('startDate' in boundary && 'endDate' in boundary) {
|
|
1417
|
+
const start = boundary.startDate;
|
|
1418
|
+
const end = boundary.endDate;
|
|
1419
|
+
if (start <= end) {
|
|
1420
|
+
if (dateStr >= start && dateStr <= end)
|
|
1421
|
+
return name;
|
|
1422
|
+
}
|
|
1423
|
+
else {
|
|
1424
|
+
// Handles wrap-around seasons like Dec–Feb
|
|
1425
|
+
if (dateStr >= start || dateStr <= end)
|
|
1426
|
+
return name;
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
else if ('startMonth' in boundary && 'endMonth' in boundary) {
|
|
1430
|
+
const { startMonth, endMonth } = boundary;
|
|
1431
|
+
if (startMonth <= endMonth) {
|
|
1432
|
+
if (this.month >= startMonth && this.month <= endMonth) {
|
|
1433
|
+
return name;
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
else {
|
|
1437
|
+
if (this.month >= startMonth || this.month <= endMonth) {
|
|
1438
|
+
return name;
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
return 'Unknown';
|
|
1444
|
+
}
|
|
1385
1445
|
/** @instance Returns number of days in current month */
|
|
1386
1446
|
daysInMonth() {
|
|
1387
1447
|
return new Date(this.year, this.month + 1, 0).getDate();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZODIAC_SIGNS = exports.DEFAULT_RANGES = exports.TIME_ZONE_LABELS = exports.TIME_ZONES = exports.sortedFormats = exports.TIME_FORMATS = exports.MILLISECOND_FORMATS = exports.SECOND_FORMATS = exports.MINUTE_FORMATS = exports.HOUR_FORMATS = exports.DAY_FORMATS = exports.DATE_FORMATS = exports.MONTH_FORMATS = exports.YEAR_FORMATS = exports.MONTHS = exports.DAYS = void 0;
|
|
3
|
+
exports.ZODIAC_SIGNS = exports.DEFAULT_RANGES = exports.TIME_ZONE_LABELS = exports.TIME_ZONES = exports.sortedFormats = exports.TIME_FORMATS = exports.MILLISECOND_FORMATS = exports.ZONE_FORMATS = exports.SECOND_FORMATS = exports.MINUTE_FORMATS = exports.HOUR_FORMATS = exports.DAY_FORMATS = exports.DATE_FORMATS = exports.MONTH_FORMATS = exports.YEAR_FORMATS = exports.MONTHS = exports.DAYS = void 0;
|
|
4
4
|
exports.DAYS = Object.freeze([
|
|
5
5
|
'Sunday',
|
|
6
6
|
'Monday',
|
|
@@ -60,6 +60,7 @@ exports.SECOND_FORMATS = Object.freeze([
|
|
|
60
60
|
'ss',
|
|
61
61
|
's',
|
|
62
62
|
]);
|
|
63
|
+
exports.ZONE_FORMATS = Object.freeze(['ZZ']);
|
|
63
64
|
exports.MILLISECOND_FORMATS = Object.freeze([
|
|
64
65
|
'ms',
|
|
65
66
|
'mss',
|
|
@@ -75,6 +76,7 @@ exports.sortedFormats = Object.freeze([
|
|
|
75
76
|
...exports.SECOND_FORMATS,
|
|
76
77
|
...exports.MILLISECOND_FORMATS,
|
|
77
78
|
...exports.TIME_FORMATS,
|
|
79
|
+
...exports.ZONE_FORMATS,
|
|
78
80
|
].sort((a, b) => b.length - a.length));
|
|
79
81
|
exports.TIME_ZONES = Object.freeze({
|
|
80
82
|
// UTC -12:00 to -01:00 (Mostly Pacific Islands, Americas)
|
|
@@ -428,6 +430,7 @@ exports.DEFAULT_RANGES =
|
|
|
428
430
|
afternoon: ['12', '16'],
|
|
429
431
|
evening: ['17', '20'],
|
|
430
432
|
});
|
|
433
|
+
/** Western Zodiac Signs */
|
|
431
434
|
exports.ZODIAC_SIGNS = Object.freeze([
|
|
432
435
|
['Capricorn', [1, 19]],
|
|
433
436
|
['Aquarius', [2, 18]],
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SEASON_PRESETS = void 0;
|
|
4
|
+
/** Default Western Seasons */
|
|
5
|
+
const DEFAULT_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
6
|
+
{ name: 'Spring', boundary: { startMonth: 2, endMonth: 4 } },
|
|
7
|
+
{ name: 'Summer', boundary: { startMonth: 5, endMonth: 7 } },
|
|
8
|
+
{ name: 'Autumn', boundary: { startMonth: 8, endMonth: 10 } },
|
|
9
|
+
{ name: 'Winter', boundary: { startMonth: 11, endMonth: 1 } },
|
|
10
|
+
]);
|
|
11
|
+
/**Default Bangladeshi Seasons */
|
|
12
|
+
const BANGLADESH_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
13
|
+
{
|
|
14
|
+
name: 'Grishsho (Summer)',
|
|
15
|
+
boundary: { startDate: '04-15', endDate: '06-14' },
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'Bôrsha (Monsoon)',
|
|
19
|
+
boundary: { startDate: '06-15', endDate: '08-14' },
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'Shôrot (Autumn)',
|
|
23
|
+
boundary: { startDate: '08-15', endDate: '10-14' },
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'Hemonto (Late Autumn)',
|
|
27
|
+
boundary: { startDate: '10-15', endDate: '12-14' },
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Sheet (Winter)',
|
|
31
|
+
boundary: { startDate: '12-15', endDate: '02-14' },
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'Bôshonto (Spring)',
|
|
35
|
+
boundary: { startDate: '02-15', endDate: '04-14' },
|
|
36
|
+
},
|
|
37
|
+
]);
|
|
38
|
+
/** Indian Seasons */
|
|
39
|
+
const INDIA_IMD_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
40
|
+
{ name: 'Winter', boundary: { startMonth: 0, endMonth: 1 } },
|
|
41
|
+
{ name: 'Pre-Monsoon', boundary: { startMonth: 2, endMonth: 4 } },
|
|
42
|
+
{ name: 'Monsoon', boundary: { startMonth: 5, endMonth: 8 } },
|
|
43
|
+
{ name: 'Post-Monsoon', boundary: { startMonth: 9, endMonth: 10 } },
|
|
44
|
+
{ name: 'Cool Season', boundary: { startMonth: 11, endMonth: 11 } },
|
|
45
|
+
]);
|
|
46
|
+
/** Indian Vedic Seasons */
|
|
47
|
+
const INDIA_VEDIC_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
48
|
+
{
|
|
49
|
+
name: 'Shishir (Winter)',
|
|
50
|
+
boundary: { startDate: '12-15', endDate: '02-14' },
|
|
51
|
+
}, // Mid-Dec to Mid-Feb
|
|
52
|
+
{
|
|
53
|
+
name: 'Vasanta (Spring)',
|
|
54
|
+
boundary: { startDate: '02-15', endDate: '04-14' },
|
|
55
|
+
}, // Mid-Feb to Mid-Apr
|
|
56
|
+
{
|
|
57
|
+
name: 'Grishma (Summer)',
|
|
58
|
+
boundary: { startDate: '04-15', endDate: '06-14' },
|
|
59
|
+
}, // Mid-Apr to Mid-Jun
|
|
60
|
+
{
|
|
61
|
+
name: 'Varsha (Monsoon)',
|
|
62
|
+
boundary: { startDate: '06-15', endDate: '08-14' },
|
|
63
|
+
}, // Mid-Jun to Mid-Aug
|
|
64
|
+
{
|
|
65
|
+
name: 'Sharad (Autumn)',
|
|
66
|
+
boundary: { startDate: '08-15', endDate: '10-14' },
|
|
67
|
+
}, // Mid-Aug to Mid-Oct
|
|
68
|
+
{
|
|
69
|
+
name: 'Hemant (Late Autumn',
|
|
70
|
+
boundary: { startDate: '10-15', endDate: '12-14' },
|
|
71
|
+
}, // Mid-Oct to Mid-Dec
|
|
72
|
+
]);
|
|
73
|
+
/** Indian Tamil Seasons */
|
|
74
|
+
const INDIA_TAMIL_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
75
|
+
{ name: 'Ilavenil (Mid-Summer)', boundary: { startMonth: 4, endMonth: 5 } }, // May – June
|
|
76
|
+
{
|
|
77
|
+
name: 'Mutuvenil (Peak-Summer)',
|
|
78
|
+
boundary: { startMonth: 6, endMonth: 7 },
|
|
79
|
+
}, // July – August
|
|
80
|
+
{ name: 'Kaar (Monsoon)', boundary: { startMonth: 7, endMonth: 9 } }, // Aug – Oct
|
|
81
|
+
{ name: 'Koothir (Autumn)', boundary: { startMonth: 9, endMonth: 10 } }, // Oct – Nov
|
|
82
|
+
{
|
|
83
|
+
name: 'Munpani (Early-Winter)',
|
|
84
|
+
boundary: { startMonth: 10, endMonth: 0 },
|
|
85
|
+
}, // Nov – Jan
|
|
86
|
+
{ name: 'Pinpani (Late-Winter)', boundary: { startMonth: 0, endMonth: 2 } }, // Jan – Mar
|
|
87
|
+
]);
|
|
88
|
+
/** Philippines Seasons */
|
|
89
|
+
const PHILIPPINES_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
90
|
+
{ name: 'Dry Season', boundary: { startMonth: 11, endMonth: 4 } }, // Dec–May
|
|
91
|
+
{ name: 'Wet Season', boundary: { startMonth: 5, endMonth: 10 } }, // Jun–Nov
|
|
92
|
+
]);
|
|
93
|
+
/** US Academic Seasons */
|
|
94
|
+
const US_ACADEMIC_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
95
|
+
{
|
|
96
|
+
name: 'Spring',
|
|
97
|
+
boundary: { startDate: '01-10', endDate: '05-15' },
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'Summer',
|
|
101
|
+
boundary: { startDate: '05-16', endDate: '08-15' },
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'Fall',
|
|
105
|
+
boundary: { startDate: '08-16', endDate: '12-20' },
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'Winter',
|
|
109
|
+
boundary: { startDate: '12-21', endDate: '01-09' },
|
|
110
|
+
},
|
|
111
|
+
]);
|
|
112
|
+
/** Japanese Seasons */
|
|
113
|
+
const JAPAN_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
114
|
+
{
|
|
115
|
+
name: 'Haru (Spring)',
|
|
116
|
+
boundary: { startDate: '03-01', endDate: '05-31' },
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: 'Natsu (Summer)',
|
|
120
|
+
boundary: { startDate: '06-01', endDate: '08-31' },
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'Aki (Autumn)',
|
|
124
|
+
boundary: { startDate: '09-01', endDate: '11-30' },
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'Fuyu (Winter)',
|
|
128
|
+
boundary: { startDate: '12-01', endDate: '02-28' },
|
|
129
|
+
},
|
|
130
|
+
]);
|
|
131
|
+
/** Australian Seasons */
|
|
132
|
+
const AUSTRALIA_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
133
|
+
{ name: 'Summer', boundary: { startMonth: 11, endMonth: 1 } },
|
|
134
|
+
{ name: 'Autumn', boundary: { startMonth: 2, endMonth: 4 } },
|
|
135
|
+
{ name: 'Winter', boundary: { startMonth: 5, endMonth: 7 } },
|
|
136
|
+
{ name: 'Spring', boundary: { startMonth: 8, endMonth: 10 } },
|
|
137
|
+
]);
|
|
138
|
+
/** Ethiopian Seasons */
|
|
139
|
+
const ETHIOPIA_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
140
|
+
{ name: 'Bega (Dry)', boundary: { startMonth: 10, endMonth: 1 } },
|
|
141
|
+
{ name: 'Belg (Short Rain)', boundary: { startMonth: 2, endMonth: 4 } },
|
|
142
|
+
{ name: 'Kiremt (Main Rain)', boundary: { startMonth: 5, endMonth: 9 } },
|
|
143
|
+
]);
|
|
144
|
+
/** All the Season Presets for `new Chronos.season()` method */
|
|
145
|
+
exports.SEASON_PRESETS = Object.freeze({
|
|
146
|
+
default: DEFAULT_SEASONS,
|
|
147
|
+
bangladesh: BANGLADESH_SEASONS,
|
|
148
|
+
india: INDIA_IMD_SEASONS,
|
|
149
|
+
tamil: INDIA_TAMIL_SEASONS,
|
|
150
|
+
vedic: INDIA_VEDIC_SEASONS,
|
|
151
|
+
philippines: PHILIPPINES_SEASONS,
|
|
152
|
+
academic_us: US_ACADEMIC_SEASONS,
|
|
153
|
+
japan: JAPAN_SEASONS,
|
|
154
|
+
australia: AUSTRALIA_SEASONS,
|
|
155
|
+
ethiopia: ETHIOPIA_SEASONS,
|
|
156
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Enumerate, LocaleCode, NumberRange } from '../number/types';
|
|
2
|
-
import type { ChronosInput, ChronosMethods, ChronosObject, DateRangeOptions, DayPart, DayPartConfig, FormatOptions, MilliSecond, MonthName, Quarter, RelativeRangeOptions, StrictFormat, TimeDuration, TimeParts, TimeUnit, TimeZone, UTCOffSet, WeekDay, ZodiacSign } from './types';
|
|
2
|
+
import type { ChronosInput, ChronosMethods, ChronosObject, DateRangeOptions, DayPart, DayPartConfig, FormatOptions, MilliSecond, MonthName, Quarter, RelativeRangeOptions, SeasonOptions, StrictFormat, TimeDuration, TimeParts, TimeUnit, TimeZone, UTCOffSet, WeekDay, ZodiacSign } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* * Creates a new immutable `Chronos` instance.
|
|
5
5
|
*
|
|
@@ -175,11 +175,21 @@ export declare class Chronos {
|
|
|
175
175
|
/** @instance Returns the time value in milliseconds since midnight, January 1, 1970 UTC. */
|
|
176
176
|
getTimeStamp(): number;
|
|
177
177
|
/**
|
|
178
|
-
* @instance Formats the date into a custom string format (local time).
|
|
178
|
+
* @instance Formats the current date into a custom string format (local time by default).
|
|
179
179
|
*
|
|
180
|
-
* @param format - The desired format (Default
|
|
181
|
-
*
|
|
182
|
-
*
|
|
180
|
+
* @param format - The desired format string (Default: `dd, mmm DD, YYYY HH:mm:ss` → e.g., `Sun, Apr 06, 2025 16:11:55`).
|
|
181
|
+
*
|
|
182
|
+
* - To output raw text (i.e., not interpreted as a date token), wrap it in square brackets.
|
|
183
|
+
* - For example, `[Today is] ddd` results in `Today is Sunday`, and `YYYY[ year]` results in `2025 year`.
|
|
184
|
+
*
|
|
185
|
+
* - Supported format tokens include: `YYYY`, `YY`, `MMMM`, `MMM`, `MM`, `M`, `DD`, `D`, `dd`, `ddd`, `Do`, `HH`, `H`, `hh`, `h`, `mm`, `m`, `ss`, `s`, `mss`, `a`, `A`, and `ZZ`.
|
|
186
|
+
* - *Any token not wrapped in brackets will be parsed and replaced with its corresponding date component.*
|
|
187
|
+
*
|
|
188
|
+
* @param useUTC - Optional boolean to format the date using UTC time.
|
|
189
|
+
* When `true`, it behaves like `formatUTC()` and outputs time based on UTC offset. Defaults to `false`.
|
|
190
|
+
*
|
|
191
|
+
* @returns Formatted date string using the specified format.
|
|
192
|
+
* Uses local time by default unless `useUTC` is set to `true`.
|
|
183
193
|
*/
|
|
184
194
|
format(format?: string, useUTC?: boolean): string;
|
|
185
195
|
/**
|
|
@@ -189,6 +199,7 @@ export declare class Chronos {
|
|
|
189
199
|
*
|
|
190
200
|
* @param format - The desired format string. Defaults to `'dd, mmm DD, YYYY HH:mm:ss'`
|
|
191
201
|
* (e.g., `'Sun, Apr 06, 2025 16:11:55'`).
|
|
202
|
+
*
|
|
192
203
|
* @param useUTC - If `true`, formats the date in UTC (equivalent to `formatUTC()`);
|
|
193
204
|
* defaults to `false` (local time).
|
|
194
205
|
* @returns A formatted date string in the specified format
|
|
@@ -198,6 +209,13 @@ export declare class Chronos {
|
|
|
198
209
|
* @instance Formats the date into a custom string format (UTC time).
|
|
199
210
|
*
|
|
200
211
|
* @param format - The desired format (Default format is `dd, mmm DD, YYYY HH:mm:ss:mss` = `Sun, Apr 06, 2025 16:11:55:379`).
|
|
212
|
+
*
|
|
213
|
+
* - To output raw text (i.e., not interpreted as a date token), wrap it in square brackets.
|
|
214
|
+
* - For example, `[Today is] ddd` results in `Today is Sunday`, and `YYYY[ year]` results in `2025 year`.
|
|
215
|
+
*
|
|
216
|
+
* - Supported format tokens include: `YYYY`, `YY`, `MMMM`, `MMM`, `MM`, `M`, `DD`, `D`, `dd`, `ddd`, `Do`, `HH`, `H`, `hh`, `h`, `mm`, `m`, `ss`, `s`, `mss`, `a`, `A`, and `ZZ`.
|
|
217
|
+
* - *Any token not wrapped in brackets will be parsed and replaced with its corresponding date component.*
|
|
218
|
+
*
|
|
201
219
|
* @returns Formatted date string in desired format (UTC time).
|
|
202
220
|
*/
|
|
203
221
|
formatUTC(format?: string): string;
|
|
@@ -603,6 +621,12 @@ export declare class Chronos {
|
|
|
603
621
|
* @returns The Western zodiac sign.
|
|
604
622
|
*/
|
|
605
623
|
getZodiacSign(): ZodiacSign;
|
|
624
|
+
/**
|
|
625
|
+
* @instance Returns the current season name based on optional season rules or presets.
|
|
626
|
+
* @param options Configuration with optional custom seasons or preset name.
|
|
627
|
+
* @returns The name of the season the current date falls under.
|
|
628
|
+
*/
|
|
629
|
+
season(options?: SeasonOptions): string;
|
|
606
630
|
/** @instance Returns number of days in current month */
|
|
607
631
|
daysInMonth(): NumberRange<28, 31>;
|
|
608
632
|
/** @instance Converts to object with all date unit parts */
|
|
@@ -639,7 +663,7 @@ export declare class Chronos {
|
|
|
639
663
|
* @param startMonth - The fiscal year start month (1-12), default is July (7).
|
|
640
664
|
* @returns The fiscal quarter (1-4).
|
|
641
665
|
*/
|
|
642
|
-
toFiscalQuarter(startMonth?:
|
|
666
|
+
toFiscalQuarter(startMonth?: NumberRange<1, 12>): Quarter;
|
|
643
667
|
/**
|
|
644
668
|
* @instance Returns the system's current UTC offset formatted as `+06:00` or `-07:00`.
|
|
645
669
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chronos.d.ts","sourceRoot":"","sources":["../../../src/date/Chronos.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Chronos.d.ts","sourceRoot":"","sources":["../../../src/date/Chronos.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAe1E,OAAO,KAAK,EAEX,YAAY,EACZ,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,aAAa,EACb,WAAW,EACX,SAAS,EACT,OAAO,EACP,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,OAAO,EAEP,UAAU,EACV,MAAM,SAAS,CAAC;AAGjB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,OAAO;;IAInB,mDAAmD;IACnD,MAAM,EAAE,IAAI,CAAC;IACb,yGAAyG;IACzG,MAAM,EAAE,cAAc,GAAG,MAAM,CAAC;IAEhC;;;;;;OAMG;;IAGH;;;;;;OAMG;gBACS,KAAK,EAAE,MAAM;IAEzB;;;;;;;;;OASG;gBACS,KAAK,EAAE,MAAM;IAEzB;;;;;;;;;OASG;gBACS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IAIpB;;;;;;;;;OASG;IACH,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,YAAY,GAAG,OAAO;IAgB5C;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS;IAYtD;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,cAAc,CACpB,GAAG,EAAE,OAAO,EACZ,OAAO,CAAC,EAAE,oBAAoB,GAC5B,MAAM,EAAE;IAEX;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,MAAM,EAAE;IAgDzE;;;OAGG;IACH,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,YAAY,EAAE,GAAG,OAAO;IAM7C;;;OAGG;IACH,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,YAAY,EAAE,GAAG,OAAO;IAM7C;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO;IAgB9C;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI;IAIjD;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM;IAIpD;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO;CAGvD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ClockHour, DayPart, UTCOffSet } from './types';
|
|
2
2
|
export declare const DAYS: readonly ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
3
3
|
export declare const MONTHS: readonly ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
4
4
|
export declare const YEAR_FORMATS: readonly ["YYYY", "YY", "yyyy", "yy"];
|
|
@@ -8,9 +8,10 @@ export declare const DAY_FORMATS: readonly ["d", "dd", "ddd"];
|
|
|
8
8
|
export declare const HOUR_FORMATS: readonly ["H", "HH", "hh", "h"];
|
|
9
9
|
export declare const MINUTE_FORMATS: readonly ["mm", "m"];
|
|
10
10
|
export declare const SECOND_FORMATS: readonly ["ss", "s"];
|
|
11
|
+
export declare const ZONE_FORMATS: readonly ["ZZ"];
|
|
11
12
|
export declare const MILLISECOND_FORMATS: readonly ["ms", "mss"];
|
|
12
13
|
export declare const TIME_FORMATS: readonly ["a", "A"];
|
|
13
|
-
export declare const sortedFormats: readonly ("a" | "m" | "h" | "d" | "M" | "D" | "s" | "A" | "YYYY" | "YY" | "yyyy" | "yy" | "MM" | "mmm" | "mmmm" | "DD" | "Do" | "dd" | "ddd" | "H" | "HH" | "hh" | "mm" | "ss" | "ms" | "mss")[];
|
|
14
|
+
export declare const sortedFormats: readonly ("a" | "m" | "h" | "d" | "M" | "D" | "s" | "A" | "YYYY" | "YY" | "yyyy" | "yy" | "MM" | "mmm" | "mmmm" | "DD" | "Do" | "dd" | "ddd" | "H" | "HH" | "hh" | "mm" | "ss" | "ZZ" | "ms" | "mss")[];
|
|
14
15
|
export declare const TIME_ZONES: Readonly<{
|
|
15
16
|
/** International Date Line West (Baker Island, Howland Island) */
|
|
16
17
|
readonly IDLW: number;
|
|
@@ -291,6 +292,7 @@ export declare const TIME_ZONES: Readonly<{
|
|
|
291
292
|
}>;
|
|
292
293
|
export declare const TIME_ZONE_LABELS: Record<UTCOffSet, string>;
|
|
293
294
|
/** Ranges for day parts. */
|
|
294
|
-
export declare const DEFAULT_RANGES: Record<DayPart, [
|
|
295
|
+
export declare const DEFAULT_RANGES: Record<DayPart, [ClockHour, ClockHour]>;
|
|
296
|
+
/** Western Zodiac Signs */
|
|
295
297
|
export declare const ZODIAC_SIGNS: readonly [readonly ["Capricorn", readonly [1, 19]], readonly ["Aquarius", readonly [2, 18]], readonly ["Pisces", readonly [3, 20]], readonly ["Aries", readonly [4, 19]], readonly ["Taurus", readonly [5, 20]], readonly ["Gemini", readonly [6, 20]], readonly ["Cancer", readonly [7, 22]], readonly ["Leo", readonly [8, 22]], readonly ["Virgo", readonly [9, 22]], readonly ["Libra", readonly [10, 22]], readonly ["Scorpio", readonly [11, 21]], readonly ["Sagittarius", readonly [12, 21]], readonly ["Capricorn", readonly [12, 31]]];
|
|
296
298
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/date/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/date/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE7D,eAAO,MAAM,IAAI,yFAQN,CAAC;AAEZ,eAAO,MAAM,MAAM,qIAaR,CAAC;AAEZ,eAAO,MAAM,YAAY,uCAKd,CAAC;AAEZ,eAAO,MAAM,aAAa,qCAKf,CAAC;AAEZ,eAAO,MAAM,YAAY,4BAId,CAAC;AAEZ,eAAO,MAAM,WAAW,6BAIb,CAAC;AAEZ,eAAO,MAAM,YAAY,iCAKd,CAAC;AAEZ,eAAO,MAAM,cAAc,sBAGhB,CAAC;AAEZ,eAAO,MAAM,cAAc,sBAGhB,CAAC;AAEZ,eAAO,MAAM,YAAY,iBAAiD,CAAC;AAE3E,eAAO,MAAM,mBAAmB,wBAGrB,CAAC;AAEZ,eAAO,MAAM,YAAY,qBAAqD,CAAC;AAE/E,eAAO,MAAM,aAAa,yMAazB,CAAC;AAEF,eAAO,MAAM,UAAU;IAEtB,kEAAkE;;IAElE,sCAAsC;;IAEtC,mDAAmD;;IAEnD,gBAAgB;;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,YAAY,khBAcd,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Numeric } from '../types/index';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ClockTime, UTCOffSet } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* * Checks if the provided value is a valid time string in "HH:MM" format.
|
|
5
5
|
*
|
|
6
6
|
* @param value - The value to check.
|
|
7
7
|
* @returns `true` if the value is a valid time string, `false` otherwise.
|
|
8
8
|
*/
|
|
9
|
-
export declare function isValidTime(value: unknown): value is
|
|
9
|
+
export declare function isValidTime(value: unknown): value is ClockTime;
|
|
10
10
|
/**
|
|
11
11
|
* * Checks if the provided value is a valid UTCOffSet (e.g. `UTC-01:30`).
|
|
12
12
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../../src/date/guards.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../../src/date/guards.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAW9D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAInE;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAKjD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CA+ClD"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** All the Season Presets for `new Chronos.season()` method */
|
|
2
|
+
export declare const SEASON_PRESETS: Readonly<{
|
|
3
|
+
readonly default: readonly {
|
|
4
|
+
name: string;
|
|
5
|
+
boundary: {
|
|
6
|
+
startMonth: number;
|
|
7
|
+
endMonth: number;
|
|
8
|
+
};
|
|
9
|
+
}[];
|
|
10
|
+
readonly bangladesh: readonly {
|
|
11
|
+
name: string;
|
|
12
|
+
boundary: {
|
|
13
|
+
startDate: string;
|
|
14
|
+
endDate: string;
|
|
15
|
+
};
|
|
16
|
+
}[];
|
|
17
|
+
readonly india: readonly {
|
|
18
|
+
name: string;
|
|
19
|
+
boundary: {
|
|
20
|
+
startMonth: number;
|
|
21
|
+
endMonth: number;
|
|
22
|
+
};
|
|
23
|
+
}[];
|
|
24
|
+
readonly tamil: readonly {
|
|
25
|
+
name: string;
|
|
26
|
+
boundary: {
|
|
27
|
+
startMonth: number;
|
|
28
|
+
endMonth: number;
|
|
29
|
+
};
|
|
30
|
+
}[];
|
|
31
|
+
readonly vedic: readonly {
|
|
32
|
+
name: string;
|
|
33
|
+
boundary: {
|
|
34
|
+
startDate: string;
|
|
35
|
+
endDate: string;
|
|
36
|
+
};
|
|
37
|
+
}[];
|
|
38
|
+
readonly philippines: readonly {
|
|
39
|
+
name: string;
|
|
40
|
+
boundary: {
|
|
41
|
+
startMonth: number;
|
|
42
|
+
endMonth: number;
|
|
43
|
+
};
|
|
44
|
+
}[];
|
|
45
|
+
readonly academic_us: readonly {
|
|
46
|
+
name: string;
|
|
47
|
+
boundary: {
|
|
48
|
+
startDate: string;
|
|
49
|
+
endDate: string;
|
|
50
|
+
};
|
|
51
|
+
}[];
|
|
52
|
+
readonly japan: readonly {
|
|
53
|
+
name: string;
|
|
54
|
+
boundary: {
|
|
55
|
+
startDate: string;
|
|
56
|
+
endDate: string;
|
|
57
|
+
};
|
|
58
|
+
}[];
|
|
59
|
+
readonly australia: readonly {
|
|
60
|
+
name: string;
|
|
61
|
+
boundary: {
|
|
62
|
+
startMonth: number;
|
|
63
|
+
endMonth: number;
|
|
64
|
+
};
|
|
65
|
+
}[];
|
|
66
|
+
readonly ethiopia: readonly {
|
|
67
|
+
name: string;
|
|
68
|
+
boundary: {
|
|
69
|
+
startMonth: number;
|
|
70
|
+
endMonth: number;
|
|
71
|
+
};
|
|
72
|
+
}[];
|
|
73
|
+
}>;
|
|
74
|
+
//# sourceMappingURL=seasons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seasons.d.ts","sourceRoot":"","sources":["../../../src/date/seasons.ts"],"names":[],"mappings":"AAsJA,+DAA+D;AAC/D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWhB,CAAC"}
|
package/dist/dts/date/types.d.ts
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import type { Enumerate } from '../number/types';
|
|
1
|
+
import type { Enumerate, NumberRange } from '../number/types';
|
|
2
2
|
import type { Chronos } from './Chronos';
|
|
3
3
|
import type { DATE_FORMATS, DAY_FORMATS, DAYS, HOUR_FORMATS, MILLISECOND_FORMATS, MINUTE_FORMATS, MONTH_FORMATS, MONTHS, SECOND_FORMATS, TIME_FORMATS, TIME_ZONES, YEAR_FORMATS, ZODIAC_SIGNS } from './constants';
|
|
4
|
+
import type { SEASON_PRESETS } from './seasons';
|
|
4
5
|
/** - Minute in numeric string from `00` to `23` */
|
|
5
|
-
export type
|
|
6
|
+
export type ClockHour = `0${Enumerate<10>}` | `${NumberRange<10, 23>}`;
|
|
6
7
|
/** - Minute in numeric string from `00` to `59` */
|
|
7
|
-
export type
|
|
8
|
+
export type ClockMinute = `0${Enumerate<10>}` | `${NumberRange<10, 59>}`;
|
|
8
9
|
/** - Second in numeric string from `00` to `59` */
|
|
9
|
-
export type
|
|
10
|
+
export type ClockSecond = `0${Enumerate<10>}` | `${NumberRange<10, 59>}`;
|
|
10
11
|
/** - Time in "HH:MM" format. */
|
|
11
|
-
export type
|
|
12
|
+
export type ClockTime = `${ClockHour}:${ClockMinute}`;
|
|
12
13
|
/** - Configuration options for greeting. */
|
|
13
14
|
export interface GreetingConfigs {
|
|
14
15
|
/** Time when the morning period ends (HH:MM format). Defaults to `11:59` */
|
|
15
|
-
morningEnds?:
|
|
16
|
+
morningEnds?: ClockTime;
|
|
16
17
|
/** Time when the noon period ends (HH:MM format). Defaults to `12:59` */
|
|
17
|
-
noonEnds?:
|
|
18
|
+
noonEnds?: ClockTime;
|
|
18
19
|
/** Time when the afternoon period ends (HH:MM format). Defaults to `17:59` */
|
|
19
|
-
afternoonEnds?:
|
|
20
|
+
afternoonEnds?: ClockTime;
|
|
20
21
|
/** Time when the evening period ends (HH:MM format). Defaults to `23:59` */
|
|
21
|
-
eveningEnds?:
|
|
22
|
+
eveningEnds?: ClockTime;
|
|
22
23
|
/** Time when the midnight period ends (HH:MM format). Defaults to `02:59` */
|
|
23
|
-
midnightEnds?:
|
|
24
|
+
midnightEnds?: ClockTime;
|
|
24
25
|
/** Current time in "HH:MM" format for some weird reason. Defaults to current time `new Date()` */
|
|
25
|
-
currentTime?:
|
|
26
|
+
currentTime?: ClockTime;
|
|
26
27
|
/** Optional string to append after each message */
|
|
27
28
|
appendToMsg?: string;
|
|
28
29
|
/** Optional string to prepend before each message */
|
|
@@ -60,7 +61,7 @@ export type Millisecond = (typeof MILLISECOND_FORMATS)[number];
|
|
|
60
61
|
/** Time formats in either capital or lowercase `am/pm` format */
|
|
61
62
|
export type TimeFormats = (typeof TIME_FORMATS)[number];
|
|
62
63
|
/** Standard union formats for `Chronos`. */
|
|
63
|
-
export type ChronosFormat = Year | Month | Day | MonthDate | Hour | Minute | Second | Millisecond | TimeFormats;
|
|
64
|
+
export type ChronosFormat = Year | Month | Day | MonthDate | Hour | Minute | Second | Millisecond | TimeFormats | 'ZZ';
|
|
64
65
|
/** Standard date formats. */
|
|
65
66
|
export type DateParts = `${MonthDate} ${Exclude<Month, 'M' | 'MM'>}` | `${Exclude<Month, 'M' | 'MM'>} ${MonthDate}` | `${Day}, ${MonthDate} ${Exclude<Month, 'M' | 'MM'>}` | `${Day}, ${Exclude<Month, 'M' | 'MM'>} ${MonthDate}` | `${Exclude<Month, 'M' | 'MM'>} ${MonthDate}, ${Year}` | `${MonthDate} ${Exclude<Month, 'M' | 'MM'>}, ${Year}` | `${Exclude<Month, 'M' | 'MM'>} ${MonthDate} ${Year}` | `${MonthDate} ${Exclude<Month, 'M' | 'MM'>} ${Year}` | `${Day}, ${Exclude<Month, 'M' | 'MM'>} ${MonthDate}, ${Year}` | `${Day}, ${MonthDate} ${Exclude<Month, 'M' | 'MM'>}, ${Year}` | `${Day}, ${Exclude<Month, 'M' | 'MM'>} ${MonthDate} ${Year}` | `${Day}, ${MonthDate} ${Exclude<Month, 'M' | 'MM'>} ${Year}` | `${Exclude<MonthDate, 'Do'>}.${Exclude<Month, 'mmm' | 'mmmm'>}.${Year}` | `${Year}.${Exclude<Month, 'mmm' | 'mmmm'>}.${Exclude<MonthDate, 'Do'>}` | `${Exclude<MonthDate, 'Do'>}/${Exclude<Month, 'mmm' | 'mmmm'>}/${Year}` | `${Exclude<MonthDate, 'Do'>}-${Exclude<Month, 'mmm' | 'mmmm'>}-${Year}` | `${Exclude<Month, 'mmm' | 'mmmm'>}/${Exclude<MonthDate, 'Do'>}/${Year}` | `${Exclude<Month, 'mmm' | 'mmmm'>}-${Exclude<MonthDate, 'Do'>}-${Year}` | `${Year}-${Exclude<Month, 'mmm' | 'mmmm'>}-${Exclude<MonthDate, 'Do'>}` | `${Year}/${Exclude<Month, 'mmm' | 'mmmm'>}/${Exclude<MonthDate, 'Do'>}` | `${Year}-${Exclude<MonthDate, 'Do'>}-${Exclude<Month, 'mmm' | 'mmmm'>}` | `${Year}/${Exclude<MonthDate, 'Do'>}/${Exclude<Month, 'mmm' | 'mmmm'>}`;
|
|
66
67
|
/** Standard Time Formats */
|
|
@@ -377,9 +378,9 @@ export interface ChronosStatics {
|
|
|
377
378
|
/** Names of time-zones */
|
|
378
379
|
export type TimeZone = keyof typeof TIME_ZONES;
|
|
379
380
|
/** Positive UTC hours */
|
|
380
|
-
export type PositiveUTCHour =
|
|
381
|
+
export type PositiveUTCHour = `+0${Enumerate<10>}` | `+${NumberRange<10, 14>}`;
|
|
381
382
|
/** Negative UTC hours */
|
|
382
|
-
export type NegativeUTCHour =
|
|
383
|
+
export type NegativeUTCHour = `-0${Enumerate<10>}` | `-${NumberRange<10, 14>}`;
|
|
383
384
|
/** UTC Minutes as quarters */
|
|
384
385
|
export type UTCMinute = '00' | '15' | '30' | '45';
|
|
385
386
|
/** UTC offset as `UTC-HH:MM` format */
|
|
@@ -394,7 +395,7 @@ export interface FormatOptions {
|
|
|
394
395
|
/** Definition of day part names. */
|
|
395
396
|
export type DayPart = 'night' | 'midnight' | 'lateNight' | 'morning' | 'afternoon' | 'evening';
|
|
396
397
|
/** Object type for extracting day parts. */
|
|
397
|
-
export type DayPartConfig = Record<DayPart, [
|
|
398
|
+
export type DayPartConfig = Record<DayPart, [ClockHour, ClockHour]>;
|
|
398
399
|
/** Quarters of the year */
|
|
399
400
|
export type Quarter = 1 | 2 | 3 | 4;
|
|
400
401
|
/** Names of Zodiac signs */
|
|
@@ -425,5 +426,39 @@ export interface RelativeRangeOptions {
|
|
|
425
426
|
export type WeekdayOptions = RelativeRangeOptions | DateRangeOptions;
|
|
426
427
|
/** Millisecond from `0-999` */
|
|
427
428
|
export type MilliSecond = Enumerate<999> | 999;
|
|
429
|
+
/** Date of the month as `0` padded numeric string e.g. `01`, `18` */
|
|
430
|
+
export type DateString = `0${NumberRange<1, 9>}` | `${NumberRange<10, 31>}`;
|
|
431
|
+
/** Month as `0` padded numeric string, e.g. `02`, `01` etc. */
|
|
432
|
+
export type MonthString = `0${NumberRange<1, 9>}` | `${NumberRange<10, 12>}`;
|
|
433
|
+
/** Date and month in `MM-DD` format, e.g. `01-12` means 'January 18' */
|
|
434
|
+
export type MonthDateString = `${MonthString}-${DateString}`;
|
|
435
|
+
/** ISO date-based range (format: `MM-DD`) e.g. `01-14` for 'January 14' */
|
|
436
|
+
export type DateBoundary = {
|
|
437
|
+
/** Start date in `MM-DD` format, e.g. `01-18` means 'January 18' */
|
|
438
|
+
startDate: MonthDateString;
|
|
439
|
+
/** End date in `MM-DD` format, e.g. `03-17` means 'March 17' */
|
|
440
|
+
endDate: MonthDateString;
|
|
441
|
+
};
|
|
442
|
+
/** Inclusive month index-based range `0-11` (0 = January) */
|
|
443
|
+
export type MonthBoundary = {
|
|
444
|
+
startMonth: Enumerate<12>;
|
|
445
|
+
endMonth: Enumerate<12>;
|
|
446
|
+
};
|
|
447
|
+
/** Season definition for season configuration */
|
|
448
|
+
export interface SeasonDefinition {
|
|
449
|
+
/** Name of the season */
|
|
450
|
+
name: string;
|
|
451
|
+
/** Inclusive date/month boundary of the season */
|
|
452
|
+
boundary: MonthBoundary | DateBoundary;
|
|
453
|
+
}
|
|
454
|
+
/** Name of a predefined season preset */
|
|
455
|
+
export type SeasonPreset = keyof typeof SEASON_PRESETS;
|
|
456
|
+
/** Options for configuring seasons */
|
|
457
|
+
export interface SeasonOptions {
|
|
458
|
+
/** Custom season list to override or define seasons manually */
|
|
459
|
+
seasons?: SeasonDefinition[];
|
|
460
|
+
/** Predefined preset to use for season calculation */
|
|
461
|
+
preset?: SeasonPreset;
|
|
462
|
+
}
|
|
428
463
|
export {};
|
|
429
464
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/date/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EACX,YAAY,EACZ,WAAW,EACX,IAAI,EACJ,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd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BAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,QAAQ,EAAE,aAAa,GAAG,YAAY,CAAC;CACvC;AAED,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,cAAc,CAAC;AAEvD,sCAAsC;AACtC,MAAM,WAAW,aAAa;IAC7B,gEAAgE;IAChE,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B,sDAAsD;IACtD,MAAM,CAAC,EAAE,YAAY,CAAC;CACtB"}
|
package/dist/dts/date/utils.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { Numeric } from '../types/index';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ClockTime, UTCOffSet } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* * Extracts the hour and minute from a time string in `HH:MM` or `-HH:MM` format.
|
|
5
5
|
*
|
|
6
6
|
* @param time - The time string to extract from.
|
|
7
7
|
* @return The extracted hour and minute as number tuple.
|
|
8
8
|
*/
|
|
9
|
-
export declare function extractHourMinute(time: `-${
|
|
9
|
+
export declare function extractHourMinute(time: `-${ClockTime}` | ClockTime): [number, number];
|
|
10
10
|
/**
|
|
11
11
|
* * Converts a time string `HH:MM` or `-HH:MM` into total minutes from `00:00`.
|
|
12
12
|
*
|
|
13
13
|
* @param time - The time in `HH:MM` or `-HH:MM` format.
|
|
14
14
|
* @returns The total minutes elapsed since `00:00`.
|
|
15
15
|
*/
|
|
16
|
-
export declare function getTotalMinutes(time: `-${
|
|
16
|
+
export declare function getTotalMinutes(time: `-${ClockTime}` | ClockTime): number;
|
|
17
17
|
/**
|
|
18
18
|
* * Returns the current date and time as `Date` object.
|
|
19
19
|
* - All the methods and properties of `new Date()` are accessible.
|
|
@@ -27,7 +27,7 @@ export declare function getCurrentDateTime(): Date;
|
|
|
27
27
|
* @param utc UTC value in `UTC-01:30` or `UTC+01:30` format.
|
|
28
28
|
* @returns The UTC value in `HH:MM` format.
|
|
29
29
|
*/
|
|
30
|
-
export declare function extractTimeFromUTC(utc: UTCOffSet): `-${
|
|
30
|
+
export declare function extractTimeFromUTC(utc: UTCOffSet): `-${ClockTime}` | ClockTime;
|
|
31
31
|
/**
|
|
32
32
|
* * Converts a UTC value in `UTC-01:30` or `UTC+01:30` format into total minutes in number.
|
|
33
33
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/date/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/date/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAChC,IAAI,EAAE,IAAI,SAAS,EAAE,GAAG,SAAS,GAC/B,CAAC,MAAM,EAAE,MAAM,CAAC,CAIlB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,SAAS,EAAE,GAAG,SAAS,GAAG,MAAM,CAUzE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CACjC,GAAG,EAAE,SAAS,GACZ,IAAI,SAAS,EAAE,GAAG,SAAS,CAE7B;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAS3D"}
|
package/dist/esm/date/Chronos.js
CHANGED
|
@@ -4,6 +4,7 @@ import { formatUnitWithPlural } from '../string/convert.js';
|
|
|
4
4
|
import { isPalindrome } from '../string/guards.js';
|
|
5
5
|
import { DAYS, DEFAULT_RANGES, MONTHS, sortedFormats, TIME_ZONE_LABELS, TIME_ZONES, ZODIAC_SIGNS, } from './constants.js';
|
|
6
6
|
import { isLeapYear, isValidUTCOffSet } from './guards.js';
|
|
7
|
+
import { SEASON_PRESETS } from './seasons.js';
|
|
7
8
|
import { extractMinutesFromUTC, formatUTCOffset } from './utils.js';
|
|
8
9
|
/**
|
|
9
10
|
* * Creates a new immutable `Chronos` instance.
|
|
@@ -179,6 +180,7 @@ export class Chronos {
|
|
|
179
180
|
const milliseconds = useUTC ?
|
|
180
181
|
this.#date.getUTCMilliseconds()
|
|
181
182
|
: this.#date.getMilliseconds();
|
|
183
|
+
const timeZone = useUTC ? 'Z' : this.getTimeZoneOffset();
|
|
182
184
|
const dateComponents = {
|
|
183
185
|
YYYY: String(year),
|
|
184
186
|
YY: String(year).slice(-2),
|
|
@@ -206,27 +208,28 @@ export class Chronos {
|
|
|
206
208
|
mss: String(milliseconds).padStart(3, '0'),
|
|
207
209
|
a: hours < 12 ? 'am' : 'pm',
|
|
208
210
|
A: hours < 12 ? 'AM' : 'PM',
|
|
211
|
+
ZZ: timeZone,
|
|
209
212
|
};
|
|
213
|
+
const tokenRegex = new RegExp(`^(${sortedFormats.join('|')})`);
|
|
210
214
|
let result = '';
|
|
211
215
|
let i = 0;
|
|
212
|
-
while (i < format
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
const nextOk = i + token?.length >= format?.length ||
|
|
221
|
-
/[^a-zA-Z0-9]/.test(next);
|
|
222
|
-
if (ahead === token && prevOk && nextOk) {
|
|
223
|
-
result += dateComponents[token];
|
|
224
|
-
i += token?.length;
|
|
225
|
-
matched = true;
|
|
226
|
-
break;
|
|
216
|
+
while (i < format.length) {
|
|
217
|
+
// Handle [escaped literal]
|
|
218
|
+
if (format[i] === '[') {
|
|
219
|
+
const end = format.indexOf(']', i);
|
|
220
|
+
if (end !== -1) {
|
|
221
|
+
result += format.slice(i + 1, end);
|
|
222
|
+
i = end + 1;
|
|
223
|
+
continue;
|
|
227
224
|
}
|
|
228
225
|
}
|
|
229
|
-
|
|
226
|
+
// Try to match a format token
|
|
227
|
+
const match = tokenRegex.exec(format.slice(i));
|
|
228
|
+
if (match) {
|
|
229
|
+
result += dateComponents[match[0]];
|
|
230
|
+
i += match[0].length;
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
230
233
|
result += format[i];
|
|
231
234
|
i++;
|
|
232
235
|
}
|
|
@@ -405,11 +408,21 @@ export class Chronos {
|
|
|
405
408
|
return this.#date.getTime();
|
|
406
409
|
}
|
|
407
410
|
/**
|
|
408
|
-
* @instance Formats the date into a custom string format (local time).
|
|
411
|
+
* @instance Formats the current date into a custom string format (local time by default).
|
|
412
|
+
*
|
|
413
|
+
* @param format - The desired format string (Default: `dd, mmm DD, YYYY HH:mm:ss` → e.g., `Sun, Apr 06, 2025 16:11:55`).
|
|
414
|
+
*
|
|
415
|
+
* - To output raw text (i.e., not interpreted as a date token), wrap it in square brackets.
|
|
416
|
+
* - For example, `[Today is] ddd` results in `Today is Sunday`, and `YYYY[ year]` results in `2025 year`.
|
|
417
|
+
*
|
|
418
|
+
* - Supported format tokens include: `YYYY`, `YY`, `MMMM`, `MMM`, `MM`, `M`, `DD`, `D`, `dd`, `ddd`, `Do`, `HH`, `H`, `hh`, `h`, `mm`, `m`, `ss`, `s`, `mss`, `a`, `A`, and `ZZ`.
|
|
419
|
+
* - *Any token not wrapped in brackets will be parsed and replaced with its corresponding date component.*
|
|
409
420
|
*
|
|
410
|
-
* @param
|
|
411
|
-
*
|
|
412
|
-
*
|
|
421
|
+
* @param useUTC - Optional boolean to format the date using UTC time.
|
|
422
|
+
* When `true`, it behaves like `formatUTC()` and outputs time based on UTC offset. Defaults to `false`.
|
|
423
|
+
*
|
|
424
|
+
* @returns Formatted date string using the specified format.
|
|
425
|
+
* Uses local time by default unless `useUTC` is set to `true`.
|
|
413
426
|
*/
|
|
414
427
|
format(format, useUTC = false) {
|
|
415
428
|
return this.#format(format ?? 'dd, mmm DD, YYYY HH:mm:ss', useUTC);
|
|
@@ -421,6 +434,7 @@ export class Chronos {
|
|
|
421
434
|
*
|
|
422
435
|
* @param format - The desired format string. Defaults to `'dd, mmm DD, YYYY HH:mm:ss'`
|
|
423
436
|
* (e.g., `'Sun, Apr 06, 2025 16:11:55'`).
|
|
437
|
+
*
|
|
424
438
|
* @param useUTC - If `true`, formats the date in UTC (equivalent to `formatUTC()`);
|
|
425
439
|
* defaults to `false` (local time).
|
|
426
440
|
* @returns A formatted date string in the specified format
|
|
@@ -432,6 +446,13 @@ export class Chronos {
|
|
|
432
446
|
* @instance Formats the date into a custom string format (UTC time).
|
|
433
447
|
*
|
|
434
448
|
* @param format - The desired format (Default format is `dd, mmm DD, YYYY HH:mm:ss:mss` = `Sun, Apr 06, 2025 16:11:55:379`).
|
|
449
|
+
*
|
|
450
|
+
* - To output raw text (i.e., not interpreted as a date token), wrap it in square brackets.
|
|
451
|
+
* - For example, `[Today is] ddd` results in `Today is Sunday`, and `YYYY[ year]` results in `2025 year`.
|
|
452
|
+
*
|
|
453
|
+
* - Supported format tokens include: `YYYY`, `YY`, `MMMM`, `MMM`, `MM`, `M`, `DD`, `D`, `dd`, `ddd`, `Do`, `HH`, `H`, `hh`, `h`, `mm`, `m`, `ss`, `s`, `mss`, `a`, `A`, and `ZZ`.
|
|
454
|
+
* - *Any token not wrapped in brackets will be parsed and replaced with its corresponding date component.*
|
|
455
|
+
*
|
|
435
456
|
* @returns Formatted date string in desired format (UTC time).
|
|
436
457
|
*/
|
|
437
458
|
formatUTC(format = 'dd, mmm DD, YYYY HH:mm:ss:mss') {
|
|
@@ -1379,6 +1400,45 @@ export class Chronos {
|
|
|
1379
1400
|
}
|
|
1380
1401
|
return 'Capricorn';
|
|
1381
1402
|
}
|
|
1403
|
+
/**
|
|
1404
|
+
* @instance Returns the current season name based on optional season rules or presets.
|
|
1405
|
+
* @param options Configuration with optional custom seasons or preset name.
|
|
1406
|
+
* @returns The name of the season the current date falls under.
|
|
1407
|
+
*/
|
|
1408
|
+
season(options) {
|
|
1409
|
+
const { preset = 'default' } = options ?? {};
|
|
1410
|
+
const seasonSet = options?.seasons ?? SEASON_PRESETS[preset];
|
|
1411
|
+
const dateStr = this.#format('MM-DD');
|
|
1412
|
+
for (const { name, boundary } of seasonSet) {
|
|
1413
|
+
if ('startDate' in boundary && 'endDate' in boundary) {
|
|
1414
|
+
const start = boundary.startDate;
|
|
1415
|
+
const end = boundary.endDate;
|
|
1416
|
+
if (start <= end) {
|
|
1417
|
+
if (dateStr >= start && dateStr <= end)
|
|
1418
|
+
return name;
|
|
1419
|
+
}
|
|
1420
|
+
else {
|
|
1421
|
+
// Handles wrap-around seasons like Dec–Feb
|
|
1422
|
+
if (dateStr >= start || dateStr <= end)
|
|
1423
|
+
return name;
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
else if ('startMonth' in boundary && 'endMonth' in boundary) {
|
|
1427
|
+
const { startMonth, endMonth } = boundary;
|
|
1428
|
+
if (startMonth <= endMonth) {
|
|
1429
|
+
if (this.month >= startMonth && this.month <= endMonth) {
|
|
1430
|
+
return name;
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
else {
|
|
1434
|
+
if (this.month >= startMonth || this.month <= endMonth) {
|
|
1435
|
+
return name;
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
return 'Unknown';
|
|
1441
|
+
}
|
|
1382
1442
|
/** @instance Returns number of days in current month */
|
|
1383
1443
|
daysInMonth() {
|
|
1384
1444
|
return new Date(this.year, this.month + 1, 0).getDate();
|
|
@@ -57,6 +57,7 @@ export const SECOND_FORMATS = /* @__PURE__ */ Object.freeze([
|
|
|
57
57
|
'ss',
|
|
58
58
|
's',
|
|
59
59
|
]);
|
|
60
|
+
export const ZONE_FORMATS = /* @__PURE__ */ Object.freeze(['ZZ']);
|
|
60
61
|
export const MILLISECOND_FORMATS = /* @__PURE__ */ Object.freeze([
|
|
61
62
|
'ms',
|
|
62
63
|
'mss',
|
|
@@ -72,6 +73,7 @@ export const sortedFormats = /* @__PURE__ */ Object.freeze([
|
|
|
72
73
|
...SECOND_FORMATS,
|
|
73
74
|
...MILLISECOND_FORMATS,
|
|
74
75
|
...TIME_FORMATS,
|
|
76
|
+
...ZONE_FORMATS,
|
|
75
77
|
].sort((a, b) => b.length - a.length));
|
|
76
78
|
export const TIME_ZONES = /* @__PURE__ */ Object.freeze({
|
|
77
79
|
// UTC -12:00 to -01:00 (Mostly Pacific Islands, Americas)
|
|
@@ -425,6 +427,7 @@ export const DEFAULT_RANGES =
|
|
|
425
427
|
afternoon: ['12', '16'],
|
|
426
428
|
evening: ['17', '20'],
|
|
427
429
|
});
|
|
430
|
+
/** Western Zodiac Signs */
|
|
428
431
|
export const ZODIAC_SIGNS = /* @__PURE__ */ Object.freeze([
|
|
429
432
|
['Capricorn', [1, 19]],
|
|
430
433
|
['Aquarius', [2, 18]],
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/** Default Western Seasons */
|
|
2
|
+
const DEFAULT_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
3
|
+
{ name: 'Spring', boundary: { startMonth: 2, endMonth: 4 } },
|
|
4
|
+
{ name: 'Summer', boundary: { startMonth: 5, endMonth: 7 } },
|
|
5
|
+
{ name: 'Autumn', boundary: { startMonth: 8, endMonth: 10 } },
|
|
6
|
+
{ name: 'Winter', boundary: { startMonth: 11, endMonth: 1 } },
|
|
7
|
+
]);
|
|
8
|
+
/**Default Bangladeshi Seasons */
|
|
9
|
+
const BANGLADESH_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
10
|
+
{
|
|
11
|
+
name: 'Grishsho (Summer)',
|
|
12
|
+
boundary: { startDate: '04-15', endDate: '06-14' },
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'Bôrsha (Monsoon)',
|
|
16
|
+
boundary: { startDate: '06-15', endDate: '08-14' },
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'Shôrot (Autumn)',
|
|
20
|
+
boundary: { startDate: '08-15', endDate: '10-14' },
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'Hemonto (Late Autumn)',
|
|
24
|
+
boundary: { startDate: '10-15', endDate: '12-14' },
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Sheet (Winter)',
|
|
28
|
+
boundary: { startDate: '12-15', endDate: '02-14' },
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'Bôshonto (Spring)',
|
|
32
|
+
boundary: { startDate: '02-15', endDate: '04-14' },
|
|
33
|
+
},
|
|
34
|
+
]);
|
|
35
|
+
/** Indian Seasons */
|
|
36
|
+
const INDIA_IMD_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
37
|
+
{ name: 'Winter', boundary: { startMonth: 0, endMonth: 1 } },
|
|
38
|
+
{ name: 'Pre-Monsoon', boundary: { startMonth: 2, endMonth: 4 } },
|
|
39
|
+
{ name: 'Monsoon', boundary: { startMonth: 5, endMonth: 8 } },
|
|
40
|
+
{ name: 'Post-Monsoon', boundary: { startMonth: 9, endMonth: 10 } },
|
|
41
|
+
{ name: 'Cool Season', boundary: { startMonth: 11, endMonth: 11 } },
|
|
42
|
+
]);
|
|
43
|
+
/** Indian Vedic Seasons */
|
|
44
|
+
const INDIA_VEDIC_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
45
|
+
{
|
|
46
|
+
name: 'Shishir (Winter)',
|
|
47
|
+
boundary: { startDate: '12-15', endDate: '02-14' },
|
|
48
|
+
}, // Mid-Dec to Mid-Feb
|
|
49
|
+
{
|
|
50
|
+
name: 'Vasanta (Spring)',
|
|
51
|
+
boundary: { startDate: '02-15', endDate: '04-14' },
|
|
52
|
+
}, // Mid-Feb to Mid-Apr
|
|
53
|
+
{
|
|
54
|
+
name: 'Grishma (Summer)',
|
|
55
|
+
boundary: { startDate: '04-15', endDate: '06-14' },
|
|
56
|
+
}, // Mid-Apr to Mid-Jun
|
|
57
|
+
{
|
|
58
|
+
name: 'Varsha (Monsoon)',
|
|
59
|
+
boundary: { startDate: '06-15', endDate: '08-14' },
|
|
60
|
+
}, // Mid-Jun to Mid-Aug
|
|
61
|
+
{
|
|
62
|
+
name: 'Sharad (Autumn)',
|
|
63
|
+
boundary: { startDate: '08-15', endDate: '10-14' },
|
|
64
|
+
}, // Mid-Aug to Mid-Oct
|
|
65
|
+
{
|
|
66
|
+
name: 'Hemant (Late Autumn',
|
|
67
|
+
boundary: { startDate: '10-15', endDate: '12-14' },
|
|
68
|
+
}, // Mid-Oct to Mid-Dec
|
|
69
|
+
]);
|
|
70
|
+
/** Indian Tamil Seasons */
|
|
71
|
+
const INDIA_TAMIL_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
72
|
+
{ name: 'Ilavenil (Mid-Summer)', boundary: { startMonth: 4, endMonth: 5 } }, // May – June
|
|
73
|
+
{
|
|
74
|
+
name: 'Mutuvenil (Peak-Summer)',
|
|
75
|
+
boundary: { startMonth: 6, endMonth: 7 },
|
|
76
|
+
}, // July – August
|
|
77
|
+
{ name: 'Kaar (Monsoon)', boundary: { startMonth: 7, endMonth: 9 } }, // Aug – Oct
|
|
78
|
+
{ name: 'Koothir (Autumn)', boundary: { startMonth: 9, endMonth: 10 } }, // Oct – Nov
|
|
79
|
+
{
|
|
80
|
+
name: 'Munpani (Early-Winter)',
|
|
81
|
+
boundary: { startMonth: 10, endMonth: 0 },
|
|
82
|
+
}, // Nov – Jan
|
|
83
|
+
{ name: 'Pinpani (Late-Winter)', boundary: { startMonth: 0, endMonth: 2 } }, // Jan – Mar
|
|
84
|
+
]);
|
|
85
|
+
/** Philippines Seasons */
|
|
86
|
+
const PHILIPPINES_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
87
|
+
{ name: 'Dry Season', boundary: { startMonth: 11, endMonth: 4 } }, // Dec–May
|
|
88
|
+
{ name: 'Wet Season', boundary: { startMonth: 5, endMonth: 10 } }, // Jun–Nov
|
|
89
|
+
]);
|
|
90
|
+
/** US Academic Seasons */
|
|
91
|
+
const US_ACADEMIC_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
92
|
+
{
|
|
93
|
+
name: 'Spring',
|
|
94
|
+
boundary: { startDate: '01-10', endDate: '05-15' },
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'Summer',
|
|
98
|
+
boundary: { startDate: '05-16', endDate: '08-15' },
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'Fall',
|
|
102
|
+
boundary: { startDate: '08-16', endDate: '12-20' },
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'Winter',
|
|
106
|
+
boundary: { startDate: '12-21', endDate: '01-09' },
|
|
107
|
+
},
|
|
108
|
+
]);
|
|
109
|
+
/** Japanese Seasons */
|
|
110
|
+
const JAPAN_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
111
|
+
{
|
|
112
|
+
name: 'Haru (Spring)',
|
|
113
|
+
boundary: { startDate: '03-01', endDate: '05-31' },
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'Natsu (Summer)',
|
|
117
|
+
boundary: { startDate: '06-01', endDate: '08-31' },
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'Aki (Autumn)',
|
|
121
|
+
boundary: { startDate: '09-01', endDate: '11-30' },
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'Fuyu (Winter)',
|
|
125
|
+
boundary: { startDate: '12-01', endDate: '02-28' },
|
|
126
|
+
},
|
|
127
|
+
]);
|
|
128
|
+
/** Australian Seasons */
|
|
129
|
+
const AUSTRALIA_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
130
|
+
{ name: 'Summer', boundary: { startMonth: 11, endMonth: 1 } },
|
|
131
|
+
{ name: 'Autumn', boundary: { startMonth: 2, endMonth: 4 } },
|
|
132
|
+
{ name: 'Winter', boundary: { startMonth: 5, endMonth: 7 } },
|
|
133
|
+
{ name: 'Spring', boundary: { startMonth: 8, endMonth: 10 } },
|
|
134
|
+
]);
|
|
135
|
+
/** Ethiopian Seasons */
|
|
136
|
+
const ETHIOPIA_SEASONS = /* @__PURE__ */ Object.freeze([
|
|
137
|
+
{ name: 'Bega (Dry)', boundary: { startMonth: 10, endMonth: 1 } },
|
|
138
|
+
{ name: 'Belg (Short Rain)', boundary: { startMonth: 2, endMonth: 4 } },
|
|
139
|
+
{ name: 'Kiremt (Main Rain)', boundary: { startMonth: 5, endMonth: 9 } },
|
|
140
|
+
]);
|
|
141
|
+
/** All the Season Presets for `new Chronos.season()` method */
|
|
142
|
+
export const SEASON_PRESETS = /* @__PURE__ */ Object.freeze({
|
|
143
|
+
default: DEFAULT_SEASONS,
|
|
144
|
+
bangladesh: BANGLADESH_SEASONS,
|
|
145
|
+
india: INDIA_IMD_SEASONS,
|
|
146
|
+
tamil: INDIA_TAMIL_SEASONS,
|
|
147
|
+
vedic: INDIA_VEDIC_SEASONS,
|
|
148
|
+
philippines: PHILIPPINES_SEASONS,
|
|
149
|
+
academic_us: US_ACADEMIC_SEASONS,
|
|
150
|
+
japan: JAPAN_SEASONS,
|
|
151
|
+
australia: AUSTRALIA_SEASONS,
|
|
152
|
+
ethiopia: ETHIOPIA_SEASONS,
|
|
153
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nhb-toolbox",
|
|
3
|
-
"version": "4.12.
|
|
3
|
+
"version": "4.12.12",
|
|
4
4
|
"description": "A versatile collection of smart, efficient, and reusable utility functions and classes for everyday development needs.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|