@bbn/bbn 2.0.79 → 2.0.80
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.js +28 -0
- package/package.json +1 -1
package/dist/dt.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
import { Temporal } from 'temporal-polyfill';
|
|
1
2
|
import bbnDtDateTime from './dt/classes/dateTime.js';
|
|
3
|
+
import bbnDtDate from './dt/classes/date.js';
|
|
4
|
+
import bbnDtTime from './dt/classes/zoned.js';
|
|
5
|
+
import bbnDtYearMonth from './dt/classes/yearMonth.js';
|
|
6
|
+
import bbnDtMonthDay from './dt/classes/monthDay.js';
|
|
7
|
+
import bbnDtZoned from './dt/classes/zoned.js';
|
|
8
|
+
import bbnDtDuration from './dt/classes/duration.js';
|
|
2
9
|
import _ from './_.js';
|
|
3
10
|
import parse from './dt/functions/parse.js';
|
|
4
11
|
import guessFormat from './dt/functions/guessFormat.js';
|
|
@@ -220,6 +227,27 @@ const dt = (value, inputFormat = null, cls = 'auto') => {
|
|
|
220
227
|
const d = value;
|
|
221
228
|
return new bbnDtDateTime(d.getFullYear(), d.getMonth() + 1, d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());
|
|
222
229
|
}
|
|
230
|
+
else if (value instanceof Temporal.PlainDateTime) {
|
|
231
|
+
return new bbnDtDateTime(value);
|
|
232
|
+
}
|
|
233
|
+
else if (value instanceof Temporal.PlainDate) {
|
|
234
|
+
return new bbnDtDate(value);
|
|
235
|
+
}
|
|
236
|
+
else if (value instanceof Temporal.PlainTime) {
|
|
237
|
+
return new bbnDtTime(value);
|
|
238
|
+
}
|
|
239
|
+
else if (value instanceof Temporal.PlainYearMonth) {
|
|
240
|
+
return new bbnDtYearMonth(value);
|
|
241
|
+
}
|
|
242
|
+
else if (value instanceof Temporal.PlainMonthDay) {
|
|
243
|
+
return new bbnDtMonthDay(value);
|
|
244
|
+
}
|
|
245
|
+
else if (value instanceof Temporal.ZonedDateTime) {
|
|
246
|
+
return new bbnDtZoned(value);
|
|
247
|
+
}
|
|
248
|
+
else if (value instanceof Temporal.Duration) {
|
|
249
|
+
return new bbnDtDuration(value);
|
|
250
|
+
}
|
|
223
251
|
else {
|
|
224
252
|
return { isValid: false };
|
|
225
253
|
}
|