-
Notifications
You must be signed in to change notification settings - Fork 109
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
No validation on date parsing #188
Comments
Options
|
Curious how other parsers handle that (e.g. in other languages). It seems toml spec specifies the date should follow the https://datatracker.ietf.org/doc/html/rfc3339. And if chrono panics on construction instead of returning an error, that's not good either, but I would lean towards Do nothing and documenting this behavior. |
Chrono offers panicing and Looking at the RFC, it seems like it shouldn't be too bad to address days of month. I assume the complexity in chrono is coming from other functionality. Leap seconds is an interesting one. If you don't bother with a lookup table, it simplifies things but knowing whether you can have a leap second or not is dependent on the month. So a date-less time can't do validation and combining a date and time can error. |
As for other languages, Python's |
If my preference is at all useful here, I would like The project where I use |
With #187, we dropped most of our date validation, like 2021-02-31 now works.
Looks like chrono has some pretty complex lookup logic to prevent that
Playground of it erroring
The text was updated successfully, but these errors were encountered: