Open willfindlay opened 1 year ago
The following changes to am_pm()
fix the bug:
fn am_pm(name: &str, mut hour: u32) -> DateResult<u32> {
if name == "pm" {
if hour != 12 {
hour += 12;
}
} else if name == "am" {
if hour == 12 {
hour = 0;
}
} else if name != "am" {
return date_result("expected am or pm");
}
Ok(hour)
}
I noticed that my fork, interim, also has this problem.
What isn't immediately clear to me is whether "12pm" should be tonight or this morning. e.g. it's currently 2023-10-15T13:33:00+01:00
. Should "12pm" be 2023-10-16T00:00:00+01:00
or 2023-10-15T00:00:00+01:00
. My gut feeling tells me that it should choose tonight.
Never mind, 12pm should be midday
Sorry guys, this is a nasty one and I will fix as soon as I get back from vacation.
See issue title.
Relevant Cargo.lock versions: