nhb-toolbox 3.6.3 → 3.6.45

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.
@@ -1,3 +1,4 @@
1
+ import type { LocaleCode } from '../number/types';
1
2
  import type { FormatOptions, TimeUnit, TimeZone, UTCOffSet } from './types';
2
3
  export declare class Chronos {
3
4
  #private;
@@ -18,6 +19,8 @@ export declare class Chronos {
18
19
  * @returns The primitive value based on the hint.
19
20
  */
20
21
  [Symbol.toPrimitive](hint: string): string | number;
22
+ /** * Clones and returns a new Chronos instance with the same date. */
23
+ clone(): Chronos;
21
24
  /** * Enables JSON.stringify and console logging to show readable output. */
22
25
  toJSON(): string;
23
26
  /** * Enables arithmetic and comparison operations (e.g., +new Chronos()). */
@@ -26,6 +29,14 @@ export declare class Chronos {
26
29
  toDate(): Date;
27
30
  /** * Returns a string representation of a date. The format of the string depends on the locale. */
28
31
  toString(): string;
32
+ /**
33
+ * * Wrapper over native `toLocaleString`
34
+ * @description Converts a date and time to a string by using the current or specified locale.
35
+ *
36
+ * @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
37
+ * @param options An object that contains one or more properties that specify comparison options.
38
+ */
39
+ toLocaleString(locale?: LocaleCode | Intl.Locale | (LocaleCode | Intl.Locale)[], options?: Intl.DateTimeFormatOptions): string;
29
40
  /** * Returns a date as a string value in ISO format. */
30
41
  toISOString(): string;
31
42
  /** * Returns the time value in milliseconds since midnight, January 1, 1970 UTC. */
@@ -139,19 +150,19 @@ export declare class Chronos {
139
150
  * @param time An optional time value to compare with (`string`, `number`, `Date`, or `Chronos` instance). Defaults to `now`.
140
151
  * @returns The difference as a human-readable string, e.g., `2 years 1 month 9 days 18 hours 56 minutes ago`.
141
152
  */
142
- fromNow(level?: Exclude<TimeUnit, 'millisecond'>, withSuffixPrefix?: boolean, time?: string | number | Date | Chronos): string;
153
+ fromNow(level?: Exclude<TimeUnit, 'millisecond'>, withSuffixPrefix?: boolean, time?: number | string | Date | Chronos): string;
143
154
  /**
144
155
  * * Returns the number of full years between the input date and now.
145
156
  * @param time Optional time to compare with the `Chronos` date/time.
146
157
  * @returns The difference in number, negative is `Chronos` time is a past time else positive.
147
158
  */
148
- getRelativeYear(time?: string | number | Date | Chronos): number;
159
+ getRelativeYear(time?: number | string | Date | Chronos): number;
149
160
  /**
150
161
  * * Returns the number of full months between the input date and now.
151
162
  * @param time Optional time to compare with the `Chronos` date/time.
152
163
  * @returns The difference in number, negative is `Chronos` time is a past time else positive.
153
164
  */
154
- getRelativeMonth(time?: string | number | Date | Chronos): number;
165
+ getRelativeMonth(time?: number | string | Date | Chronos): number;
155
166
  /**
156
167
  * * Determines if the given date is today, tomorrow, yesterday or any relative day.
157
168
  * @param date - The date to compare (Date object).
@@ -162,31 +173,31 @@ export declare class Chronos {
162
173
  * - `1` if the date is tomorrow.
163
174
  * - Other positive or negative numbers for other relative days (e.g., `-2` for two days ago, `2` for two days ahead).
164
175
  */
165
- getRelativeDay(time?: string | number | Date | Chronos): number;
176
+ getRelativeDay(time?: number | string | Date | Chronos): number;
166
177
  /**
167
178
  * * Returns the number of full hours between the input date and now.
168
179
  * @param time Optional time to compare with the `Chronos` date/time.
169
180
  * @returns The difference in number, negative is `Chronos` time is a past time else positive.
170
181
  */
171
- getRelativeHour(time?: string | number | Date | Chronos): number;
182
+ getRelativeHour(time?: number | string | Date | Chronos): number;
172
183
  /**
173
184
  * * Returns the number of full minutes between the input date and now.
174
185
  * @param time Optional time to compare with the `Chronos` date/time.
175
186
  * @returns The difference in number, negative is `Chronos` time is a past time else positive.
176
187
  */
177
- getRelativeMinute(time?: string | number | Date | Chronos): number;
188
+ getRelativeMinute(time?: number | string | Date | Chronos): number;
178
189
  /**
179
190
  * * Returns the number of full seconds between the input date and now.
180
191
  * @param time Optional time to compare with the `Chronos` date/time.
181
192
  * @returns The difference in number, negative is `Chronos` time is a past time else positive.
182
193
  */
183
- getRelativeSecond(time?: string | number | Date | Chronos): number;
194
+ getRelativeSecond(time?: number | string | Date | Chronos): number;
184
195
  /**
185
196
  * * Returns the number of milliseconds between the input date and now.
186
197
  * @param time Optional time to compare with the `Chronos` date/time.
187
198
  * @returns The difference in number, negative is `Chronos` time is a past time else positive.
188
199
  */
189
- getRelativeMilliSecond(time?: string | number | Date | Chronos): number;
200
+ getRelativeMilliSecond(time?: number | string | Date | Chronos): number;
190
201
  /**
191
202
  * * Compares the stored date with now, returning the difference in the specified unit.
192
203
  *
@@ -194,6 +205,64 @@ export declare class Chronos {
194
205
  * @param time Optional time to compare with the `Chronos` date/time.
195
206
  * @returns The difference in number, negative is `Chronos` time is a past time else positive.
196
207
  */
197
- compare(unit?: TimeUnit, time?: string | number | Date | Chronos): number;
208
+ compare(unit?: TimeUnit, time?: number | string | Date | Chronos): number;
209
+ /**
210
+ * * Returns a new Chronos instance at the start of a given unit.
211
+ * @param unit The unit to reset (e.g., year, month, day).
212
+ */
213
+ startOf(unit: TimeUnit): Chronos;
214
+ /**
215
+ * * Returns a new Chronos instance at the end of a given unit.
216
+ * @param unit The unit to adjust (e.g., year, month, day).
217
+ */
218
+ endOf(unit: TimeUnit): Chronos;
219
+ /**
220
+ * * Returns a new Chronos instance with the specified unit added.
221
+ * @param amount The amount to add (can be negative).
222
+ * @param unit The time unit to add.
223
+ */
224
+ add(amount: number, unit: TimeUnit): Chronos;
225
+ /**
226
+ * * Gets the value of a specific time unit from the date.
227
+ * @param unit The unit to retrieve.
228
+ */
229
+ get(unit: TimeUnit): number;
230
+ /**
231
+ * Returns a new Chronos instance with the specified unit set to the given value.
232
+ * @param unit The unit to modify.
233
+ * @param value The value to set for the unit.
234
+ */
235
+ set(unit: TimeUnit, value: number): Chronos;
236
+ /**
237
+ * * Returns the difference between this and another date in the given unit.
238
+ * @param other The other date to compare.
239
+ * @param unit The unit in which to return the difference.
240
+ */
241
+ diff(other: number | string | Date | Chronos, unit: TimeUnit): number;
242
+ /**
243
+ * * Checks if another date is the same as this one in a specific unit.
244
+ * @param other The other date to compare.
245
+ * @param unit The unit to compare.
246
+ */
247
+ isSame(other: number | string | Date | Chronos, unit: TimeUnit): boolean;
248
+ /**
249
+ * * Checks if this date is before another date in a specific unit.
250
+ * @param other The other date to compare.
251
+ * @param unit The unit to compare.
252
+ */
253
+ isBefore(other: number | string | Date | Chronos, unit: TimeUnit): boolean;
254
+ /**
255
+ * * Checks if this date is after another date in a specific unit.
256
+ * @param other The other date to compare.
257
+ * @param unit The unit to compare.
258
+ */
259
+ isAfter(other: number | string | Date | Chronos, unit: TimeUnit): boolean;
260
+ /**
261
+ * * Returns a human-readable relative calendar time like "Today at 3:00 PM"
262
+ * @param baseDate Optional base date to compare with.
263
+ */
264
+ calendar(baseDate?: number | string | Date | Chronos): string;
265
+ /** * Returns a short human-readable string like "2h ago", "in 5m" */
266
+ fromNowShort(): string;
198
267
  }
199
268
  //# sourceMappingURL=Chronos.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chronos.d.ts","sourceRoot":"","sources":["../../src/date/Chronos.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEX,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,MAAM,SAAS,CAAC;AAGjB,qBAAa,OAAO;;IAInB;;;;;;;;OAQG;gBACS,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO;IAOpD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;IAED;;;;OAIG;IACH,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM;IAKnD,4EAA4E;IAC5E,MAAM,IAAI,MAAM;IAIhB,6EAA6E;IAC7E,OAAO,IAAI,MAAM;IAIjB,qDAAqD;IACrD,MAAM,IAAI,IAAI;IAId,mGAAmG;IACnG,QA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AQ,CACd,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,EACvC,IAAI,EAAE,QAAQ,GACZ,OAAO;IASV;;;;OAIG;IACI,OAAO,CACb,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,EACvC,IAAI,EAAE,QAAQ,GACZ,OAAO;IASV;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,GAAG,MAAM;IA0B7D,qEAAqE;IACrE,YAAY,IAAI,MAAM;CAuBtB"}
@@ -31,6 +31,10 @@ export class Chronos {
31
31
  return this.valueOf();
32
32
  return this.toString();
33
33
  }
34
+ /** * Clones and returns a new Chronos instance with the same date. */
35
+ clone() {
36
+ return new Chronos(this.#date);
37
+ }
34
38
  /** * Enables JSON.stringify and console logging to show readable output. */
35
39
  toJSON() {
36
40
  return this.toISOString();
@@ -47,6 +51,16 @@ export class Chronos {
47
51
  toString() {
48
52
  return this.#date.toString();
49
53
  }
54
+ /**
55
+ * * Wrapper over native `toLocaleString`
56
+ * @description Converts a date and time to a string by using the current or specified locale.
57
+ *
58
+ * @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
59
+ * @param options An object that contains one or more properties that specify comparison options.
60
+ */
61
+ toLocaleString(locale, options) {
62
+ return this.#date.toLocaleString(locale, options);
63
+ }
50
64
  /** * Returns a date as a string value in ISO format. */
51
65
  toISOString() {
52
66
  return this.#date.toISOString();
@@ -500,4 +514,239 @@ export class Chronos {
500
514
  throw new Error(`Unsupported time unit: ${unit}`);
501
515
  }
502
516
  }
517
+ /**
518
+ * * Returns a new Chronos instance at the start of a given unit.
519
+ * @param unit The unit to reset (e.g., year, month, day).
520
+ */
521
+ startOf(unit) {
522
+ const d = new Date(this.#date);
523
+ switch (unit) {
524
+ case 'year':
525
+ d.setMonth(0, 1);
526
+ d.setHours(0, 0, 0, 0);
527
+ break;
528
+ case 'month':
529
+ d.setDate(1);
530
+ d.setHours(0, 0, 0, 0);
531
+ break;
532
+ case 'day':
533
+ d.setHours(0, 0, 0, 0);
534
+ break;
535
+ case 'hour':
536
+ d.setMinutes(0, 0, 0);
537
+ break;
538
+ case 'minute':
539
+ d.setSeconds(0, 0);
540
+ break;
541
+ case 'second':
542
+ d.setMilliseconds(0);
543
+ break;
544
+ case 'millisecond':
545
+ break;
546
+ }
547
+ return new Chronos(d);
548
+ }
549
+ /**
550
+ * * Returns a new Chronos instance at the end of a given unit.
551
+ * @param unit The unit to adjust (e.g., year, month, day).
552
+ */
553
+ endOf(unit) {
554
+ return this.startOf(unit).add(1, unit).add(-1, 'millisecond');
555
+ }
556
+ /**
557
+ * * Returns a new Chronos instance with the specified unit added.
558
+ * @param amount The amount to add (can be negative).
559
+ * @param unit The time unit to add.
560
+ */
561
+ add(amount, unit) {
562
+ const d = new Date(this.#date);
563
+ switch (unit) {
564
+ case 'millisecond':
565
+ d.setMilliseconds(d.getMilliseconds() + amount);
566
+ break;
567
+ case 'second':
568
+ d.setSeconds(d.getSeconds() + amount);
569
+ break;
570
+ case 'minute':
571
+ d.setMinutes(d.getMinutes() + amount);
572
+ break;
573
+ case 'hour':
574
+ d.setHours(d.getHours() + amount);
575
+ break;
576
+ case 'day':
577
+ d.setDate(d.getDate() + amount);
578
+ break;
579
+ case 'month':
580
+ d.setMonth(d.getMonth() + amount);
581
+ break;
582
+ case 'year':
583
+ d.setFullYear(d.getFullYear() + amount);
584
+ break;
585
+ }
586
+ return new Chronos(d);
587
+ }
588
+ /**
589
+ * * Gets the value of a specific time unit from the date.
590
+ * @param unit The unit to retrieve.
591
+ */
592
+ get(unit) {
593
+ switch (unit) {
594
+ case 'year':
595
+ return this.#date.getFullYear();
596
+ case 'month':
597
+ return this.#date.getMonth();
598
+ case 'day':
599
+ return this.#date.getDate();
600
+ case 'hour':
601
+ return this.#date.getHours();
602
+ case 'minute':
603
+ return this.#date.getMinutes();
604
+ case 'second':
605
+ return this.#date.getSeconds();
606
+ case 'millisecond':
607
+ return this.#date.getMilliseconds();
608
+ }
609
+ }
610
+ /**
611
+ * Returns a new Chronos instance with the specified unit set to the given value.
612
+ * @param unit The unit to modify.
613
+ * @param value The value to set for the unit.
614
+ */
615
+ set(unit, value) {
616
+ const d = new Date(this.#date);
617
+ switch (unit) {
618
+ case 'year':
619
+ d.setFullYear(value);
620
+ break;
621
+ case 'month':
622
+ d.setMonth(value);
623
+ break;
624
+ case 'day':
625
+ d.setDate(value);
626
+ break;
627
+ case 'hour':
628
+ d.setHours(value);
629
+ break;
630
+ case 'minute':
631
+ d.setMinutes(value);
632
+ break;
633
+ case 'second':
634
+ d.setSeconds(value);
635
+ break;
636
+ case 'millisecond':
637
+ d.setMilliseconds(value);
638
+ break;
639
+ }
640
+ return new Chronos(d);
641
+ }
642
+ /**
643
+ * * Returns the difference between this and another date in the given unit.
644
+ * @param other The other date to compare.
645
+ * @param unit The unit in which to return the difference.
646
+ */
647
+ diff(other, unit) {
648
+ const time = new Chronos(other);
649
+ const msDiff = this.#date.getTime() - time.toDate().getTime();
650
+ switch (unit) {
651
+ case 'millisecond':
652
+ return msDiff;
653
+ case 'second':
654
+ return msDiff / 1e3;
655
+ case 'minute':
656
+ return msDiff / 6e4;
657
+ case 'hour':
658
+ return msDiff / 3.6e6;
659
+ case 'day':
660
+ return msDiff / 8.64e7;
661
+ case 'month':
662
+ return ((this.get('year') - time.get('year')) * 12 +
663
+ (this.get('month') - time.get('month')));
664
+ case 'year':
665
+ return this.get('year') - time.get('year');
666
+ }
667
+ }
668
+ /**
669
+ * * Checks if another date is the same as this one in a specific unit.
670
+ * @param other The other date to compare.
671
+ * @param unit The unit to compare.
672
+ */
673
+ isSame(other, unit) {
674
+ const time = new Chronos(other);
675
+ return (this.startOf(unit).toDate().getTime() ===
676
+ time.startOf(unit).toDate().getTime());
677
+ }
678
+ /**
679
+ * * Checks if this date is before another date in a specific unit.
680
+ * @param other The other date to compare.
681
+ * @param unit The unit to compare.
682
+ */
683
+ isBefore(other, unit) {
684
+ const time = new Chronos(other);
685
+ return (this.startOf(unit).toDate().getTime() <
686
+ time.startOf(unit).toDate().getTime());
687
+ }
688
+ /**
689
+ * * Checks if this date is after another date in a specific unit.
690
+ * @param other The other date to compare.
691
+ * @param unit The unit to compare.
692
+ */
693
+ isAfter(other, unit) {
694
+ const time = new Chronos(other);
695
+ return (this.startOf(unit).toDate().getTime() >
696
+ time.startOf(unit).toDate().getTime());
697
+ }
698
+ /**
699
+ * * Returns a human-readable relative calendar time like "Today at 3:00 PM"
700
+ * @param baseDate Optional base date to compare with.
701
+ */
702
+ calendar(baseDate) {
703
+ const base = baseDate ? new Chronos(baseDate) : new Chronos();
704
+ const input = this.startOf('day');
705
+ const comparison = base.startOf('day');
706
+ const diff = input.diff(comparison, 'day');
707
+ const timeStr = this.toDate().toLocaleString(undefined, {
708
+ hour: 'numeric',
709
+ minute: '2-digit',
710
+ });
711
+ if (diff === 0)
712
+ return `Today at ${timeStr}`;
713
+ if (diff === 1)
714
+ return `Tomorrow at ${timeStr}`;
715
+ if (diff === -1)
716
+ return `Yesterday at ${timeStr}`;
717
+ return this.toDate().toLocaleString(undefined, {
718
+ month: 'long',
719
+ day: '2-digit',
720
+ year: 'numeric',
721
+ weekday: 'long',
722
+ hour: 'numeric',
723
+ minute: '2-digit',
724
+ });
725
+ }
726
+ /** * Returns a short human-readable string like "2h ago", "in 5m" */
727
+ fromNowShort() {
728
+ const now = new Chronos();
729
+ const diffInSeconds = this.diff(now, 'second');
730
+ const abs = Math.abs(diffInSeconds);
731
+ const suffix = diffInSeconds >= 0 ? 'in ' : '';
732
+ const postfix = diffInSeconds < 0 ? ' ago' : '';
733
+ if (abs < 60) {
734
+ return `${suffix}${Math.floor(abs)}s${postfix}`;
735
+ }
736
+ else if (abs < 3600) {
737
+ return `${suffix}${Math.floor(abs / 60)}m${postfix}`;
738
+ }
739
+ else if (abs < 86400) {
740
+ return `${suffix}${Math.floor(abs / 3600)}h${postfix}`;
741
+ }
742
+ else if (abs < 2592000) {
743
+ return `${suffix}${Math.floor(abs / 86400)}d${postfix}`;
744
+ }
745
+ else if (abs < 31536000) {
746
+ return `${suffix}${Math.floor(abs / 2592000)}mo${postfix}`;
747
+ }
748
+ else {
749
+ return `${suffix}${Math.floor(abs / 31536000)}y${postfix}`;
750
+ }
751
+ }
503
752
  }
@@ -1,3 +1,4 @@
1
+ import type { Chronos } from './Chronos';
1
2
  import type { DATE_FORMATS, DAY_FORMATS, HOUR_FORMATS, MILLISECOND_FORMATS, MINUTE_FORMATS, MONTH_FORMATS, SECOND_FORMATS, TIME_FORMATS, TIME_ZONES, YEAR_FORMATS } from './constants';
2
3
  /** - Minute in numeric string from `00` to `23` */
3
4
  export type Hours = '00' | '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12' | '13' | '14' | '15' | '16' | '17' | '18' | '19' | '20' | '21' | '22' | '23';
@@ -47,6 +48,7 @@ export type Second = (typeof SECOND_FORMATS)[number];
47
48
  export type Millisecond = (typeof MILLISECOND_FORMATS)[number];
48
49
  export type TimeFormats = (typeof TIME_FORMATS)[number];
49
50
  export type ChronosFormat = Year | Month | Day | Date | Hour | Minute | Second | Millisecond | TimeFormats;
51
+ export type ChronosDate = number | string | Date | Chronos;
50
52
  export type TimeZone = keyof typeof TIME_ZONES;
51
53
  export type PositiveUTCHour = '+00' | '+01' | '+02' | '+03' | '+04' | '+05' | '+06' | '+07' | '+08' | '+09' | '+10' | '+11' | '+12' | '+13' | '+14';
52
54
  export type NegativeUTCHour = '-00' | '-01' | '-02' | '-03' | '-04' | '-05' | '-06' | '-07' | '-08' | '-09' | '-10' | '-11' | '-12' | '-13' | '-14';
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/date/types.ts"],"names":[],"mappings":"AAAA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K,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,CAAC;AAET,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAElD,MAAM,MAAM,SAAS,GAAG,MAAM,eAAe,GAAG,eAAe,IAAI,SAAS,EAAE,CAAC;AAE/E,uBAAuB;AACvB,MAAM,WAAW,aAAa;IAC7B,+GAA+G;IAC/G,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nhb-toolbox",
3
- "version": "3.6.3",
3
+ "version": "3.6.45",
4
4
  "description": "A versatile collection of smart, efficient, and reusable utility functions for everyday development needs.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",