nhb-toolbox 4.26.0 → 4.26.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/CHANGELOG.md CHANGED
@@ -6,7 +6,11 @@ All notable changes to the package will be documented here.
6
6
 
7
7
  ---
8
8
 
9
- ## [4.26.00] - 2025-11-08
9
+ ## [4.26.1] - 2025-11-08
10
+
11
+ - **Updated** *tsdoc* for some `Chronos` *methods* and *public properties*.
12
+
13
+ ## [4.26.0] - 2025-11-08
10
14
 
11
15
  ### 🕧 New in Chronos
12
16
 
@@ -38,14 +38,32 @@ export declare class Chronos {
38
38
  * - Also accessible via {@link toDate} instance method.
39
39
  */
40
40
  native: Date;
41
- /** Current UTC offset in `UTC±HH:mm` format */
41
+ /**
42
+ * * Current UTC offset in `UTC±HH:mm` format.
43
+ *
44
+ * - Also accessible via {@link getUTCOffset} instance method without `UTC` prefix (`±HH:mm` format).
45
+ */
42
46
  utcOffset: UTCOffSet;
43
- /** Current timezone name (e.g. `"Bangladesh Standard Time"`) or fallback to timezone identifier if name not found (e.g., `"Asia/Dhaka"`) */
47
+ /**
48
+ * Represents the current timezone name (e.g., `"Bangladesh Standard Time"`), or falls back to the corresponding timezone identifier (e.g., `"Asia/Dhaka"`) if no name can be resolved.
49
+ *
50
+ * @remarks
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.
53
+ */
44
54
  timeZoneName: string;
45
- /** Current timezone identifier, array of timezone identifiers or UTC offset.
46
- * - `TimeZoneIdentifier`: (e.g., `"Asia/Dhaka"`)
47
- * - Array of `TimeZoneIdentifier` (e.g., `['Asia/Kathmandu', 'Asia/Katmandu']` for timezones that share same UTC offset like `"UTC+05:45"`)
48
- * - `UTCOffset` if no timezone identifier is found for specific UTC offset (e.g., `"UTC+05:45"`, `"UTC+02:15"` etc.) */
55
+ /**
56
+ * Represents the current timezone context, which can be a single identifier, an array of equivalent identifiers, or a UTC offset.
57
+ *
58
+ * - **`TimeZoneIdentifier`** — e.g., `"Asia/Dhaka"`. Returned when the {@link timeZone} method has not been invoked. It is default behaviour.
59
+ * - **Array of `TimeZoneIdentifier`** — e.g., `['Asia/Kathmandu', 'Asia/Katmandu']`, used when multiple timezones share the same UTC offset such as `"UTC+05:45"`.
60
+ * - **`UTCOffset`** — e.g., `"UTC+06:45"` or `"UTC+02:15"`, returned when no named timezone corresponds to a given offset.
61
+ *
62
+ * @remarks
63
+ * - By default, when {@link timeZone} is not applied, a single `TimeZoneIdentifier` string is provided.
64
+ * - When applied, it may instead return a single identifier string, an array of equivalent identifiers or a UTC offset string.
65
+ * - To retrieve the local system’s native timezone identifier, use the {@link $getNativeTimeZoneId} instance method.
66
+ */
49
67
  timeZoneId: TimeZoneId;
50
68
  /**
51
69
  * * Creates a new immutable `Chronos` instance.
@@ -136,15 +154,23 @@ export declare class Chronos {
136
154
  get [Symbol.toStringTag](): string;
137
155
  get [Symbol.isConcatSpreadable](): boolean;
138
156
  /**
139
- * * Safely get the current timezone name (e.g. `"Bangladesh Standard Time"`) or fallback to timezone identifier if name not found (e.g., `"Asia/Dhaka"`) for the local machine's timezone.
157
+ * @instance Retrieves the local system’s current timezone name (e.g., `"Bangladesh Standard Time"`), or falls back to its corresponding IANA timezone identifier (e.g., `"Asia/Dhaka"`) if the name cannot be determined.
140
158
  *
141
- * @remarks If {@link timeZone} or {@link utc}/{@link toUTC} method is applied, it still returns the local machine's timezone info. To access the modified timezone info use {@link timeZoneName} property.
159
+ * @remarks
160
+ * - This method always reflects the local machine’s timezone, regardless of whether {@link timeZone}, {@link utc}, or {@link toUTC} methods have been applied.
161
+ * - To access the timezone name of a modified or converted instance, use the {@link timeZoneName} public property instead.
162
+ *
163
+ * @returns The resolved timezone name or its IANA identifier as a fallback.
142
164
  */
143
165
  $getNativeTimeZone(): string;
144
166
  /**
145
- * * Safely get the IANA timezone identifier (e.g. `"Asia/Dhaka"`, `"Africa/Harare"` etc.) for the local machine's timezone.
167
+ * @instance Retrieves the IANA time zone identifier (e.g., `"Asia/Dhaka"`, `"Africa/Harare"`) for the local system’s current time zone.
168
+ *
169
+ * @remarks
170
+ * - This method always returns the identifier of the local machine’s time zone, regardless of whether {@link timeZone}, {@link utc}, or {@link toUTC} methods have been applied.
171
+ * - To obtain the identifier(s) of a modified or converted instance, use the {@link timeZoneId} public property instead.
146
172
  *
147
- * @remarks If {@link timeZone} or {@link utc}/{@link toUTC} method is applied, it still returns the local machine's timezone identifier. To access the modified timezone identifier(s) use {@link timeZoneId} property.
173
+ * @returns The local system’s IANA time zone identifier.
148
174
  */
149
175
  $getNativeTimeZoneId(): TimeZoneIdentifier;
150
176
  /** Gets the full year of the date. */
@@ -185,7 +211,7 @@ export declare class Chronos {
185
211
  toDate(): Date;
186
212
  /** @instance Returns a string representation of a date. */
187
213
  toString(): string;
188
- /** @instance Returns ISO string with local machine's time zone offset. */
214
+ /** @instance Returns ISO string with local machine's timezone offset. */
189
215
  toLocalISOString(): string;
190
216
  /** @instance Returns a date as a string value in ISO format. Respects timezone. */
191
217
  toISOString(): string;
@@ -477,7 +503,7 @@ export declare class Chronos {
477
503
  /**
478
504
  * @instance Returns the system's current UTC offset formatted as `±HH:mm` (`+06:00` or `-07:00`).
479
505
  *
480
- * - *Unlike JavaScript's {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset `Date.prototype.getTimezoneOffset()`}, which returns the offset in minutes **behind** UTC (positive for locations west of UTC and negative for east), this method returns the more intuitive sign format used in time zone representations (e.g., `+06:00` means 6 hours **ahead** of UTC).*
506
+ * - *Unlike JavaScript's {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset `Date.prototype.getTimezoneOffset()`}, which returns the offset in minutes **behind** UTC (positive for locations west of UTC and negative for east), this method returns the more intuitive sign format used in timezone representations (e.g., `+06:00` means 6 hours **ahead** of UTC).*
481
507
  *
482
508
  * @returns The (local) system's UTC offset in `±HH:mm` format.
483
509
  */
@@ -485,7 +511,7 @@ export declare class Chronos {
485
511
  /**
486
512
  * @instance Returns the timezone offset of this `Chronos` instance in `±HH:mm` format maintaining current timezone.
487
513
  *
488
- * - *Unlike JavaScript's {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset Date.prototype.getTimezoneOffset()}, which returns the offset in minutes **behind** UTC (positive for locations west of UTC and negative for east), this method returns the more intuitive sign format used in time zone representations (e.g., `+06:00` means 6 hours **ahead** of UTC).*
514
+ * - *Unlike JavaScript's {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset Date.prototype.getTimezoneOffset()}, which returns the offset in minutes **behind** UTC (positive for locations west of UTC and negative for east), this method returns the more intuitive sign format used in timezone representations (e.g., `+06:00` means 6 hours **ahead** of UTC).*
489
515
  *
490
516
  * @returns The timezone offset string in `±HH:mm` format maintaining the current timezone regardless of system having different one.
491
517
  */
@@ -509,7 +535,7 @@ export declare class Chronos {
509
535
  * @returns The UTC offset in minutes maintaining the current timezone regardless of system having different one.
510
536
  */
511
537
  getTimeZoneOffsetMinutes(): number;
512
- /** @instance Returns new `Chronos` instance in UTC */
538
+ /** @instance Returns new `Chronos` instance in UTC time */
513
539
  toUTC(): Chronos;
514
540
  /** @instance Returns new `Chronos` instance in local time */
515
541
  toLocal(): Chronos;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nhb-toolbox",
3
- "version": "4.26.0",
3
+ "version": "4.26.1",
4
4
  "description": "A versatile collection of smart, efficient, and reusable utility functions, classes and types for everyday development needs.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",