Skip to content

Commit

Permalink
Clone new current month before passing it to callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Meed committed Aug 8, 2017
1 parent fd064d4 commit 1c4bc4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/DayPickerRangeController.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ export default class DayPickerRangeController extends React.Component {
},
});

onPrevMonthClick(newCurrentMonth);
onPrevMonthClick(newCurrentMonth.clone());
}

onNextMonthClick() {
Expand All @@ -524,7 +524,7 @@ export default class DayPickerRangeController extends React.Component {
},
});

onNextMonthClick(newCurrentMonth);
onNextMonthClick(newCurrentMonth.clone());
}

onMultiplyScrollableMonths() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/DayPickerSingleDateController.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export default class DayPickerSingleDateController extends React.Component {
},
});

onPrevMonthClick(prevMonth);
onPrevMonthClick(prevMonth.clone());
}

onNextMonthClick() {
Expand All @@ -355,7 +355,7 @@ export default class DayPickerSingleDateController extends React.Component {
},
});

onNextMonthClick(newCurrentMonth);
onNextMonthClick(newCurrentMonth.clone());
}


Expand Down

0 comments on commit 1c4bc4e

Please sign in to comment.