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

Commit

Permalink
fix(datepicker): fallback to current date
Browse files Browse the repository at this point in the history
- Fallback to current date if model not present

Closes #5418
Fixes #5417
  • Loading branch information
trickpattyFH20 authored and wesleycho committed Feb 5, 2016
1 parent 068d181 commit e4fc201
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/datepicker/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,7 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst
ngModelCtrl = ngModelCtrl_;
ngModelOptions = ngModelCtrl_.$options || datepickerConfig.ngModelOptions;

if (ngModelCtrl.$modelValue) {
this.activeDate = ngModelCtrl.$modelValue;
}
this.activeDate = ngModelCtrl.$modelValue || new Date();

ngModelCtrl.$render = function() {
self.render();
Expand Down

0 comments on commit e4fc201

Please sign in to comment.