diff --git a/src/app.rs b/src/app.rs index 8964dcc78..cb6135c78 100644 --- a/src/app.rs +++ b/src/app.rs @@ -290,11 +290,10 @@ fn validate_date_argument(arg: String) -> Result<(), String> { } pub fn validate_time_format(formatter: &str) -> Result<(), String> { - let str = formatter.to_string(); - let vec: Vec<&str> = str.split('\n').collect(); + let vec: Vec<&str> = formatter.split('\n').collect(); if vec.len() > 2 { - return Err("invalid format, can only contain one newline separator".to_owned()); + return Err("invalid date format, cannot contain more than two entries".to_owned()); } for s in vec { diff --git a/src/meta/date.rs b/src/meta/date.rs index 2f82d32ad..b952c38fe 100644 --- a/src/meta/date.rs +++ b/src/meta/date.rs @@ -68,7 +68,7 @@ impl Date { DateFlag::Formatted(format) => { let vec: Vec<&str> = format.split('\n').collect(); - if vec.len() == 1 || *val > Local::now() - Duration::seconds(15_778_476) { + if vec.len() == 1 || *val < Local::now() - Duration::seconds(15_778_476) { // non-recent or only one format val.format(vec[0]).to_string() } else {