-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pickers] Allow to refuse ranges that contains at least one disabled date #12072
Comments
@bruns6077 interesting use case indeed! |
@michelengelen Yeah i think also that this could be expensive. But what about the custom day rendering then ? |
Great suggestion for disabled dates behavior. As for the custom day rendering, have you tried passing your own component to the And for the current option to implement the requested custom behavior - yes, using I'm moving this issue to our board for grooming to discuss the disabled behavior extending. 😉 |
@LukasTy our discussion works great for Would you be OK to only add the prop to BTW the other issue solved by a lower level API like |
It looks like we might be able to utilize a boolean to control the ability to select disabled dates just as some competitors do. As for #8868, we'd need some double-checking, but it would seem that a combination of Naturally, if we see that the performance impact is undesirable, maybe going for a more lightweight solution like As for the DateTimeRangePicker and TimeRangePicker—I wouldn't see a problem in them not supporting these features at first until we see requests for them. |
@LukasTy or other team member: My question for you is, is there any way I can do that with the current range picker? I expected that to be the default behavior, but I don't see an option in the docs. If the feature doesn't exist maybe I could do some |
Hello, @dlsso. We are currently working on a feature to cover this behavior, it should be open for review soon. |
@dlsso As @arthurbalduini mentioned, there is no built-in behavior for it yet. |
Thank you both, I appreciate the feedback! |
Steps to reproduce
Link to live example: Livedemo
Steps:
Current behavior
When i define some Dates i want to disable (lets say we want to reflect some booking on the date-range picker)
I am still able to include them in my range by selecting a date before them and after them
Expected behavior
I would expect i can only select a range until a date is not disabled.
so lets assume the following:
10,14 Feb disabled: i would only be able to select 11,12,13 Feb
Basically if you select 11 Feb all dates except 12 and 13 need to be disabled so we can not select them until u made your selection.
1,2,3,5 Feb disabled: i would only be able to select 4 Feb
Basically if you select 4 Feb all dates except 12 and 13 need to be disabled so we can not select them until u made your selection.
i would suggest to implement it as an optional boolean which has its default value to true.
Context
this function is needed to be able to reflect booking mechanisms which much applications will need.
another thing which would be nice is a function for custom rendering days (maybe we want some certain dates to appear differently cause there are different events or prices) a possibility would be an render functions which kind of works like shouldDisableDate but does not only have the date as param, it should also include the component as param, and the handlers. so manipulation could be done. The function could Look Like this (date,component,handlers) => React.ReactElement<DAY_T>
Your environment
No response
Search keywords: datepicker,timepicker,daterangepicker,picker,bug,ui,ux,booking mechanism, custom day rendering
The text was updated successfully, but these errors were encountered: