From 95ae28aa0fbca0c32bd67b74b09009802dd29307 Mon Sep 17 00:00:00 2001 From: Chris Sexton <3216719+chrissexton@users.noreply.github.com> Date: Wed, 28 Feb 2024 17:05:23 -0500 Subject: [PATCH] web: format time string --- bot/stats/stats.go | 4 ++-- bot/web/index.templ | 2 +- bot/web/index_templ.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bot/stats/stats.go b/bot/stats/stats.go index 3ca919a..61a27eb 100644 --- a/bot/stats/stats.go +++ b/bot/stats/stats.go @@ -14,6 +14,6 @@ func New() *Stats { return &Stats{startTime: time.Now()} } -func (s Stats) Uptime() time.Duration { - return time.Now().Sub(s.startTime) +func (s Stats) Uptime() string { + return time.Now().Sub(s.startTime).Truncate(time.Second).String() } diff --git a/bot/web/index.templ b/bot/web/index.templ index f6d6a29..cc555a2 100644 --- a/bot/web/index.templ +++ b/bot/web/index.templ @@ -76,7 +76,7 @@ templ (w *Web) showStats() {