From e7795f799e31034621914aaadc3d89f232087b39 Mon Sep 17 00:00:00 2001 From: Yoan Uria Date: Tue, 18 Jul 2017 08:57:04 -0400 Subject: [PATCH] fix(datepicker): datepickerMode does change when selection is manual (#1976) fixes #1911 --- src/datepicker/datepicker-inner.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/datepicker/datepicker-inner.component.ts b/src/datepicker/datepicker-inner.component.ts index f262656136..cb3321ed59 100644 --- a/src/datepicker/datepicker-inner.component.ts +++ b/src/datepicker/datepicker-inner.component.ts @@ -232,7 +232,9 @@ export class DatePickerInnerComponent implements OnInit, OnChanges { this.activeDate = new Date(date.getFullYear(), date.getMonth(), date.getDate()); } else { this.activeDate = new Date(date.getFullYear(), date.getMonth(), date.getDate()); - this.datepickerMode = this.modes[this.modes.indexOf(this.datepickerMode) - 1]; + if (isManual) { + this.datepickerMode = this.modes[this.modes.indexOf(this.datepickerMode) - 1]; + } } this.selectedDate = new Date(this.activeDate.valueOf() as number);