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

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 #5395
Fixes #5190
  • Loading branch information
wesleycho committed Feb 2, 2016
1 parent f125537 commit 4b2ee0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/datepicker/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,8 @@ function(scope, element, attrs, $compile, $parse, $document, $rootScope, $positi

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

Expand Down

0 comments on commit 4b2ee0f

Please sign in to comment.