@bbn/bbn 2.0.101 → 2.0.103
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.js +3 -3
- package/dist/dt.js +3 -0
- package/package.json +1 -1
package/dist/dt/classes/dt.js
CHANGED
|
@@ -433,8 +433,8 @@ export class bbnDt {
|
|
|
433
433
|
}
|
|
434
434
|
datetime(v) {
|
|
435
435
|
if (0 in arguments && (v !== undefined) && !(v instanceof Event)) {
|
|
436
|
-
if (this
|
|
437
|
-
return this.parse(this.date() + ' ' + v, 'Y-m-d
|
|
436
|
+
if (this.kind === 'date') {
|
|
437
|
+
return this.parse(this.date() + ' ' + v, 'Y-m-d 00:00:00', 'dateTime');
|
|
438
438
|
}
|
|
439
439
|
return this.parse(v, 'Y-m-d H:i:s');
|
|
440
440
|
}
|
|
@@ -442,7 +442,7 @@ export class bbnDt {
|
|
|
442
442
|
}
|
|
443
443
|
time(v) {
|
|
444
444
|
if (0 in arguments && (v !== undefined) && !(v instanceof Event)) {
|
|
445
|
-
if (this
|
|
445
|
+
if (this.kind === 'date') {
|
|
446
446
|
return this.parse(this.date() + ' ' + v, 'Y-m-d H:i:s', 'dateTime');
|
|
447
447
|
}
|
|
448
448
|
return this.parse(v, 'H:i:s');
|
package/dist/dt.js
CHANGED
|
@@ -197,6 +197,9 @@ const dt = (value, inputFormat = null, cls = 'auto') => {
|
|
|
197
197
|
if (typeof value === 'number') {
|
|
198
198
|
return new bbnDtDateTime(value);
|
|
199
199
|
}
|
|
200
|
+
else if (value instanceof bbnDt) {
|
|
201
|
+
return value;
|
|
202
|
+
}
|
|
200
203
|
else if (value instanceof Date) {
|
|
201
204
|
const d = value;
|
|
202
205
|
return new bbnDtDateTime(d.getFullYear(), d.getMonth() + 1, d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());
|