use same logig for date calculation as mini-beieli-web
This commit is contained in:
+1
-2
@@ -7,7 +7,6 @@ import (
|
|||||||
"html/template"
|
"html/template"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"math"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
@@ -403,7 +402,7 @@ func CalcDaysUntil(mydate string) int {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
days = 0
|
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
|
return days
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user