Skip to content
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

[Feature Request] An event handler when the user clicks on a date in DateRangePicker #3473

Open
spilist opened this issue Jul 15, 2024 · 2 comments

Comments

@spilist
Copy link

spilist commented Jul 15, 2024

Is your feature request related to a problem? Please describe.

In DateRangePicker, I wanted to make it possible to select only up to 2 weeks before and after when a user clicks a date inside Calendar UI.

Describe the solution you'd like

When an event handler, say onDateSelected, is called when a user clicks a date inside Calendar, I can dynamically change maxValue and minValue props of DateRangePicker.

Describe alternatives you've considered

  1. Without adding a new handler, add a new possible option for maxValue as number. A positive number can be given to these props only when isMaxValueRelative prop is true. For example, if 30 is set to maxValue, DateRangePicker only permits date from the selected date to "30 days after the selected date". Same for minValue.
  2. (current alternative) Show error message when user selects more than 2 weeks of period.

Screenshots or Videos

No response

@awesome-pro
Copy link
Contributor

awesome-pro commented Jul 26, 2024

@spilist I think you can use Date-range-picker component for this purpose. You can use useState hook to set values as per user interaction. I believe it should solve your feature need.

Or developing this feature requires team permission I will confirm you soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants