@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.
@@ -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 instanceof bbnDtDate) {
437
- return this.parse(this.date() + ' ' + v, 'Y-m-d H:i:s', 'dateTime');
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 instanceof bbnDtDate) {
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());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "2.0.101",
3
+ "version": "2.0.103",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",