From f78cd5e6149fd55cbab7c04b5c1168f3048e3abf Mon Sep 17 00:00:00 2001 From: kekskurse Date: Fri, 14 Jan 2022 23:17:44 +0100 Subject: [PATCH] Add Current endpoint --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index f9d7f56..b699231 100644 --- a/main.go +++ b/main.go @@ -52,7 +52,8 @@ func runHttpServer() { w.Write([]byte("Doing "+lastEvent.Name+" since "+lastEvent.EventTimestamp.Format(time.RFC3339)+"
")) w.Write([]byte("

Today

")) for tag, _ := range currentState { - i := currentState[tag][time.Now().Format("02.01.06")] + i := currentState[tag][time.Now().Format("02.01.06") + i = i / 60 s := strconv.FormatInt(i, 10) line := tag+": "+s+"
" w.Write([]byte(line)) @@ -66,7 +67,7 @@ func runHttpServer() { secounds := currentState[tag][t.Format("02.01.06")] gi = gi + secounds } - + gi = gi / 60 s := strconv.FormatInt(gi, 10) line := tag+": "+s+"
" w.Write([]byte(line))