diff options
author | Ben S <ogham@bsago.me> | 2015-02-09 18:14:05 +0000 |
---|---|---|
committer | Ben S <ogham@bsago.me> | 2015-02-09 18:14:05 +0000 |
commit | 8b520edf3d667b8f37278be7b3a313b2972db7a8 (patch) | |
tree | e2ff5e93ce162562f0106f28b0661f617cbfc400 /src/options.rs | |
parent | bc7492e7e6ee993b70e81c51bc341d15f70dcf12 (diff) |
Only display the year if it's last year
Otherwise, just display the hour and minute.
Diffstat (limited to 'src/options.rs')
-rw-r--r-- | src/options.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/options.rs b/src/options.rs index cbba1fd..e12b349 100644 --- a/src/options.rs +++ b/src/options.rs @@ -12,6 +12,8 @@ use std::fmt; use getopts; use natord; +use datetime::local::{LocalDateTime, DatePiece}; + use self::Misfire::*; /// The *Options* struct represents a parsed version of the user's @@ -422,16 +424,18 @@ impl Columns { columns.push(Group); } + let current_year = LocalDateTime::now().year(); + if self.time_types.modified { - columns.push(Timestamp(TimeType::FileModified)); + columns.push(Timestamp(TimeType::FileModified, current_year)); } if self.time_types.created { - columns.push(Timestamp(TimeType::FileCreated)); + columns.push(Timestamp(TimeType::FileCreated, current_year)); } if self.time_types.accessed { - columns.push(Timestamp(TimeType::FileAccessed)); + columns.push(Timestamp(TimeType::FileAccessed, current_year)); } if cfg!(feature="git") { |