1
0
Эх сурвалжийг харах

correctly right-align timestamp column

Denis Cornehl 3 жил өмнө
parent
commit
2e9080d8b1

+ 1 - 0
src/output/table.rs

@@ -157,6 +157,7 @@ impl Column {
             Self::HardLinks  |
             Self::Inode      |
             Self::Blocks     |
+            Self::Timestamp(_) | 
             Self::GitStatus  => Alignment::Right,
             _                => Alignment::Left,
         }

+ 6 - 9
src/output/time.rs

@@ -122,15 +122,12 @@ fn long_zoned(time: SystemTime, zone: &TimeZone) -> String {
 
 #[allow(trivial_numeric_casts)]
 fn relative(time: SystemTime) -> String {
-    format!(
-        "{:>13}", 
-        timeago::Formatter::new().convert(
-            Duration::from_secs(
-                max(0, Instant::now().seconds() - systemtime_epoch(time))
-                // this .unwrap is safe since the call above can never result in a 
-                // value < 0
-                .try_into().unwrap()
-            )
+    timeago::Formatter::new().convert(
+        Duration::from_secs(
+            max(0, Instant::now().seconds() - systemtime_epoch(time))
+            // this .unwrap is safe since the call above can never result in a 
+            // value < 0
+            .try_into().unwrap()
         )
     )
 }