-
Notifications
You must be signed in to change notification settings - Fork 2
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
Check isNaN on alMax & use today as birthdate max #248
Conversation
Finish the code done in #245.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but there are more cases than you mentioned there. It was much harder to read IMO, so I didn't continue that.
No worries. It's been a while since I've looked at that code and what I'm seeing here makes sense to me. I like the new warning. I was hoping to get that in at some point.
This does treat invalid alMax / alMin dates as nothing instead of as a NaN Date, which will always be false when compared to other dates with <= and >=. I think means user's wouldn't be able to submit?
I think by "nothing" you mean an empty string from what I see. isNaN(new Date(""))
does === true
, so I think it won't get down to the date comparison.
Co-authored-by: plocket <[email protected]>
* refer to correct date var in `isNaN` * do similar logic in message functions to prevent errors * default to showing "birthdate must be in past" when birthdate max is invalid
Testing is done! Made a few last fixes for issues I found, but it's ready for review / merging |
@plocket for you to review when you have a chance i think! You know this code much better |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good as far as I can tell! I had one question to confirm my understanding of the flow, but it's not crucial.
Finish the code done in #245.
@plocket, is this the direction we want to take? I tried a version using
if/else
s like you suggested in #245 (comment), but there are more cases than you mentioned there. It was much harder to read IMO, so I didn't continue that.This does treat invalid alMax / alMin dates as nothing instead of as a NaN Date, which will always be false when compared to other dates with
<=
and>=
. I think means user's wouldn't be able to submit? (part of the testing I need to still do). It's a behavior change, but probably the safest one?Tested with: