Skip to content

Commit

Permalink
fix(datepicker): default to current date
Browse files Browse the repository at this point in the history
- When model is empty, default to current date

Closes angular-ui#5395
Fixes angular-ui#5190
  • Loading branch information
wesleycho committed Feb 2, 2016
1 parent f125537 commit 358ad50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/datepicker/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ function(scope, element, attrs, $compile, $parse, $document, $rootScope, $positi
ngModel.$parsers.unshift(parseDate);
ngModel.$formatters.push(function(value) {
if (ngModel.$isEmpty(value)) {
scope.date = value;
scope.date = new Date();
return value;
}

Expand Down

0 comments on commit 358ad50

Please sign in to comment.