fix(helpers): interpretation of plain numbers as time
- leading zeroes are not ignored anymore - no odd jump between 59 and 60
This commit is contained in:
parent
a1347def62
commit
ee33086824
1 changed files with 2 additions and 2 deletions
|
@ -44,8 +44,8 @@ pub fn parse_hour_after<T: TimeZone>(str: &str, after: DateTime<T>) -> Option<Da
|
|||
str.parse::<u32>().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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue