diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -354,7 +354,7 @@ lazy_static! { end => ("end") from_now_or_ago => [["from now", "ago"]] h12 => (?-B) [(1..=12).into_iter().collect::<Vec<_>>()] - h24 => [(1..=24).into_iter().flat_map(|i| vec![format!("{}", i), format!("{:02}", i)]).collect::<Vec<_>>()] + h24 => [(0..24).into_iter().flat_map(|i| vec![format!("{}", i), format!("{:02}", i)]).collect::<Vec<_>>()] minute => (?-B) [ (0..60).into_iter().map(|i| format!("{:02}", i)).collect::<Vec<_>>() ] modifier => [["the", "this", "last", "next"]] named_time => [["noon", "midnight"]] @@ -1518,12 +1518,7 @@ fn time(m: &Match) -> (u32, u32, u32, bool) { }; } let hour = if let Some(hour_24) = m.name("hour_24") { - let hour = s_to_n(hour_24.name("h24").unwrap().as_str()); - if hour == 24 { - 0 - } else { - hour - } + s_to_n(hour_24.name("h24").unwrap().as_str()) } else if let Some(hour_12) = m.name("hour_12") { let mut hour = s_to_n(hour_12.name("h12").unwrap().as_str()); hour = if let Some(am_pm) = m.name("am_pm") { |