nhb-toolbox 3.4.77 → 3.5.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/date/Chronos.d.ts +36 -4
- package/dist/date/Chronos.d.ts.map +1 -1
- package/dist/date/Chronos.js +86 -16
- package/dist/date/constants.d.ts +129 -0
- package/dist/date/constants.d.ts.map +1 -1
- package/dist/date/constants.js +141 -0
- package/dist/date/greet.d.ts.map +1 -1
- package/dist/date/greet.js +7 -7
- package/dist/date/guards.d.ts +8 -1
- package/dist/date/guards.d.ts.map +1 -1
- package/dist/date/guards.js +11 -0
- package/dist/date/types.d.ts +8 -3
- package/dist/date/types.d.ts.map +1 -1
- package/dist/date/utils.d.ts +27 -1
- package/dist/date/utils.d.ts.map +1 -1
- package/dist/date/utils.js +32 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/date/Chronos.d.ts
CHANGED
|
@@ -1,10 +1,27 @@
|
|
|
1
|
+
import type { TimeZone, UTCOffSet } from './types';
|
|
1
2
|
export declare class Chronos {
|
|
2
3
|
#private;
|
|
3
4
|
/**
|
|
4
|
-
* * Creates a new immutable Chronos instance.
|
|
5
|
-
*
|
|
5
|
+
* * Creates a new immutable `Chronos` instance.
|
|
6
|
+
*
|
|
7
|
+
* @param value - A date value (`number`, `string`, `Date`, or `Chronos` object).
|
|
8
|
+
* - If a string is provided, it should be in a format that can be parsed by the Date constructor.
|
|
9
|
+
* - If a number is provided, it should be a timestamp (milliseconds since the Unix epoch).
|
|
10
|
+
* - If a Date object is provided, it will be used as is.
|
|
11
|
+
* - If a Chronos object is provided, it will be converted to a Date object.
|
|
6
12
|
*/
|
|
7
13
|
constructor(value?: number | string | Date | Chronos);
|
|
14
|
+
get [Symbol.toStringTag](): string;
|
|
15
|
+
/**
|
|
16
|
+
* * Enables primitive coercion like `console.log`, `${chronos}`, etc.
|
|
17
|
+
* @param hint - The type hint provided by the JS engine.
|
|
18
|
+
* @returns The primitive value based on the hint.
|
|
19
|
+
*/
|
|
20
|
+
[Symbol.toPrimitive](hint: string): string | number;
|
|
21
|
+
/** * Enables JSON.stringify and console logging to show readable output. */
|
|
22
|
+
toJSON(): string;
|
|
23
|
+
/** * Enables arithmetic and comparison operations (e.g., +new Chronos()). */
|
|
24
|
+
valueOf(): number;
|
|
8
25
|
/** * Gets the native `Date` instance (read-only). */
|
|
9
26
|
toDate(): Date;
|
|
10
27
|
/** * Returns a string representation of a date. The format of the string depends on the locale. */
|
|
@@ -38,11 +55,19 @@ export declare class Chronos {
|
|
|
38
55
|
*/
|
|
39
56
|
static now(): number;
|
|
40
57
|
/**
|
|
41
|
-
* * Formats the date into a custom string format.
|
|
58
|
+
* * Formats the date into a custom string format (local time).
|
|
59
|
+
*
|
|
42
60
|
* @param format - The desired format (Default format is `DD-MM-YYYY` = `30-06-1995`).
|
|
43
|
-
* @returns Formatted date string in desired format.
|
|
61
|
+
* @returns Formatted date string in desired format (local time).
|
|
44
62
|
*/
|
|
45
63
|
format(format?: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* * Formats the date into a custom string format (UTC time).
|
|
66
|
+
*
|
|
67
|
+
* @param format - The desired format (Default format is `DD-MM-YYYY` = `30-06-1995`).
|
|
68
|
+
* @returns Formatted date string in desired format (UTC time).
|
|
69
|
+
*/
|
|
70
|
+
formatUTC(format?: string): string;
|
|
46
71
|
/**
|
|
47
72
|
* * Adds days and returns a new immutable instance.
|
|
48
73
|
* @param days - Number of days to add.
|
|
@@ -72,5 +97,12 @@ export declare class Chronos {
|
|
|
72
97
|
* @returns `true` if the year is a leap year, `false` otherwise.
|
|
73
98
|
*/
|
|
74
99
|
isLeapYear(): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* * Create a new instance of `Chronos` in the specified timezone.
|
|
102
|
+
*
|
|
103
|
+
* @param zone - Standard timezone abbreviation (e.g., 'IST', 'UTC', 'EST') or UTC Offset in in `UTC-01:30` format.
|
|
104
|
+
* @returns A new instance of `Chronos` with time in the given timezone. Invalid input sets time-zone to `UTC`.
|
|
105
|
+
*/
|
|
106
|
+
timeZone(zone: TimeZone | UTCOffSet): Chronos;
|
|
75
107
|
}
|
|
76
108
|
//# sourceMappingURL=Chronos.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chronos.d.ts","sourceRoot":"","sources":["../../src/date/Chronos.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Chronos.d.ts","sourceRoot":"","sources":["../../src/date/Chronos.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGlE,qBAAa,OAAO;;IAInB;;;;;;;;OAQG;gBACS,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO;IAepD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;IAED;;;;OAIG;IACH,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM;IAKnD,4EAA4E;IAC5E,MAAM,IAAI,MAAM;IAIhB,6EAA6E;IAC7E,OAAO,IAAI,MAAM;IAIjB,qDAAqD;IACrD,MAAM,IAAI,IAAI;IAId,mGAAmG;IACnG,QAAQ,IAAI,MAAM;IAIlB,wDAAwD;IACxD,WAAW,IAAI,MAAM;IAIrB,oFAAoF;IACpF,YAAY,IAAI,MAAM;IAItB,mDAAmD;IACnD,IAAI,IAAI,IAAI,IAAI,CAEf;IAED,oFAAoF;IACpF,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,SAA4B,GAAG,MAAM;IAKjD;;;;;OAKG;IACH,MAAM,CAAC,KAAK,CAAC,MAAM,SAA4B,GAAG,MAAM;IAKxD;;;;OAIG;IACH,MAAM,CAAC,GAAG,IAAI,MAAM;IA4FpB;;;;;OAKG;IACH,MAAM,CAAC,MAAM,GAAE,MAAqB,GAAG,MAAM;IAI7C;;;;;OAKG;IACH,SAAS,CAAC,MAAM,GAAE,MAAqB,GAAG,MAAM;IAIhD;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAM9B;;;;OAIG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAInC;;;;;;;;OAQG;IACH,cAAc,IAAI,MAAM;IAexB;;;;;OAKG;IACH,UAAU,IAAI,OAAO;IAMrB;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO;CAgB7C"}
|
package/dist/date/Chronos.js
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import { DAYS, MONTHS, sortedFormats } from './constants';
|
|
1
|
+
import { DAYS, MONTHS, sortedFormats, TIME_ZONES } from './constants';
|
|
2
|
+
import { isValidUTCOffSet } from './guards';
|
|
3
|
+
import { extractMinutesFromUTC } from './utils';
|
|
2
4
|
export class Chronos {
|
|
3
5
|
#date;
|
|
6
|
+
// readonly preview: string;
|
|
4
7
|
/**
|
|
5
|
-
* * Creates a new immutable Chronos instance.
|
|
6
|
-
*
|
|
8
|
+
* * Creates a new immutable `Chronos` instance.
|
|
9
|
+
*
|
|
10
|
+
* @param value - A date value (`number`, `string`, `Date`, or `Chronos` object).
|
|
11
|
+
* - If a string is provided, it should be in a format that can be parsed by the Date constructor.
|
|
12
|
+
* - If a number is provided, it should be a timestamp (milliseconds since the Unix epoch).
|
|
13
|
+
* - If a Date object is provided, it will be used as is.
|
|
14
|
+
* - If a Chronos object is provided, it will be converted to a Date object.
|
|
7
15
|
*/
|
|
8
16
|
constructor(value) {
|
|
9
17
|
const date = value instanceof Chronos ?
|
|
@@ -11,9 +19,31 @@ export class Chronos {
|
|
|
11
19
|
: new Date(value ?? Date.now());
|
|
12
20
|
// Check if the date is invalid
|
|
13
21
|
if (isNaN(date.getTime())) {
|
|
14
|
-
throw new Error('
|
|
22
|
+
throw new Error('Provided date is invalid!');
|
|
15
23
|
}
|
|
16
24
|
this.#date = date;
|
|
25
|
+
// this.preview = this.toISOString();
|
|
26
|
+
}
|
|
27
|
+
get [Symbol.toStringTag]() {
|
|
28
|
+
return this.toISOString();
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* * Enables primitive coercion like `console.log`, `${chronos}`, etc.
|
|
32
|
+
* @param hint - The type hint provided by the JS engine.
|
|
33
|
+
* @returns The primitive value based on the hint.
|
|
34
|
+
*/
|
|
35
|
+
[Symbol.toPrimitive](hint) {
|
|
36
|
+
if (hint === 'number')
|
|
37
|
+
return this.valueOf();
|
|
38
|
+
return this.toString();
|
|
39
|
+
}
|
|
40
|
+
/** * Enables JSON.stringify and console logging to show readable output. */
|
|
41
|
+
toJSON() {
|
|
42
|
+
return this.toISOString();
|
|
43
|
+
}
|
|
44
|
+
/** * Enables arithmetic and comparison operations (e.g., +new Chronos()). */
|
|
45
|
+
valueOf() {
|
|
46
|
+
return this.getTimeStamp();
|
|
17
47
|
}
|
|
18
48
|
/** * Gets the native `Date` instance (read-only). */
|
|
19
49
|
toDate() {
|
|
@@ -68,19 +98,23 @@ export class Chronos {
|
|
|
68
98
|
return Date.now();
|
|
69
99
|
}
|
|
70
100
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* @
|
|
101
|
+
* @private Formats the current `Chronos` date using the specified template.
|
|
102
|
+
*
|
|
103
|
+
* @param format - The desired date format.
|
|
104
|
+
* @param useUTC - Whether to use UTC or local time.
|
|
105
|
+
* @returns Formatted date string.
|
|
74
106
|
*/
|
|
75
|
-
format(format =
|
|
76
|
-
const year = this.#date.getFullYear();
|
|
77
|
-
const month = this.#date.getMonth();
|
|
78
|
-
const day = this.#date.getDay();
|
|
79
|
-
const date = this.#date.getDate();
|
|
80
|
-
const hours = this.#date.getHours();
|
|
81
|
-
const minutes = this.#date.getMinutes();
|
|
82
|
-
const seconds = this.#date.getSeconds();
|
|
83
|
-
const milliseconds =
|
|
107
|
+
#format(format, useUTC = false) {
|
|
108
|
+
const year = useUTC ? this.#date.getUTCFullYear() : this.#date.getFullYear();
|
|
109
|
+
const month = useUTC ? this.#date.getUTCMonth() : this.#date.getMonth();
|
|
110
|
+
const day = useUTC ? this.#date.getUTCDay() : this.#date.getDay();
|
|
111
|
+
const date = useUTC ? this.#date.getUTCDate() : this.#date.getDate();
|
|
112
|
+
const hours = useUTC ? this.#date.getUTCHours() : this.#date.getHours();
|
|
113
|
+
const minutes = useUTC ? this.#date.getUTCMinutes() : this.#date.getMinutes();
|
|
114
|
+
const seconds = useUTC ? this.#date.getUTCSeconds() : this.#date.getSeconds();
|
|
115
|
+
const milliseconds = useUTC ?
|
|
116
|
+
this.#date.getUTCMilliseconds()
|
|
117
|
+
: this.#date.getMilliseconds();
|
|
84
118
|
const dateComponents = {
|
|
85
119
|
YYYY: String(year),
|
|
86
120
|
YY: String(year).slice(-2),
|
|
@@ -137,6 +171,24 @@ export class Chronos {
|
|
|
137
171
|
}
|
|
138
172
|
return result;
|
|
139
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* * Formats the date into a custom string format (local time).
|
|
176
|
+
*
|
|
177
|
+
* @param format - The desired format (Default format is `DD-MM-YYYY` = `30-06-1995`).
|
|
178
|
+
* @returns Formatted date string in desired format (local time).
|
|
179
|
+
*/
|
|
180
|
+
format(format = 'DD-MM-YYYY') {
|
|
181
|
+
return this.#format(format, false);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* * Formats the date into a custom string format (UTC time).
|
|
185
|
+
*
|
|
186
|
+
* @param format - The desired format (Default format is `DD-MM-YYYY` = `30-06-1995`).
|
|
187
|
+
* @returns Formatted date string in desired format (UTC time).
|
|
188
|
+
*/
|
|
189
|
+
formatUTC(format = 'DD-MM-YYYY') {
|
|
190
|
+
return this.#format(format, true);
|
|
191
|
+
}
|
|
140
192
|
/**
|
|
141
193
|
* * Adds days and returns a new immutable instance.
|
|
142
194
|
* @param days - Number of days to add.
|
|
@@ -185,4 +237,22 @@ export class Chronos {
|
|
|
185
237
|
const year = this.#date.getFullYear();
|
|
186
238
|
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
|
|
187
239
|
}
|
|
240
|
+
/**
|
|
241
|
+
* * Create a new instance of `Chronos` in the specified timezone.
|
|
242
|
+
*
|
|
243
|
+
* @param zone - Standard timezone abbreviation (e.g., 'IST', 'UTC', 'EST') or UTC Offset in in `UTC-01:30` format.
|
|
244
|
+
* @returns A new instance of `Chronos` with time in the given timezone. Invalid input sets time-zone to `UTC`.
|
|
245
|
+
*/
|
|
246
|
+
timeZone(zone) {
|
|
247
|
+
let offset;
|
|
248
|
+
if (isValidUTCOffSet(zone)) {
|
|
249
|
+
offset = extractMinutesFromUTC(zone);
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
offset = TIME_ZONES[zone] ?? 0;
|
|
253
|
+
}
|
|
254
|
+
const utc = this.#date.getTime() + this.#date.getTimezoneOffset() * 60 * 1000;
|
|
255
|
+
const adjusted = new Date(utc + offset * 60 * 1000);
|
|
256
|
+
return new Chronos(adjusted);
|
|
257
|
+
}
|
|
188
258
|
}
|
package/dist/date/constants.d.ts
CHANGED
|
@@ -10,4 +10,133 @@ export declare const SECOND_FORMATS: readonly ["ss", "s"];
|
|
|
10
10
|
export declare const MILLISECOND_FORMATS: readonly ["ms", "mss"];
|
|
11
11
|
export declare const TIME_FORMATS: readonly ["a", "A"];
|
|
12
12
|
export declare const sortedFormats: ("a" | "M" | "D" | "A" | "YYYY" | "YY" | "yyyy" | "yy" | "MM" | "MMM" | "MMMM" | "mmm" | "mmmm" | "DD" | "d" | "dd" | "ddd" | "dddd" | "H" | "HH" | "hh" | "h" | "mm" | "m" | "ss" | "s" | "ms" | "mss")[];
|
|
13
|
+
export declare const TIME_ZONES: {
|
|
14
|
+
readonly UTC: 0;
|
|
15
|
+
readonly GMT: 0;
|
|
16
|
+
readonly EST: number;
|
|
17
|
+
readonly EDT: number;
|
|
18
|
+
readonly CST: number;
|
|
19
|
+
readonly CDT: number;
|
|
20
|
+
readonly MST: number;
|
|
21
|
+
readonly MDT: number;
|
|
22
|
+
readonly PST: number;
|
|
23
|
+
readonly PDT: number;
|
|
24
|
+
readonly AKST: number;
|
|
25
|
+
readonly AKDT: number;
|
|
26
|
+
readonly HST: number;
|
|
27
|
+
readonly HDT: number;
|
|
28
|
+
readonly ART: number;
|
|
29
|
+
readonly BRST: number;
|
|
30
|
+
readonly BRT: number;
|
|
31
|
+
readonly CLT: number;
|
|
32
|
+
readonly CLST: number;
|
|
33
|
+
readonly GFT: number;
|
|
34
|
+
readonly UYT: number;
|
|
35
|
+
readonly CET: number;
|
|
36
|
+
readonly CEST: number;
|
|
37
|
+
readonly EET: number;
|
|
38
|
+
readonly EEST: number;
|
|
39
|
+
readonly WET: 0;
|
|
40
|
+
readonly WEST: number;
|
|
41
|
+
readonly MET: number;
|
|
42
|
+
readonly MEST: number;
|
|
43
|
+
readonly WAT: number;
|
|
44
|
+
readonly CAT: number;
|
|
45
|
+
readonly EAT: number;
|
|
46
|
+
readonly IST: number;
|
|
47
|
+
readonly PKT: number;
|
|
48
|
+
readonly BST: number;
|
|
49
|
+
readonly NPT: number;
|
|
50
|
+
readonly MYT: number;
|
|
51
|
+
readonly THA: number;
|
|
52
|
+
readonly ICT: number;
|
|
53
|
+
readonly WIB: number;
|
|
54
|
+
readonly WITA: number;
|
|
55
|
+
readonly WIT: number;
|
|
56
|
+
readonly SGT: number;
|
|
57
|
+
readonly CST_CHINA: number;
|
|
58
|
+
readonly JST: number;
|
|
59
|
+
readonly KST: number;
|
|
60
|
+
readonly IRKT: number;
|
|
61
|
+
readonly IRKT_DST: number;
|
|
62
|
+
readonly AEST: number;
|
|
63
|
+
readonly AEDT: number;
|
|
64
|
+
readonly ACST: number;
|
|
65
|
+
readonly ACDT: number;
|
|
66
|
+
readonly AWST: number;
|
|
67
|
+
readonly NZST: number;
|
|
68
|
+
readonly NZDT: number;
|
|
69
|
+
readonly CHAST: number;
|
|
70
|
+
readonly CHADT: number;
|
|
71
|
+
readonly MSK: number;
|
|
72
|
+
readonly SAMT: number;
|
|
73
|
+
readonly YEKST: number;
|
|
74
|
+
readonly OMST: number;
|
|
75
|
+
readonly KRAT: number;
|
|
76
|
+
readonly IRKT_RU: number;
|
|
77
|
+
readonly YAKT: number;
|
|
78
|
+
readonly VLAT: number;
|
|
79
|
+
readonly MAGT: number;
|
|
80
|
+
readonly PETT: number;
|
|
81
|
+
readonly IRST: number;
|
|
82
|
+
readonly IRDT: number;
|
|
83
|
+
readonly GST: number;
|
|
84
|
+
readonly ROTT: number;
|
|
85
|
+
readonly MAWT: number;
|
|
86
|
+
readonly NZAT: number;
|
|
87
|
+
readonly AST: number;
|
|
88
|
+
readonly ADT: number;
|
|
89
|
+
readonly NST: number;
|
|
90
|
+
readonly NDT: number;
|
|
91
|
+
readonly SST: number;
|
|
92
|
+
readonly CHST: number;
|
|
93
|
+
readonly MART: number;
|
|
94
|
+
readonly CHAST_NZ: number;
|
|
95
|
+
readonly LHST: number;
|
|
96
|
+
readonly LHDT: number;
|
|
97
|
+
readonly ACWST: number;
|
|
98
|
+
readonly NPT_NEPAL: number;
|
|
99
|
+
readonly UTC_MINUS_12: number;
|
|
100
|
+
readonly UTC_MINUS_11: number;
|
|
101
|
+
readonly UTC_MINUS_10: number;
|
|
102
|
+
readonly UTC_MINUS_9: number;
|
|
103
|
+
readonly UTC_MINUS_8: number;
|
|
104
|
+
readonly UTC_MINUS_7: number;
|
|
105
|
+
readonly UTC_MINUS_6: number;
|
|
106
|
+
readonly UTC_MINUS_5: number;
|
|
107
|
+
readonly UTC_MINUS_4: number;
|
|
108
|
+
readonly UTC_MINUS_3: number;
|
|
109
|
+
readonly UTC_MINUS_2: number;
|
|
110
|
+
readonly UTC_MINUS_1: number;
|
|
111
|
+
readonly UTC_PLUS_0: 0;
|
|
112
|
+
readonly UTC_PLUS_1: number;
|
|
113
|
+
readonly UTC_PLUS_2: number;
|
|
114
|
+
readonly UTC_PLUS_3: number;
|
|
115
|
+
readonly UTC_PLUS_3_30: number;
|
|
116
|
+
readonly UTC_PLUS_4: number;
|
|
117
|
+
readonly UTC_PLUS_4_30: number;
|
|
118
|
+
readonly UTC_PLUS_5: number;
|
|
119
|
+
readonly UTC_PLUS_5_30: number;
|
|
120
|
+
readonly UTC_PLUS_5_45: number;
|
|
121
|
+
readonly UTC_PLUS_6: number;
|
|
122
|
+
readonly UTC_PLUS_6_30: number;
|
|
123
|
+
readonly UTC_PLUS_7: number;
|
|
124
|
+
readonly UTC_PLUS_8: number;
|
|
125
|
+
readonly UTC_PLUS_8_45: number;
|
|
126
|
+
readonly UTC_PLUS_9: number;
|
|
127
|
+
readonly UTC_PLUS_9_30: number;
|
|
128
|
+
readonly UTC_PLUS_10: number;
|
|
129
|
+
readonly UTC_PLUS_10_30: number;
|
|
130
|
+
readonly UTC_PLUS_11: number;
|
|
131
|
+
readonly UTC_PLUS_12: number;
|
|
132
|
+
readonly UTC_PLUS_12_45: number;
|
|
133
|
+
readonly UTC_PLUS_13: number;
|
|
134
|
+
readonly UTC_PLUS_14: number;
|
|
135
|
+
readonly BST_UK: 60;
|
|
136
|
+
readonly BST_BD: 360;
|
|
137
|
+
readonly IST_IN: 330;
|
|
138
|
+
readonly IST_IL: 120;
|
|
139
|
+
readonly CST_US: -360;
|
|
140
|
+
readonly CST_CN: 480;
|
|
141
|
+
};
|
|
13
142
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/date/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,yFAQP,CAAC;AAEX,eAAO,MAAM,MAAM,qIAaT,CAAC;AAEX,eAAO,MAAM,YAAY,uCAAwC,CAAC;AAClE,eAAO,MAAM,aAAa,oDAAqD,CAAC;AAChF,eAAO,MAAM,YAAY,sBAAuB,CAAC;AACjD,eAAO,MAAM,WAAW,qCAAsC,CAAC;AAC/D,eAAO,MAAM,YAAY,iCAAkC,CAAC;AAC5D,eAAO,MAAM,cAAc,sBAAuB,CAAC;AACnD,eAAO,MAAM,cAAc,sBAAuB,CAAC;AACnD,eAAO,MAAM,mBAAmB,wBAAyB,CAAC;AAC1D,eAAO,MAAM,YAAY,qBAAsB,CAAC;AAEhD,eAAO,MAAM,aAAa,4MAUW,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/date/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,yFAQP,CAAC;AAEX,eAAO,MAAM,MAAM,qIAaT,CAAC;AAEX,eAAO,MAAM,YAAY,uCAAwC,CAAC;AAClE,eAAO,MAAM,aAAa,oDAAqD,CAAC;AAChF,eAAO,MAAM,YAAY,sBAAuB,CAAC;AACjD,eAAO,MAAM,WAAW,qCAAsC,CAAC;AAC/D,eAAO,MAAM,YAAY,iCAAkC,CAAC;AAC5D,eAAO,MAAM,cAAc,sBAAuB,CAAC;AACnD,eAAO,MAAM,cAAc,sBAAuB,CAAC;AACnD,eAAO,MAAM,mBAAmB,wBAAyB,CAAC;AAC1D,eAAO,MAAM,YAAY,qBAAsB,CAAC;AAEhD,eAAO,MAAM,aAAa,4MAUW,CAAC;AAEtC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyJb,CAAC"}
|
package/dist/date/constants.js
CHANGED
|
@@ -41,3 +41,144 @@ export const sortedFormats = [
|
|
|
41
41
|
...MILLISECOND_FORMATS,
|
|
42
42
|
...TIME_FORMATS,
|
|
43
43
|
].sort((a, b) => b.length - a.length);
|
|
44
|
+
export const TIME_ZONES = {
|
|
45
|
+
// Universal
|
|
46
|
+
UTC: 0,
|
|
47
|
+
GMT: 0,
|
|
48
|
+
// North America
|
|
49
|
+
EST: -5 * 60,
|
|
50
|
+
EDT: -4 * 60,
|
|
51
|
+
CST: -6 * 60,
|
|
52
|
+
CDT: -5 * 60,
|
|
53
|
+
MST: -7 * 60,
|
|
54
|
+
MDT: -6 * 60,
|
|
55
|
+
PST: -8 * 60,
|
|
56
|
+
PDT: -7 * 60,
|
|
57
|
+
AKST: -9 * 60,
|
|
58
|
+
AKDT: -8 * 60,
|
|
59
|
+
HST: -10 * 60,
|
|
60
|
+
HDT: -9 * 60,
|
|
61
|
+
// South America
|
|
62
|
+
ART: -3 * 60,
|
|
63
|
+
BRST: -2 * 60,
|
|
64
|
+
BRT: -3 * 60,
|
|
65
|
+
CLT: -4 * 60,
|
|
66
|
+
CLST: -3 * 60,
|
|
67
|
+
GFT: -3 * 60,
|
|
68
|
+
UYT: -3 * 60,
|
|
69
|
+
// Europe
|
|
70
|
+
CET: 1 * 60,
|
|
71
|
+
CEST: 2 * 60,
|
|
72
|
+
EET: 2 * 60,
|
|
73
|
+
EEST: 3 * 60,
|
|
74
|
+
WET: 0,
|
|
75
|
+
WEST: 1 * 60,
|
|
76
|
+
MET: 1 * 60,
|
|
77
|
+
MEST: 2 * 60,
|
|
78
|
+
// Africa
|
|
79
|
+
WAT: 1 * 60,
|
|
80
|
+
CAT: 2 * 60,
|
|
81
|
+
EAT: 3 * 60,
|
|
82
|
+
// Asia
|
|
83
|
+
IST: 5.5 * 60, // India
|
|
84
|
+
PKT: 5 * 60,
|
|
85
|
+
BST: 6 * 60, // Bangladesh
|
|
86
|
+
NPT: 5.75 * 60,
|
|
87
|
+
MYT: 8 * 60,
|
|
88
|
+
THA: 7 * 60,
|
|
89
|
+
ICT: 7 * 60,
|
|
90
|
+
WIB: 7 * 60,
|
|
91
|
+
WITA: 8 * 60,
|
|
92
|
+
WIT: 9 * 60,
|
|
93
|
+
SGT: 8 * 60,
|
|
94
|
+
CST_CHINA: 8 * 60,
|
|
95
|
+
JST: 9 * 60,
|
|
96
|
+
KST: 9 * 60,
|
|
97
|
+
IRKT: 8 * 60,
|
|
98
|
+
IRKT_DST: 9 * 60,
|
|
99
|
+
// Australia & Oceania
|
|
100
|
+
AEST: 10 * 60,
|
|
101
|
+
AEDT: 11 * 60,
|
|
102
|
+
ACST: 9.5 * 60,
|
|
103
|
+
ACDT: 10.5 * 60,
|
|
104
|
+
AWST: 8 * 60,
|
|
105
|
+
NZST: 12 * 60,
|
|
106
|
+
NZDT: 13 * 60,
|
|
107
|
+
CHAST: 12.75 * 60,
|
|
108
|
+
CHADT: 13.75 * 60,
|
|
109
|
+
// Russia
|
|
110
|
+
MSK: 3 * 60,
|
|
111
|
+
SAMT: 4 * 60,
|
|
112
|
+
YEKST: 5 * 60,
|
|
113
|
+
OMST: 6 * 60,
|
|
114
|
+
KRAT: 7 * 60,
|
|
115
|
+
IRKT_RU: 8 * 60,
|
|
116
|
+
YAKT: 9 * 60,
|
|
117
|
+
VLAT: 10 * 60,
|
|
118
|
+
MAGT: 11 * 60,
|
|
119
|
+
PETT: 12 * 60,
|
|
120
|
+
// Middle East
|
|
121
|
+
IRST: 3.5 * 60,
|
|
122
|
+
IRDT: 4.5 * 60,
|
|
123
|
+
GST: 4 * 60,
|
|
124
|
+
// Antarctica (used in research stations)
|
|
125
|
+
ROTT: -3 * 60,
|
|
126
|
+
MAWT: 5 * 60,
|
|
127
|
+
NZAT: 13 * 60,
|
|
128
|
+
// Misc
|
|
129
|
+
AST: -4 * 60,
|
|
130
|
+
ADT: -3 * 60,
|
|
131
|
+
NST: -3.5 * 60,
|
|
132
|
+
NDT: -2.5 * 60,
|
|
133
|
+
SST: -11 * 60,
|
|
134
|
+
CHST: 10 * 60,
|
|
135
|
+
// Rare fractional or unique time zones
|
|
136
|
+
MART: -9.5 * 60, // Marquesas Islands Time (UTC−09:30)
|
|
137
|
+
CHAST_NZ: 12.75 * 60, // Chatham Standard Time (NZ, UTC+12:45)
|
|
138
|
+
LHST: 10.5 * 60, // Lord Howe Standard Time (UTC+10:30)
|
|
139
|
+
LHDT: 11 * 60, // Lord Howe Daylight Time (DST +30min)
|
|
140
|
+
ACWST: 8.75 * 60, // Australian Central Western Standard Time (Eucla, UTC+08:45)
|
|
141
|
+
NPT_NEPAL: 5.75 * 60, // Nepal Time (UTC+05:45)
|
|
142
|
+
UTC_MINUS_12: -12 * 60,
|
|
143
|
+
UTC_MINUS_11: -11 * 60,
|
|
144
|
+
UTC_MINUS_10: -10 * 60,
|
|
145
|
+
UTC_MINUS_9: -9 * 60,
|
|
146
|
+
UTC_MINUS_8: -8 * 60,
|
|
147
|
+
UTC_MINUS_7: -7 * 60,
|
|
148
|
+
UTC_MINUS_6: -6 * 60,
|
|
149
|
+
UTC_MINUS_5: -5 * 60,
|
|
150
|
+
UTC_MINUS_4: -4 * 60,
|
|
151
|
+
UTC_MINUS_3: -3 * 60,
|
|
152
|
+
UTC_MINUS_2: -2 * 60,
|
|
153
|
+
UTC_MINUS_1: -1 * 60,
|
|
154
|
+
UTC_PLUS_0: 0,
|
|
155
|
+
UTC_PLUS_1: 1 * 60,
|
|
156
|
+
UTC_PLUS_2: 2 * 60,
|
|
157
|
+
UTC_PLUS_3: 3 * 60,
|
|
158
|
+
UTC_PLUS_3_30: 3.5 * 60,
|
|
159
|
+
UTC_PLUS_4: 4 * 60,
|
|
160
|
+
UTC_PLUS_4_30: 4.5 * 60,
|
|
161
|
+
UTC_PLUS_5: 5 * 60,
|
|
162
|
+
UTC_PLUS_5_30: 5.5 * 60,
|
|
163
|
+
UTC_PLUS_5_45: 5.75 * 60,
|
|
164
|
+
UTC_PLUS_6: 6 * 60,
|
|
165
|
+
UTC_PLUS_6_30: 6.5 * 60,
|
|
166
|
+
UTC_PLUS_7: 7 * 60,
|
|
167
|
+
UTC_PLUS_8: 8 * 60,
|
|
168
|
+
UTC_PLUS_8_45: 8.75 * 60,
|
|
169
|
+
UTC_PLUS_9: 9 * 60,
|
|
170
|
+
UTC_PLUS_9_30: 9.5 * 60,
|
|
171
|
+
UTC_PLUS_10: 10 * 60,
|
|
172
|
+
UTC_PLUS_10_30: 10.5 * 60,
|
|
173
|
+
UTC_PLUS_11: 11 * 60,
|
|
174
|
+
UTC_PLUS_12: 12 * 60,
|
|
175
|
+
UTC_PLUS_12_45: 12.75 * 60,
|
|
176
|
+
UTC_PLUS_13: 13 * 60,
|
|
177
|
+
UTC_PLUS_14: 14 * 60,
|
|
178
|
+
BST_UK: 60, // British Summer Time (UK DST)
|
|
179
|
+
BST_BD: 360, // Bangladesh Standard Time
|
|
180
|
+
IST_IN: 330, // India
|
|
181
|
+
IST_IL: 120, // Israel
|
|
182
|
+
CST_US: -360,
|
|
183
|
+
CST_CN: 480,
|
|
184
|
+
};
|
package/dist/date/greet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"greet.d.ts","sourceRoot":"","sources":["../../src/date/greet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"greet.d.ts","sourceRoot":"","sources":["../../src/date/greet.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAO/C;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,MAAM,CAiD7D"}
|
package/dist/date/greet.js
CHANGED
|
@@ -7,7 +7,7 @@ import { extractHourMinute, getCurrentDateTime, getTotalMinutes, } from './utils
|
|
|
7
7
|
* @returns The appropriate greeting message.
|
|
8
8
|
*/
|
|
9
9
|
export function getGreeting(configs) {
|
|
10
|
-
const { morningEnds = '11:59', noonEnds = '12:59', afternoonEnds = '17:59', eveningEnds = '23:59', midnightEnds = '02:59', currentTime,
|
|
10
|
+
const { morningEnds = '11:59', noonEnds = '12:59', afternoonEnds = '17:59', eveningEnds = '23:59', midnightEnds = '02:59', currentTime, appendToMsg = '', prependToMsg = '', morningMessage = 'Good Morning!', noonMessage = 'Good Noon!', afternoonMessage = 'Good Afternoon!', eveningMessage = 'Good Evening!', midnightMessage = 'Hello, Night Owl!', defaultMessage = 'Greetings!', } = configs || {};
|
|
11
11
|
let hour;
|
|
12
12
|
let minute;
|
|
13
13
|
if (currentTime && isValidTime(currentTime)) {
|
|
@@ -24,21 +24,21 @@ export function getGreeting(configs) {
|
|
|
24
24
|
const eveningEndMinutes = getTotalMinutes(eveningEnds);
|
|
25
25
|
const midnightEndMinutes = getTotalMinutes(midnightEnds);
|
|
26
26
|
if (currentTotalMinutes <= midnightEndMinutes) {
|
|
27
|
-
return
|
|
27
|
+
return prependToMsg.concat(midnightMessage.concat(appendToMsg));
|
|
28
28
|
}
|
|
29
29
|
else if (currentTotalMinutes <= morningEndMinutes) {
|
|
30
|
-
return
|
|
30
|
+
return prependToMsg.concat(morningMessage.concat(appendToMsg));
|
|
31
31
|
}
|
|
32
32
|
else if (currentTotalMinutes <= noonEndMinutes) {
|
|
33
|
-
return
|
|
33
|
+
return prependToMsg.concat(noonMessage.concat(appendToMsg));
|
|
34
34
|
}
|
|
35
35
|
else if (currentTotalMinutes <= afternoonEndMinutes) {
|
|
36
|
-
return
|
|
36
|
+
return prependToMsg.concat(afternoonMessage.concat(appendToMsg));
|
|
37
37
|
}
|
|
38
38
|
else if (currentTotalMinutes <= eveningEndMinutes) {
|
|
39
|
-
return
|
|
39
|
+
return prependToMsg.concat(eveningMessage.concat(appendToMsg));
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
|
-
return
|
|
42
|
+
return prependToMsg.concat(defaultMessage.concat(appendToMsg));
|
|
43
43
|
}
|
|
44
44
|
}
|
package/dist/date/guards.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Time } from './types';
|
|
1
|
+
import type { Time, UTCOffSet } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* * Checks if the provided value is a valid time string in "HH:MM" format.
|
|
4
4
|
*
|
|
@@ -6,4 +6,11 @@ import type { Time } from './types';
|
|
|
6
6
|
* @returns `true` if the value is a valid time string, `false` otherwise.
|
|
7
7
|
*/
|
|
8
8
|
export declare function isValidTime(value: unknown): value is Time;
|
|
9
|
+
/**
|
|
10
|
+
* * Checks if the provided value is a valid UTCOffSet (e.g. `UTC-01:30`).
|
|
11
|
+
*
|
|
12
|
+
* @param value - The value to check.
|
|
13
|
+
* @returns `true` if the value is a valid utc offset, `false` otherwise.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isValidUTCOffSet(value: unknown): value is UTCOffSet;
|
|
9
16
|
//# sourceMappingURL=guards.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../src/date/guards.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../src/date/guards.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAWzD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAInE"}
|
package/dist/date/guards.js
CHANGED
|
@@ -16,3 +16,14 @@ export function isValidTime(value) {
|
|
|
16
16
|
const minute = Number(minuteStr);
|
|
17
17
|
return hour >= 0 && hour <= 23 && minute >= 0 && minute <= 59;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* * Checks if the provided value is a valid UTCOffSet (e.g. `UTC-01:30`).
|
|
21
|
+
*
|
|
22
|
+
* @param value - The value to check.
|
|
23
|
+
* @returns `true` if the value is a valid utc offset, `false` otherwise.
|
|
24
|
+
*/
|
|
25
|
+
export function isValidUTCOffSet(value) {
|
|
26
|
+
if (!isString(value))
|
|
27
|
+
return false;
|
|
28
|
+
return /^UTC[+-]?\d{1,2}:\d{2}$/.test(value);
|
|
29
|
+
}
|
package/dist/date/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DATE_FORMATS, DAY_FORMATS, HOUR_FORMATS, MILLISECOND_FORMATS, MINUTE_FORMATS, MONTH_FORMATS, SECOND_FORMATS, TIME_FORMATS, YEAR_FORMATS } from './constants';
|
|
1
|
+
import type { DATE_FORMATS, DAY_FORMATS, HOUR_FORMATS, MILLISECOND_FORMATS, MINUTE_FORMATS, MONTH_FORMATS, SECOND_FORMATS, TIME_FORMATS, TIME_ZONES, YEAR_FORMATS } from './constants';
|
|
2
2
|
/** - Minute in numeric string from `00` to `23` */
|
|
3
3
|
export type Hours = '00' | '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12' | '13' | '14' | '15' | '16' | '17' | '18' | '19' | '20' | '21' | '22' | '23';
|
|
4
4
|
/** - Minute in numeric string from `00` to `59` */
|
|
@@ -20,9 +20,9 @@ export interface GreetingConfigs {
|
|
|
20
20
|
/** Current time in "HH:MM" format for some weird reason. Defaults to current time `new Date()` */
|
|
21
21
|
currentTime?: Time;
|
|
22
22
|
/** Optional string to append after each message */
|
|
23
|
-
|
|
23
|
+
appendToMsg?: string;
|
|
24
24
|
/** Optional string to prepend before each message */
|
|
25
|
-
|
|
25
|
+
prependToMsg?: string;
|
|
26
26
|
/** Custom greeting message for the morning period. */
|
|
27
27
|
morningMessage?: string;
|
|
28
28
|
/** Custom greeting message for the noon period. */
|
|
@@ -47,4 +47,9 @@ export type Second = (typeof SECOND_FORMATS)[number];
|
|
|
47
47
|
export type Millisecond = (typeof MILLISECOND_FORMATS)[number];
|
|
48
48
|
export type TimeFormats = (typeof TIME_FORMATS)[number];
|
|
49
49
|
export type ChronosFormat = Year | Month | Day | Date | Hour | Minute | Second | Millisecond | TimeFormats;
|
|
50
|
+
export type TimeZone = keyof typeof TIME_ZONES;
|
|
51
|
+
export type PositiveUTCHour = '+00' | '+01' | '+02' | '+03' | '+04' | '+05' | '+06' | '+07' | '+08' | '+09' | '+10' | '+11' | '+12' | '+13' | '+14';
|
|
52
|
+
export type NegativeUTCHour = '-01' | '-02' | '-03' | '-04' | '-05' | '-06' | '-07' | '-08' | '-09' | '-10' | '-11' | '-12';
|
|
53
|
+
export type UTCMinute = '00' | '15' | '30' | '45';
|
|
54
|
+
export type UTCOffSet = `UTC${PositiveUTCHour | NegativeUTCHour}:${UTCMinute}`;
|
|
50
55
|
//# 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,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,EACZ,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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,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AACrD,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AACrD,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/D,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD,MAAM,MAAM,aAAa,GACtB,IAAI,GACJ,KAAK,GACL,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,MAAM,GACN,MAAM,GACN,WAAW,GACX,WAAW,CAAC;AAEf,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,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"}
|
package/dist/date/utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Chronos } from './Chronos';
|
|
2
|
+
import type { Time, UTCOffSet } from './types';
|
|
2
3
|
/**
|
|
3
4
|
* * Extracts the hour and minute from a time string in `HH:MM` format.
|
|
4
5
|
*
|
|
@@ -20,4 +21,29 @@ export declare function getTotalMinutes(time: Time): number;
|
|
|
20
21
|
* @returns The current date and time as a `Date` object.
|
|
21
22
|
*/
|
|
22
23
|
export declare function getCurrentDateTime(): Date;
|
|
24
|
+
/**
|
|
25
|
+
* * Converts a date into a Chronos object.
|
|
26
|
+
*
|
|
27
|
+
* @param date - A date value. It can be a `string`, `number`, `Date`, or `Chronos` object.
|
|
28
|
+
* - If a string is provided, it should be in a format that can be parsed by the Date constructor.
|
|
29
|
+
* - If a number is provided, it should be a timestamp (milliseconds since the Unix epoch).
|
|
30
|
+
* - If a Date object is provided, it will be used as is.
|
|
31
|
+
* - If a Chronos object is provided, it will be converted to a Date object.
|
|
32
|
+
* @returns A new Chronos object representing the provided date.
|
|
33
|
+
*/
|
|
34
|
+
export declare function chronos(date?: number | string | Date | Chronos): Chronos;
|
|
35
|
+
/**
|
|
36
|
+
* * Extract Time in `HH:MM` format from given UTC value.
|
|
37
|
+
*
|
|
38
|
+
* @param utc UTC value in `UTC-01:30` or `UTC+01:30` format.
|
|
39
|
+
* @returns The UTC value in `HH:MM` format.
|
|
40
|
+
*/
|
|
41
|
+
export declare function extractTimeFromUTC(utc: UTCOffSet): Time;
|
|
42
|
+
/**
|
|
43
|
+
* * Converts a UTC value in `UTC-01:30` or `UTC+01:30` format into total minutes in number.
|
|
44
|
+
*
|
|
45
|
+
* @param time - UTC value in `UTC-01:30` or `UTC+01:30` format.
|
|
46
|
+
* @returns The total minutes elapsed since `00:00`.
|
|
47
|
+
*/
|
|
48
|
+
export declare function extractMinutesFromUTC(utc: UTCOffSet): number;
|
|
23
49
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/date/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/date/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/date/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAI9D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAIlD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,WAE9D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,CAE5D"}
|
package/dist/date/utils.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Chronos } from './Chronos';
|
|
1
2
|
/**
|
|
2
3
|
* * Extracts the hour and minute from a time string in `HH:MM` format.
|
|
3
4
|
*
|
|
@@ -27,3 +28,34 @@ export function getTotalMinutes(time) {
|
|
|
27
28
|
export function getCurrentDateTime() {
|
|
28
29
|
return new Date();
|
|
29
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* * Converts a date into a Chronos object.
|
|
33
|
+
*
|
|
34
|
+
* @param date - A date value. It can be a `string`, `number`, `Date`, or `Chronos` object.
|
|
35
|
+
* - If a string is provided, it should be in a format that can be parsed by the Date constructor.
|
|
36
|
+
* - If a number is provided, it should be a timestamp (milliseconds since the Unix epoch).
|
|
37
|
+
* - If a Date object is provided, it will be used as is.
|
|
38
|
+
* - If a Chronos object is provided, it will be converted to a Date object.
|
|
39
|
+
* @returns A new Chronos object representing the provided date.
|
|
40
|
+
*/
|
|
41
|
+
export function chronos(date) {
|
|
42
|
+
return new Chronos(date);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* * Extract Time in `HH:MM` format from given UTC value.
|
|
46
|
+
*
|
|
47
|
+
* @param utc UTC value in `UTC-01:30` or `UTC+01:30` format.
|
|
48
|
+
* @returns The UTC value in `HH:MM` format.
|
|
49
|
+
*/
|
|
50
|
+
export function extractTimeFromUTC(utc) {
|
|
51
|
+
return utc.replace(/^UTC[+-]?/g, '');
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* * Converts a UTC value in `UTC-01:30` or `UTC+01:30` format into total minutes in number.
|
|
55
|
+
*
|
|
56
|
+
* @param time - UTC value in `UTC-01:30` or `UTC+01:30` format.
|
|
57
|
+
* @returns The total minutes elapsed since `00:00`.
|
|
58
|
+
*/
|
|
59
|
+
export function extractMinutesFromUTC(utc) {
|
|
60
|
+
return getTotalMinutes(extractTimeFromUTC(utc));
|
|
61
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,9 +14,9 @@ export { generateRandomColorInHexRGB, generateRandomHSLColor, } from './colors/r
|
|
|
14
14
|
export { convertColorCode, convertHex8ToHsla, convertHex8ToRgba, convertHexToHsl, convertHexToRgb, convertHslaToHex8, convertHslaToRgba, convertHslToHex, convertHslToRgb, convertRgbaToHex8, convertRgbaToHsla, convertRgbToHex, convertRgbToHsl, convertRgbToRgba, } from './colors/convert';
|
|
15
15
|
export { Color, Color as Colour } from './colors/Color';
|
|
16
16
|
export { getGreeting as generateGreeting, getGreeting, getGreeting as greet, } from './date/greet';
|
|
17
|
-
export { isValidTime, isValidTime as isValidTimeString } from './date/guards';
|
|
17
|
+
export { isValidTime, isValidTime as isValidTimeString, isValidUTCOffSet as isValidUTC, isValidUTCOffSet, } from './date/guards';
|
|
18
18
|
export { Chronos, Chronos as Chronus } from './date/Chronos';
|
|
19
|
-
export { extractHourMinute, getCurrentDateTime, getCurrentDateTime as getCurrentTime, getTotalMinutes, } from './date/utils';
|
|
19
|
+
export { chronos, chronos as chronosjs, chronos as chronosts, chronos as chronus, chronos as chronusjs, chronos as chronusts, extractHourMinute, extractMinutesFromUTC, extractTimeFromUTC, extractTimeFromUTC as extractTimeStringFromUTC, getTotalMinutes as extractTotalMinutesFromTime, getCurrentDateTime, getCurrentDateTime as getCurrentTime, extractMinutesFromUTC as getMinutesFromUTC, extractTimeFromUTC as getTimeStringFromUTC, getTotalMinutes, getTotalMinutes as getTotalMinutesFromTime, extractMinutesFromUTC as getTotalMinutesFromUTC, } from './date/utils';
|
|
20
20
|
export { filterArrayOfObjects, flattenArray, getLastArrayElement, isInvalidOrEmptyArray, isInvalidOrEmptyArray as isValidEmptyArray, shuffleArray, } from './array/basics';
|
|
21
21
|
export { sortAnArray } from './array/sort';
|
|
22
22
|
export { createOptionsArray, moveArrayElement, removeDuplicatesFromArray, rotateArray, splitArray, } from './array/transform';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,cAAc,GACd,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EACN,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,GACX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,aAAa,GACb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,IAAI,mBAAmB,GAC7C,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACN,YAAY,IAAI,YAAY,EAC5B,YAAY,EACZ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ACL,MAAM,EACN,OAAO,IAAI,YAAY,EACvB,KAAK,IAAI,UAAU,GACnB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -18,9 +18,9 @@ export { convertColorCode, convertHex8ToHsla, convertHex8ToRgba, convertHexToHsl
|
|
|
18
18
|
export { Color, Color as Colour } from './colors/Color';
|
|
19
19
|
// ! Date & Time Utilities
|
|
20
20
|
export { getGreeting as generateGreeting, getGreeting, getGreeting as greet, } from './date/greet';
|
|
21
|
-
export { isValidTime, isValidTime as isValidTimeString } from './date/guards';
|
|
21
|
+
export { isValidTime, isValidTime as isValidTimeString, isValidUTCOffSet as isValidUTC, isValidUTCOffSet, } from './date/guards';
|
|
22
22
|
export { Chronos, Chronos as Chronus } from './date/Chronos';
|
|
23
|
-
export { extractHourMinute, getCurrentDateTime, getCurrentDateTime as getCurrentTime, getTotalMinutes, } from './date/utils';
|
|
23
|
+
export { chronos, chronos as chronosjs, chronos as chronosts, chronos as chronus, chronos as chronusjs, chronos as chronusts, extractHourMinute, extractMinutesFromUTC, extractTimeFromUTC, extractTimeFromUTC as extractTimeStringFromUTC, getTotalMinutes as extractTotalMinutesFromTime, getCurrentDateTime, getCurrentDateTime as getCurrentTime, extractMinutesFromUTC as getMinutesFromUTC, extractTimeFromUTC as getTimeStringFromUTC, getTotalMinutes, getTotalMinutes as getTotalMinutesFromTime, extractMinutesFromUTC as getTotalMinutesFromUTC, } from './date/utils';
|
|
24
24
|
// ! Array Utilities
|
|
25
25
|
export { filterArrayOfObjects, flattenArray, getLastArrayElement, isInvalidOrEmptyArray, isInvalidOrEmptyArray as isValidEmptyArray, shuffleArray, } from './array/basics';
|
|
26
26
|
export { sortAnArray } from './array/sort';
|
package/package.json
CHANGED