From a96c5dc1f84d988ae4567618df1c2c293ee446ad Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Wed, 29 Nov 2023 06:11:08 -0700 Subject: [PATCH] tbh yaml too many lines this is k --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 7c53d67..c6581ab 100644 --- a/src/main.rs +++ b/src/main.rs @@ -101,7 +101,12 @@ fn log(f: &String, since: &Option) -> Result<(), String> { fn parse_time(since: &Option) -> Result { 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))), }