From 358ad504d36fb6924a9fe125270ce693b5eaee4d Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Tue, 2 Feb 2016 13:42:09 -0800 Subject: [PATCH] fix(datepicker): default to current date - When model is empty, default to current date Closes #5395 Fixes #5190 --- src/datepicker/datepicker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datepicker/datepicker.js b/src/datepicker/datepicker.js index 79542565e9..d2d3a1a3e1 100644 --- a/src/datepicker/datepicker.js +++ b/src/datepicker/datepicker.js @@ -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; }