use same logig for date calculation as mini-beieli-web

This commit is contained in:
Joerg Lehmann 2022-08-01 10:58:09 +02:00
parent 5a2204876d
commit e306a17ebd
1 changed files with 1 additions and 2 deletions

View File

@ -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
}