We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3313cbf commit 81b0c87Copy full SHA for 81b0c87
src/calendar-list/index.js
@@ -83,8 +83,7 @@ class CalendarList extends Component {
83
scrollToMonth(m) {
84
const month = parseDate(m);
85
const scrollTo = month || this.state.openDate;
86
- let diffMonths = this.state.openDate.diffMonths(scrollTo);
87
- diffMonths = diffMonths < 0 ? Math.ceil(diffMonths) : Math.floor(diffMonths);
+ let diffMonths = Math.round(this.state.openDate.clone().setDate(1).diffMonths(scrollTo.clone().setDate(1)));
88
const scrollAmount = (calendarHeight * this.pastScrollRange) + (diffMonths * calendarHeight);
89
//console.log(month, this.state.openDate);
90
//console.log(scrollAmount, diffMonths);
0 commit comments