Skip to content

Commit

Permalink
chore: set datepicker default view to minimum date
Browse files Browse the repository at this point in the history
  • Loading branch information
tshuli committed Nov 9, 2020
1 parent 0e1ecee commit 4f8e445
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function dateFieldComponentController() {
yearColumns: 3,
minDate: null,
maxDate: null,
initDate: null,
}

vm.$onChanges = (changesObj) => {
Expand Down Expand Up @@ -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
}
}

Expand Down

0 comments on commit 4f8e445

Please sign in to comment.