tbh yaml too many lines this is k
parent
b2c7df2361
commit
a96c5dc1f8
|
|
@ -101,7 +101,12 @@ fn log(f: &String, since: &Option<String>) -> Result<(), String> {
|
|||
fn parse_time(since: &Option<String>) -> Result<SystemTime, String> {
|
||||
match since {
|
||||
Some(since) => {
|
||||
Err("not impl".to_string())
|
||||
match DateTime::parse_from_str(since, "%Y-%m-%d") {
|
||||
Ok(dt) => {
|
||||
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))),
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue