tbh yaml too many lines this is k
parent
b2c7df2361
commit
a96c5dc1f8
|
|
@ -101,8 +101,13 @@ fn log(f: &String, since: &Option<String>) -> Result<(), String> {
|
||||||
fn parse_time(since: &Option<String>) -> Result<SystemTime, String> {
|
fn parse_time(since: &Option<String>) -> Result<SystemTime, String> {
|
||||||
match since {
|
match since {
|
||||||
Some(since) => {
|
Some(since) => {
|
||||||
|
match DateTime::parse_from_str(since, "%Y-%m-%d") {
|
||||||
|
Ok(dt) => {
|
||||||
Err("not impl".to_string())
|
Err("not impl".to_string())
|
||||||
},
|
},
|
||||||
|
Err(msg) => Err(format!("failed to parse {}: {}", since, msg)),
|
||||||
|
}
|
||||||
|
},
|
||||||
None => Ok(SystemTime::now().sub(Duration::from_secs(60*60*24*7))),
|
None => Ok(SystemTime::now().sub(Duration::from_secs(60*60*24*7))),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue