File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -290,11 +290,10 @@ fn validate_date_argument(arg: String) -> Result<(), String> {
290290}
291291
292292pub fn validate_time_format ( formatter : & str ) -> Result < ( ) , String > {
293- let str = formatter. to_string ( ) ;
294- let vec: Vec < & str > = str. split ( '\n' ) . collect ( ) ;
293+ let vec: Vec < & str > = formatter. split ( '\n' ) . collect ( ) ;
295294
296295 if vec. len ( ) > 2 {
297- return Err ( "invalid format, can only contain one newline separator " . to_owned ( ) ) ;
296+ return Err ( "invalid date format, cannot contain more than two entries " . to_owned ( ) ) ;
298297 }
299298
300299 for s in vec {
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ impl Date {
6868 DateFlag :: Formatted ( format) => {
6969 let vec: Vec < & str > = format. split ( '\n' ) . collect ( ) ;
7070
71- if vec. len ( ) == 1 || * val > Local :: now ( ) - Duration :: seconds ( 15_778_476 ) {
71+ if vec. len ( ) == 1 || * val < Local :: now ( ) - Duration :: seconds ( 15_778_476 ) {
7272 // non-recent or only one format
7373 val. format ( vec[ 0 ] ) . to_string ( )
7474 } else {
You can’t perform that action at this time.
0 commit comments