@bbn/bbn 2.0.109 → 2.0.111
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/classes/date.js
CHANGED
|
@@ -41,7 +41,7 @@ export default class bbnDtDate extends bbnDt {
|
|
|
41
41
|
if (!format) {
|
|
42
42
|
format = getRow(bbn.dt.locales.date, { year: 'numeric', month: 'numeric', day: 'numeric' }).pattern;
|
|
43
43
|
}
|
|
44
|
-
return bbnDt.prototype.format.call(this,
|
|
44
|
+
return bbnDt.prototype.format.call(this, format);
|
|
45
45
|
}
|
|
46
46
|
ftime(withSeconds = false) {
|
|
47
47
|
return '00:00' + (withSeconds ? ':00' : '');
|
|
@@ -37,7 +37,7 @@ export default class bbnDtDateTime extends bbnDt {
|
|
|
37
37
|
if (!format) {
|
|
38
38
|
format = getRow(bbn.dt.locales.date, { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: '2-digit', second: undefined }).pattern;
|
|
39
39
|
}
|
|
40
|
-
return bbnDt.prototype.format.call(this,
|
|
40
|
+
return bbnDt.prototype.format.call(this, format);
|
|
41
41
|
}
|
|
42
42
|
fdate(long = false, withTime = false, weekday = false) {
|
|
43
43
|
if (!this.value) {
|
package/dist/dt/classes/dt.d.ts
CHANGED
|
@@ -87,6 +87,7 @@ export declare abstract class bbnDt<TValue extends bbnDtTemporal> {
|
|
|
87
87
|
get S(): string;
|
|
88
88
|
get WW(): string;
|
|
89
89
|
get W(): string;
|
|
90
|
+
unix(ms?: boolean | number): number | bbnDt<any>;
|
|
90
91
|
format(format?: string): string;
|
|
91
92
|
matchFormat(value: any, format: string): boolean;
|
|
92
93
|
getWeekday(n: 0 | 1 | 2 | 3 | 4 | 5 | 6, mode?: string, locale?: string): string | object;
|
package/dist/dt/classes/dt.js
CHANGED
|
@@ -624,6 +624,14 @@ export class bbnDt {
|
|
|
624
624
|
}
|
|
625
625
|
return undefined;
|
|
626
626
|
}
|
|
627
|
+
unix(ms = false) {
|
|
628
|
+
if (typeof ms === 'number') {
|
|
629
|
+
const Ctor = this.constructor;
|
|
630
|
+
const d = new Date(ms);
|
|
631
|
+
return new Ctor(d);
|
|
632
|
+
}
|
|
633
|
+
return ms ? this.toEpochMs() : Math.floor(this.toEpochMs() / 1000);
|
|
634
|
+
}
|
|
627
635
|
format(format = 'YYYY-MM-DD HH:II:SS') {
|
|
628
636
|
let str = '';
|
|
629
637
|
if (format) {
|
|
@@ -42,7 +42,7 @@ export default class bbnDtYearMonth extends bbnDt {
|
|
|
42
42
|
&& (d.month === 'numeric')
|
|
43
43
|
&& !('day' in d)).pattern;
|
|
44
44
|
}
|
|
45
|
-
return bbnDt.prototype.format.call(this,
|
|
45
|
+
return bbnDt.prototype.format.call(this, format);
|
|
46
46
|
}
|
|
47
47
|
fdate(long = false, withTime = false, weekday = false) {
|
|
48
48
|
if (!this.value) {
|