From 2878cea446651b80c35a4ea74b054f7cf8882628 Mon Sep 17 00:00:00 2001 From: gignacnic Date: Thu, 3 May 2018 11:22:07 -0400 Subject: [PATCH] fix(wmstime): set only if min or max date is undefined (#143) --- .../filter/time-filter-form/time-filter-form.component.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/filter/time-filter-form/time-filter-form.component.ts b/src/lib/filter/time-filter-form/time-filter-form.component.ts index 813d66f15c..a16e4849f0 100644 --- a/src/lib/filter/time-filter-form/time-filter-form.component.ts +++ b/src/lib/filter/time-filter-form/time-filter-form.component.ts @@ -102,8 +102,12 @@ export class TimeFilterFormComponent implements OnInit { constructor() { } ngOnInit() { - this.startDate = new Date(this.min); - this.endDate = new Date(this.max); + if (this.startDate === undefined) { + this.startDate = new Date(this.min); + } + if (this.endDate === undefined) { + this.endDate = new Date(this.max); + } } handleDateChange(event: any) {