I wish to use the Range Picker to select a start day and end date. Check-ins and Check-outs must be Saturdays, so disabledDays
is populated such that it includes all dates which are not Saturdays.
I expect to be able to select the range of my choice.
<RangePicker
numberOfMonths={1}
initialMonthAndYear="2021-08"
onChange={(dates) => window.console.log(dates)}
disabledDays={['2021-08-01','2021-08-02','2021-08-03','2021-08-04','2021-08-05','2021-08-06','2021-08-08','2021-08-09','2021-08-10','2021-08-11','2021-08-12','2021-08-13','2021-08-15','2021-08-16','2021-08-17','2021-08-18','2021-08-19','2021-08-20','2021-08-22','2021-08-23','2021-08-24','2021-08-25','2021-08-26','2021-08-27','2021-08-29','2021-08-30','2021-08-31']}
/>
If you select, e.g. the 7th August, and then select 14th of August as the end date, the onChange event will return log Object { from: "2021-08-07", to: "2021-08-07" }
, i.e. starting and ending on the 7th. I've done more extensive testing allowing a few days to be non-disabled after the start date and it does set the "to" value to be as long as possible up to the first non-disabled date.
I presume this is a valid use case for "disabledDays" (the meaning of them being "disabled" changes slightly after the start day has been selected - it can (as in this case) mean an invalid choice of end date, rather than something which cannot be spanned)