-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Why does isOutsideRange get called multiple times for each date, and at different times (midnight vs noon)? #2140
Comments
I'd expect always noon, since midnight doesn't always exist. This seems like a bug. |
Hi @ljharb, Proposed a fix for this issue, please take a look. |
A cache isn’t a good idea, because the callback may need to be called multiple times. the fix is to not use midnight. |
Wow, thanks for both of your help! Exciting to see the potential fix! |
Hi, wanted to ask if this ever got fixed? I'm still struggling to figure out how to deal with this, as I'm currently assuming noon time, but it'll still give me midnight time sometimes causing my users to see strange bugs |
Ah nvm, sorry for the thrash, I see that #2146 was merged in! Thank you so much for the fix! Will test this out more and see what might be going on |
@opqpop it's been merged, but not yet released. |
Ah okay thanks, any ETA on when that might be? Meanwhile, I dug into it and threw in something like this in my callsite, which seems to have helped with some of the bugs
|
react-dates version
react-dates@21.8.0
Describe the bug
isOutsideRange prop callback is passing each calendar day multiple times for some reason
specifically, each date can be called at local time midnight or local time noon, which makes it hard for me to know which one I'm supposed to compare for to return a correct value to isOutSideRange
expected behavior: returns consistent time, either always midnight local time or always noon local time
Source code (including props configuration)
Load and see strange output
zoom_0.mp4
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: