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] add min range #17

Closed
metalmaninfr opened this issue May 14, 2021 · 5 comments
Closed

[Feature] add min range #17

metalmaninfr opened this issue May 14, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@metalmaninfr
Copy link

Problem

it's almost impossible to create a custom function that handles both start and end date on the range calendar

Solution

add min range prop to calendar or return selected from & to on the onChange prop

Community Benefits

be able to use calendar to set a minimum range of days

@metalmaninfr metalmaninfr changed the title [Feature] [Feature] add min range May 14, 2021
@sephi-dev
Copy link

sephi-dev commented May 17, 2021

I think we need to add the first click in the onChange (to get the from) and then the to.

@samsam-ahmadi
Copy link
Owner

@metalmaninfr Currently we are returning the from and to in onChange,
But if you need to get from after a click, we can do it.

@sephi-dev
Copy link

sephi-dev commented May 17, 2021

That's exactly what we are looking for. I think it's from Day, we need to add a first condition if dayjs(from) && to === "" to call setSelectedDays() with at least from at the first click. Maybe I'm wrong.

This is in order to set the min range after the first click.

@samsam-ahmadi
Copy link
Owner

@davidvenin
Ok, Please check this version 1.6.3

@samsam-ahmadi samsam-ahmadi added the enhancement New feature or request label May 17, 2021
@metalmaninfr
Copy link
Author

awesome thank you :)

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

No branches or pull requests

3 participants