From e306a17ebdaf0bba7a59cfba32f0bef0a1a5f89d Mon Sep 17 00:00:00 2001 From: Joerg Lehmann Date: Mon, 1 Aug 2022 10:58:09 +0200 Subject: [PATCH] use same logig for date calculation as mini-beieli-web --- metrics.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/metrics.go b/metrics.go index 2d0923d..ad70eb1 100644 --- a/metrics.go +++ b/metrics.go @@ -7,7 +7,6 @@ import ( "html/template" "io/ioutil" "log" - "math" "net/http" "os" "strconv" @@ -403,7 +402,7 @@ func CalcDaysUntil(mydate string) int { if err != nil { days = 0 } - days = int(math.Round((t.Sub(time.Now()).Hours() / 24) + 0.5)) + days = int(t.Sub(time.Now().Truncate(24*time.Hour)).Hours() / 24) return days }