Closed DeanWilliamMills closed 7 years ago
Sounds like a race condition to me.
You try adding an ng-init and explicitly setting the model yet?
@WVWillHall Thanks for the reply. I also tried adding ng-init, but still doesn't work.
Here is my code snippet:
Controller:
$scope.testDate = new Date($scope.date.getFullYear() - 10, $scope.date.getMonth(), 1);
HTML:
<input ng-model="testDate" type="text" readonly class="form-control" uib-datepicker-popup="{{datepickerOptions.format}}" is-open="datepickerToggle" />
working for me.
@WVWillHall thanks for your help. I realized I was not on the latest version. After updating to the latest version the issue was resolved.
If the ng-model has a value (populated from the database) and you open the datepicker it opens on today's date and not on the ng-model date. When you close the datepicker and open it again then it opens on the pre-populated date. So it only happens the first time you open the datepicker