Skip to content

Commit

Permalink
refactor: set initDate only if minDate
Browse files Browse the repository at this point in the history
  • Loading branch information
tshuli committed Nov 9, 2020
1 parent 4f8e445 commit e89da38
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ function dateFieldComponentController() {
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
// If minDate is set, default view upon opening datepicker to be month of minDate
if (vm.dateOptions.minDate) {
vm.dateOptions.initDate = vm.dateOptions.minDate
}
}
}

Expand Down

0 comments on commit e89da38

Please sign in to comment.