[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/why-this 624e98bc78 23/59: Fix relative time calculation
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/why-this 624e98bc78 23/59: Fix relative time calculation |
Date: |
Sun, 27 Nov 2022 16:02:50 -0500 (EST) |
branch: elpa/why-this
commit 624e98bc78f3ae55215d615c2df9def60fa72dd1
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>
Fix relative time calculation
---
why-this.el | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/why-this.el b/why-this.el
index be5a1c9cea..e707e11536 100644
--- a/why-this.el
+++ b/why-this.el
@@ -177,10 +177,13 @@ When EXACT is non-nil, be as exact as possible."
(setq str (concat str
(unless (zerop count)
(if (eq count 1)
- (format "a%s %s "
- (if (string= type "hour")
- "n" "")
- type)
+ (if (and (not exact)
+ (string= type "day"))
+ "Yesterday"
+ (format "A%s %s "
+ (if (string= type "hour")
+ "n" "")
+ type))
(format "%i %ss " count type))))
elapsed (% elapsed length))))))
(if (zerop elapsed)
@@ -196,7 +199,9 @@ When EXACT is non-nil, be as exact as possible."
(funcall calc-time "minute" 60)
(when (or exact (zerop (length str)))
(funcall calc-time "second" 1))))))
- (concat str "ago"))))
+ (if (and (not exact) (string= str "Yesterday"))
+ str
+ (concat str "ago")))))
(defun why-this-format-data (format data)
"Format DATA using FORMAT."
- [nongnu] elpa/why-this 3497115c2b 35/59: Don't store unnecessary data, (continued)
- [nongnu] elpa/why-this 3497115c2b 35/59: Don't store unnecessary data, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 7a2e4af450 19/59: Rewrite Git backend, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 41fe21da73 15/59: Fontify before annotate, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 006ea3864a 13/59: Fix Git backend 'supported-p command, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 0c1686d8d3 12/59: Fix misspelled word "annonate", ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 73398fb7cb 04/59: Don't interfere with writing, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 2093cadb03 06/59: Add relative time support and fix Git backend, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this c2a21ca13d 01/59: Core implementation without any backends, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this b26fca274d 21/59: Add COPYING, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 88ee5f9746 27/59: Add Mercurial backend, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 624e98bc78 23/59: Fix relative time calculation,
ELPA Syncer <=
- [nongnu] elpa/why-this 45dc65ccb1 26/59: Fix timezone problem in Git backend, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 236f8fd225 09/59: Fix problem when enabled on multiple buffers, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this dc5fc19b75 30/59: Allow changing time format, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this b8e612d4cb 20/59: Show tooltip on hover, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this aa15ec4fcd 29/59: Add support for minimum column of message, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 3e3f852835 38/59: Fix README, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 357cfa7e1e 34/59: Ensure that temporary file created by Git backend is deleted, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this f3d1e47b80 37/59: Fix indentation, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 1c8a4fbfd5 31/59: Update screenshots, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 37f3842f5e 32/59: Improve why-this-relative-time, ELPA Syncer, 2022/11/27