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

minimum date for "to" date should be more than "from" date in Range Date picker #95

Closed
MasoumeAfshar opened this issue Dec 23, 2019 · 4 comments
Labels
invalid This doesn't seem right question Further information is requested

Comments

@MasoumeAfshar
Copy link

I use Range Datepicker, it isn't correct that "from" date be equal with the "to" date, minimum date for the "to" date should be more than "from" date

from: {day: 9, month: 10, year: 1398}
to: {day: 9, month: 10, year: 1398}
@MasoumeAfshar MasoumeAfshar added the bug Something isn't working label Dec 23, 2019
@Kiarash-Z
Copy link
Owner

@MasoumeAfshar This is the expected behavior. Imagine you want to select a day range for your payments, and you want to see only today's payments. How would you select that(with keeping the functionality for other ranges selection)?

@Kiarash-Z Kiarash-Z added invalid This doesn't seem right question Further information is requested and removed bug Something isn't working labels Dec 23, 2019
@MasoumeAfshar
Copy link
Author

This usage is less likely to occur, Why use Range in these circumstances, to see only today's payments!!
This is not good for booking and at least has the ability to set limits for the "to" date

@Kiarash-Z
Copy link
Owner

Kiarash-Z commented Dec 23, 2019

@MasoumeAfshar This is actually quite popular! I used it many times in my projects. However, this date picker is quite customizable. You can easily control this behavior by checking value in onChange callback. Just make sure to is not equal with from, if it is, don't update the state and show an error for the user.

@MasoumeAfshar
Copy link
Author

thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants