chronos-date 1.0.2 → 1.1.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.
Files changed (117) hide show
  1. package/dist/basic-DqKyujoj.mjs +382 -0
  2. package/dist/basic-DsQqC5nZ.cjs +466 -0
  3. package/dist/constants.cjs +43 -1
  4. package/dist/constants.d.cts +17 -1
  5. package/dist/constants.d.mts +17 -1
  6. package/dist/constants.mjs +21 -1
  7. package/dist/convert-DbgntRVW.cjs +49 -0
  8. package/dist/convert-mMaI4YP0.mjs +38 -0
  9. package/dist/greet-D07t2_e6.mjs +51 -0
  10. package/dist/greet-hjVsd2dt.cjs +56 -0
  11. package/dist/guards.cjs +140 -1
  12. package/dist/guards.d.cts +18 -2
  13. package/dist/guards.d.mts +18 -2
  14. package/dist/guards.mjs +131 -1
  15. package/dist/helpers-CQzi908i.cjs +278 -0
  16. package/dist/helpers-DEf4sevD.mjs +201 -0
  17. package/dist/index.cjs +1477 -1
  18. package/dist/index.d.cts +18 -2
  19. package/dist/index.d.mts +18 -2
  20. package/dist/index.mjs +1474 -1
  21. package/dist/non-primitives-D9zxCwX8.cjs +68 -0
  22. package/dist/non-primitives-DBtomDty.mjs +38 -0
  23. package/dist/plugins/banglaPlugin.cjs +137 -1
  24. package/dist/plugins/banglaPlugin.d.cts +19 -3
  25. package/dist/plugins/banglaPlugin.d.mts +19 -3
  26. package/dist/plugins/banglaPlugin.mjs +136 -1
  27. package/dist/plugins/businessPlugin.cjs +134 -1
  28. package/dist/plugins/businessPlugin.d.cts +17 -1
  29. package/dist/plugins/businessPlugin.d.mts +17 -1
  30. package/dist/plugins/businessPlugin.mjs +133 -1
  31. package/dist/plugins/dateRangePlugin.cjs +62 -1
  32. package/dist/plugins/dateRangePlugin.d.cts +19 -3
  33. package/dist/plugins/dateRangePlugin.d.mts +19 -3
  34. package/dist/plugins/dateRangePlugin.mjs +61 -1
  35. package/dist/plugins/dayPartPlugin.cjs +42 -1
  36. package/dist/plugins/dayPartPlugin.d.cts +17 -1
  37. package/dist/plugins/dayPartPlugin.d.mts +17 -1
  38. package/dist/plugins/dayPartPlugin.mjs +41 -1
  39. package/dist/plugins/durationPlugin.cjs +107 -1
  40. package/dist/plugins/durationPlugin.d.cts +17 -1
  41. package/dist/plugins/durationPlugin.d.mts +17 -1
  42. package/dist/plugins/durationPlugin.mjs +106 -1
  43. package/dist/plugins/fromNowPlugin.cjs +96 -1
  44. package/dist/plugins/fromNowPlugin.d.cts +17 -1
  45. package/dist/plugins/fromNowPlugin.d.mts +17 -1
  46. package/dist/plugins/fromNowPlugin.mjs +95 -1
  47. package/dist/plugins/greetingPlugin.cjs +35 -1
  48. package/dist/plugins/greetingPlugin.d.cts +17 -1
  49. package/dist/plugins/greetingPlugin.d.mts +17 -1
  50. package/dist/plugins/greetingPlugin.mjs +34 -1
  51. package/dist/plugins/palindromePlugin.cjs +38 -1
  52. package/dist/plugins/palindromePlugin.d.cts +17 -1
  53. package/dist/plugins/palindromePlugin.d.mts +17 -1
  54. package/dist/plugins/palindromePlugin.mjs +37 -1
  55. package/dist/plugins/relativeTimePlugin.cjs +90 -1
  56. package/dist/plugins/relativeTimePlugin.d.cts +17 -1
  57. package/dist/plugins/relativeTimePlugin.d.mts +17 -1
  58. package/dist/plugins/relativeTimePlugin.mjs +89 -1
  59. package/dist/plugins/roundPlugin.cjs +85 -1
  60. package/dist/plugins/roundPlugin.d.cts +17 -1
  61. package/dist/plugins/roundPlugin.d.mts +17 -1
  62. package/dist/plugins/roundPlugin.mjs +84 -1
  63. package/dist/plugins/seasonPlugin.cjs +47 -1
  64. package/dist/plugins/seasonPlugin.d.cts +17 -1
  65. package/dist/plugins/seasonPlugin.d.mts +17 -1
  66. package/dist/plugins/seasonPlugin.mjs +46 -1
  67. package/dist/plugins/timeZonePlugin.cjs +155 -1
  68. package/dist/plugins/timeZonePlugin.d.cts +17 -1
  69. package/dist/plugins/timeZonePlugin.d.mts +17 -1
  70. package/dist/plugins/timeZonePlugin.mjs +154 -1
  71. package/dist/plugins/zodiacPlugin.cjs +67 -1
  72. package/dist/plugins/zodiacPlugin.d.cts +17 -1
  73. package/dist/plugins/zodiacPlugin.d.mts +17 -1
  74. package/dist/plugins/zodiacPlugin.mjs +66 -1
  75. package/dist/primitives-CtuSNmV7.cjs +65 -0
  76. package/dist/primitives-dXzXlzJw.mjs +35 -0
  77. package/dist/seasons-B7kK88zq.cjs +434 -0
  78. package/dist/{seasons-CioTH5Dm.d.mts → seasons-B_kjFWIX.d.mts} +16 -0
  79. package/dist/{seasons-CsVeJ27s.d.cts → seasons-CpUn45n6.d.cts} +16 -0
  80. package/dist/seasons-Cq3ah3pV.mjs +368 -0
  81. package/dist/timezone-BNnHFgki.cjs +5625 -0
  82. package/dist/timezone-Db2CeL32.mjs +5589 -0
  83. package/dist/{types-B2fgrJ86.d.mts → types-Cb4gxrgJ.d.mts} +29 -15
  84. package/dist/{types-DPTQ_yLx.d.cts → types-CdmsXbU_.d.cts} +29 -15
  85. package/dist/types.cjs +16 -0
  86. package/dist/types.d.cts +18 -2
  87. package/dist/types.d.mts +18 -2
  88. package/dist/types.mjs +17 -1
  89. package/dist/utilities-BGX8dviZ.mjs +257 -0
  90. package/dist/utilities-BKtVo78T.mjs +59 -0
  91. package/dist/utilities-CpF3uys3.cjs +88 -0
  92. package/dist/utilities-D47SN9EZ.cjs +334 -0
  93. package/dist/utils.cjs +92 -1
  94. package/dist/utils.d.cts +20 -4
  95. package/dist/utils.d.mts +20 -4
  96. package/dist/utils.mjs +60 -1
  97. package/package.json +10 -4
  98. package/dist/basic-CKxaRSHQ.cjs +0 -1
  99. package/dist/basic-e46DaNAi.mjs +0 -1
  100. package/dist/convert-Bmp63ats.mjs +0 -1
  101. package/dist/convert-DrLrcgqz.cjs +0 -1
  102. package/dist/greet-BBsrvmkn.mjs +0 -1
  103. package/dist/greet-C-6mruI9.cjs +0 -1
  104. package/dist/helpers-DGzYnP81.cjs +0 -1
  105. package/dist/helpers-N1X_Rj_V.mjs +0 -1
  106. package/dist/non-primitives-B2EE6D6s.mjs +0 -1
  107. package/dist/non-primitives-Bu3a4WL4.cjs +0 -1
  108. package/dist/primitives-Cxss_JVF.mjs +0 -1
  109. package/dist/primitives-Db2FUp4e.cjs +0 -1
  110. package/dist/seasons-ChAIVphi.mjs +0 -1
  111. package/dist/seasons-oABOhHcX.cjs +0 -1
  112. package/dist/timezone-B10UItNO.mjs +0 -1
  113. package/dist/timezone-CWxbK_7I.cjs +0 -1
  114. package/dist/utilities-B8dOAQVD.cjs +0 -1
  115. package/dist/utilities-BJE06bms.mjs +0 -1
  116. package/dist/utilities-D2-p26DX.cjs +0 -1
  117. package/dist/utilities-DV_ohS37.mjs +0 -1
@@ -1,4 +1,20 @@
1
- import { A as MILLISECOND_FORMATS, B as ZODIAC_PRESETS, C as DATE_PARTS, D as INTERNALS, E as HOUR_FORMATS, F as TIME_FORMATS, I as TIME_UNIT_VARIANTS, M as MONTHS, N as MONTH_FORMATS, O as LOCALE_CALENDARS, P as SECOND_FORMATS, R as WESTERN_ZODIAC_SIGNS, S as DATE_FORMATS, T as DAY_FORMATS, _ as TIME_ZONE_LABELS, b as BN_MONTH_TABLES, g as TIME_ZONE_IDS, h as TIME_ZONES_NATIVE, j as MINUTE_FORMATS, k as LOCALE_NUMBERING_SYSTEMS, m as TIME_ZONES, u as SEASON_PRESETS, v as BN_DAYS, w as DAYS, x as BN_SEASONS, y as BN_MONTHS, z as YEAR_FORMATS } from "./seasons-CioTH5Dm.mjs";
1
+ /**
2
+ * Copyright 2026 - present Nazmul Hassan
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { A as MILLISECOND_FORMATS, B as ZODIAC_PRESETS, C as DATE_PARTS, D as INTERNALS, E as HOUR_FORMATS, F as TIME_FORMATS, I as TIME_UNIT_VARIANTS, M as MONTHS, N as MONTH_FORMATS, O as LOCALE_CALENDARS, P as SECOND_FORMATS, R as WESTERN_ZODIAC_SIGNS, S as DATE_FORMATS, T as DAY_FORMATS, _ as TIME_ZONE_LABELS, b as BN_MONTH_TABLES, g as TIME_ZONE_IDS, h as TIME_ZONES_NATIVE, j as MINUTE_FORMATS, k as LOCALE_NUMBERING_SYSTEMS, m as TIME_ZONES, u as SEASON_PRESETS, v as BN_DAYS, w as DAYS, x as BN_SEASONS, y as BN_MONTHS, z as YEAR_FORMATS } from "./seasons-B_kjFWIX.mjs";
2
18
 
3
19
  //#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/dts/utils/types.d.ts
4
20
  /**
@@ -698,7 +714,7 @@ declare class Chronos {
698
714
  /** @instance Returns a string representation of a date. */
