Skip to content

Commit

Permalink
Fixed render of months #543
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrognomik committed Nov 20, 2017
1 parent b28dd81 commit 02221c8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/DayPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ export default class DayPicker extends Component {
props.fromMonth,
Math.floor(diffInMonths / props.numberOfMonths) * props.numberOfMonths
);
} else if (props.toMonth && props.numberOfMonths > 1) {
const diffInMonths = Helpers.getMonthsDiff(props.toMonth, currentMonth);
if (diffInMonths <= 0) {
currentMonth = DateUtils.addMonths(
props.toMonth,
1 - this.props.numberOfMonths
);
}
}
return { currentMonth };
};
Expand Down

0 comments on commit 02221c8

Please sign in to comment.