-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Date validation default error message #654
Comments
Thanks for bringing this up. We could easily fix this, but we have to be careful not to break the current language-neutral |
This is a good idea. The only drawback might be that it is not clear whether the input was the string "Invalid Date" or an invalid date object, but it is probably better than the current solution. |
We could use quotes which are not used for strings then :) |
I am not sure I want to introduce a new syntax just for one case. I recommend going with "Invalid Date" until we find a better solution. |
Valibot v0.33.1 is available 🎉 |
great, thanks! |
When receiving an invalid date(say
new Date("invalid")
) what you get as an error iswhich is really confusing
I would suggest checking for invalid date case and then producing an error message like
I'm willing to work on a PR
My current workaround is this
Given we're already handling an error input could only be a Date if it's only an invalid date but we could do a more rigorous check here like
The text was updated successfully, but these errors were encountered: