瀏覽代碼

remove "ago" from relative dates

Denis Cornehl 3 年之前
父節點
當前提交
bb3eadb3be
共有 1 個文件被更改,包括 9 次插入7 次删除
  1. 9 7
      src/output/time.rs

+ 9 - 7
src/output/time.rs

@@ -122,14 +122,16 @@ fn long_zoned(time: SystemTime, zone: &TimeZone) -> String {
 
 #[allow(trivial_numeric_casts)]
 fn relative(time: SystemTime) -> String {
-    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()
+        .ago("")
+        .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()
+            )
         )
-    )
 }
 
 #[allow(trivial_numeric_casts)]