699
715
  toString(): string;
700
716
  /** @instance Returns ISO time string in appropriate time zone with offset. */
701
- toLocalISOString(): ISOTimeString;
717
+ toLocalISOString(): ISODateTimeString<'local'>;
702
718
  /** @instance Returns a date as a string value in ISO format (UTC). */
703
719
  toISOString(): ISODateTimeString;
704
720
  /**
@@ -1107,8 +1123,8 @@ declare class Chronos {
1107
1123
  static tomorrow(): Chronos;
1108
1124
  /**
1109
1125
  * @static Returns the number of milliseconds elapsed since midnight, January 1, 1970 Universal Coordinated Time (UTC).
1110
- * * It basically calls {@link Date.now()}.
1111
1126
  * @returns The number of milliseconds elapsed since the Unix epoch.
1127
+ * @remarks It internally uses {@link Date.now()}.
1112
1128
  */
1113
1129
  static now(): number;
1114
1130
  /**
@@ -1218,12 +1234,12 @@ declare class Chronos {
1218
1234
  * - A year is a leap year if it is divisible by 4, but not divisible by 100, unless it is also divisible by 400.
1219
1235
  * - For example, 2000 and 2400 are leap years, but 1900 and 2100 are not.
1220
1236
  *
1221
- * @description
1222
- * This method accepts different types of date inputs and extracts the year to check if it's a leap year.
1223
- * If the provided date is a `number`, it will be treated as a year (must be a valid year from 0 to 9999).
1224
- * If the year is out of this range (negative or larger than 9999), it will be treated as a Unix timestamp.
1225
- * If the provided date is a string or a `Date` object, it will be parsed and the year will be extracted.
1226
- * If a `Chronos` instance is passed, the year will be directly accessed from the instance.
1237
+ * @remarks
1238
+ * - This method accepts different types of date inputs and extracts the year to check if it's a leap year.
1239
+ * - If the provided date is a `number`, it will be treated as a year (must be a valid year from 0 to 9999).
1240
+ * - If the year is out of this range (negative or larger than 9999), it will be treated as a Unix timestamp.
1241
+ * - If the provided date is a string or a `Date` object, it will be parsed and the year will be extracted.
1242
+ * - If a `Chronos` instance is passed, the year will be directly accessed from the instance.
1227
1243
  *
1228
1244
  * @param date - A `number` (year or Unix timestamp), `string`, `Date`, or `Chronos` instance representing a date.
1229
1245
  * @returns `true` if the year is a leap year, `false` otherwise.
@@ -1717,15 +1733,13 @@ type UTCOffset = `UTC${$UTCOffset}`;
1717
1733
  /** GMT offset in `GMT±HH:mm` or simply `GMT` format */
1718
1734
  type $GMTOffset = `GMT${$UTCOffset}` | 'GMT';
1719
1735
  type $ISOTimeString = `${number}-${number}-${number}T${number}:${number}:${number}.${number}`;
1720
- type ISODateTimeString = `${$ISOTimeString}Z`;
1721
- /** ISO timestamp string type in ISO 8601 format */
1722
- type ISOTimeString = `${$ISOTimeString}${'Z' | $UTCOffset}`;
1736
+ type ISODateTimeString<F extends ISODateFormat = 'utc'> = F extends 'utc' ? `${$ISOTimeString}Z` : `${$ISOTimeString}${$UTCOffset}`;
1723
1737
  /** Valid argument type accepted by `Date` constructor */
1724
1738
  type DateArgs = string | number | Date;
1725
1739
  /** Type for ISO date format options */
1726
1740
  type ISODateFormat = 'local' | 'utc';
1727
1741
  /** Options for `getTimestamp` utility */
