@bbn/bbn 2.0.155 → 2.0.156

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.
@@ -46,6 +46,7 @@ export declare abstract class bbnDt<TValue extends bbnDtTemporal> {
46
46
  compare(other: any, unit?: string): -1 | 0 | 1;
47
47
  add(amount: number | bbnDtDuration | object, unit?: string): bbnDt<any>;
48
48
  subtract(amount: number | bbnDtDuration | object, unit?: string): bbnDt<any>;
49
+ duration(amount: number, unit: string): bbnDtDuration;
49
50
  isBefore(other: any, unit?: string): boolean;
50
51
  isBeforeOrSame(other: any, unit?: string): boolean;
51
52
  isAfter(other: any, unit?: string): boolean;
@@ -325,6 +325,9 @@ export class bbnDt {
325
325
  return new this.constructor(d);
326
326
  }
327
327
  }
328
+ duration(amount, unit) {
329
+ return bbnDtDuration.fromUnit(amount, unit);
330
+ }
328
331
  isBefore(other, unit) {
329
332
  return this.compare(other, unit) < 0;
330
333
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "2.0.155",
3
+ "version": "2.0.156",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",