date: format date to correct date format before parsing#6401
date: format date to correct date format before parsing#6401ahmadabd wants to merge 2 commits intouutils:mainfrom
Conversation
|
GNU testsuite comparison: |
|
After looking at the code, there is this snippet in the For some reasons (I may not have all the context about it), we add I could understand why parsing Maybe a workaround would be to add respectively This would require a change to the parse_datetime crate. |
|
You mean the bug is in parse datetime crate? @RenjiSann |
|
Yes, it most probably is. |
|
The following example isolates the bug being on the parsing of the last single digit. It has no issue parsing use parse_datetime::parse_datetime;
fn main() {
let one = parse_datetime("2001-01-04");
let two = parse_datetime("2001-1-04");
let three = parse_datetime("2001-01-4");
let four = parse_datetime("2001-1-4");
println!("Result:\n{:?}\n{:?}\n{:?}\n{:?}", one, two, three, four);
} |
|
Here is a PR for the fix in |
|
Waiting for uutils/parse_datetime#76 to be released |
|
#6423 was merged, from what I am testing, this is fixed. Maybe we can still add tests to make sure there are no regressions afterwards ? @ahmadabd do you want to give it a shot ? You can take a look at the tests I added in |
| @@ -222,6 +222,12 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { | |||
| // Iterate over all dates - whether it's a single date or a file. | |||
|
please reopen when ready :) |
closes #6392