aboutsummaryrefslogtreecommitdiff
path: root/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'renderer')
-rw-r--r--renderer/renderer.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/renderer/renderer.go b/renderer/renderer.go
index 293a6c6..a4f749d 100644
--- a/renderer/renderer.go
+++ b/renderer/renderer.go
@@ -197,11 +197,19 @@ func DurToStr(dur time.Duration) string {
}
func TimeSince(t time.Time) string {
- return DurToStr(time.Since(t))
+ d := time.Since(t)
+ if d < 0 {
+ d = 0
+ }
+ return DurToStr(d)
}
func TimeUntil(t time.Time) string {
- return DurToStr(time.Until(t))
+ d := time.Until(t)
+ if d < 0 {
+ d = 0
+ }
+ return DurToStr(d)
}
func FormatTimeRFC3339(t time.Time) string {