adobe / react-spectrum

A collection of libraries and tools that help you build adaptive, accessible, and robust user experiences.
https://react-spectrum.adobe.com
Apache License 2.0
12.58k stars 1.09k forks source link

Limit the range can selected based on start date in useRangePicker #6677

Open snowystinger opened 2 months ago

snowystinger commented 2 months ago

Discussed in https://github.com/adobe/react-spectrum/discussions/6595

Originally posted by **vanntrong** June 22, 2024 Hello, I would like to ask if there is any way to set the maxDate prop based on the `value.start`. Like in other packages, when the user selects a `start value`, the days that are out of range will be disabled. How can I do that? Thank you.
romansndlr commented 1 month ago

This would be extremely useful! Most programs that take orders calculate the availability/price based on the start date.

noamyagil commented 1 month ago

Like implemented in airbnb, after selecting a start date - the available endDate which was disabled as a start date should be enabled. To do that I need to change the isDateUnavailable according to the selected startDate.

alexglushenk commented 1 month ago

I've been eagerly awaiting a feature that allows the date range calendar to validate the end date based on the start date. will be great if you will help with it

jherskow commented 1 month ago

Likewise, this is a core functionality for us and we are not sure to do it here.

avr0000m commented 1 month ago

Same here. I'm pretty frustrated bout this . Hope to work around it until this will be solved. 😒

idanKoper commented 1 month ago

In general, it would be very useful to be able to run async logic based on the range start date like this price calculation from the Expedia site.

Screen Shot 2024-07-23 at 17 33 04