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

Improve validation for date representation #2

Open
ThomasPO opened this issue Jun 4, 2024 · 0 comments
Open

Improve validation for date representation #2

ThomasPO opened this issue Jun 4, 2024 · 0 comments

Comments

@ThomasPO
Copy link
Collaborator

ThomasPO commented Jun 4, 2024

DateTime representation typed "Date" is validated using regular expression. This implementation accepts non-valid date as 30th of February 2020.

Would it be interesting to add a cast to identify these cases at runtime. For instance:

rule_date_report : match_characters(cast(date_report, date), "^\d{4}-(((0)[0-9])|((1)[0-2]))-([0-2][0-9]|(3)[0-1])$") errorcode "Date format YYYY-MM-DD not valid";
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

No branches or pull requests

1 participant