@bbn/bbn 2.0.80 → 2.0.82

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/dt.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import bbnDtDuration from './dt/classes/duration.js';
1
2
  import parse from './dt/functions/parse.js';
2
3
  import guessFormat from './dt/functions/guessFormat.js';
3
4
  declare const dt: {
@@ -8,7 +9,7 @@ declare const dt: {
8
9
  time(): void;
9
10
  date(): void;
10
11
  dateTime(): void;
11
- duration(): void;
12
+ duration(amount: any, unit: any): bbnDtDuration;
12
13
  zoned(): void;
13
14
  monthDay(): void;
14
15
  yearMonth(): void;
package/dist/dt.js CHANGED
@@ -259,7 +259,12 @@ dt.guessFormat = guessFormat;
259
259
  dt.time = () => { };
260
260
  dt.date = () => { };
261
261
  dt.dateTime = () => { };
262
- dt.duration = () => { };
262
+ dt.duration = (amount, unit) => {
263
+ if (amount instanceof Temporal.Duration) {
264
+ return new bbnDtDuration(amount);
265
+ }
266
+ return bbnDtDuration.fromUnit(amount, unit);
267
+ };
263
268
  dt.zoned = () => { };
264
269
  dt.monthDay = () => { };
265
270
  dt.yearMonth = () => { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "2.0.80",
3
+ "version": "2.0.82",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",