-
Notifications
You must be signed in to change notification settings - Fork 543
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
%Y-%W-%w parsing for 2019 #961
Comments
Okay, there seems to be a bug in the logic for I can't quite work out the correct logic right now, please submit a PR if you can (and add the failing case as a test case). |
I think the fix is the same as from https://github.com/chronotope/chrono/pull/921/files - I'll push a commit to that PR |
a related question: why is I could make a separate issue if this is too much off-topic here ;-) |
%W identifies a week, but not a date, so you can't parse a date out of it. |
@djc that was my first thought as well. But if you take |
I guess if someone wants to contribute code to allow leaving off |
let date = NaiveDate::parse_from_str("2020-01-0", "%Y-%W-%w")?;
Returns: 2020-01-12
But:
let date = NaiveDate::parse_from_str("2019-01-0", "%Y-%W-%w")?;
Returns: Error: ParseError(Impossible)
Any reasons? Thx
The text was updated successfully, but these errors were encountered: