nhb-toolbox 4.26.21 → 4.26.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/dist/cjs/colors/constants.js +2 -2
  3. package/dist/cjs/colors/css-colors.js +1 -1
  4. package/dist/cjs/converter/constants.js +1 -1
  5. package/dist/cjs/date/Chronos.js +15 -11
  6. package/dist/cjs/date/constants.js +17 -17
  7. package/dist/cjs/date/plugins/timeZonePlugin.js +64 -26
  8. package/dist/cjs/date/seasons.js +11 -11
  9. package/dist/cjs/date/timezone.js +6 -6
  10. package/dist/cjs/date/utils.js +15 -0
  11. package/dist/cjs/http-status/constants.js +2 -2
  12. package/dist/cjs/index.js +5 -4
  13. package/dist/cjs/number/constants.js +12 -12
  14. package/dist/cjs/object/countries.js +1 -1
  15. package/dist/cjs/pluralizer/rules.js +4 -4
  16. package/dist/cjs/string/constants.js +1 -1
  17. package/dist/cjs/{utils → stylog}/constants.js +4 -4
  18. package/dist/cjs/verbalizer/rules.js +4 -4
  19. package/dist/dts/date/Chronos.d.ts +15 -13
  20. package/dist/dts/date/plugins/businessPlugin.d.ts +2 -2
  21. package/dist/dts/date/plugins/durationPlugin.d.ts +6 -0
  22. package/dist/dts/date/plugins/timeZonePlugin.d.ts +17 -8
  23. package/dist/dts/date/timezone.d.ts +3 -3
  24. package/dist/dts/date/types.d.ts +12 -0
  25. package/dist/dts/date/utils.d.ts +8 -1
  26. package/dist/dts/index.d.ts +1 -1
  27. package/dist/dts/{utils → stylog}/constants.d.ts +2 -2
  28. package/dist/dts/{utils → stylog}/helpers.d.ts +1 -1
  29. package/dist/esm/colors/constants.js +2 -2
  30. package/dist/esm/colors/css-colors.js +1 -1
  31. package/dist/esm/converter/constants.js +1 -1
  32. package/dist/esm/date/Chronos.js +15 -11
  33. package/dist/esm/date/constants.js +17 -17
  34. package/dist/esm/date/plugins/timeZonePlugin.js +65 -27
  35. package/dist/esm/date/seasons.js +11 -11
  36. package/dist/esm/date/timezone.js +6 -6
  37. package/dist/esm/date/utils.js +14 -0
  38. package/dist/esm/http-status/constants.js +2 -2
  39. package/dist/esm/index.js +1 -1
  40. package/dist/esm/number/constants.js +12 -12
  41. package/dist/esm/object/countries.js +1 -1
  42. package/dist/esm/pluralizer/rules.js +4 -4
  43. package/dist/esm/string/constants.js +1 -1
  44. package/dist/esm/{utils → stylog}/constants.js +4 -4
  45. package/dist/esm/verbalizer/rules.js +4 -4
  46. package/package.json +11 -11
  47. /package/dist/cjs/{utils/stylog.js → stylog/Stylog.js} +0 -0
  48. /package/dist/cjs/{utils → stylog}/helpers.js +0 -0
  49. /package/dist/dts/{utils/stylog.d.ts → stylog/Stylog.d.ts} +0 -0
  50. /package/dist/esm/{utils/stylog.js → stylog/Stylog.js} +0 -0
  51. /package/dist/esm/{utils → stylog}/helpers.js +0 -0
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PREFIX_MULTIPLIERS = exports.UNITS = exports.SUPPORTED_CURRENCIES = exports.CURRENCY_LOCALES = exports.LOCALE_CODES = exports.CURRENCY_CODES = exports.ORDINAL_TO_CARDINAL = exports.ORDINAL_UNDER_TEEN = exports.THOUSANDS = exports.TENS = exports.TEENS = exports.ONES = void 0;
4
- exports.ONES = Object.freeze([
4
+ exports.ONES = /* @__PURE__ */ Object.freeze([
5
5
  '',
6
6
  'one',
7
7
  'two',
@@ -13,7 +13,7 @@ exports.ONES = Object.freeze([
13
13
  'eight',
14
14
  'nine',
15
15
  ]);
16
- exports.TEENS = Object.freeze([
16
+ exports.TEENS = /* @__PURE__ */ Object.freeze([
17
17
  'ten',
18
18
  'eleven',
19
19
  'twelve',
@@ -25,7 +25,7 @@ exports.TEENS = Object.freeze([
25
25
  'eighteen',
26
26
  'nineteen',
27
27
  ]);
28
- exports.TENS = Object.freeze([
28
+ exports.TENS = /* @__PURE__ */ Object.freeze([
29
29
  '',
30
30
  'ten',
31
31
  'twenty',
@@ -37,7 +37,7 @@ exports.TENS = Object.freeze([
37
37
  'eighty',
38
38
  'ninety',
39
39
  ]);
40
- exports.THOUSANDS = Object.freeze([
40
+ exports.THOUSANDS = /* @__PURE__ */ Object.freeze([
41
41
  '',
42
42
  'thousand',
43
43
  'million',
@@ -46,7 +46,7 @@ exports.THOUSANDS = Object.freeze([
46
46
  'quadrillion',
47
47
  'quintillion',
48
48
  ]);
49
- exports.ORDINAL_UNDER_TEEN = Object.freeze({
49
+ exports.ORDINAL_UNDER_TEEN = /* @__PURE__ */ Object.freeze({
50
50
  zero: 'zeroth',
51
51
  one: 'first',
52
52
  two: 'second',
@@ -61,7 +61,7 @@ exports.ORDINAL_UNDER_TEEN = Object.freeze({
61
61
  eleven: 'eleventh',
62
62
  twelve: 'twelfth',
63
63
  });
64
- exports.ORDINAL_TO_CARDINAL = Object.freeze({
64
+ exports.ORDINAL_TO_CARDINAL = /* @__PURE__ */ Object.freeze({
65
65
  first: 'one',
66
66
  second: 'two',
67
67
  third: 'three',
@@ -90,7 +90,7 @@ exports.ORDINAL_TO_CARDINAL = Object.freeze({
90
90
  eightieth: 'eighty',
91
91
  ninetieth: 'ninety',
92
92
  });
93
- exports.CURRENCY_CODES = Object.freeze([
93
+ exports.CURRENCY_CODES = /* @__PURE__ */ Object.freeze([
94
94
  'AED',
95
95
  'AFN',
96
96
  'ALL',
@@ -252,7 +252,7 @@ exports.CURRENCY_CODES = Object.freeze([
252
252
  'ZMW',
253
253
  'ZWL',
254
254
  ]);
255
- exports.LOCALE_CODES = Object.freeze([
255
+ exports.LOCALE_CODES = /* @__PURE__ */ Object.freeze([
256
256
  'af-ZA',
257
257
  'am-ET',
258
258
  'ar-AE',
@@ -379,7 +379,7 @@ exports.LOCALE_CODES = Object.freeze([
379
379
  'zh-HK',
380
380
  'zh-TW',
381
381
  ]);
382
- exports.CURRENCY_LOCALES = Object.freeze({
382
+ exports.CURRENCY_LOCALES = /* @__PURE__ */ Object.freeze({
383
383
  AED: 'ar-AE',
384
384
  AFN: 'fa-IR',
385
385
  ALL: 'sq-AL',
@@ -541,7 +541,7 @@ exports.CURRENCY_LOCALES = Object.freeze({
541
541
  ZMW: 'en-ZM',
542
542
  ZWL: 'en-ZW',
543
543
  });
544
- exports.SUPPORTED_CURRENCIES = Object.freeze([
544
+ exports.SUPPORTED_CURRENCIES = /* @__PURE__ */ Object.freeze([
545
545
  'AUD',
546
546
  'BGN',
547
547
  'BRL',
@@ -574,7 +574,7 @@ exports.SUPPORTED_CURRENCIES = Object.freeze([
574
574
  'USD',
575
575
  'ZAR',
576
576
  ]);
577
- exports.UNITS = Object.freeze({
577
+ exports.UNITS = /* @__PURE__ */ Object.freeze({
578
578
  m: 'Meter',
579
579
  km: 'Kilometer',
580
580
  mi: 'Mile',
@@ -606,7 +606,7 @@ exports.UNITS = Object.freeze({
606
606
  hz: 'Hertz',
607
607
  khz: 'Kilohertz',
608
608
  });
609
- exports.PREFIX_MULTIPLIERS = Object.freeze({
609
+ exports.PREFIX_MULTIPLIERS = /* @__PURE__ */ Object.freeze({
610
610
  y: 1e-24,
611
611
  z: 1e-21,
612
612
  a: 1e-18,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.COUNTRIES = void 0;
4
- exports.COUNTRIES = Object.freeze([
4
+ exports.COUNTRIES = /* @__PURE__ */ Object.freeze([
5
5
  {
6
6
  country_name: 'Afghanistan',
7
7
  country_code: '93',
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.uncountables = exports.singularRules = exports.pluralRules = exports.irregularRules = void 0;
4
- exports.irregularRules = Object.freeze([
4
+ exports.irregularRules = /* @__PURE__ */ Object.freeze([
5
5
  ['I', 'we'],
6
6
  ['me', 'us'],
7
7
  ['he', 'they'],
@@ -89,7 +89,7 @@ exports.irregularRules = Object.freeze([
89
89
  ['wolf', 'wolves'],
90
90
  ['yes', 'yeses'],
91
91
  ]);
92
- exports.pluralRules = Object.freeze([
92
+ exports.pluralRules = /* @__PURE__ */ Object.freeze([
93
93
  [/s?$/i, 's'],
94
94
  [/(pe)(rson|ople)$/i, '$1ople'],
95
95
  [/(child)(?:ren)?$/i, '$1ren'],
@@ -126,7 +126,7 @@ exports.pluralRules = Object.freeze([
126
126
  '$1i',
127
127
  ],
128
128
  ]);
129
- exports.singularRules = Object.freeze([
129
+ exports.singularRules = /* @__PURE__ */ Object.freeze([
130
130
  [/s$/i, ''],
131
131
  [/(\P{ASCII})$/u, '$1'],
132
132
  [/(pe)(rson|ople)$/i, '$1rson'],
@@ -188,7 +188,7 @@ exports.singularRules = Object.freeze([
188
188
  '$1us',
189
189
  ],
190
190
  ]);
191
- exports.uncountables = Object.freeze(new Set([
191
+ exports.uncountables = /* @__PURE__ */ Object.freeze(new Set([
192
192
  'aircraft',
193
193
  'alcohol',
194
194
  'ammo',
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LOWERCASE = void 0;
4
- exports.LOWERCASE = Object.freeze([
4
+ exports.LOWERCASE = /* @__PURE__ */ Object.freeze([
5
5
  'and',
6
6
  'but',
7
7
  'or',
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CSS_16_COLORS = exports.ANSI_16_COLORS = exports.CSS_TEXT_STYLES = exports.ANSI_TEXT_STYLES = void 0;
4
- exports.ANSI_TEXT_STYLES = Object.freeze({
4
+ exports.ANSI_TEXT_STYLES = /* @__PURE__ */ Object.freeze({
5
5
  bold: ['\x1b[1m', '\x1b[22m'],
6
6
  bolder: ['\x1b[1m', '\x1b[22m'],
7
7
  dim: ['\x1b[2m', '\x1b[22m'],
@@ -10,7 +10,7 @@ exports.ANSI_TEXT_STYLES = Object.freeze({
10
10
  strikethrough: ['\x1b[9m', '\x1b[29m'],
11
11
  inverse: ['\x1b[7m', '\x1b[27m'],
12
12
  });
13
- exports.CSS_TEXT_STYLES = Object.freeze({
13
+ exports.CSS_TEXT_STYLES = /* @__PURE__ */ Object.freeze({
14
14
  bold: 'font-weight: bold',
15
15
  bolder: 'font-weight: bolder',
16
16
  dim: 'opacity: 0.7',
@@ -19,7 +19,7 @@ exports.CSS_TEXT_STYLES = Object.freeze({
19
19
  strikethrough: 'text-decoration: line-through',
20
20
  inverse: 'filter: invert(1)',
21
21
  });
22
- exports.ANSI_16_COLORS = Object.freeze({
22
+ exports.ANSI_16_COLORS = /* @__PURE__ */ Object.freeze({
23
23
  black: [30, 39],
24
24
  red: [31, 39],
25
25
  green: [32, 39],
@@ -53,7 +53,7 @@ exports.ANSI_16_COLORS = Object.freeze({
53
53
  bgCyanBright: [106, 49],
54
54
  bgWhiteBright: [107, 49],
55
55
  });
56
- exports.CSS_16_COLORS = Object.freeze({
56
+ exports.CSS_16_COLORS = /* @__PURE__ */ Object.freeze({
57
57
  black: '#000000',
58
58
  red: '#800000',
59
59
  green: '#008000',
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.baseRules = exports.pastParticipleRules = exports.pastRules = exports.irregularVerbs = void 0;
4
- exports.irregularVerbs = Object.freeze([
4
+ exports.irregularVerbs = /* @__PURE__ */ Object.freeze([
5
5
  ['am', 'was', 'been'],
6
6
  ['is', 'was', 'been'],
7
7
  ['are', 'were', 'been'],
@@ -144,7 +144,7 @@ exports.irregularVerbs = Object.freeze([
144
144
  ['wind', 'wound', 'wound'],
145
145
  ['write', 'wrote', 'written'],
146
146
  ]);
147
- exports.pastRules = Object.freeze([
147
+ exports.pastRules = /* @__PURE__ */ Object.freeze([
148
148
  [/([aeiou])y$/i, '$1yed'],
149
149
  [/e$/i, 'ed'],
150
150
  [/([aeiou])lf$/i, '$1lved'],
@@ -153,7 +153,7 @@ exports.pastRules = Object.freeze([
153
153
  [/([^aeiou])([aeiou])([^aeiou])$/i, '$1$2$3$3ed'],
154
154
  [/$/i, 'ed'],
155
155
  ]);
156
- exports.pastParticipleRules = Object.freeze([
156
+ exports.pastParticipleRules = /* @__PURE__ */ Object.freeze([
157
157
  [/([aeiou])y$/i, '$1yed'],
158
158
  [/e$/i, 'ed'],
159
159
  [/([aeiou])lf$/i, '$1lved'],
@@ -162,7 +162,7 @@ exports.pastParticipleRules = Object.freeze([
162
162
  [/([^aeiou])([aeiou])([^aeiou])$/i, '$1$2$3$3ed'],
163
163
  [/$/i, 'ed'],
164
164
  ]);
165
- exports.baseRules = Object.freeze([
165
+ exports.baseRules = /* @__PURE__ */ Object.freeze([
166
166
  [/([aeiou])yed$/i, '$1y'],
167
167
  [/^([^aeiouwy])ied$/i, '$1ie'],
168
168
  [/ied$/i, 'y'],
@@ -17,7 +17,7 @@ import type { $UTCOffset, ChronosInput, ChronosInternals, ChronosMethods, Chrono
17
17
  * **It also accepts number values as following:**
18
18
  * - **`year, month, date, hours, minutes, seconds, milliseconds`**: Individual components of a date-time to construct a `Chronos` instance.
19
19
  * - **`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.
20
- * - **`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).
20
+ * - **`month`**: A number between 1 and 12 representing the month (1 for January, 12 for December).
21
21
  * - **`date`**: A number between 1 and 31 representing the day of the month.
22
22
  * - **`hours`**: A number between 0 and 23 representing the hour of the day.
23
23
  * - **`minutes`**: A number between 0 and 59 representing the minutes past the hour.
@@ -49,7 +49,7 @@ export declare class Chronos {
49
49
  *
50
50
  * @remarks
51
51
  * - Invoking the {@link timeZone} method sets the timezone name that corresponds to the specified UTC offset, or the UTC offset itself if no name exists. For more details on this behavior, see {@link getTimeZoneName}.
52
- * - To retrieve the local system's native timezone name (or its identifier if the name is unavailable), use the {@link $getNativeTimeZone} instance method.
52
+ * - To retrieve the local system's native timezone name (or its identifier if the name is unavailable), use the {@link $getNativeTimeZoneName} instance method.
53
53
  */
54
54
  timeZoneName: LooseLiteral<TimeZoneName>;
55
55
  /**
@@ -157,9 +157,11 @@ export declare class Chronos {
157
157
  * - This method always reflects the local machine's timezone, regardless of whether {@link timeZone}, {@link utc}, or {@link toUTC} methods have been applied.
158
158
  * - To access the timezone name of a modified or converted instance, use the {@link timeZoneName} public property instead.
159
159
  *
160
+ * @param tzId Optional time zone identifier to get time zone name for that identifier.
161
+ *
160
162
  * @returns The resolved timezone name or its IANA identifier as a fallback.
161
163
  */
162
- $getNativeTimeZone(): LooseLiteral<TimeZoneName | TimeZoneIdentifier>;
164
+ $getNativeTimeZoneName(tzId?: TimeZoneIdentifier): LooseLiteral<TimeZoneName | TimeZoneIdentifier>;
163
165
  /**
164
166
  * @instance Retrieves the IANA time zone identifier (e.g., `"Asia/Dhaka"`, `"Africa/Harare"`) for the local system's current time zone.
165
167
  *
@@ -198,13 +200,13 @@ export declare class Chronos {
198
200
  get lastDateOfMonth(): NumberRange<28, 31>;
199
201
  /** @instance Returns a debug-friendly string for `console.log` or `util.inspect`. */
200
202
  inspect(): string;
201
- /** @instance Enables JSON.stringify and logging in the console (in Browser environment) to show readable output. */
203
+ /** @instance Enables `JSON.stringify` to show readable output. Calls {@link toLocalISOString} method. */
202
204
  toJSON(): string;
203
- /** @instance Enables arithmetic and comparison operations (e.g., +new Chronos()). */
205
+ /** @instance Enables arithmetic and comparison operations (e.g., `+new Chronos()`). Calls {@link getTimeStamp} method. */
204
206
  valueOf(): number;
205
- /** @instance Clones and returns a new `Chronos` instance with the same date. */
207
+ /** @instance Clones and returns exactly same `Chronos` instance. */
206
208
  clone(): Chronos;
207
- /** @instance Gets the native `Date` instance (read-only). */
209
+ /** @instance Gets the native `Date` instance of the current `Chronos`. */
208
210
  toDate(): Date;
209
211
  /** @instance Returns a string representation of a date. */
210
212
  toString(): string;
@@ -320,11 +322,11 @@ export declare class Chronos {
320
322
  * @returns `true` if the year is a leap year, `false` otherwise.
321
323
  */
322
324
  isLeapYear(year?: number): boolean;
323
- /** @instance Checks if another date is exactly equal to this one */
325
+ /** @instance Checks if another date is exactly equal to this one. */
324
326
  isEqual(other: ChronosInput): boolean;
325
- /** @instance Checks if another date is exactly equal to or before this one */
327
+ /** @instance Checks if another date is exactly equal to or before this one. */
326
328
  isEqualOrBefore(other: ChronosInput): boolean;
327
- /** @instance Checks if another date is exactly equal to or after this one */
329
+ /** @instance Checks if another date is exactly equal to or after this one. */
328
330
  isEqualOrAfter(other: ChronosInput): boolean;
329
331
  /**
330
332
  * @instance Checks if another date is the same as this one in a specific unit.
@@ -489,7 +491,7 @@ export declare class Chronos {
489
491
  * - `Q3`: July to September
490
492
  * - `Q4`: October to December
491
493
  *
492
- * This method strictly uses the **calendar year**. For fiscal quarters, use `toFiscalQuarter()` instead.
494
+ * This method strictly uses the **calendar year**. For fiscal quarters, use {@link toFiscalQuarter} instead.
493
495
  *
494
496
  * @example
495
497
  * new Chronos('2025-02-14').toQuarter(); // 1
@@ -752,12 +754,12 @@ export declare class Chronos {
752
754
  */
753
755
  static getDatesForDay(day: WeekDay, options?: DateRangeOptions): string[];
754
756
  /**
755
- * @static Returns earliest Chronos
757
+ * @static Returns earliest Chronos.
756
758
  * @param dates Date inputs.
757
759
  */
758
760
  static min(...dates: ChronosInput[]): Chronos;
759
761
  /**
760
- * @static Returns latest Chronos
762
+ * @static Returns latest Chronos.
761
763
  * @param dates Date inputs.
762
764
  */
763
765
  static max(...dates: ChronosInput[]): Chronos;
@@ -107,13 +107,13 @@ declare module '../Chronos' {
107
107
  */
108
108
  isBusinessHour(options?: BusinessOptionsWeekends): boolean;
109
109
  /**
110
- * @instance Returns the academic year based on a typical start in July and end in June.
110
+ * @instance Returns the academic year based on a typical start in `July` and end in `June`.
111
111
  * @returns The academic year in format `YYYY-YYYY`.
112
112
  */
113
113
  toAcademicYear(): AcademicYear;
114
114
  /**
115
115
  * @instance Returns the fiscal quarter based on custom fiscal year start (defaults to July).
116
- * @param startMonth - The fiscal year start month (1-12), default is July (7).
116
+ * @param startMonth - The fiscal year start month (1-12), default is July (`7`).
117
117
  * @returns The fiscal quarter (1-4).
118
118
  */
119
119
  toFiscalQuarter(startMonth?: NumberRange<1, 12>): Quarter;
@@ -4,6 +4,9 @@ declare module '../Chronos' {
4
4
  interface Chronos {
5
5
  /**
6
6
  * @instance Returns the full time duration breakdown between current input (start) and another time (to) as {@link TimeDuration} object.
7
+ *
8
+ * @remarks This method calculates the elapsed time difference (excludes the end day), if you need an inclusive calendar-style difference (counting both start and end days), adjust one day manually before calling `duration()`.
9
+ *
7
10
  * @param toTime The time to compare with. Defaults to `now`.
8
11
  * @param absolute If true, returns all values as positive numbers. Defaults to `true`.
9
12
  * @returns An object of time units: `years`, `months`, `days`, `hours`, `minutes`, `seconds`, `milliseconds` ({@link TimeDuration}).
@@ -11,6 +14,9 @@ declare module '../Chronos' {
11
14
  duration(toTime?: ChronosInput, absolute?: boolean): TimeDuration;
12
15
  /**
13
16
  * @instance Returns a human-readable formatted duration string between the current instance (start) and another time (to).
17
+ *
18
+ * @remarks This method calculates the elapsed time difference (excludes the end day), if you need an inclusive calendar-style difference (counting both start and end days), adjust one day manually before calling `durationString()`.
19
+ *
14
20
  * @param options {@link DurationOptions} to format duration string, including the time to compare with.
15
21
  * @returns A formatted duration string, e.g. `"2 hours, 5 minutes"` or `"2h 5m"`.
16
22
  */
@@ -34,32 +34,41 @@ declare module '../Chronos' {
34
34
  /**
35
35
  * @instance Returns the current time zone name as a full descriptive string (e.g. `"Bangladesh Standard Time"`).
36
36
  *
37
- * @param utc Optional UTC offset in `"UTC+06:00"` format. When passed, it bypasses the current time zone offset.
38
- * @returns Time zone name in full descriptive string or UTC offset if it is not a valid time zone.
39
- *
40
37
  * @remarks
41
38
  * - This method uses a predefined mapping of UTC offsets to time zone names.
42
39
  * - If multiple time zones share the same UTC offset, it returns the **first match** from the predefined list.
43
40
  * - If no match is found (which is rare), it falls back to returning the UTC offset (e.g. `"UTC+06:00"`).
44
- * - To retrieve the local system's native time zone name (or its identifier if the name is unavailable), use the {@link $getNativeTimeZone} instance method.
41
+ * - To retrieve the local system's native time zone name (or its identifier if the name is unavailable), use the {@link $getNativeTimeZoneName} instance method.
45
42
  * - To retrieve the local system's native time zone identifier, use the {@link $getNativeTimeZoneId} instance method.
43
+ *
44
+ * @param utc Optional UTC offset in `"UTC+06:00"` format. When passed, it bypasses the current time zone offset.
45
+ * @returns Time zone name in full descriptive string or UTC offset if it is not a valid time zone.
46
46
  */
47
47
  getTimeZoneName(utc?: UTCOffset): LooseLiteral<TimeZoneName | UTCOffset>;
48
48
  /**
49
49
  * @instance Returns the current time zone abbreviation (e.g. `"BST"` for `Bangladesh Standard Time`).
50
50
  *
51
- * @param utc Optional UTC offset in `"UTC+06:00"` format. When passed, it bypasses the current time zone offset.
52
- * @returns Time zone name in full descriptive string or UTC offset if it is not a valid time zone.
53
- *
54
51
  * @remarks
55
52
  * - This method uses a predefined mapping of UTC offsets to abbreviated time zone codes.
56
53
  * - If multiple time zones share the same UTC offset, it returns the **first abbreviation** from the list.
57
54
  * - If no abbreviation is found it abbreviates full time zone name from {@link TIME_ZONE_LABELS} using UTC offset.
58
55
  * - If no match is found (for unlisted or fictional utc offset), it returns the UTC offset (e.g. `"UTC+06:00"`).
59
- * - To retrieve the local system's native time zone name (or its identifier if the name is unavailable), use the {@link $getNativeTimeZone} instance method.
56
+ * - To retrieve the local system's native time zone name (or its identifier if the name is unavailable), use the {@link $getNativeTimeZoneName} instance method.
60
57
  * - To retrieve the local system's native time zone identifier, use the {@link $getNativeTimeZoneId} instance method.
58
+ *
59
+ * @param utc Optional UTC offset in `"UTC+06:00"` format. When passed, it bypasses the current time zone offset.
60
+ * @returns Time zone name in full descriptive string or UTC offset if it is not a valid time zone.
61
61
  */
62
62
  getTimeZoneNameShort(utc?: UTCOffset): LooseLiteral<TimeZone | UTCOffset>;
63
+ /**
64
+ * @instance Returns the current time zone abbreviation (e.g. `"BST"` for `Bangladesh Standard Time`).
65
+ *
66
+ * @remarks This method is an alias for {@link getTimeZoneNameShort}.
67
+ *
68
+ * @param utc Optional UTC offset in `"UTC+06:00"` format. When passed, it bypasses the current time zone offset.
69
+ * @returns Time zone name in full descriptive string or UTC offset if it is not a valid time zone.
70
+ */
71
+ getTimeZoneNameAbbr(utc?: UTCOffset): LooseLiteral<TimeZone | UTCOffset>;
63
72
  }
64
73
  }
65
74
  /** * Plugin to inject `timeZone` related methods */
@@ -249,7 +249,7 @@ export declare const TIME_ZONES: Readonly<{
249
249
  readonly offset: "UTC+07:00";
250
250
  };
251
251
  readonly DDUT: {
252
- readonly tzName: "Dumont d'Urville Time (in French Antarctic Station)";
252
+ readonly tzName: "Dumont d'Urville Time (Antarctic Station in French)";
253
253
  readonly offset: "UTC+10:00";
254
254
  };
255
255
  readonly DFT: {
@@ -397,7 +397,7 @@ export declare const TIME_ZONES: Readonly<{
397
397
  readonly offset: "UTC+07:00";
398
398
  };
399
399
  readonly IDLW: {
400
- readonly tzName: "International Date Line West time zone";
400
+ readonly tzName: "International Date Line West";
401
401
  readonly offset: "UTC-12:00";
402
402
  };
403
403
  readonly IDT: {
@@ -891,7 +891,7 @@ export declare const TIME_ZONE_LABELS: Readonly<{
891
891
  readonly 'UTC+10:30': "Lord Howe Standard Time";
892
892
  readonly 'UTC+11:00': "Central Pacific Standard Time";
893
893
  readonly 'UTC+12:00': "New Zealand Standard Time";
894
- readonly 'UTC+12:45': "Chatham Islands Time";
894
+ readonly 'UTC+12:45': "Chatham Standard Time";
895
895
  readonly 'UTC+13:00': "Phoenix Island Time";
896
896
  readonly 'UTC+14:00': "Line Islands Time";
897
897
  }>;
@@ -47,6 +47,17 @@ export interface GreetingConfigs {
47
47
  /** Default greeting message if no period matches. */
48
48
  defaultMessage?: string;
49
49
  }
50
+ /** Time zone details */
51
+ export type TimeZoneDetails = {
52
+ /** Time zone identifier */
53
+ tzIdentifier: LooseLiteral<TimeZoneIdentifier>;
54
+ /** Full time zone name */
55
+ tzNameLong?: LooseLiteral<TimeZoneName>;
56
+ /** Full time zone name but omits specific location */
57
+ tzNameLongGeneric?: LooseLiteral<TimeZoneName>;
58
+ /** Time zone offset from `UTC`, prefixed with `"GMT"` */
59
+ tzNameLongOffset?: LooseLiteral<`GMT${$UTCOffset}`>;
60
+ };
50
61
  /** Name of time unit from `year` to `millisecond` */
51
62
  export type TimeUnit = 'year' | 'month' | 'day' | 'week' | 'hour' | 'minute' | 'second' | 'millisecond';
52
63
  /** Name of time unit from `year` to `millisecond`, except `week` */
@@ -214,6 +225,7 @@ export type ChronosMethods = $InstanceMethods | $StaticMethods | $PluginMethods;
214
225
  export type ChronosInput = number | string | Date | Chronos;
215
226
  /** Represents key of `ChronosStatics` (each static method and property) */
216
227
  export type ChronosStaticKey = keyof ChronosStatics;
228
+ /** Key of {@link TIME_ZONE_LABELS} ({@link UTCOffset}) */
217
229
  export type $TZLabelKey = keyof typeof TIME_ZONE_LABELS;
218
230
  /** Abbreviated time-zone names (from {@link https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations time zone abbreviations on Wikipedia}) */
219
231
  export type TimeZone = keyof typeof TIME_ZONES;
@@ -1,5 +1,5 @@
1
1
  import type { Numeric } from '../types/index';
2
- import type { ClockTime, HourMinutes, UTCOffset } from './types';
2
+ import type { ClockTime, HourMinutes, TimeZoneDetails, TimeZoneIdentifier, 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
  *
@@ -55,3 +55,10 @@ export declare function convertMinutesToTime(minutes: Numeric): HourMinutes;
55
55
  * @returns A formatted UTC offset string like `UTC+05:30` or `UTC-04:00`.
56
56
  */
57
57
  export declare function formatUTCOffset(minutes: Numeric): UTCOffset;
58
+ /**
59
+ * * Retrieves comprehensive timezone details using the `Intl` API.
60
+ * @param tzId Optional timezone identifier; defaults to the system timezone.
61
+ * @param date Optional date for which to resolve the information.
62
+ * @returns Object containing identifier, names, and offset.
63
+ */
64
+ export declare function getTimeZoneDetails(tzId?: TimeZoneIdentifier, date?: Date): TimeZoneDetails;
@@ -43,7 +43,7 @@ export { isDateLike, isLeapYear, isValidTime, isValidTime as isValidTimeString,
43
43
  export { Chronos, Chronos as Chronus } from './date/Chronos';
44
44
  export { INTERNALS } from './date/constants';
45
45
  export { chronos, chronos as chronosjs, chronos as chronosts, chronos as chronus, chronos as chronusjs, chronos as chronusts, } from './date/chronos-fn';
46
- export { convertMinutesToTime as convertMinutesToHourMinutes, convertMinutesToTime, formatUTCOffset as convertMinutesToUTCOffset, extractHourMinute, extractMinutesFromUTC, extractTimeFromUTC, extractTimeFromUTC as extractTimeStringFromUTC, getTotalMinutes as extractTotalMinutesFromTime, formatUTCOffset, getCurrentDateTime, getCurrentDateTime as getCurrentTime, convertMinutesToTime as getHourMinutesFromMinutes, extractMinutesFromUTC as getMinutesFromUTC, convertMinutesToTime as getTimeFromMinutes, extractTimeFromUTC as getTimeStringFromUTC, getTotalMinutes, getTotalMinutes as getTotalMinutesFromTime, extractMinutesFromUTC as getTotalMinutesFromUTC, formatUTCOffset as minutesToUTCOffset, } from './date/utils';
46
+ export { convertMinutesToTime as convertMinutesToHourMinutes, convertMinutesToTime, formatUTCOffset as convertMinutesToUTCOffset, extractHourMinute, extractMinutesFromUTC, extractTimeFromUTC, extractTimeFromUTC as extractTimeStringFromUTC, getTotalMinutes as extractTotalMinutesFromTime, formatUTCOffset, getCurrentDateTime, getCurrentDateTime as getCurrentTime, convertMinutesToTime as getHourMinutesFromMinutes, extractMinutesFromUTC as getMinutesFromUTC, convertMinutesToTime as getTimeFromMinutes, extractTimeFromUTC as getTimeStringFromUTC, getTotalMinutes, getTotalMinutes as getTotalMinutesFromTime, extractMinutesFromUTC as getTotalMinutesFromUTC, formatUTCOffset as minutesToUTCOffset, getTimeZoneDetails, } from './date/utils';
47
47
  export { filterArrayOfObjects, flattenArray, getLastArrayElement, isInvalidOrEmptyArray, isInvalidOrEmptyArray as isValidEmptyArray, shuffleArray, } from './array/basics';
48
48
  export { averageByField, averageByField as avgByField, groupAndAverageByField, groupAndAverageByField as groupAndAvgByField, groupAndSumByField, sumByField, sumFieldDifference, sumFieldDifference as totalDeltaByField, } from './array/calc';
49
49
  export { Finder } from './array/Finder';
@@ -1,5 +1,5 @@
1
1
  import type { Hex6 } from '../colors/types';
2
- import type { AnsiSequence, TextStyle } from './stylog';
2
+ import type { AnsiSequence, TextStyle } from './Stylog';
3
3
  /** ANSI styles for non-color text effects */
4
4
  export declare const ANSI_TEXT_STYLES: Record<TextStyle, AnsiSequence>;
5
5
  /** Browser CSS equivalents */
@@ -40,4 +40,4 @@ export declare const ANSI_16_COLORS: Readonly<{
40
40
  readonly bgWhiteBright: readonly [107, 49];
41
41
  }>;
42
42
  /** Browser CSS equivalents for ANSI 16 colors */
43
- export declare const CSS_16_COLORS: Readonly<Record<"black" | "white" | "red" | "purple" | "green" | "yellow" | "blue" | "cyan" | "bgBlack" | "bgWhite" | "bgRed" | "bgPurple" | "bgGreen" | "bgYellow" | "bgBlue" | "bgCyan" | "blackBright" | "redBright" | "greenBright" | "yellowBright" | "blueBright" | "purpleBright" | "cyanBright" | "whiteBright" | "bgBlackBright" | "bgRedBright" | "bgGreenBright" | "bgYellowBright" | "bgBlueBright" | "bgPurpleBright" | "bgCyanBright" | "bgWhiteBright", Hex6>>;
43
+ export declare const CSS_16_COLORS: Readonly<Record<"black" | "white" | "red" | "purple" | "green" | "yellow" | "blue" | "cyan" | "blackBright" | "redBright" | "greenBright" | "yellowBright" | "blueBright" | "purpleBright" | "cyanBright" | "whiteBright" | "bgBlack" | "bgRed" | "bgGreen" | "bgYellow" | "bgBlue" | "bgPurple" | "bgCyan" | "bgWhite" | "bgBlackBright" | "bgRedBright" | "bgGreenBright" | "bgYellowBright" | "bgBlueBright" | "bgPurpleBright" | "bgCyanBright" | "bgWhiteBright", Hex6>>;
@@ -1,5 +1,5 @@
1
1
  import type { CSSColor, Hex6 } from '../colors/types';
2
- import type { Ansi16Value, AnsiSequence, BGColor, CSS16Color } from './stylog';
2
+ import type { Ansi16Value, AnsiSequence, BGColor, CSS16Color } from './Stylog';
3
3
  /**
4
4
  * * Extract the CSS color name from a background-prefixed style key.
5
5
  *
@@ -1,4 +1,4 @@
1
- export const ALPHABET_COLOR_PALETTE = Object.freeze([
1
+ export const ALPHABET_COLOR_PALETTE = /* @__PURE__ */ Object.freeze([
2
2
  '#00094C',
3
3
  '#00376E',
4
4
  '#005600',
@@ -26,7 +26,7 @@ export const ALPHABET_COLOR_PALETTE = Object.freeze([
26
26
  '#546F1C',
27
27
  '#824809',
28
28
  ]);
29
- export const NUMBER_COLOR_PALETTE = Object.freeze([
29
+ export const NUMBER_COLOR_PALETTE = /* @__PURE__ */ Object.freeze([
30
30
  '#893213',
31
31
  '#A44C15',
32
32
  '#8B4513',
@@ -1,4 +1,4 @@
1
- export const CSS_COLORS = Object.freeze({
1
+ export const CSS_COLORS = /* @__PURE__ */ Object.freeze({
2
2
  black: '#000000',
3
3
  silver: '#C0C0C0',
4
4
  gray: '#808080',
@@ -1,4 +1,4 @@
1
- export const UNITS = Object.freeze({
1
+ export const UNITS = /* @__PURE__ */ Object.freeze({
2
2
  time: [
3
3
  'nanosecond',
4
4
  'microsecond',
@@ -43,7 +43,7 @@ export class Chronos {
43
43
  this.origin = this.#ORIGIN;
44
44
  this.#offset = `UTC${this.getUTCOffset()}`;
45
45
  this.utcOffset = this.#offset;
46
- this.timeZoneName = this.$getNativeTimeZone();
46
+ this.timeZoneName = this.$getNativeTimeZoneName();
47
47
  this.timeZoneId = this.$getNativeTimeZoneId();
48
48
  }
49
49
  *[Symbol.iterator]() {
@@ -124,13 +124,9 @@ export class Chronos {
124
124
  get [Symbol.isConcatSpreadable]() {
125
125
  return true;
126
126
  }
127
- $getNativeTimeZone() {
128
- const details = new Intl.DateTimeFormat(undefined, {
129
- timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
130
- timeZoneName: 'long',
131
- }).formatToParts(this.toDate());
132
- const tzPart = details.find((p) => p.type === 'timeZoneName');
133
- return tzPart?.value ?? Intl.DateTimeFormat().resolvedOptions().timeZone;
127
+ $getNativeTimeZoneName(tzId) {
128
+ const $tzId = tzId || this.$getNativeTimeZoneId();
129
+ return this.#getNativeTzName(tzId) ?? $tzId;
134
130
  }
135
131
  $getNativeTimeZoneId() {
136
132
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
@@ -159,6 +155,14 @@ export class Chronos {
159
155
  instance.native = instance.toDate();
160
156
  return instance;
161
157
  }
158
+ #getNativeTzName(tzId) {
159
+ const tzDetails = new Intl.DateTimeFormat('en', {
160
+ timeZone: tzId,
161
+ timeZoneName: 'long',
162
+ }).formatToParts(this.#date);
163
+ const tzPart = tzDetails.find((p) => p.type === 'timeZoneName');
164
+ return tzPart?.value;
165
+ }
162
166
  #format(format, useUTC = false) {
163
167
  const year = useUTC ? this.#date.getUTCFullYear() : this.#date.getFullYear();
164
168
  const month = useUTC ? this.#date.getUTCMonth() : this.#date.getMonth();
@@ -281,7 +285,7 @@ export class Chronos {
281
285
  return this.getTimeStamp();
282
286
  }
283
287
  clone() {
284
- return new _a(this.#date).#withOrigin(this.#ORIGIN);
288
+ return new _a(this.#date).#withOrigin(this.#ORIGIN, this.#offset, this.timeZoneName, this.timeZoneId, this.$tzTracker);
285
289
  }
286
290
  toDate() {
287
291
  switch (this.#ORIGIN) {
@@ -625,7 +629,7 @@ export class Chronos {
625
629
  const input = this.startOf('day');
626
630
  const comparison = base.startOf('day');
627
631
  const diff = input.diff(comparison, 'day');
628
- const timeStr = this.toDate().toLocaleString(undefined, {
632
+ const timeStr = this.toDate().toLocaleString('en', {
629
633
  hour: 'numeric',
630
634
  minute: '2-digit',
631
635
  });
@@ -635,7 +639,7 @@ export class Chronos {
635
639
  return `Tomorrow at ${timeStr}`;
636
640
  if (diff === -1)
637
641
  return `Yesterday at ${timeStr}`;
638
- return this.toDate().toLocaleString(undefined, {
642
+ return this.toDate().toLocaleString('en', {
639
643
  month: 'long',
640
644
  day: '2-digit',
641
645
  year: 'numeric',