-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Add invalid datetime message in Range validator #36326
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
[Validator] Add invalid datetime message in Range validator #36326
Conversation
since this is using some heuristic logic, I would suggest reporting this when min AND max are can be parsed as dates. |
@przemyslaw-bogusz Any comments about @nicolas-grekas suggestion? |
d8757fc
to
7d96db7
Compare
@nicolas-grekas I've modified the PR. As I understand, if one of the boundries is null and the other one is parsable DateTime string, this should also return |
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.
This should be rebased on master as this is a new feature.
@przemyslaw-bogusz I think you're right for your latest question. Still willing to finish this PR for master? |
9096d63
to
69792c2
Compare
69792c2
to
c777306
Compare
Thank you @przemyslaw-bogusz. |
When the validated value is invalid (it isn't a number nor a datetime), but
min
ormax
option indicate that theRange
constraint is being used to validate a datetime, the displayed message will beThis value should be a valid datetime
instead ofThis value should be a valid number
. This PR replaces #35998.