From 4f8e445e6aa1a4b844eb2ee77508ed51c1ae2826 Mon Sep 17 00:00:00 2001 From: shuli-ogp Date: Mon, 9 Nov 2020 10:29:40 +0800 Subject: [PATCH] chore: set datepicker default view to minimum date --- .../forms/base/components/field-date.client.component.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/public/modules/forms/base/components/field-date.client.component.js b/src/public/modules/forms/base/components/field-date.client.component.js index 2143a1919b..35c4ec0ee2 100644 --- a/src/public/modules/forms/base/components/field-date.client.component.js +++ b/src/public/modules/forms/base/components/field-date.client.component.js @@ -24,6 +24,7 @@ function dateFieldComponentController() { yearColumns: 3, minDate: null, maxDate: null, + initDate: null, } vm.$onChanges = (changesObj) => { @@ -55,6 +56,9 @@ function dateFieldComponentController() { if (get(vm.field, 'dateValidation.customMaxDate')) { vm.dateOptions.maxDate = new Date(vm.field.dateValidation.customMaxDate) } + + // Set default view upon opening datepicker to be month of minDate + vm.dateOptions.initDate = vm.dateOptions.minDate } }