From f6f5fc05b77a1bf442273aa62f61590b2078d1cc Mon Sep 17 00:00:00 2001 From: Fynn Feldpausch Date: Wed, 29 May 2024 23:38:55 +0200 Subject: [PATCH] fix(angular): emit end date with 23:59:59.999 (closes #522) --- .../catalyst/src/lib/directives/date-value-accessor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/angular/projects/catalyst/src/lib/directives/date-value-accessor.ts b/angular/projects/catalyst/src/lib/directives/date-value-accessor.ts index 14fd5148..f52df045 100644 --- a/angular/projects/catalyst/src/lib/directives/date-value-accessor.ts +++ b/angular/projects/catalyst/src/lib/directives/date-value-accessor.ts @@ -37,7 +37,9 @@ export class DateValueAccessor extends ValueAccessor { if (!this.el.nativeElement.range) { return super.handleChangeEvent(this.toDate(value)); } else if (typeof value === 'string') { - return super.handleChangeEvent(JSON.parse(value).map(this.toDate)); + const data = JSON.parse(value).map(this.toDate); + data[1]?.setHours(23, 59, 59, 999); + return super.handleChangeEvent(data); } super.handleChangeEvent(null); }