-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[WIP] Add date format fallbacks #6667
Conversation
GNU testsuite comparison:
|
f150a2e
to
49d56b8
Compare
70b912a
to
8da859d
Compare
85c1547
to
a860422
Compare
GNU testsuite comparison:
|
GNU testsuite comparison:
|
51ab733
to
5224337
Compare
GNU testsuite comparison:
|
src/uu/date/src/parser.rs
Outdated
// Parse fallback for dates. It try to parse `input` and update | ||
// `d` accordingly. | ||
pub fn parse_fb( | ||
input: &str, | ||
d: DateTime<FixedOffset>, | ||
) -> Result<DateTime<FixedOffset>, (&str, parse_datetime::ParseDateTimeError)> { | ||
Token::parse(input, d).map_err(|_| (input, parse_datetime::ParseDateTimeError::InvalidInput)) | ||
} |
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.
I added this function, but afterward, I realized that parse_datetime is not a 3rd party library. I guess this should be fixed there instead of here!?
5224337
to
71c0305
Compare
GNU testsuite comparison:
|
Continuing at: uutils/parse_datetime#86 |
This MR adds a date/parser.rs module with a fallback parser for failing dates.