@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.
@@ -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
  }
@@ -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') } : {}));
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "2.0.100",
3
+ "version": "2.0.102",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",