Skip to content

Commit

Permalink
Fixed invalid date in FF, Safari and IE.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnost Pleskot committed Oct 12, 2015
1 parent e3ee523 commit 1d2d3ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dist/angular-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

scope.$watch('useMonth', function(newVal) {
if(newVal) {
scope.date = new Date([newVal.year, newVal.month + 1]);
scope.date = new Date(newVal.year, newVal.month + 1, 0);
update();
// Destroy watcher (http://stackoverflow.com/questions/14957614/angularjs-clear-watch)
}
Expand Down Expand Up @@ -188,7 +188,7 @@

scope.currentMonth = {
year: scope.date.getFullYear(),
month: scope.date.getMonth(),
month: scope.date.getMonth()
};
}

Expand Down

0 comments on commit 1d2d3ac

Please sign in to comment.