onefinestay / react-daterange-picker

Other
563 stars 209 forks source link

Displayed range presumes selecting dates from future rather than past #231

Open jaycincotta opened 4 years ago

jaycincotta commented 4 years ago

I would like to use this for selecting date ranges for retrieving historical data. With numberOfCalendars=4 and maximumDate=today, I would expect the control to display this month and the previous four months, but it displays one month in the past and two months into the future.

When maximumDate is set, there is no value in viewing entire future months that are ineligible for selection. In this scenario, I would expect to see the current month and the three previous months.

In fact, if you use the arrow buttons to scroll into the past then try to scroll back into the future, the control will not allow you to scroll beyond the month containing maximumDate. This same constraint should be applied to the initial set of calendars displayed.

Codesandbox