nhb-toolbox 3.9.39 → 3.9.60
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/colors/Color.d.ts +38 -24
- package/dist/colors/Color.d.ts.map +1 -1
- package/dist/colors/Color.js +19 -17
- package/dist/date/Chronos.d.ts +233 -116
- package/dist/date/Chronos.d.ts.map +1 -1
- package/dist/date/Chronos.js +225 -154
- package/dist/date/chronos-fn.d.ts +24 -32
- package/dist/date/chronos-fn.d.ts.map +1 -1
- package/dist/date/chronos-fn.js +61 -6
- package/dist/date/constants.d.ts +3 -1
- package/dist/date/constants.d.ts.map +1 -1
- package/dist/date/constants.js +9 -0
- package/dist/date/types.d.ts +101 -12
- package/dist/date/types.d.ts.map +1 -1
- package/dist/date/utils.js +1 -1
- package/package.json +1 -1
|
@@ -1,44 +1,36 @@
|
|
|
1
1
|
import type { ChronosStatics } from './types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* The following types of input are supported:
|
|
8
|
-
*
|
|
9
|
-
* - **`string`**: A string representing a date, which can be parsed by the JavaScript `Date` constructor.
|
|
10
|
-
* Example: `"2023-12-31"`.
|
|
11
|
-
* - **`number`**: A timestamp representing the number of milliseconds since the Unix epoch.
|
|
12
|
-
* Example: `1672531199000`.
|
|
13
|
-
* - **`Date`**: A JavaScript `Date` object.
|
|
14
|
-
* - **`Chronos`**: A `Chronos` instance created by the same constructor.
|
|
15
|
-
*
|
|
16
|
-
* This function also allows you to access static methods from the `Chronos` class, as it copies all static methods from `Chronos` to the `chronos` function itself.
|
|
17
|
-
* Therefore, static methods can be called either through the `Chronos` class directly or through the `chronos` function.
|
|
3
|
+
* @static
|
|
4
|
+
* @remarks
|
|
5
|
+
* Static methods from the `Chronos` class are copied over to the `chronos` function.
|
|
6
|
+
* Therefore, you can access static methods from `Chronos` both through the `Chronos` class and the `chronos` function.
|
|
18
7
|
*
|
|
19
|
-
* @example
|
|
20
8
|
* Example usage:
|
|
21
|
-
*
|
|
22
9
|
* ```ts
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* const sameInstanceClass = Chronos.parse("2023-12-31", "YYYY-MM-DD");
|
|
10
|
+
* chronos.parse("2023-12-31", "YYYY-MM-DD");
|
|
11
|
+
* // Or
|
|
12
|
+
* Chronos.parse("2023-12-31", "YYYY-MM-DD");
|
|
27
13
|
* ```
|
|
28
14
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
15
|
+
* *No need to call `chronos` for accessing the static methods. Simply call them.*
|
|
16
|
+
*
|
|
17
|
+
* **Available Static Methods:**
|
|
31
18
|
*
|
|
32
|
-
* @static
|
|
33
|
-
* @remarks
|
|
34
|
-
* Static methods can be accessed from both the `Chronos` class and the `chronos` function.
|
|
35
|
-
* Static methods from the `Chronos` class are copied over to the `chronos` function, so you can call them like:
|
|
36
19
|
* ```ts
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
20
|
+
* today(options?: FormatOptions): string
|
|
21
|
+
* yesterday(): Chronos;
|
|
22
|
+
* tomorrow(): Chronos
|
|
23
|
+
* now(): number
|
|
24
|
+
* parse(dateStr: string, format: string): Chronos
|
|
25
|
+
* utc(dateLike: ChronosInput): Chronos
|
|
26
|
+
* min(...dates: ChronosInput[]): Chronos
|
|
27
|
+
* max(...dates: ChronosInput[]): Chronos
|
|
28
|
+
* isLeapYear(date: ChronosInput): boolean
|
|
29
|
+
* isValidDate(value: unknown): boolean
|
|
30
|
+
* isDateString(value: unknown): boolean
|
|
31
|
+
* isValidChronos(value: unknown): boolean
|
|
40
32
|
* ```
|
|
41
33
|
*/
|
|
42
|
-
declare const
|
|
43
|
-
export { chronos };
|
|
34
|
+
declare const typedChronos: ChronosStatics;
|
|
35
|
+
export { typedChronos as chronos };
|
|
44
36
|
//# sourceMappingURL=chronos-fn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chronos-fn.d.ts","sourceRoot":"","sources":["../../src/date/chronos-fn.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"chronos-fn.d.ts","sourceRoot":"","sources":["../../src/date/chronos-fn.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,SAAS,CAAC;AAqF5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,QAAA,MAAM,YAAY,EAAc,cAAc,CAAC;AAsB/C,OAAO,EAAE,YAAY,IAAI,OAAO,EAAE,CAAC"}
|
package/dist/date/chronos-fn.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Chronos } from '..';
|
|
2
2
|
/**
|
|
3
|
-
* * Converts a date into a Chronos object and access to all `Chronos` methods.
|
|
3
|
+
* * Converts a date into a Chronos object and access to all `Chronos` methods and properties.
|
|
4
4
|
*
|
|
5
5
|
* @description
|
|
6
6
|
* This function serves as a wrapper around the `Chronos` class constructor and allows you to create a new `Chronos` instance from various types of date representations.
|
|
@@ -12,6 +12,14 @@ import { Chronos } from '..';
|
|
|
12
12
|
* Example: `1672531199000`.
|
|
13
13
|
* - **`Date`**: A JavaScript `Date` object.
|
|
14
14
|
* - **`Chronos`**: A `Chronos` instance created by the same constructor.
|
|
15
|
+
* - **`year, month, date, hours, minutes, seconds, milliseconds`**: Individual components of a date-time to construct a `Chronos` instance.
|
|
16
|
+
* - **`year`**: A number representing the year. If the year is between 0 and 99, it will be assumed to be the year 1900 + the provided year.
|
|
17
|
+
* - **`month`**: A number between 1 and 12 representing the month (1 for January, 12 for December). It is adjusted internally to a 0-based index (0 for January, 11 for December).
|
|
18
|
+
* - **`date`**: A number between 1 and 31 representing the day of the month.
|
|
19
|
+
* - **`hours`**: A number between 0 and 23 representing the hour of the day.
|
|
20
|
+
* - **`minutes`**: A number between 0 and 59 representing the minutes past the hour.
|
|
21
|
+
* - **`seconds`**: A number between 0 and 59 representing the seconds past the minute.
|
|
22
|
+
* - **`milliseconds`**: A number between 0 and 999 representing the milliseconds past the second.
|
|
15
23
|
*
|
|
16
24
|
* This function also allows you to access static methods from the `Chronos` class, as it copies all static methods from `Chronos` to the `chronos` function itself.
|
|
17
25
|
* Therefore, static methods can be called either through the `Chronos` class directly or through the `chronos` function.
|
|
@@ -26,8 +34,15 @@ import { Chronos } from '..';
|
|
|
26
34
|
* const sameInstanceClass = Chronos.parse("2023-12-31", "YYYY-MM-DD");
|
|
27
35
|
* ```
|
|
28
36
|
*
|
|
29
|
-
* @param
|
|
30
|
-
* @
|
|
37
|
+
* @param valueOrYear The value in number, string, Date or Chronos format or the full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
|
|
38
|
+
* @param month The month as a number between 1 and 12 (January to December).
|
|
39
|
+
* @param date The date as a number between 1 and 31.
|
|
40
|
+
* @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.
|
|
41
|
+
* @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.
|
|
42
|
+
* @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.
|
|
43
|
+
* @param ms A number from 0 to 999 that specifies the milliseconds.
|
|
44
|
+
*
|
|
45
|
+
* @returns new `Chronos` instance representing the provided date with all methods and properties.
|
|
31
46
|
*
|
|
32
47
|
* @static
|
|
33
48
|
* @remarks
|
|
@@ -39,9 +54,49 @@ import { Chronos } from '..';
|
|
|
39
54
|
* Chronos.parse("2023-12-31", "YYYY-MM-DD");
|
|
40
55
|
* ```
|
|
41
56
|
*/
|
|
42
|
-
const chronos = ((date) => {
|
|
43
|
-
|
|
57
|
+
const chronos = ((valueOrYear, month, date, hours, minutes, seconds, ms) => {
|
|
58
|
+
let newChronos;
|
|
59
|
+
if (typeof valueOrYear === 'number' && typeof month === 'number') {
|
|
60
|
+
newChronos = new Chronos(valueOrYear, month, date ?? 1, hours ?? 0, minutes ?? 0, seconds ?? 0, ms ?? 0);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
newChronos = new Chronos(valueOrYear);
|
|
64
|
+
}
|
|
65
|
+
return newChronos;
|
|
44
66
|
});
|
|
67
|
+
/**
|
|
68
|
+
* @static
|
|
69
|
+
* @remarks
|
|
70
|
+
* Static methods from the `Chronos` class are copied over to the `chronos` function.
|
|
71
|
+
* Therefore, you can access static methods from `Chronos` both through the `Chronos` class and the `chronos` function.
|
|
72
|
+
*
|
|
73
|
+
* Example usage:
|
|
74
|
+
* ```ts
|
|
75
|
+
* chronos.parse("2023-12-31", "YYYY-MM-DD");
|
|
76
|
+
* // Or
|
|
77
|
+
* Chronos.parse("2023-12-31", "YYYY-MM-DD");
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* *No need to call `chronos` for accessing the static methods. Simply call them.*
|
|
81
|
+
*
|
|
82
|
+
* **Available Static Methods:**
|
|
83
|
+
*
|
|
84
|
+
* ```ts
|
|
85
|
+
* today(options?: FormatOptions): string
|
|
86
|
+
* yesterday(): Chronos;
|
|
87
|
+
* tomorrow(): Chronos
|
|
88
|
+
* now(): number
|
|
89
|
+
* parse(dateStr: string, format: string): Chronos
|
|
90
|
+
* utc(dateLike: ChronosInput): Chronos
|
|
91
|
+
* min(...dates: ChronosInput[]): Chronos
|
|
92
|
+
* max(...dates: ChronosInput[]): Chronos
|
|
93
|
+
* isLeapYear(date: ChronosInput): boolean
|
|
94
|
+
* isValidDate(value: unknown): boolean
|
|
95
|
+
* isDateString(value: unknown): boolean
|
|
96
|
+
* isValidChronos(value: unknown): boolean
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
const typedChronos = chronos;
|
|
45
100
|
// ? Add static methods from Chronos class to the chronos function
|
|
46
101
|
Object.getOwnPropertyNames(Chronos).forEach((method) => {
|
|
47
102
|
// Exclude non-method properties like `length`, `name`, `prototype`
|
|
@@ -60,4 +115,4 @@ Object.getOwnPropertyNames(Chronos).forEach((method) => {
|
|
|
60
115
|
// };
|
|
61
116
|
// }
|
|
62
117
|
// });
|
|
63
|
-
export { chronos };
|
|
118
|
+
export { typedChronos as chronos };
|
package/dist/date/constants.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UTCOffSet } from './types';
|
|
1
|
+
import type { DayPart, Hours, UTCOffSet } from './types';
|
|
2
2
|
export declare const ORIGIN: unique symbol;
|
|
3
3
|
export declare const DAYS: readonly ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
4
4
|
export declare const MONTHS: readonly ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
@@ -291,4 +291,6 @@ export declare const TIME_ZONES: {
|
|
|
291
291
|
readonly PETT: number;
|
|
292
292
|
};
|
|
293
293
|
export declare const TIME_ZONE_LABELS: Record<UTCOffSet, string>;
|
|
294
|
+
/** Ranges for day parts. */
|
|
295
|
+
export declare const DEFAULT_RANGES: Record<DayPart, [Hours, Hours]>;
|
|
294
296
|
//# 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,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/date/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzD,eAAO,MAAM,MAAM,eAAmB,CAAC;AAEvC,eAAO,MAAM,IAAI,yFAQP,CAAC;AAEX,eAAO,MAAM,MAAM,qIAaT,CAAC;AAEX,eAAO,MAAM,YAAY,uCAAwC,CAAC;AAClE,eAAO,MAAM,aAAa,qCAAsC,CAAC;AACjE,eAAO,MAAM,YAAY,4BAA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A0C;;IAE1C,qCAAqC;;IAErC,mBAAmB;;IAEnB,iBAAiB;;IAEjB,kCAAkC;;IAElC,mCAAmC;;IAInC,gCAAgC;;IAEhC,+BAA+B;;IAE/B,6CAA6C;;CAEpC,CAAC;AAEX,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAwDzB,CAAC;AAE/B,4BAA4B;AAC5B,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAOjD,CAAC"}
|
package/dist/date/constants.js
CHANGED
|
@@ -383,3 +383,12 @@ export const TIME_ZONE_LABELS = {
|
|
|
383
383
|
'UTC+13:45': 'Tokelau Time (Unofficial)',
|
|
384
384
|
'UTC+14:00': 'Line Islands Time',
|
|
385
385
|
};
|
|
386
|
+
/** Ranges for day parts. */
|
|
387
|
+
export const DEFAULT_RANGES = {
|
|
388
|
+
night: ['21', '23'],
|
|
389
|
+
midnight: ['00', '01'],
|
|
390
|
+
lateNight: ['02', '04'],
|
|
391
|
+
morning: ['05', '11'],
|
|
392
|
+
afternoon: ['12', '16'],
|
|
393
|
+
evening: ['17', '20'],
|
|
394
|
+
};
|
package/dist/date/types.d.ts
CHANGED
|
@@ -78,16 +78,101 @@ export type ChronosMethods = {
|
|
|
78
78
|
[key in K]: (...args: any[]) => Chronos;
|
|
79
79
|
} ? K : never;
|
|
80
80
|
}[keyof typeof Chronos];
|
|
81
|
+
/** Accepted Input type for `Chronos` */
|
|
82
|
+
export type ChronosInput = number | string | Date | Chronos;
|
|
81
83
|
/** All the statics methods in `Chronos` class */
|
|
82
84
|
export interface ChronosStatics {
|
|
83
|
-
|
|
85
|
+
/**
|
|
86
|
+
* * Converts a date into a `Chronos` object and access to all `Chronos` methods and properties.
|
|
87
|
+
*
|
|
88
|
+
* @description
|
|
89
|
+
* This function serves as a wrapper around the `Chronos` class constructor and allows you to create a new `Chronos` instance from various types of date representations.
|
|
90
|
+
*
|
|
91
|
+
* Accepts no arguments (defaults to now).
|
|
92
|
+
*
|
|
93
|
+
* @returns Instance of `Chronos` with all methods and properties.
|
|
94
|
+
*/
|
|
95
|
+
(): Chronos;
|
|
96
|
+
/**
|
|
97
|
+
* * Converts a date into a `Chronos` object and access to all `Chronos` methods and properties.
|
|
98
|
+
*
|
|
99
|
+
* @description
|
|
100
|
+
* This function serves as a wrapper around the `Chronos` class constructor and allows you to create a new `Chronos` instance from various types of date representations.
|
|
101
|
+
*
|
|
102
|
+
* @param value - A date value in `number`, it should be a timestamp (milliseconds since the Unix epoch).
|
|
103
|
+
*
|
|
104
|
+
* @returns Instance of `Chronos` with all methods and properties.
|
|
105
|
+
*/
|
|
106
|
+
(value: number): Chronos;
|
|
107
|
+
/**
|
|
108
|
+
* * Converts a date into a `Chronos` object and access to all `Chronos` methods and properties.
|
|
109
|
+
*
|
|
110
|
+
* @description
|
|
111
|
+
* This function serves as a wrapper around the `Chronos` class constructor and allows you to create a new `Chronos` instance from various types of date representations.
|
|
112
|
+
*
|
|
113
|
+
* @param value - A date value in `string`, it should be in a format that can be parsed by the `Date` constructor.
|
|
114
|
+
*
|
|
115
|
+
* @returns Instance of `Chronos` with all methods and properties.
|
|
116
|
+
*/
|
|
117
|
+
(value: string): Chronos;
|
|
118
|
+
/**
|
|
119
|
+
* * Converts a date into a `Chronos` object and access to all `Chronos` methods and properties.
|
|
120
|
+
*
|
|
121
|
+
* @description
|
|
122
|
+
* This function serves as a wrapper around the `Chronos` class constructor and allows you to create a new `Chronos` instance from various types of date representations.
|
|
123
|
+
*
|
|
124
|
+
* @param value - A date value as `Date` object, it will be used as is.
|
|
125
|
+
*
|
|
126
|
+
* @returns Instance of `Chronos` with all methods and properties.
|
|
127
|
+
*/
|
|
128
|
+
(value: Date): Chronos;
|
|
129
|
+
/**
|
|
130
|
+
* * Converts a date into a `Chronos` object and access to all `Chronos` methods and properties.
|
|
131
|
+
*
|
|
132
|
+
* @description
|
|
133
|
+
* This function serves as a wrapper around the `Chronos` class constructor and allows you to create a new `Chronos` instance from various types of date representations.
|
|
134
|
+
*
|
|
135
|
+
* @param value - A date value as `Chronos` object.
|
|
136
|
+
*
|
|
137
|
+
* @returns Instance of `Chronos` with all methods and properties.
|
|
138
|
+
*/
|
|
139
|
+
(value: Chronos): Chronos;
|
|
140
|
+
/**
|
|
141
|
+
* * Converts a date into a `Chronos` object and access to all `Chronos` methods and properties.
|
|
142
|
+
*
|
|
143
|
+
* @description
|
|
144
|
+
* This function serves as a wrapper around the `Chronos` class constructor and allows you to create a new `Chronos` instance from various types of date representations.
|
|
145
|
+
*
|
|
146
|
+
* @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
|
|
147
|
+
* @param month The month as a number between 1 and 12 (January to December).
|
|
148
|
+
* @param date The date as a number between 1 and 31.
|
|
149
|
+
* @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.
|
|
150
|
+
* @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.
|
|
151
|
+
* @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.
|
|
152
|
+
* @param ms A number from 0 to 999 that specifies the milliseconds.
|
|
153
|
+
*
|
|
154
|
+
* @returns Instance of `Chronos` with all methods and properties.
|
|
155
|
+
*/
|
|
156
|
+
(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Chronos;
|
|
84
157
|
/**
|
|
85
158
|
* * Returns the current date and time in a specified format in local time.
|
|
86
|
-
* * Default format is dd, `MMM DD, YYYY HH:mm:ss` = `Sun, Apr 06, 2025 16:11:55
|
|
159
|
+
* * Default format is dd, `MMM DD, YYYY HH:mm:ss` = `Sun, Apr 06, 2025 16:11:55`
|
|
87
160
|
* @param options - Configure format string and whether to format using utc offset.
|
|
88
161
|
* @returns Formatted date string in desired format.
|
|
89
162
|
*/
|
|
90
163
|
today(options?: FormatOptions): string;
|
|
164
|
+
/**
|
|
165
|
+
* * Returns a new `Chronos` instance representing yesterday's date.
|
|
166
|
+
*
|
|
167
|
+
* @returns A `Chronos` instance for the next calendar day.
|
|
168
|
+
*/
|
|
169
|
+
yesterday(): Chronos;
|
|
170
|
+
/**
|
|
171
|
+
* * Returns a new `Chronos` instance representing tomorrow's date.
|
|
172
|
+
*
|
|
173
|
+
* @returns A `Chronos` instance for the next calendar day.
|
|
174
|
+
*/
|
|
175
|
+
tomorrow(): Chronos;
|
|
91
176
|
/**
|
|
92
177
|
* * Returns the number of milliseconds elapsed since midnight, January 1, 1970 Universal Coordinated Time (UTC).
|
|
93
178
|
* * It basically calls `Date.now()`.
|
|
@@ -112,27 +197,27 @@ export interface ChronosStatics {
|
|
|
112
197
|
* // returns Chronos instance with the parsed date 2023-12-31T15:30:45
|
|
113
198
|
* ```
|
|
114
199
|
*
|
|
115
|
-
* @param
|
|
116
|
-
* @param
|
|
117
|
-
* @returns
|
|
118
|
-
* @throws
|
|
200
|
+
* @param dateStr - The date string to be parsed
|
|
201
|
+
* @param format - The format of the date string. Tokens like `YYYY`, `MM`, `DD`, `HH`, `mm`, `ss` are used to specify the structure.
|
|
202
|
+
* @returns A new `Chronos` instance representing the parsed date.
|
|
203
|
+
* @throws `Error` If the date string does not match the format.
|
|
119
204
|
*/
|
|
120
205
|
parse(dateStr: string, format: string): Chronos;
|
|
121
206
|
/**
|
|
122
207
|
* * Creates UTC Chronos
|
|
123
208
|
* @param dateLike Date input to create utc time.
|
|
124
209
|
*/
|
|
125
|
-
utc(dateLike:
|
|
210
|
+
utc(dateLike: ChronosInput): Chronos;
|
|
126
211
|
/**
|
|
127
212
|
* * Returns earliest Chronos
|
|
128
213
|
* @param dates Date inputs.
|
|
129
214
|
*/
|
|
130
|
-
min(...dates:
|
|
215
|
+
min(...dates: ChronosInput[]): Chronos;
|
|
131
216
|
/**
|
|
132
217
|
* * Returns latest Chronos
|
|
133
218
|
* @param dates Date inputs.
|
|
134
219
|
*/
|
|
135
|
-
max(...dates:
|
|
220
|
+
max(...dates: ChronosInput[]): Chronos;
|
|
136
221
|
/**
|
|
137
222
|
* * Checks if the year in the date string or year (from 0 - 9999) is a leap year.
|
|
138
223
|
* - A year is a leap year if it is divisible by 4, but not divisible by 100, unless it is also divisible by 400.
|
|
@@ -148,7 +233,7 @@ export interface ChronosStatics {
|
|
|
148
233
|
* @param date - A `number` (year or Unix timestamp), `string`, `Date`, or `Chronos` instance representing a date.
|
|
149
234
|
* @returns `true` if the year is a leap year, `false` otherwise.
|
|
150
235
|
*/
|
|
151
|
-
isLeapYear(date:
|
|
236
|
+
isLeapYear(date: ChronosInput): boolean;
|
|
152
237
|
/**
|
|
153
238
|
* * Checks if the given value is a valid `Date` object.
|
|
154
239
|
* - A value is considered valid if it is an instance of the built-in `Date` class.
|
|
@@ -156,7 +241,7 @@ export interface ChronosStatics {
|
|
|
156
241
|
* @param value - The value to test.
|
|
157
242
|
* @returns `true` if the value is a valid Date object, otherwise `false`.
|
|
158
243
|
*/
|
|
159
|
-
isValidDate(value: unknown): value is
|
|
244
|
+
isValidDate(value: unknown): value is Date;
|
|
160
245
|
/**
|
|
161
246
|
* * Checks if the given value is a valid date string.
|
|
162
247
|
* - A value is considered a valid date string if it is a string and can be parsed by `Date.parse()`.
|
|
@@ -180,10 +265,14 @@ export type UTCMinute = '00' | '15' | '30' | '45';
|
|
|
180
265
|
export type UTCOffSet = `UTC${PositiveUTCHour | NegativeUTCHour}:${UTCMinute}`;
|
|
181
266
|
/** * Format options */
|
|
182
267
|
export interface FormatOptions {
|
|
183
|
-
/** - The desired format (Default format is dd, `MMM DD, YYYY HH:mm:ss` = `Sun, Apr 06, 2025 16:11:55
|
|
268
|
+
/** - The desired format (Default format is dd, `MMM DD, YYYY HH:mm:ss` = `Sun, Apr 06, 2025 16:11:55). */
|
|
184
269
|
format?: string;
|
|
185
270
|
/** - Whether to use UTC time. Defaults to `false`. */
|
|
186
271
|
useUTC?: boolean;
|
|
187
272
|
}
|
|
273
|
+
/** Definition of day part names. */
|
|
274
|
+
export type DayPart = 'night' | 'midnight' | 'lateNight' | 'morning' | 'afternoon' | 'evening';
|
|
275
|
+
/** Object type for extracting day parts. */
|
|
276
|
+
export type DayPartConfig = Record<DayPart, [Hours, Hours]>;
|
|
188
277
|
export {};
|
|
189
278
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/date/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/date/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,MAAM,EACN,cAAc,EACd,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,MAAM,aAAa,CAAC;AAErB,mDAAmD;AACnD,MAAM,MAAM,KAAK,GACd,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,CAAC;AAER,mDAAmD;AACnD,MAAM,MAAM,OAAO,GAChB,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAA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MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,UAAU,CAAC;AAE/C,MAAM,MAAM,eAAe,GACxB,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,CAAC;AAET,MAAM,MAAM,eAAe,GACxB,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,CAAC;AAET,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAElD,MAAM,MAAM,SAAS,GAAG,MAAM,eAAe,GAAG,eAAe,IAAI,SAAS,EAAE,CAAC;AAE/E,uBAAuB;AACvB,MAAM,WAAW,aAAa;IAC7B,0GAA0G;IAC1G,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,oCAAoC;AACpC,MAAM,MAAM,OAAO,GAChB,OAAO,GACP,UAAU,GACV,WAAW,GACX,SAAS,GACT,WAAW,GACX,SAAS,CAAC;AAEb,4CAA4C;AAC5C,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC"}
|
package/dist/date/utils.js
CHANGED
|
@@ -39,7 +39,7 @@ export function getCurrentDateTime() {
|
|
|
39
39
|
// * - If a Chronos object is provided, it will be converted to a Date object.
|
|
40
40
|
// * @returns A new Chronos object representing the provided date.
|
|
41
41
|
// */
|
|
42
|
-
// export function chronos(date?:
|
|
42
|
+
// export function chronos(date?: ChronosInput) {
|
|
43
43
|
// return new Chronos(date);
|
|
44
44
|
// }
|
|
45
45
|
/**
|
package/package.json
CHANGED