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

Pattern FASTDATETIME does not catch invalid dates like 31 November #87

Open
AmraKu opened this issue Feb 6, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@AmraKu
Copy link

AmraKu commented Feb 6, 2023

Version

4.3.5

Context

The validation using pattern FASTDATETIME fails to catch invalid dates where the day is within the 1-31 range, but the month does not have 31 days (e.g. 31 November).

Solution

The definition of private static boolean testDateTime(String value) here
should be rewritten to return

Instant.parse(value);

instead of

FASTDATETIME.matcher(value).find();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant