@bbn/bbn 2.0.100 → 2.0.102
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/date.d.ts +1 -0
- package/dist/dt/classes/date.js +3 -0
- package/dist/dt/classes/dt.js +2 -2
- package/package.json +1 -1
|
@@ -4,5 +4,6 @@ export default class bbnDtDate extends bbnDt<Temporal.PlainDate> {
|
|
|
4
4
|
readonly kind: bbnDtKind;
|
|
5
5
|
constructor(y?: any, m?: number, d?: number);
|
|
6
6
|
protected compareSameKind(other: this): -1 | 0 | 1;
|
|
7
|
+
ftime(withSeconds?: boolean): string;
|
|
7
8
|
fdate(long?: boolean, weekday?: boolean): string;
|
|
8
9
|
}
|
package/dist/dt/classes/date.js
CHANGED
|
@@ -31,6 +31,9 @@ export default class bbnDtDate extends bbnDt {
|
|
|
31
31
|
const cmp = Temporal.PlainDate.compare(this.value, other.value);
|
|
32
32
|
return (cmp < 0 ? -1 : cmp > 0 ? 1 : 0);
|
|
33
33
|
}
|
|
34
|
+
ftime(withSeconds = false) {
|
|
35
|
+
return '00:00' + (withSeconds ? ':00' : '');
|
|
36
|
+
}
|
|
34
37
|
fdate(long = false, weekday = false) {
|
|
35
38
|
const date = new Date(this.year(), this.month() - 1, this.day());
|
|
36
39
|
const opt = Object.assign({ year: 'numeric', month: long ? 'long' : 'numeric', day: 'numeric' }, (weekday ? { weekday: (long ? 'long' : 'short') } : {}));
|
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
|
}
|