File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ mod relative {
156156 "month" => Span :: new ( ) . try_months ( units) ,
157157 "year" => Span :: new ( ) . try_years ( units) ,
158158 // Ignore values you don't know, assume seconds then (so does git)
159- _ => return None ,
159+ _anything => Span :: new ( ) . try_seconds ( units ) ,
160160 } ;
161161 Some ( result. map_err ( |_| Error :: RelativeTimeConversion ) )
162162 }
Original file line number Diff line number Diff line change @@ -184,6 +184,7 @@ mod relative {
184184 // For comparison, a few are the same as in: https://github.com/git/git/blob/master/t/t0006-date.sh
185185 let cases = [
186186 ( "5 seconds ago" , 5 . seconds ( ) ) ,
187+ ( "12345 florx ago" , 12_345 . seconds ( ) ) , // Anything parses as seconds
187188 ( "5 minutes ago" , 5 . minutes ( ) ) ,
188189 ( "5 hours ago" , 5 . hours ( ) ) ,
189190 ( "5 days ago" , 5 . days ( ) ) ,
You can’t perform that action at this time.
0 commit comments