diff --git a/src/column.rs b/src/column.rs index 73692e3..4bacba1 100644 --- a/src/column.rs +++ b/src/column.rs @@ -11,7 +11,7 @@ use unicode_width::UnicodeWidthStr; pub enum Column { Permissions, FileSize(SizeFormat), - Timestamp(TimeType, i64), + Timestamp(TimeType), Blocks, User, Group, @@ -46,15 +46,15 @@ impl Column { /// to have a header row printed. pub fn header(&self) -> &'static str { match *self { - Column::Permissions => "Permissions", - Column::FileSize(_) => "Size", - Column::Timestamp(t, _) => t.header(), - Column::Blocks => "Blocks", - Column::User => "User", - Column::Group => "Group", - Column::HardLinks => "Links", - Column::Inode => "inode", - Column::GitStatus => "Git", + Column::Permissions => "Permissions", + Column::FileSize(_) => "Size", + Column::Timestamp(t) => t.header(), + Column::Blocks => "Blocks", + Column::User => "User", + Column::Group => "Group", + Column::HardLinks => "Links", + Column::Inode => "inode", + Column::GitStatus => "Git", } } } diff --git a/src/options.rs b/src/options.rs index bff0d12..fdc2d04 100644 --- a/src/options.rs +++ b/src/options.rs @@ -15,8 +15,6 @@ use std::os::unix::fs::MetadataExt; use getopts; use natord; -use datetime::local::{LocalDateTime, DatePiece}; - use self::Misfire::*; /// The *Options* struct represents a parsed version of the user's @@ -555,18 +553,16 @@ impl Columns { columns.push(Group); } - let current_year = LocalDateTime::now().year(); - if self.time_types.modified { - columns.push(Timestamp(TimeType::FileModified, current_year)); + columns.push(Timestamp(TimeType::FileModified)); } if self.time_types.created { - columns.push(Timestamp(TimeType::FileCreated, current_year)); + columns.push(Timestamp(TimeType::FileCreated)); } if self.time_types.accessed { - columns.push(Timestamp(TimeType::FileAccessed, current_year)); + columns.push(Timestamp(TimeType::FileAccessed)); } if cfg!(feature="git") { diff --git a/src/output/details.rs b/src/output/details.rs index 7fdec9c..95dead9 100644 --- a/src/output/details.rs +++ b/src/output/details.rs @@ -183,15 +183,15 @@ impl Table { fn display(&mut self, file: &File, column: &Column) -> Cell { match *column { - Column::Permissions => self.render_permissions(file.permissions()), - Column::FileSize(fmt) => self.render_size(file.size(), fmt), - Column::Timestamp(t, _) => self.render_time(file.timestamp(t)), - Column::HardLinks => self.render_links(file.links()), - Column::Inode => self.render_inode(file.inode()), - Column::Blocks => self.render_blocks(file.blocks()), - Column::User => self.render_user(file.user()), - Column::Group => self.render_group(file.group()), - Column::GitStatus => self.render_git_status(file.git_status()), + Column::Permissions => self.render_permissions(file.permissions()), + Column::FileSize(fmt) => self.render_size(file.size(), fmt), + Column::Timestamp(t) => self.render_time(file.timestamp(t)), + Column::HardLinks => self.render_links(file.links()), + Column::Inode => self.render_inode(file.inode()), + Column::Blocks => self.render_blocks(file.blocks()), + Column::User => self.render_user(file.user()), + Column::Group => self.render_group(file.group()), + Column::GitStatus => self.render_git_status(file.git_status()), } }