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

🐛 Deal with invalid date inputs #7

Merged
merged 1 commit into from
Feb 22, 2023
Merged

🐛 Deal with invalid date inputs #7

merged 1 commit into from
Feb 22, 2023

Conversation

minimav
Copy link
Owner

@minimav minimav commented Feb 22, 2023

Due to using date picker elements, an invalid date can only occur if a user types in one of the fields, and even then some possible failure modes can't occur, e.g. trying to type a day above 31 or month above 12 will not work. Only typing an invalid day for a shorter month, e.g. 31st November, will cause an error. In this case the date picker's value is just the empty string rather than what is visible in the date picker. The other invalid situation is when the start date is after the end date.

This resolves #5

Due to using date picker elements, an invalid date can only occur if a user types in one of the fields, and even then some possible failure modes can't occur, e.g. trying to type a day above 31 or month above 12 will not work. Only typing an invalid day for a shorter month, e.g. 31st November, will cause an error. In this case the date picker's value is just the empty string rather than what is visible in the date picker. The other invalid situation is when the start date is after the end date.
@minimav minimav merged commit 67534ef into main Feb 22, 2023
@minimav minimav deleted the date-validation branch February 22, 2023 20:02
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

Successfully merging this pull request may close these issues.

Invalid dates in forms
1 participant