mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-27 21:02:35 +00:00
all client parsing tests pass except known upce
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
// import java.util.regex.Matcher;
|
||||
// import java.util.regex.Pattern;
|
||||
|
||||
use chrono::{Date, DateTime, NaiveDateTime, TimeZone, Utc};
|
||||
use chrono::{Date, DateTime, Local, NaiveDateTime, TimeZone, Utc};
|
||||
use chrono_tz::Tz;
|
||||
use regex::Regex;
|
||||
|
||||
@@ -229,6 +229,17 @@ impl CalendarParsedRXingResult {
|
||||
))),
|
||||
};
|
||||
}
|
||||
|
||||
// Try a final time with an exact length
|
||||
if when.len() == 15 {
|
||||
return match Utc.datetime_from_str(&when, "%Y%m%dT%H%M%S") {
|
||||
Ok(dtm) => Ok(dtm.timestamp()),
|
||||
Err(e) => Err(Exceptions::ParseException(format!(
|
||||
"couldn't parse local time: {}",
|
||||
e
|
||||
))),
|
||||
};
|
||||
}
|
||||
Self::parseDateTimeString(&when)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user