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 9f2412a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/datepicker/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ function(scope, element, attrs, $compile, $parse, $document, $rootScope, $positi

scope.watchData[key] = value === null ? null : cache[key];
} else {
var date = value ? new Date(value) : new Date();
scope.watchData[key] = dateParser.fromTimezone(new Date(value), ngModelOptions.timezone);
}
}));
Expand Down

0 comments on commit 9f2412a

Please sign in to comment.