Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit e4fc201

Browse files
trickpattyFH20wesleycho
authored andcommitted
fix(datepicker): fallback to current date
- Fallback to current date if model not present Closes #5418 Fixes #5417
1 parent 068d181 commit e4fc201

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Diff for: src/datepicker/datepicker.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,7 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst
217217
ngModelCtrl = ngModelCtrl_;
218218
ngModelOptions = ngModelCtrl_.$options || datepickerConfig.ngModelOptions;
219219

220-
if (ngModelCtrl.$modelValue) {
221-
this.activeDate = ngModelCtrl.$modelValue;
222-
}
220+
this.activeDate = ngModelCtrl.$modelValue || new Date();
223221

224222
ngModelCtrl.$render = function() {
225223
self.render();

0 commit comments

Comments
 (0)