react-infinite-calendar
react-infinite-calendar copied to clipboard
fix utils.getMonthsForYear() to account for months shorter than that …
…of the selected date; resolves #140
Hmm, would you care to elaborate a little about this solution?
new Date(2017, 1, 28)
Tue Feb 28 2017 00:00:00 GMT-0600 (Central Standard Time)
new Date(2017, 1, 31)
Fri Mar 03 2017 00:00:00 GMT-0600 (Central Standard Time)
If the day passed to getMonthsForYear is greater than the number of days in that month, you end up getting the following month. Result being in your year view, you end up with Jan Mar Mar May May...
So the proposed solution is to constrain the day to fall within the month. Math.min
returns the lesser of n values.
Hi, is there any plan to merge this PR?