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

Commit 4b2ee0f

Browse files
committed
fix(datepicker): default to current date
- When model is empty, default to current date Closes #5395 Fixes #5190
1 parent f125537 commit 4b2ee0f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/datepicker/datepicker.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,8 @@ function(scope, element, attrs, $compile, $parse, $document, $rootScope, $positi
813813

814814
scope.watchData[key] = value === null ? null : cache[key];
815815
} else {
816-
scope.watchData[key] = dateParser.fromTimezone(new Date(value), ngModelOptions.timezone);
816+
var date = value ? new Date(value) : new Date();
817+
scope.watchData[key] = dateParser.fromTimezone(date, ngModelOptions.timezone);
817818
}
818819
}));
819820

0 commit comments

Comments
 (0)