summaryrefslogtreecommitdiffstats
path: root/src/cli.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/cli.rs b/src/cli.rs
index ff7fcd8..e97308e 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -1256,6 +1256,7 @@ fn arg_older_than_date(about: &str) -> Arg<'_> {
.about(about)
.long_about(r#"
DATE can be a freeform date, for example '2h'
+ It can also be a exact date: '2020-01-01 00:12:45'
Supported suffixes:
@@ -1285,6 +1286,7 @@ fn arg_newer_than_date(about: &str) -> Arg<'_> {
.about(about)
.long_about(r#"
DATE can be a freeform date, for example '2h'
+ It can also be a exact date: '2020-01-01 00:12:45'
Supported suffixes:
@@ -1305,7 +1307,14 @@ fn arg_newer_than_date(about: &str) -> Arg<'_> {
}
fn parse_date_from_string(s: &str) -> std::result::Result<(), String> {
- humantime::parse_duration(s).map_err(|e| e.to_string()).map(|_| ())
+ humantime::parse_duration(s)
+ .map_err(|e| e.to_string())
+ .map(|_| ())
+ .or_else(|_| {
+ humantime::parse_rfc3339_weak(s)
+ .map_err(|e| e.to_string())
+ .map(|_| ())
+ })
}
fn parse_usize(s: &str) -> std::result::Result<(), String> {