Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(datepicker): fix error w/ null date model value. Fixes #4232
Browse files Browse the repository at this point in the history
  • Loading branch information
jelbourn committed Aug 19, 2015
1 parent e314072 commit bafbacb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/datepicker/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
* @param {Date=} opt_date
*/
CalendarCtrl.prototype.focus = function(opt_date) {
var date = opt_date || this.selectedDate;
var date = opt_date || this.selectedDate || this.today;

var previousFocus = this.calendarElement.querySelector('.md-focus');
if (previousFocus) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/datepicker/dateLocaleProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
* @returns {string}
*/
function defaultFormatDate(date) {
return date.toLocaleDateString();
return date ? date.toLocaleDateString() : '';
}

/**
Expand Down

0 comments on commit bafbacb

Please sign in to comment.