tbh yaml too many lines this is k
This commit is contained in:
@@ -101,7 +101,12 @@ 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) => {
|
||||||
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))),
|
None => Ok(SystemTime::now().sub(Duration::from_secs(60*60*24*7))),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user