Skip to content

[WIP] Add date format fallbacks #6667

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

Closed
wants to merge 1 commit into from

Conversation

dhilst
Copy link

@dhilst dhilst commented Aug 25, 2024

This MR adds a date/parser.rs module with a fallback parser for failing dates.

Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/date/date-tz is no longer failing!
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

@dhilst dhilst force-pushed the date-format-fallbacks branch from f150a2e to 49d56b8 Compare August 25, 2024 11:51
@dhilst dhilst force-pushed the date-format-fallbacks branch 2 times, most recently from 70b912a to 8da859d Compare August 25, 2024 15:38
@dhilst dhilst force-pushed the date-format-fallbacks branch 5 times, most recently from 85c1547 to a860422 Compare August 25, 2024 16:14
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/date/date-tz is no longer failing!
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

@dhilst dhilst force-pushed the date-format-fallbacks branch 5 times, most recently from 51ab733 to 5224337 Compare August 25, 2024 17:38
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

Comment on lines 199 to 206
// 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))
}
Copy link
Author

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!?

@dhilst dhilst force-pushed the date-format-fallbacks branch from 5224337 to 71c0305 Compare August 26, 2024 14:12
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

@dhilst
Copy link
Author

dhilst commented Aug 29, 2024

Continuing at: uutils/parse_datetime#86

@dhilst dhilst closed this Aug 29, 2024
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

Successfully merging this pull request may close these issues.

1 participant