Skip to content

How to select start or end dates of 'isUnavailable' range in useRangeCalendar? #4505

Answered by LFDanLu
MattHeslington asked this question in Q&A
Discussion options

You must be logged in to vote

Using https://react-spectrum.adobe.com/react-aria/useRangeCalendar.html#unavailable-dates as an example, you could perhaps change unavailable date logic to date.compare(interval[0]) > 0 && date.compare(interval[1]) < 0 instead like so. This makes the first/last date in each of the ranges of disabledRanges available.

However, this does mean that a user can select the first day of a booked range as their start date (e.g. if June 7th to 14th is booked, someone could select June 7th to June 7th, assuming that single day ranges are allowed) which feels odd to me.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MattHeslington
Comment options

Answer selected by MattHeslington
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants