cleanup more warnings and deprecated function use

This commit is contained in:
Henry Schimke
2022-12-30 17:00:35 -06:00
parent b383d7b0d4
commit 29a4040f2d
38 changed files with 158 additions and 133 deletions

View File

@@ -256,9 +256,11 @@ impl CalendarParsedRXingResult {
// ? DateFormat.getDateInstance(DateFormat.MEDIUM)
// : DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
// return format.format(date);
NaiveDateTime::from_timestamp(date, 0)
.format(format_string)
.to_string()
if let Some(dtm) = NaiveDateTime::from_timestamp_opt(date, 0) {
dtm.format(format_string).to_string()
} else {
String::from("")
}
}
fn parseDurationMS(durationString: &str) -> i64 {