summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-15 03:02:53 -0500
committerJeff Carr <[email protected]>2025-10-15 03:02:53 -0500
commit045697fb6a7f4f11d22219983d56aba850d8f8fe (patch)
treecbdf0ddc46ba0883a398c1acdbabd2a30d0281a8
parentc81936f59c8d242397f20b16c745e8e8c6ea4439 (diff)
check for durations in the futurev0.0.24
-rw-r--r--formatTime.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/formatTime.go b/formatTime.go
index 23cc5d1..6956ecc 100644
--- a/formatTime.go
+++ b/formatTime.go
@@ -18,6 +18,10 @@ func FormatTime(t time.Time) string {
func FormatTimeLocal(t time.Time) string {
localTime := t.Local()
s := localTime.Format("2006/01/02 15:04:03")
+ now := time.Now()
+ if now.Before(t) {
+ return s + " (future)"
+ }
dur := time.Since(t)
//always time, two spaces, (duration)
return s + " (" + FormatDuration(dur) + ")"