From ee33086824ef311bd6119a4583037e82be2f1769 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Wed, 15 Jan 2025 22:08:15 +0100 Subject: [PATCH] fix(helpers): interpretation of plain numbers as time - leading zeroes are not ignored anymore - no odd jump between 59 and 60 --- src/helpers.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 712a837..c22389c 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -44,8 +44,8 @@ pub fn parse_hour_after(str: &str, after: DateTime) -> Option().ok().and_then(|number| { #[allow(deprecated)] after.date().and_hms_opt( - if number > 23 { number / 100 } else { number }, - if number > 23 { number % 100 } else { 0 }, + if str.len() > 2 { number / 100 } else { number }, + if str.len() > 2 { number % 100 } else { 0 }, 0, ).map(|time| { if time < after {