@bbn/bbn 2.0.102 → 2.0.104
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.d.ts +1 -0
- package/dist/dt/classes/dt.js +2 -1
- package/dist/dt.js +3 -0
- package/package.json +1 -1
package/dist/dt/classes/dt.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare abstract class bbnDt<TValue extends bbnDtTemporal> {
|
|
|
5
5
|
#private;
|
|
6
6
|
abstract readonly kind: bbnDtKind;
|
|
7
7
|
readonly __bbnNoData = true;
|
|
8
|
+
readonly __isBbnDt = true;
|
|
8
9
|
constructor(value?: TValue);
|
|
9
10
|
get value(): TValue | undefined;
|
|
10
11
|
get hasFullDate(): boolean;
|
package/dist/dt/classes/dt.js
CHANGED
|
@@ -22,6 +22,7 @@ import camelToCss from '../../fn/string/camelToCss.js';
|
|
|
22
22
|
export class bbnDt {
|
|
23
23
|
constructor(value) {
|
|
24
24
|
this.__bbnNoData = true;
|
|
25
|
+
this.__isBbnDt = true;
|
|
25
26
|
_bbnDt_value.set(this, void 0);
|
|
26
27
|
this.getWeekdayIndex = (name, locale) => {
|
|
27
28
|
const loc = locale || bbn.env.lang;
|
|
@@ -442,7 +443,7 @@ export class bbnDt {
|
|
|
442
443
|
}
|
|
443
444
|
time(v) {
|
|
444
445
|
if (0 in arguments && (v !== undefined) && !(v instanceof Event)) {
|
|
445
|
-
if (this
|
|
446
|
+
if (this.kind === 'date') {
|
|
446
447
|
return this.parse(this.date() + ' ' + v, 'Y-m-d H:i:s', 'dateTime');
|
|
447
448
|
}
|
|
448
449
|
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.__isBbnDt) {
|
|
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());
|