Skip to content
This repository has been archived by the owner on Aug 6, 2020. It is now read-only.

Commit

Permalink
Merge pull request #73 from num13ru/fix-dates-days
Browse files Browse the repository at this point in the history
Fix for dates if we display highlighted and selected days together
  • Loading branch information
mgohin authored Sep 12, 2016
2 parents 7a3d0ed + 55419dd commit 30f0b68
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/multipleDatePicker.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions multipleDatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,16 @@
} else {
var idx = -1;
for (var i = 0; i < scope.ngModel.length; ++i) {
if (scope.ngModel[i].isSame(day.date, 'day')) {
idx = i;
break;
if (moment.isMoment(scope.ngModel[i])) {
if (scope.ngModel[i].isSame(day.date, 'day')) {
idx = i;
break;
}
} else {
if (scope.ngModel[i].date.isSame(day.date, 'day')) {
idx = i;
break;
}
}
}
if (idx !== -1) scope.ngModel.splice(idx, 1);
Expand Down

0 comments on commit 30f0b68

Please sign in to comment.