@bbn/bbn 2.0.132 → 2.0.134
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/dt/classes/dt.d.ts +5 -5
- package/dist/dt/classes/dt.js +13 -10
- package/package.json +1 -1
package/dist/dt/classes/dt.d.ts
CHANGED
|
@@ -44,11 +44,11 @@ export declare abstract class bbnDt<TValue extends bbnDtTemporal> {
|
|
|
44
44
|
compare(other: any, unit?: string): -1 | 0 | 1;
|
|
45
45
|
add(amount: number | bbnDtDuration | object, unit?: string): bbnDt<any>;
|
|
46
46
|
subtract(amount: number | bbnDtDuration | object, unit?: string): bbnDt<any>;
|
|
47
|
-
isBefore(other: any): boolean;
|
|
48
|
-
isBeforeOrSame(other: any): boolean;
|
|
49
|
-
isAfter(other: any): boolean;
|
|
50
|
-
isAfterOrSame(other: any): boolean;
|
|
51
|
-
isSame(other: any): boolean;
|
|
47
|
+
isBefore(other: any, unit?: string): boolean;
|
|
48
|
+
isBeforeOrSame(other: any, unit?: string): boolean;
|
|
49
|
+
isAfter(other: any, unit?: string): boolean;
|
|
50
|
+
isAfterOrSame(other: any, unit?: string): boolean;
|
|
51
|
+
isSame(other: any, unit?: string): boolean;
|
|
52
52
|
equals(other: any): boolean;
|
|
53
53
|
toJSON(): {
|
|
54
54
|
kind: bbnDtKind;
|
package/dist/dt/classes/dt.js
CHANGED
|
@@ -200,6 +200,9 @@ export class bbnDt {
|
|
|
200
200
|
}
|
|
201
201
|
throw new TypeError('toZdt expects a bbnDt wrapper or ZonedDateTime');
|
|
202
202
|
};
|
|
203
|
+
if (unit === 'd') {
|
|
204
|
+
debugger;
|
|
205
|
+
}
|
|
203
206
|
// ---- CASE 1: same constructor → your original logic on raw Temporal ----
|
|
204
207
|
const rawA = unwrap(a);
|
|
205
208
|
const rawB = unwrap(b);
|
|
@@ -304,20 +307,20 @@ export class bbnDt {
|
|
|
304
307
|
return new this.constructor(d);
|
|
305
308
|
}
|
|
306
309
|
}
|
|
307
|
-
isBefore(other) {
|
|
308
|
-
return this.compare(other) < 0;
|
|
310
|
+
isBefore(other, unit) {
|
|
311
|
+
return this.compare(other, unit) < 0;
|
|
309
312
|
}
|
|
310
|
-
isBeforeOrSame(other) {
|
|
311
|
-
return this.compare(other) <= 0;
|
|
313
|
+
isBeforeOrSame(other, unit) {
|
|
314
|
+
return this.compare(other, unit) <= 0;
|
|
312
315
|
}
|
|
313
|
-
isAfter(other) {
|
|
314
|
-
return this.compare(other) > 0;
|
|
316
|
+
isAfter(other, unit) {
|
|
317
|
+
return this.compare(other, unit) > 0;
|
|
315
318
|
}
|
|
316
|
-
isAfterOrSame(other) {
|
|
317
|
-
return this.compare(other) >= 0;
|
|
319
|
+
isAfterOrSame(other, unit) {
|
|
320
|
+
return this.compare(other, unit) >= 0;
|
|
318
321
|
}
|
|
319
|
-
isSame(other) {
|
|
320
|
-
return this.compare(other) === 0;
|
|
322
|
+
isSame(other, unit) {
|
|
323
|
+
return this.compare(other, unit) === 0;
|
|
321
324
|
}
|
|
322
325
|
equals(other) {
|
|
323
326
|
return this.isSame(other);
|