1728
- interface TimestampOptions {
1742
+ interface TimestampOptions<F extends ISODateFormat = 'utc'> {
1729
1743
  /**
1730
1744
  * Optional date input (string, number, or `Date` object).
1731
1745
  * Defaults to {@link Date new Date()}.
@@ -1736,7 +1750,7 @@ interface TimestampOptions {
1736
1750
  * - `'utc'` (default) → returns ISO string in UTC (`...Z`).
1737
1751
  * - `'local'` → returns ISO string with current system offset (`...+05:30`).
1738
1752
  */
1739
- format?: ISODateFormat;
1753
+ format?: F | ISODateFormat;
1740
1754
  }
1741
1755
  /** `Chronos` Date Format options */
1742
1756
  interface FormatOptions {
@@ -2120,4 +2134,4 @@ interface DurationOptions {
2120
2134
  showZero?: boolean;
2121
2135
  }
2122
2136
  //#endregion
2123
- export { ChronosStaticKey as $, BanglaDateOptions as $t, ChronosObject as A, TimeZoneDetails as At, WithoutOrigin as B, ChronosStatics as Bt, $Chronos as C, Numeric as Cn, NumberingSystem as Ct, ChronosInput as D, RangeTuple as Dn, TimeUnitValue as Dt, $StaticMethods as E, LooseLiteral as En, TimeUnit as Et, PluginMethods as F, TimeZoneNameNative as Ft, $NativeTzNameOrId as G, $BanglaYear as Gt, $GMTOffset as H, chronos as Ht, RangeWithDates as I, TimestampOptions as It, $TimeUnitVar as J, $BnMonthPadded as Jt, $TZLabelKey as K, $BnDatePadded as Kt, RelativeDateRange as L, UTCMinute as Lt, ChronosWithOptions as M, TimeZoneIdNative as Mt, DateRangeOptions as N, TimeZoneIdentifier as Nt, ChronosInternals as O, TimeWithUnit as Ot, DatesInRangeOptions as P, TimeZoneName as Pt, $UnitAnyCase as Q, BanglaDateObject as Qt, RelativeRangeOptions as R, UTCOffset as Rt, ZodiacSign as S, Maybe as Sn, NegativeUTCHour as St, $PluginMethods as T, NumberRange as Tn, Quarter as Tt, $ISOTimeString as U, $BanglaMonth as Ut, $DateUnit as V, Chronos as Vt, $LocalArguments as W, $BanglaMonthDate as Wt, $TimeZoneIdentifier as X, BanglaDate as Xt, $TimeUnitVarMap as Y, $BnYearPadded as Yt, $UTCOffset as Z, BanglaDateFormat as Zt, ZodiacArray as _, StrictFormat as _n, LocalesArguments as _t, BusinessOptionsWeekends as a, BnCalendarConfig as an, DateFormatOptions as at, ZodiacOptions as b, TimeToken as bn, MonthName as bt, DayPart as c, DateFormatToken as cn, DateTimeFormatOptions as ct, DurationOptions as d, FormatToken as dn, GreetingConfigs as dt, BanglaDayName as en, ClockHour as et, MonthBoundary as f, HourToken as fn, HourMinutes as ft, TimeDuration as g, SecondToken as gn, LocaleCalendar as gt, SeasonPreset as h, MonthToken as hn, ISOTimeString as ht, BusinessOptionsBasic as i, BanglaYear as in, DateArgs as it, ChronosProperties as j, TimeZoneId as jt, ChronosMethods as k, TimeZone as kt, DayPartConfig as l, DateToken as ln, FormatOptions as lt, SeasonOptions as m, MinuteToken as mn, ISODateTimeString as mt, $BusinessHourOptions as n, BanglaMonthName as nn, ClockSecond as nt, ChronosPlugin as o, BnCalendarVariant as on, DateLike as ot, SeasonDefinition as p, MSToken as pn, ISODateFormat as pt, $TimeUnitKey as q, $BnEn as qt, AcademicYear as r, BanglaSeasonName as rn, ClockTime as rt, DateBoundary as s, DateWithSeasonToken as sn, DateString as st, $BusinessHourBaseOptions as t, BanglaMonth as tn, ClockMinute as tt, DurationKey as u, DayToken as un, FromNowUnit as ut, ZodiacMeta as v, TimeFormatToken as vn, Milliseconds as vt, $InstanceMethods as w, Enumerate as wn, PositiveUTCHour as wt, ZodiacPreset as x, YearToken as xn, MonthString as xt, ZodiacMetaOptions as y, TimeOnlyFormat as yn, MonthDateString as yt, WeekdayOptions as z, WeekDay as zt };
2137
+ export { ChronosStaticKey as $, BanglaDayName as $t, ChronosObject as A, TimeZoneId as At, WithoutOrigin as B, Chronos as Bt, $Chronos as C, Enumerate as Cn, PositiveUTCHour as Ct, ChronosInput as D, TimeWithUnit as Dt, $StaticMethods as E, RangeTuple as En, TimeUnitValue as Et, PluginMethods as F, TimestampOptions as Ft, $NativeTzNameOrId as G, $BnDatePadded as Gt, $GMTOffset as H, $BanglaMonth as Ht, RangeWithDates as I, UTCMinute as It, $TimeUnitVar as J, $BnYearPadded as Jt, $TZLabelKey as K, $BnEn as Kt, RelativeDateRange as L, UTCOffset as Lt, ChronosWithOptions as M, TimeZoneIdentifier as Mt, DateRangeOptions as N, TimeZoneName as Nt, ChronosInternals as O, TimeZone as Ot, DatesInRangeOptions as P, TimeZoneNameNative as Pt, $UnitAnyCase as Q, BanglaDateOptions as Qt, RelativeRangeOptions as R, WeekDay as Rt, ZodiacSign as S, Numeric as Sn, NumberingSystem as St, $PluginMethods as T, LooseLiteral as Tn, TimeUnit as Tt, $ISOTimeString as U, $BanglaMonthDate as Ut, $DateUnit as V, chronos as Vt, $LocalArguments as W, $BanglaYear as Wt, $TimeZoneIdentifier as X, BanglaDateFormat as Xt, $TimeUnitVarMap as Y, BanglaDate as Yt, $UTCOffset as Z, BanglaDateObject as Zt, ZodiacArray as _, TimeFormatToken as _n, Milliseconds as _t, BusinessOptionsWeekends as a, BnCalendarVariant as an, DateFormatOptions as at, ZodiacOptions as b, YearToken as bn, MonthString as bt, DayPart as c, DateToken as cn, DateTimeFormatOptions as ct, DurationOptions as d, HourToken as dn, GreetingConfigs as dt, BanglaMonth as en, ClockHour as et, MonthBoundary as f, MSToken as fn, HourMinutes as ft, TimeDuration as g, StrictFormat as gn, LocalesArguments as gt, SeasonPreset as h, SecondToken as hn, LocaleCalendar as ht, BusinessOptionsBasic as i, BnCalendarConfig as in, DateArgs as it, ChronosProperties as j, TimeZoneIdNative as jt, ChronosMethods as k, TimeZoneDetails as kt, DayPartConfig as l, DayToken as ln, FormatOptions as lt, SeasonOptions as m, MonthToken as mn, ISODateTimeString as mt, $BusinessHourOptions as n, BanglaSeasonName as nn, ClockSecond as nt, ChronosPlugin as o, DateWithSeasonToken as on, DateLike as ot, SeasonDefinition as p, MinuteToken as pn, ISODateFormat as pt, $TimeUnitKey as q, $BnMonthPadded as qt, AcademicYear as r, BanglaYear as rn, ClockTime as rt, DateBoundary as s, DateFormatToken as sn, DateString as st, $BusinessHourBaseOptions as t, BanglaMonthName as tn, ClockMinute as tt, DurationKey as u, FormatToken as un, FromNowUnit as ut, ZodiacMeta as v, TimeOnlyFormat as vn, MonthDateString as vt, $InstanceMethods as w, NumberRange as wn, Quarter as wt, ZodiacPreset as x, Maybe as xn, NegativeUTCHour as xt, ZodiacMetaOptions as y, TimeToken as yn, MonthName as yt, WeekdayOptions as z, ChronosStatics as zt };
@@ -1,4 +1,20 @@
1
- import { A as MILLISECOND_FORMATS, B as ZODIAC_PRESETS, C as DATE_PARTS, D as INTERNALS, E as HOUR_FORMATS, F as TIME_FORMATS, I as TIME_UNIT_VARIANTS, M as MONTHS, N as MONTH_FORMATS, O as LOCALE_CALENDARS, P as SECOND_FORMATS, R as WESTERN_ZODIAC_SIGNS, S as DATE_FORMATS, T as DAY_FORMATS, _ as TIME_ZONE_LABELS, b as BN_MONTH_TABLES, g as TIME_ZONE_IDS, h as TIME_ZONES_NATIVE, j as MINUTE_FORMATS, k as LOCALE_NUMBERING_SYSTEMS, m as TIME_ZONES, u as SEASON_PRESETS, v as BN_DAYS, w as DAYS, x as BN_SEASONS, y as BN_MONTHS, z as YEAR_FORMATS } from "./seasons-CsVeJ27s.cjs";
1
+ /**
2
+ * Copyright 2026 - present Nazmul Hassan
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { A as MILLISECOND_FORMATS, B as ZODIAC_PRESETS, C as DATE_PARTS, D as INTERNALS, E as HOUR_FORMATS, F as TIME_FORMATS, I as TIME_UNIT_VARIANTS, M as MONTHS, N as MONTH_FORMATS, O as LOCALE_CALENDARS, P as SECOND_FORMATS, R as WESTERN_ZODIAC_SIGNS, S as DATE_FORMATS, T as DAY_FORMATS, _ as TIME_ZONE_LABELS, b as BN_MONTH_TABLES, g as TIME_ZONE_IDS, h as TIME_ZONES_NATIVE, j as MINUTE_FORMATS, k as LOCALE_NUMBERING_SYSTEMS, m as TIME_ZONES, u as SEASON_PRESETS, v as BN_DAYS, w as DAYS, x as BN_SEASONS, y as BN_MONTHS, z as YEAR_FORMATS } from "./seasons-CpUn45n6.cjs";
2
18
 
3
19
  //#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/dts/utils/types.d.ts
4
20
  /**
@@ -698,7 +714,7 @@ declare class Chronos {
698
714
  /** @instance Returns a string representation of a date. */
699
715
  toString(): string;
700
716
  /** @instance Returns ISO time string in appropriate time zone with offset. */
701
- toLocalISOString(): ISOTimeString;
717
+ toLocalISOString(): ISODateTimeString<'local'>;
702
718
  /** @instance Returns a date as a string value in ISO format (UTC). */
703
719
  toISOString(): ISODateTimeString;
704
720
  /**
@@ -1107,8 +1123,8 @@ declare class Chronos {
1107
1123
  static tomorrow(): Chronos;
1108
1124
  /**
1109
1125
  * @static Returns the number of milliseconds elapsed since midnight, January 1, 1970 Universal Coordinated Time (UTC).
1110
- * * It basically calls {@link Date.now()}.
1111
1126
  * @returns The number of milliseconds elapsed since the Unix epoch.
1127
+ * @remarks It internally uses {@link Date.now()}.
1112
1128
  */
1113
1129
  static now(): number;
1114
1130
  /**
@@ -1218,12 +1234,12 @@ declare class Chronos {
1218
1234
  * - A year is a leap year if it is divisible by 4, but not divisible by 100, unless it is also divisible by 400.
1219
1235
  * - For example, 2000 and 2400 are leap years, but 1900 and 2100 are not.
1220
1236
  *
1221
- * @description
1222
- * This method accepts different types of date inputs and extracts the year to check if it's a leap year.
1223
- * If the provided date is a `number`, it will be treated as a year (must be a valid year from 0 to 9999).
1224
- * If the year is out of this range (negative or larger than 9999), it will be treated as a Unix timestamp.
1225
- * If the provided date is a string or a `Date` object, it will be parsed and the year will be extracted.
1226
- * If a `Chronos` instance is passed, the year will be directly accessed from the instance.
1237
+ * @remarks
1238
+ * - This method accepts different types of date inputs and extracts the year to check if it's a leap year.
1239
+ * - If the provided date is a `number`, it will be treated as a year (must be a valid year from 0 to 9999).
1240
+ * - If the year is out of this range (negative or larger than 9999), it will be treated as a Unix timestamp.
1241
+ * - If the provided date is a string or a `Date` object, it will be parsed and the year will be extracted.
1242
+ * - If a `Chronos` instance is passed, the year will be directly accessed from the instance.
1227
1243
  *
1228
1244
  * @param date - A `number` (year or Unix timestamp), `string`, `Date`, or `Chronos` instance representing a date.
1229
1245
  * @returns `true` if the year is a leap year, `false` otherwise.
@@ -1717,15 +1733,13 @@ type UTCOffset = `UTC${$UTCOffset}`;
1717
1733
  /** GMT offset in `GMT±HH:mm` or simply `GMT` format */
1718
1734
  type $GMTOffset = `GMT${$UTCOffset}` | 'GMT';
1719
1735
  type $ISOTimeString = `${number}-${number}-${number}T${number}:${number}:${number}.${number}`;
1720
- type ISODateTimeString = `${$ISOTimeString}Z`;
1721
- /** ISO timestamp string type in ISO 8601 format */
1722
- type ISOTimeString = `${$ISOTimeString}${'Z' | $UTCOffset}`;
1736
+ type ISODateTimeString<F extends ISODateFormat = 'utc'> = F extends 'utc' ? `${$ISOTimeString}Z` : `${$ISOTimeString}${$UTCOffset}`;
1723
1737
  /** Valid argument type accepted by `Date` constructor */
1724
1738
  type DateArgs = string | number | Date;
1725
1739
  /** Type for ISO date format options */
1726
1740
  type ISODateFormat = 'local' | 'utc';
1727
1741
  /** Options for `getTimestamp` utility */
1728
- interface TimestampOptions {
1742
+ interface TimestampOptions<F extends ISODateFormat = 'utc'> {
1729
1743
  /**
1730
1744
  * Optional date input (string, number, or `Date` object).
1731
1745
  * Defaults to {@link Date new Date()}.
@@ -1736,7 +1750,7 @@ interface TimestampOptions {
1736
1750
  * - `'utc'` (default) → returns ISO string in UTC (`...Z`).
1737
1751
  * - `'local'` → returns ISO string with current system offset (`...+05:30`).
1738
1752
  */
1739
- format?: ISODateFormat;
1753
+ format?: F | ISODateFormat;
1740
1754
  }
1741
1755
  /** `Chronos` Date Format options */
1742
1756
  interface FormatOptions {
@@ -2120,4 +2134,4 @@ interface DurationOptions {
2120
2134
  showZero?: boolean;
2121
2135
  }
2122
2136
  //#endregion
2123
- export { ChronosStaticKey as $, BanglaDateOptions as $t, ChronosObject as A, TimeZoneDetails as At, WithoutOrigin as B, ChronosStatics as Bt, $Chronos as C, Numeric as Cn, NumberingSystem as Ct, ChronosInput as D, RangeTuple as Dn, TimeUnitValue as Dt, $StaticMethods as E, LooseLiteral as En, TimeUnit as Et, PluginMethods as F, TimeZoneNameNative as Ft, $NativeTzNameOrId as G, $BanglaYear as Gt, $GMTOffset as H, chronos as Ht, RangeWithDates as I, TimestampOptions as It, $TimeUnitVar as J, $BnMonthPadded as Jt, $TZLabelKey as K, $BnDatePadded as Kt, RelativeDateRange as L, UTCMinute as Lt, ChronosWithOptions as M, TimeZoneIdNative as Mt, DateRangeOptions as N, TimeZoneIdentifier as Nt, ChronosInternals as O, TimeWithUnit as Ot, DatesInRangeOptions as P, TimeZoneName as Pt, $UnitAnyCase as Q, BanglaDateObject as Qt, RelativeRangeOptions as R, UTCOffset as Rt, ZodiacSign as S, Maybe as Sn, NegativeUTCHour as St, $PluginMethods as T, NumberRange as Tn, Quarter as Tt, $ISOTimeString as U, $BanglaMonth as Ut, $DateUnit as V, Chronos as Vt, $LocalArguments as W, $BanglaMonthDate as Wt, $TimeZoneIdentifier as X, BanglaDate as Xt, $TimeUnitVarMap as Y, $BnYearPadded as Yt, $UTCOffset as Z, BanglaDateFormat as Zt, ZodiacArray as _, StrictFormat as _n, LocalesArguments as _t, BusinessOptionsWeekends as a, BnCalendarConfig as an, DateFormatOptions as at, ZodiacOptions as b, TimeToken as bn, MonthName as bt, DayPart as c, DateFormatToken as cn, DateTimeFormatOptions as ct, DurationOptions as d, FormatToken as dn, GreetingConfigs as dt, BanglaDayName as en, ClockHour as et, MonthBoundary as f, HourToken as fn, HourMinutes as ft, TimeDuration as g, SecondToken as gn, LocaleCalendar as gt, SeasonPreset as h, MonthToken as hn, ISOTimeString as ht, BusinessOptionsBasic as i, BanglaYear as in, DateArgs as it, ChronosProperties as j, TimeZoneId as jt, ChronosMethods as k, TimeZone as kt, DayPartConfig as l, DateToken as ln, FormatOptions as lt, SeasonOptions as m, MinuteToken as mn, ISODateTimeString as mt, $BusinessHourOptions as n, BanglaMonthName as nn, ClockSecond as nt, ChronosPlugin as o, BnCalendarVariant as on, DateLike as ot, SeasonDefinition as p, MSToken as pn, ISODateFormat as pt, $TimeUnitKey as q, $BnEn as qt, AcademicYear as r, BanglaSeasonName as rn, ClockTime as rt, DateBoundary as s, DateWithSeasonToken as sn, DateString as st, $BusinessHourBaseOptions as t, BanglaMonth as tn, ClockMinute as tt, DurationKey as u, DayToken as un, FromNowUnit as ut, ZodiacMeta as v, TimeFormatToken as vn, Milliseconds as vt, $InstanceMethods as w, Enumerate as wn, PositiveUTCHour as wt, ZodiacPreset as x, YearToken as xn, MonthString as xt, ZodiacMetaOptions as y, TimeOnlyFormat as yn, MonthDateString as yt, WeekdayOptions as z, WeekDay as zt };
2137
+ export { ChronosStaticKey as $, BanglaDayName as $t, ChronosObject as A, TimeZoneId as At, WithoutOrigin as B, Chronos as Bt, $Chronos as C, Enumerate as Cn, PositiveUTCHour as Ct, ChronosInput as D, TimeWithUnit as Dt, $StaticMethods as E, RangeTuple as En, TimeUnitValue as Et, PluginMethods as F, TimestampOptions as Ft, $NativeTzNameOrId as G, $BnDatePadded as Gt, $GMTOffset as H, $BanglaMonth as Ht, RangeWithDates as I, UTCMinute as It, $TimeUnitVar as J, $BnYearPadded as Jt, $TZLabelKey as K, $BnEn as Kt, RelativeDateRange as L, UTCOffset as Lt, ChronosWithOptions as M, TimeZoneIdentifier as Mt, DateRangeOptions as N, TimeZoneName as Nt, ChronosInternals as O, TimeZone as Ot, DatesInRangeOptions as P, TimeZoneNameNative as Pt, $UnitAnyCase as Q, BanglaDateOptions as Qt, RelativeRangeOptions as R, WeekDay as Rt, ZodiacSign as S, Numeric as Sn, NumberingSystem as St, $PluginMethods as T, LooseLiteral as Tn, TimeUnit as Tt, $ISOTimeString as U, $BanglaMonthDate as Ut, $DateUnit as V, chronos as Vt, $LocalArguments as W, $BanglaYear as Wt, $TimeZoneIdentifier as X, BanglaDateFormat as Xt, $TimeUnitVarMap as Y, BanglaDate as Yt, $UTCOffset as Z, BanglaDateObject as Zt, ZodiacArray as _, TimeFormatToken as _n, Milliseconds as _t, BusinessOptionsWeekends as a, BnCalendarVariant as an, DateFormatOptions as at, ZodiacOptions as b, YearToken as bn, MonthString as bt, DayPart as c, DateToken as cn, DateTimeFormatOptions as ct, DurationOptions as d, HourToken as dn, GreetingConfigs as dt, BanglaMonth as en, ClockHour as et, MonthBoundary as f, MSToken as fn, HourMinutes as ft, TimeDuration as g, StrictFormat as gn, LocalesArguments as gt, SeasonPreset as h, SecondToken as hn, LocaleCalendar as ht, BusinessOptionsBasic as i, BnCalendarConfig as in, DateArgs as it, ChronosProperties as j, TimeZoneIdNative as jt, ChronosMethods as k, TimeZoneDetails as kt, DayPartConfig as l, DayToken as ln, FormatOptions as lt, SeasonOptions as m, MonthToken as mn, ISODateTimeString as mt, $BusinessHourOptions as n, BanglaSeasonName as nn, ClockSecond as nt, ChronosPlugin as o, DateWithSeasonToken as on, DateLike as ot, SeasonDefinition as p, MinuteToken as pn, ISODateFormat as pt, $TimeUnitKey as q, $BnMonthPadded as qt, AcademicYear as r, BanglaYear as rn, ClockTime as rt, DateBoundary as s, DateFormatToken as sn, DateString as st, $BusinessHourBaseOptions as t, BanglaMonthName as tn, ClockMinute as tt, DurationKey as u, FormatToken as un, FromNowUnit as ut, ZodiacMeta as v, TimeOnlyFormat as vn, MonthDateString as vt, $InstanceMethods as w, NumberRange as wn, Quarter as wt, ZodiacPreset as x, Maybe as xn, NegativeUTCHour as xt, ZodiacMetaOptions as y, TimeToken as yn, MonthName as yt, WeekdayOptions as z, ChronosStatics as zt };
package/dist/types.cjs CHANGED
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2026 - present Nazmul Hassan
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
package/dist/types.d.cts CHANGED
@@ -1,2 +1,18 @@
1
- import { $ as ChronosStaticKey, $t as BanglaDateOptions, A as ChronosObject, At as TimeZoneDetails, B as WithoutOrigin, Bt as ChronosStatics, C as $Chronos, Ct as NumberingSystem, D as ChronosInput, Dt as TimeUnitValue, E as $StaticMethods, Et as TimeUnit, F as PluginMethods, Ft as TimeZoneNameNative, G as $NativeTzNameOrId, Gt as $BanglaYear, H as $GMTOffset, I as RangeWithDates, It as TimestampOptions, J as $TimeUnitVar, Jt as $BnMonthPadded, K as $TZLabelKey, Kt as $BnDatePadded, L as RelativeDateRange, Lt as UTCMinute, M as ChronosWithOptions, Mt as TimeZoneIdNative, N as DateRangeOptions, Nt as TimeZoneIdentifier, O as ChronosInternals, Ot as TimeWithUnit, P as DatesInRangeOptions, Pt as TimeZoneName, Q as $UnitAnyCase, Qt as BanglaDateObject, R as RelativeRangeOptions, Rt as UTCOffset, S as ZodiacSign, St as NegativeUTCHour, T as $PluginMethods, Tt as Quarter, U as $ISOTimeString, Ut as $BanglaMonth, V as $DateUnit, W as $LocalArguments, Wt as $BanglaMonthDate, X as $TimeZoneIdentifier, Xt as BanglaDate, Y as $TimeUnitVarMap, Yt as $BnYearPadded, Z as $UTCOffset, Zt as BanglaDateFormat, _ as ZodiacArray, _n as StrictFormat, _t as LocalesArguments, a as BusinessOptionsWeekends, an as BnCalendarConfig, at as DateFormatOptions, b as ZodiacOptions, bn as TimeToken, bt as MonthName, c as DayPart, cn as DateFormatToken, ct as DateTimeFormatOptions, d as DurationOptions, dn as FormatToken, dt as GreetingConfigs, en as BanglaDayName, et as ClockHour, f as MonthBoundary, fn as HourToken, ft as HourMinutes, g as TimeDuration, gn as SecondToken, gt as LocaleCalendar, h as SeasonPreset, hn as MonthToken, ht as ISOTimeString, i as BusinessOptionsBasic, in as BanglaYear, it as DateArgs, j as ChronosProperties, jt as TimeZoneId, k as ChronosMethods, kt as TimeZone, l as DayPartConfig, ln as DateToken, lt as FormatOptions, m as SeasonOptions, mn as MinuteToken, mt as ISODateTimeString, n as $BusinessHourOptions, nn as BanglaMonthName, nt as ClockSecond, o as ChronosPlugin, on as BnCalendarVariant, ot as DateLike, p as SeasonDefinition, pn as MSToken, pt as ISODateFormat, q as $TimeUnitKey, qt as $BnEn, r as AcademicYear, rn as BanglaSeasonName, rt as ClockTime, s as DateBoundary, sn as DateWithSeasonToken, st as DateString, t as $BusinessHourBaseOptions, tn as BanglaMonth, tt as ClockMinute, u as DurationKey, un as DayToken, ut as FromNowUnit, v as ZodiacMeta, vn as TimeFormatToken, vt as Milliseconds, w as $InstanceMethods, wt as PositiveUTCHour, x as ZodiacPreset, xn as YearToken, xt as MonthString, y as ZodiacMetaOptions, yn as TimeOnlyFormat, yt as MonthDateString, z as WeekdayOptions, zt as WeekDay } from "./types-DPTQ_yLx.cjs";
2
- export { $BanglaMonth, $BanglaMonthDate, $BanglaYear, $BnDatePadded, $BnEn, $BnMonthPadded, $BnYearPadded, $BusinessHourBaseOptions, $BusinessHourOptions, $Chronos, $DateUnit, $GMTOffset, $ISOTimeString, $InstanceMethods, $LocalArguments, $NativeTzNameOrId, $PluginMethods, $StaticMethods, $TZLabelKey, $TimeUnitKey, $TimeUnitVar, $TimeUnitVarMap, $TimeZoneIdentifier, $UTCOffset, $UnitAnyCase, AcademicYear, BanglaDate, BanglaDateFormat, BanglaDateObject, BanglaDateOptions, BanglaDayName, BanglaMonth, BanglaMonthName, BanglaSeasonName, BanglaYear, BnCalendarConfig, BnCalendarVariant, BusinessOptionsBasic, BusinessOptionsWeekends, ChronosInput, ChronosInternals, ChronosMethods, ChronosObject, ChronosPlugin, ChronosProperties, ChronosStaticKey, ChronosStatics, ChronosWithOptions, ClockHour, ClockMinute, ClockSecond, ClockTime, DateArgs, DateBoundary, DateFormatOptions, DateFormatToken, DateLike, DateRangeOptions, DateString, DateTimeFormatOptions, DateToken, DateWithSeasonToken, DatesInRangeOptions, DayPart, DayPartConfig, DayToken, DurationKey, DurationOptions, FormatOptions, FormatToken, FromNowUnit, GreetingConfigs, HourMinutes, HourToken, ISODateFormat, ISODateTimeString, ISOTimeString, LocaleCalendar, LocalesArguments, MSToken, Milliseconds, MinuteToken, MonthBoundary, MonthDateString, MonthName, MonthString, MonthToken, NegativeUTCHour, NumberingSystem, PluginMethods, PositiveUTCHour, Quarter, RangeWithDates, RelativeDateRange, RelativeRangeOptions, SeasonDefinition, SeasonOptions, SeasonPreset, SecondToken, StrictFormat, TimeDuration, TimeFormatToken, TimeOnlyFormat, TimeToken, TimeUnit, TimeUnitValue, TimeWithUnit, TimeZone, TimeZoneDetails, TimeZoneId, TimeZoneIdNative, TimeZoneIdentifier, TimeZoneName, TimeZoneNameNative, TimestampOptions, UTCMinute, UTCOffset, WeekDay, WeekdayOptions, WithoutOrigin, YearToken, ZodiacArray, ZodiacMeta, ZodiacMetaOptions, ZodiacOptions, ZodiacPreset, ZodiacSign };
1
+ /**
2
+ * Copyright 2026 - present Nazmul Hassan
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { $ as ChronosStaticKey, $t as BanglaDayName, A as ChronosObject, At as TimeZoneId, B as WithoutOrigin, C as $Chronos, Ct as PositiveUTCHour, D as ChronosInput, Dt as TimeWithUnit, E as $StaticMethods, Et as TimeUnitValue, F as PluginMethods, Ft as TimestampOptions, G as $NativeTzNameOrId, Gt as $BnDatePadded, H as $GMTOffset, Ht as $BanglaMonth, I as RangeWithDates, It as UTCMinute, J as $TimeUnitVar, Jt as $BnYearPadded, K as $TZLabelKey, Kt as $BnEn, L as RelativeDateRange, Lt as UTCOffset, M as ChronosWithOptions, Mt as TimeZoneIdentifier, N as DateRangeOptions, Nt as TimeZoneName, O as ChronosInternals, Ot as TimeZone, P as DatesInRangeOptions, Pt as TimeZoneNameNative, Q as $UnitAnyCase, Qt as BanglaDateOptions, R as RelativeRangeOptions, Rt as WeekDay, S as ZodiacSign, St as NumberingSystem, T as $PluginMethods, Tt as TimeUnit, U as $ISOTimeString, Ut as $BanglaMonthDate, V as $DateUnit, W as $LocalArguments, Wt as $BanglaYear, X as $TimeZoneIdentifier, Xt as BanglaDateFormat, Y as $TimeUnitVarMap, Yt as BanglaDate, Z as $UTCOffset, Zt as BanglaDateObject, _ as ZodiacArray, _n as TimeFormatToken, _t as Milliseconds, a as BusinessOptionsWeekends, an as BnCalendarVariant, at as DateFormatOptions, b as ZodiacOptions, bn as YearToken, bt as MonthString, c as DayPart, cn as DateToken, ct as DateTimeFormatOptions, d as DurationOptions, dn as HourToken, dt as GreetingConfigs, en as BanglaMonth, et as ClockHour, f as MonthBoundary, fn as MSToken, ft as HourMinutes, g as TimeDuration, gn as StrictFormat, gt as LocalesArguments, h as SeasonPreset, hn as SecondToken, ht as LocaleCalendar, i as BusinessOptionsBasic, in as BnCalendarConfig, it as DateArgs, j as ChronosProperties, jt as TimeZoneIdNative, k as ChronosMethods, kt as TimeZoneDetails, l as DayPartConfig, ln as DayToken, lt as FormatOptions, m as SeasonOptions, mn as MonthToken, mt as ISODateTimeString, n as $BusinessHourOptions, nn as BanglaSeasonName, nt as ClockSecond, o as ChronosPlugin, on as DateWithSeasonToken, ot as DateLike, p as SeasonDefinition, pn as MinuteToken, pt as ISODateFormat, q as $TimeUnitKey, qt as $BnMonthPadded, r as AcademicYear, rn as BanglaYear, rt as ClockTime, s as DateBoundary, sn as DateFormatToken, st as DateString, t as $BusinessHourBaseOptions, tn as BanglaMonthName, tt as ClockMinute, u as DurationKey, un as FormatToken, ut as FromNowUnit, v as ZodiacMeta, vn as TimeOnlyFormat, vt as MonthDateString, w as $InstanceMethods, wt as Quarter, x as ZodiacPreset, xt as NegativeUTCHour, y as ZodiacMetaOptions, yn as TimeToken, yt as MonthName, z as WeekdayOptions, zt as ChronosStatics } from "./types-CdmsXbU_.cjs";
18
+ export { $BanglaMonth, $BanglaMonthDate, $BanglaYear, $BnDatePadded, $BnEn, $BnMonthPadded, $BnYearPadded, $BusinessHourBaseOptions, $BusinessHourOptions, $Chronos, $DateUnit, $GMTOffset, $ISOTimeString, $InstanceMethods, $LocalArguments, $NativeTzNameOrId, $PluginMethods, $StaticMethods, $TZLabelKey, $TimeUnitKey, $TimeUnitVar, $TimeUnitVarMap, $TimeZoneIdentifier, $UTCOffset, $UnitAnyCase, AcademicYear, BanglaDate, BanglaDateFormat, BanglaDateObject, BanglaDateOptions, BanglaDayName, BanglaMonth, BanglaMonthName, BanglaSeasonName, BanglaYear, BnCalendarConfig, BnCalendarVariant, BusinessOptionsBasic, BusinessOptionsWeekends, ChronosInput, ChronosInternals, ChronosMethods, ChronosObject, ChronosPlugin, ChronosProperties, ChronosStaticKey, ChronosStatics, ChronosWithOptions, ClockHour, ClockMinute, ClockSecond, ClockTime, DateArgs, DateBoundary, DateFormatOptions, DateFormatToken, DateLike, DateRangeOptions, DateString, DateTimeFormatOptions, DateToken, DateWithSeasonToken, DatesInRangeOptions, DayPart, DayPartConfig, DayToken, DurationKey, DurationOptions, FormatOptions, FormatToken, FromNowUnit, GreetingConfigs, HourMinutes, HourToken, ISODateFormat, ISODateTimeString, LocaleCalendar, LocalesArguments, MSToken, Milliseconds, MinuteToken, MonthBoundary, MonthDateString, MonthName, MonthString, MonthToken, NegativeUTCHour, NumberingSystem, PluginMethods, PositiveUTCHour, Quarter, RangeWithDates, RelativeDateRange, RelativeRangeOptions, SeasonDefinition, SeasonOptions, SeasonPreset, SecondToken, StrictFormat, TimeDuration, TimeFormatToken, TimeOnlyFormat, TimeToken, TimeUnit, TimeUnitValue, TimeWithUnit, TimeZone, TimeZoneDetails, TimeZoneId, TimeZoneIdNative, TimeZoneIdentifier, TimeZoneName, TimeZoneNameNative, TimestampOptions, UTCMinute, UTCOffset, WeekDay, WeekdayOptions, WithoutOrigin, YearToken, ZodiacArray, ZodiacMeta, ZodiacMetaOptions, ZodiacOptions, ZodiacPreset, ZodiacSign };
package/dist/types.d.mts CHANGED
@@ -1,2 +1,18 @@
1
- import { $ as ChronosStaticKey, $t as BanglaDateOptions, A as ChronosObject, At as TimeZoneDetails, B as WithoutOrigin, Bt as ChronosStatics, C as $Chronos, Ct as NumberingSystem, D as ChronosInput, Dt as TimeUnitValue, E as $StaticMethods, Et as TimeUnit, F as PluginMethods, Ft as TimeZoneNameNative, G as $NativeTzNameOrId, Gt as $BanglaYear, H as $GMTOffset, I as RangeWithDates, It as TimestampOptions, J as $TimeUnitVar, Jt as $BnMonthPadded, K as $TZLabelKey, Kt as $BnDatePadded, L as RelativeDateRange, Lt as UTCMinute, M as ChronosWithOptions, Mt as TimeZoneIdNative, N as DateRangeOptions, Nt as TimeZoneIdentifier, O as ChronosInternals, Ot as TimeWithUnit, P as DatesInRangeOptions, Pt as TimeZoneName, Q as $UnitAnyCase, Qt as BanglaDateObject, R as RelativeRangeOptions, Rt as UTCOffset, S as ZodiacSign, St as NegativeUTCHour, T as $PluginMethods, Tt as Quarter, U as $ISOTimeString, Ut as $BanglaMonth, V as $DateUnit, W as $LocalArguments, Wt as $BanglaMonthDate, X as $TimeZoneIdentifier, Xt as BanglaDate, Y as $TimeUnitVarMap, Yt as $BnYearPadded, Z as $UTCOffset, Zt as BanglaDateFormat, _ as ZodiacArray, _n as StrictFormat, _t as LocalesArguments, a as BusinessOptionsWeekends, an as BnCalendarConfig, at as DateFormatOptions, b as ZodiacOptions, bn as TimeToken, bt as MonthName, c as DayPart, cn as DateFormatToken, ct as DateTimeFormatOptions, d as DurationOptions, dn as FormatToken, dt as GreetingConfigs, en as BanglaDayName, et as ClockHour, f as MonthBoundary, fn as HourToken, ft as HourMinutes, g as TimeDuration, gn as SecondToken, gt as LocaleCalendar, h as SeasonPreset, hn as MonthToken, ht as ISOTimeString, i as BusinessOptionsBasic, in as BanglaYear, it as DateArgs, j as ChronosProperties, jt as TimeZoneId, k as ChronosMethods, kt as TimeZone, l as DayPartConfig, ln as DateToken, lt as FormatOptions, m as SeasonOptions, mn as MinuteToken, mt as ISODateTimeString, n as $BusinessHourOptions, nn as BanglaMonthName, nt as ClockSecond, o as ChronosPlugin, on as BnCalendarVariant, ot as DateLike, p as SeasonDefinition, pn as MSToken, pt as ISODateFormat, q as $TimeUnitKey, qt as $BnEn, r as AcademicYear, rn as BanglaSeasonName, rt as ClockTime, s as DateBoundary, sn as DateWithSeasonToken, st as DateString, t as $BusinessHourBaseOptions, tn as BanglaMonth, tt as ClockMinute, u as DurationKey, un as DayToken, ut as FromNowUnit, v as ZodiacMeta, vn as TimeFormatToken, vt as Milliseconds, w as $InstanceMethods, wt as PositiveUTCHour, x as ZodiacPreset, xn as YearToken, xt as MonthString, y as ZodiacMetaOptions, yn as TimeOnlyFormat, yt as MonthDateString, z as WeekdayOptions, zt as WeekDay } from "./types-B2fgrJ86.mjs";
2
- export { $BanglaMonth, $BanglaMonthDate, $BanglaYear, $BnDatePadded, $BnEn, $BnMonthPadded, $BnYearPadded, $BusinessHourBaseOptions, $BusinessHourOptions, $Chronos, $DateUnit, $GMTOffset, $ISOTimeString, $InstanceMethods, $LocalArguments, $NativeTzNameOrId, $PluginMethods, $StaticMethods, $TZLabelKey, $TimeUnitKey, $TimeUnitVar, $TimeUnitVarMap, $TimeZoneIdentifier, $UTCOffset, $UnitAnyCase, AcademicYear, BanglaDate, BanglaDateFormat, BanglaDateObject, BanglaDateOptions, BanglaDayName, BanglaMonth, BanglaMonthName, BanglaSeasonName, BanglaYear, BnCalendarConfig, BnCalendarVariant, BusinessOptionsBasic, BusinessOptionsWeekends, ChronosInput, ChronosInternals, ChronosMethods, ChronosObject, ChronosPlugin, ChronosProperties, ChronosStaticKey, ChronosStatics, ChronosWithOptions, ClockHour, ClockMinute, ClockSecond, ClockTime, DateArgs, DateBoundary, DateFormatOptions, DateFormatToken, DateLike, DateRangeOptions, DateString, DateTimeFormatOptions, DateToken, DateWithSeasonToken, DatesInRangeOptions, DayPart, DayPartConfig, DayToken, DurationKey, DurationOptions, FormatOptions, FormatToken, FromNowUnit, GreetingConfigs, HourMinutes, HourToken, ISODateFormat, ISODateTimeString, ISOTimeString, LocaleCalendar, LocalesArguments, MSToken, Milliseconds, MinuteToken, MonthBoundary, MonthDateString, MonthName, MonthString, MonthToken, NegativeUTCHour, NumberingSystem, PluginMethods, PositiveUTCHour, Quarter, RangeWithDates, RelativeDateRange, RelativeRangeOptions, SeasonDefinition, SeasonOptions, SeasonPreset, SecondToken, StrictFormat, TimeDuration, TimeFormatToken, TimeOnlyFormat, TimeToken, TimeUnit, TimeUnitValue, TimeWithUnit, TimeZone, TimeZoneDetails, TimeZoneId, TimeZoneIdNative, TimeZoneIdentifier, TimeZoneName, TimeZoneNameNative, TimestampOptions, UTCMinute, UTCOffset, WeekDay, WeekdayOptions, WithoutOrigin, YearToken, ZodiacArray, ZodiacMeta, ZodiacMetaOptions, ZodiacOptions, ZodiacPreset, ZodiacSign };
1
+ /**
2
+ * Copyright 2026 - present Nazmul Hassan
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { $ as ChronosStaticKey, $t as BanglaDayName, A as ChronosObject, At as TimeZoneId, B as WithoutOrigin, C as $Chronos, Ct as PositiveUTCHour, D as ChronosInput, Dt as TimeWithUnit, E as $StaticMethods, Et as TimeUnitValue, F as PluginMethods, Ft as TimestampOptions, G as $NativeTzNameOrId, Gt as $BnDatePadded, H as $GMTOffset, Ht as $BanglaMonth, I as RangeWithDates, It as UTCMinute, J as $TimeUnitVar, Jt as $BnYearPadded, K as $TZLabelKey, Kt as $BnEn, L as RelativeDateRange, Lt as UTCOffset, M as ChronosWithOptions, Mt as TimeZoneIdentifier, N as DateRangeOptions, Nt as TimeZoneName, O as ChronosInternals, Ot as TimeZone, P as DatesInRangeOptions, Pt as TimeZoneNameNative, Q as $UnitAnyCase, Qt as BanglaDateOptions, R as RelativeRangeOptions, Rt as WeekDay, S as ZodiacSign, St as NumberingSystem, T as $PluginMethods, Tt as TimeUnit, U as $ISOTimeString, Ut as $BanglaMonthDate, V as $DateUnit, W as $LocalArguments, Wt as $BanglaYear, X as $TimeZoneIdentifier, Xt as BanglaDateFormat, Y as $TimeUnitVarMap, Yt as BanglaDate, Z as $UTCOffset, Zt as BanglaDateObject, _ as ZodiacArray, _n as TimeFormatToken, _t as Milliseconds, a as BusinessOptionsWeekends, an as BnCalendarVariant, at as DateFormatOptions, b as ZodiacOptions, bn as YearToken, bt as MonthString, c as DayPart, cn as DateToken, ct as DateTimeFormatOptions, d as DurationOptions, dn as HourToken, dt as GreetingConfigs, en as BanglaMonth, et as ClockHour, f as MonthBoundary, fn as MSToken, ft as HourMinutes, g as TimeDuration, gn as StrictFormat, gt as LocalesArguments, h as SeasonPreset, hn as SecondToken, ht as LocaleCalendar, i as BusinessOptionsBasic, in as BnCalendarConfig, it as DateArgs, j as ChronosProperties, jt as TimeZoneIdNative, k as ChronosMethods, kt as TimeZoneDetails, l as DayPartConfig, ln as DayToken, lt as FormatOptions, m as SeasonOptions, mn as MonthToken, mt as ISODateTimeString, n as $BusinessHourOptions, nn as BanglaSeasonName, nt as ClockSecond, o as ChronosPlugin, on as DateWithSeasonToken, ot as DateLike, p as SeasonDefinition, pn as MinuteToken, pt as ISODateFormat, q as $TimeUnitKey, qt as $BnMonthPadded, r as AcademicYear, rn as BanglaYear, rt as ClockTime, s as DateBoundary, sn as DateFormatToken, st as DateString, t as $BusinessHourBaseOptions, tn as BanglaMonthName, tt as ClockMinute, u as DurationKey, un as FormatToken, ut as FromNowUnit, v as ZodiacMeta, vn as TimeOnlyFormat, vt as MonthDateString, w as $InstanceMethods, wt as Quarter, x as ZodiacPreset, xt as NegativeUTCHour, y as ZodiacMetaOptions, yn as TimeToken, yt as MonthName, z as WeekdayOptions, zt as ChronosStatics } from "./types-Cb4gxrgJ.mjs";
18
+ export { $BanglaMonth, $BanglaMonthDate, $BanglaYear, $BnDatePadded, $BnEn, $BnMonthPadded, $BnYearPadded, $BusinessHourBaseOptions, $BusinessHourOptions, $Chronos, $DateUnit, $GMTOffset, $ISOTimeString, $InstanceMethods, $LocalArguments, $NativeTzNameOrId, $PluginMethods, $StaticMethods, $TZLabelKey, $TimeUnitKey, $TimeUnitVar, $TimeUnitVarMap, $TimeZoneIdentifier, $UTCOffset, $UnitAnyCase, AcademicYear, BanglaDate, BanglaDateFormat, BanglaDateObject, BanglaDateOptions, BanglaDayName, BanglaMonth, BanglaMonthName, BanglaSeasonName, BanglaYear, BnCalendarConfig, BnCalendarVariant, BusinessOptionsBasic, BusinessOptionsWeekends, ChronosInput, ChronosInternals, ChronosMethods, ChronosObject, ChronosPlugin, ChronosProperties, ChronosStaticKey, ChronosStatics, ChronosWithOptions, ClockHour, ClockMinute, ClockSecond, ClockTime, DateArgs, DateBoundary, DateFormatOptions, DateFormatToken, DateLike, DateRangeOptions, DateString, DateTimeFormatOptions, DateToken, DateWithSeasonToken, DatesInRangeOptions, DayPart, DayPartConfig, DayToken, DurationKey, DurationOptions, FormatOptions, FormatToken, FromNowUnit, GreetingConfigs, HourMinutes, HourToken, ISODateFormat, ISODateTimeString, LocaleCalendar, LocalesArguments, MSToken, Milliseconds, MinuteToken, MonthBoundary, MonthDateString, MonthName, MonthString, MonthToken, NegativeUTCHour, NumberingSystem, PluginMethods, PositiveUTCHour, Quarter, RangeWithDates, RelativeDateRange, RelativeRangeOptions, SeasonDefinition, SeasonOptions, SeasonPreset, SecondToken, StrictFormat, TimeDuration, TimeFormatToken, TimeOnlyFormat, TimeToken, TimeUnit, TimeUnitValue, TimeWithUnit, TimeZone, TimeZoneDetails, TimeZoneId, TimeZoneIdNative, TimeZoneIdentifier, TimeZoneName, TimeZoneNameNative, TimestampOptions, UTCMinute, UTCOffset, WeekDay, WeekdayOptions, WithoutOrigin, YearToken, ZodiacArray, ZodiacMeta, ZodiacMetaOptions, ZodiacOptions, ZodiacPreset, ZodiacSign };
package/dist/types.mjs CHANGED
@@ -1 +1,17 @@
1
- export{};
1
+ /**
2
+ * Copyright 2026 - present Nazmul Hassan
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export { };
@@ -0,0 +1,257 @@
1
+ /**
2
+ * Copyright 2026 - present Nazmul Hassan
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { n as NATIVE_TZ_IDS } from "./timezone-Db2CeL32.mjs";
18
+ import { a as isUndefined } from "./primitives-dXzXlzJw.mjs";
19
+ import { r as isObject } from "./non-primitives-DBtomDty.mjs";
20
+ import { n as normalizeNumber } from "./utilities-BKtVo78T.mjs";
21
+ import { isValidUTCOffset } from "./guards.mjs";
22
+ import { n as _dateArgsToDate, p as _resolveNativeTzName, r as _formatDate, s as _gmtToUtcOffset, u as _normalizeOffset } from "./helpers-DEf4sevD.mjs";
23
+
24
+ //#region src/utils/utilities.ts
25
+ /**
26
+ * * Extracts the hour and minute from a time string in `HH:MM` or `-HH:MM` format.
27
+ *
28
+ * @param time - The time string to extract from.
29
+ * @return The extracted hour and minute as number tuple.
30
+ */
31
+ function extractHourMinute(time) {
32
+ const [hour, minute] = time.split(":").map(Number);
33
+ return [hour, minute];
34
+ }
35
+ /**
36
+ * * Converts a time string `HH:MM` or `-HH:MM` into total minutes from `00:00`.
37
+ *
38
+ * @param time - The time in `HH:MM` or `-HH:MM` format.
39
+ * @returns The total minutes elapsed since `00:00`.
40
+ */
41
+ function getTotalMinutes(time) {
42
+ const isNegative = time.startsWith("-");
43
+ const [h, m] = extractHourMinute(isNegative ? time.slice(1) : time);
44
+ const total = h * 60 + m;
45
+ return isNegative ? -total : total;
46
+ }
47
+ /**
48
+ * * Extract Time in `HH:MM` format from given UTC value.
49
+ *
50
+ * @param utc UTC value in `UTC-01:30` or `UTC+01:30` format.
51
+ * @returns The UTC value in `HH:MM` format.
52
+ */
53
+ function extractTimeFromUTC(utc) {
54
+ return utc.replace(/^UTC[+]?/g, "");
55
+ }
56
+ /**
57
+ * * Converts a UTC value in `UTC-01:30` or `UTC+01:30` format into total minutes in number.
58
+ *
59
+ * @param time - UTC value in `UTC-01:30` or `UTC+01:30` format.
60
+ * @returns The total minutes elapsed since `00:00`.
61
+ */
62
+ function extractMinutesFromUTC(utc) {
63
+ return getTotalMinutes(extractTimeFromUTC(utc));
64
+ }
65
+ /**
66
+ * * Converts a number of minutes into a time string in "HH:MM" format.
67
+ *
68
+ * @param minutes - The number of minutes to convert. Can be a number or a numeric string.
69
+ * @returns A string representing the time in "HH:MM" format.
70
+ *
71
+ * @remarks Always returns the absolute value of the minutes, ignoring the sign if they are negative.
72
+ *
73
+ * @example
74
+ * convertMinutesToTime(75); // "1:15"
75
+ * convertMinutesToTime(-45); // "0:45"
76
+ */
77
+ function convertMinutesToTime(minutes) {
78
+ const parsed = normalizeNumber(minutes);
79
+ if (isUndefined(parsed)) throw new TypeError(`Invalid numeric input!`, { cause: `${minutes} cannot be converted to a number.` });
80
+ const numMIn = Math.abs(parsed);
81
+ return `${String(Math.floor(numMIn / 60))}:${String(numMIn % 60).padStart(2, "0")}`;
82
+ }
83
+ /**
84
+ * * Converts a minute-based offset to a UTC offset string in the format `UTC±HH:MM`.
85
+ *
86
+ * @param minutes - The offset in minutes (positive or negative).
87
+ * @returns A formatted UTC offset string like `UTC+05:30` or `UTC-04:00`.
88
+ */
89
+ function formatUTCOffset(minutes) {
90
+ const parsed = normalizeNumber(minutes);
91
+ if (isUndefined(parsed)) throw new TypeError(`Invalid numeric input!`, { cause: `${minutes} cannot be converted to a number.` });
92
+ const sign = parsed < 0 ? "-" : "+";
93
+ const abs = Math.abs(parsed);
94
+ return `UTC${sign}${String(Math.floor(abs / 60)).padStart(2, "0")}:${String(abs % 60).padStart(2, "0")}`;
95
+ }
96
+ /** Get the current system's time zone identifier using {@link Intl.DateTimeFormat} API. */
97
+ function getNativeTimeZoneId() {
98
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
99
+ }
100
+ /**
101
+ * * Retrieves comprehensive time zone details using the {@link Intl.DateTimeFormat} API.
102
+ * @param tzId Optional timezone identifier. Defaults to the system timezone.
103
+ * @param date Optional date for which to resolve the information.
104
+ * @returns Object containing time zone identifier, names, and offset.
105
+ */
106
+ function getTimeZoneDetails(tzId, date) {
107
+ const TZ_NAME_TYPES = [
108
+ "long",
109
+ "longGeneric",
110
+ "longOffset"
111
+ ];
112
+ const $tzId = tzId || getNativeTimeZoneId();
113
+ const obj = { tzIdentifier: $tzId };
114
+ for (const type of TZ_NAME_TYPES) {
115
+ const key = `tzName${type[0].toUpperCase()}${type.slice(1)}`;
116
+ obj[key] = _resolveNativeTzName($tzId, type, date);
117
+ }
118
+ return obj;
119
+ }
120
+ /** Cache for offset to time zone */
121
+ const TZ_MAP = /* @__PURE__ */ new Map();
122
+ /**
123
+ * * Resolves all IANA time-zone identifiers that match a given UTC offset.
124
+ *
125
+ * @remarks
126
+ * - Uses an internal in-memory cache that persists for the lifetime of the running application.
127
+ * - The cache is lazily populated so the `offset`-to-`time-zone` mapping is computed only once per offset.
128
+ * - Offset and time-zone identifier detection uses the {@link Intl.DateTimeFormat} API.
129
+ *
130
+ * @param offset The UTC offset in `"UTC±HH:MM"` format.
131
+ * @returns An array of matching IANA time-zone identifiers, or an empty array if the offset is invalid.
132
+ */
133
+ function getTimeZoneIds(offset) {
134
+ if (!isValidUTCOffset(offset)) return [];
135
+ if (TZ_MAP.has(offset)) return TZ_MAP.get(offset) ?? [];
136
+ for (const zone of NATIVE_TZ_IDS) {
137
+ const off = _gmtToUtcOffset(_resolveNativeTzName(zone, "longOffset"));
138
+ if (off) TZ_MAP.set(off, [...TZ_MAP.get(off) ?? [], zone]);
139
+ }
140
+ return TZ_MAP.get(offset) ?? [];
141
+ }
142
+ /**
143
+ * * Formats a date into a specified string format.
144
+ *
145
+ * @param options Options to control date and time formatting.
146
+ *
147
+ * @remarks
148
+ * - If no date is provided, the current date and time will be used.
149
+ * - If the provided date is invalid, the function will return `'Invalid Date!'`.
150
+ * - The default format is `'dd, mmm DD, YYYY HH:mm:ss'` (e.g., `'Sun, Apr 06, 2025 16:11:55'`).
151
+ * - By default, local time is used; set `useUTC` to `true` to format in UTC.
152
+ * - The format string supports various tokens for date and time components, as well as literal text enclosed in square brackets.
153
+ * - See {@link https://toolbox.nazmul-nhb.dev/docs/utilities/date/formatDate#format-tokens format tokens} for details on supported tokens.
154
+ * - For more complex date/time manipulations, consider using the {@link https://toolbox.nazmul-nhb.dev/docs/classes/Chronos Chronos} class.
155
+ *
156
+ * @returns Date/time string in specified format.
157
+ */
158
+ function formatDate(options) {
159
+ const { date = /* @__PURE__ */ new Date(), format = "dd, mmm DD, YYYY HH:mm:ss", useUTC = false } = options ?? {};
160
+ const $date = _dateArgsToDate(date);
161
+ if (isNaN($date.getTime())) return "Invalid Date!";
162
+ /** Get unit value for {@link $date} for specific unit in local or UTC time */
163
+ const _getUnitValue = (suffix) => {
164
+ return useUTC ? $date[`getUTC${suffix}`]() : $date[`get${suffix}`]();
165
+ };
166
+ return _formatDate(format, _getUnitValue("FullYear"), _getUnitValue("Month"), _getUnitValue("Day"), _getUnitValue("Date"), _getUnitValue("Hours"), _getUnitValue("Minutes"), _getUnitValue("Seconds"), _getUnitValue("Milliseconds"), useUTC ? "Z" : formatUTCOffset(-$date.getTimezoneOffset()).slice(3));
167
+ }
168
+ /**
169
+ * * Formats a time-only string into a formatted time string.
170
+ *
171
+ * @param time - Time string to be formatted. Supported formats include:
172
+ * - `HH:mm` → e.g., `'14:50'`
173
+ * - `HH:mm:ss` → e.g., `'14:50:00'`
174
+ * - `HH:mm:ss.mss` → e.g., `'14:50:00.800'`
175
+ * - `HH:mm+TimeZoneOffset(HH)` → e.g., `'14:50+06'`
176
+ * - `HH:mm+TimeZoneOffset(HH:mm)` → e.g., `'14:50+06:00'`
177
+ * - `HH:mm:ss+TimeZoneOffset(HH)` → e.g., `'14:50:00+06'`
178
+ * - `HH:mm:ss+TimeZoneOffset(HH:mm)` → e.g., `'14:50:00+05:30'`
179
+ * - `HH:mm:ss.mss+TimeZoneOffset(HH)` → e.g., `'14:50:00.800+06'`
180
+ * - `HH:mm:ss.mss+TimeZoneOffset(HH:mm)` → e.g., `'14:50:00.800+06:30'`
181
+ *
182
+ * - *Input will default to today's date and assume local timezone if no offset is provided.*
183
+ *
184
+ * @param format - Format tokens accepted by {@link formatDate} method ({@link TimeOnlyFormat}) for time part only.
185
+ * Default: `hh:mm:ss a` → 02:33:36 pm.
186
+ * @returns Formatted time string in local (System) time.
187
+ */
188
+ function formatTimePart(time, format) {
189
+ return formatDate({
190
+ date: `${formatDate({ format: "YYYY-MM-DD" })}T${_normalizeOffset(time)}`,
191
+ format: format || "hh:mm:ss a"
192
+ });
193
+ }
194
+ /**
195
+ * * Formats a date as a relative time string (e.g., "5m ago", "2h from now").
196
+ *
197
+ * @param date - The date to format, which can be a `Date` object, a date string, or a timestamp number.
198
+ * @param format - Optional format string for dates older than 7 days. Defaults to `'mmm D, yyyy hh:mm a'`.
199
+ * @returns A relative time string if the date is within the last 7 days, otherwise a formatted date string.
200
+ *
201
+ * @remarks
202
+ * - If date is provided but `undefined`, current date and time will be used.
203
+ * - If the provided date is invalid, the function will return `'Invalid Date!'`.
204
+ * - For dates within the last 7 days, the output will be in the format of "Xm ago" or "Xh from now".
205
+ * - For dates older than 7 days, the output will be formatted using the provided `format` string or the default format if none is provided.
206
+ *
207
+ * @example
208
+ * formatDateRelative(Date.now() - 5 * 60000); // "5m ago"
209
+ * formatDateRelative(Date.now() + 2 * 3600000); // "2h from now"
210
+ * formatDateRelative(Date.now() - 10 * 86400000); // "Apr 6, 2026 04:11 PM" (formatted date string)
211
+ */
212
+ function formatDateRelative(date, format) {
213
+ const $date = _dateArgsToDate(date);
214
+ if (isNaN($date.getTime())) return "Invalid Date!";
215
+ const now = Date.now();
216
+ const then = $date.getTime();
217
+ const diff = Math.abs(now - then);
218
+ const minutes = Math.floor(diff / 6e4);
219
+ const hours = Math.floor(diff / 36e5);
220
+ const days = Math.floor(diff / 864e5);
221
+ const suffix = then < now ? "ago" : "from now";
222
+ if (minutes < 1) return "Just now";
223
+ if (minutes < 60) return `${minutes}m ${suffix}`;
224
+ if (hours < 24) return `${hours}h ${suffix}`;
225
+ if (days < 7) return `${days}d ${suffix}`;
226
+ return formatDate({
227
+ date,
228
+ format: format || "mmm D, yyyy hh:mm a"
229
+ });
230
+ }
231
+ /** Get timestamp in ISO 8601 format. */
232
+ function getTimestamp(args, format) {
233
+ let $value;
234
+ let $format;
235
+ const _isTsOptions = (opt) => {
236
+ return isObject(opt) && ("value" in opt || "format" in opt);
237
+ };
238
+ if (_isTsOptions(args)) {
239
+ $value = args.value || /* @__PURE__ */ new Date();
240
+ $format = args.format || "utc";
241
+ } else {
242
+ $value = args || /* @__PURE__ */ new Date();
243
+ $format = format || "utc";
244
+ }
245
+ let date = _dateArgsToDate($value);
246
+ if (isNaN(date.getTime())) date = /* @__PURE__ */ new Date();
247
+ if ($format === "local") {
248
+ const offsetMins = date.getTimezoneOffset();
249
+ const localDate = /* @__PURE__ */ new Date(date.getTime() - offsetMins * 6e4);
250
+ const offset = formatUTCOffset(-offsetMins).slice(3);
251
+ return localDate.toISOString().replace("Z", offset);
252
+ }
253
+ return date.toISOString();
254
+ }
255
+
256
+ //#endregion
257
+ export { formatDate as a, formatUTCOffset as c, getTimeZoneIds as d, getTimestamp as f, extractTimeFromUTC as i, getNativeTimeZoneId as l, extractHourMinute as n, formatDateRelative as o, getTotalMinutes as p, extractMinutesFromUTC as r, formatTimePart as s, convertMinutesToTime as t, getTimeZoneDetails as u };
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Copyright 2026 - present Nazmul Hassan
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { i as isString, r as isNumber } from "./primitives-dXzXlzJw.mjs";
18
+
19
+ //#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/esm/guards/specials.js
20
+ function isNumericString(value) {
21
+ return isString(value) && value?.trim() !== "" && Number.isFinite(Number(value));
22
+ }
23
+
24
+ //#endregion
25
+ //#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/esm/number/constants.js
26
+ const BN_DIGITS = /* @__PURE__ */ Object.freeze({
27
+ "০": 0,
28
+ "১": 1,
29
+ "২": 2,
30
+ "৩": 3,
31
+ "৪": 4,
32
+ "৫": 5,
33
+ "৬": 6,
34
+ "৭": 7,
35
+ "৮": 8,
36
+ "৯": 9
37
+ });
38
+
39
+ //#endregion
40
+ //#region node_modules/.pnpm/nhb-toolbox@4.30.1/node_modules/nhb-toolbox/dist/esm/number/utilities.js
41
+ const roundToNearest = (value, interval = 5) => {
42
+ return Math.round(Number(value) / interval) * interval;
43
+ };
44
+ const getOrdinal = (num, withNumber = true) => {
45
+ const remainder10 = Number(num) % 10;
46
+ const remainder100 = Number(num) % 100;
47
+ let suffix;
48
+ if (remainder10 === 1 && remainder100 !== 11) suffix = "st";
49
+ else if (remainder10 === 2 && remainder100 !== 12) suffix = "nd";
50
+ else if (remainder10 === 3 && remainder100 !== 13) suffix = "rd";
51
+ else suffix = "th";
52
+ return withNumber ? String(num).concat(suffix) : suffix;
53
+ };
54
+ function normalizeNumber(num) {
55
+ return isNumber(num) ? num : isNumericString(num) ? Number(num) : void 0;
56
+ }
57
+
58
+ //#endregion
59
+ export { isNumericString as a, BN_DIGITS as i, normalizeNumber as n, roundToNearest as r, getOrdinal as t };