Fix not loading timezones on all operating systems
This commit is contained in:
parent
53c4637fb6
commit
1c93aab7e0
3 changed files with 7 additions and 1 deletions
1
go.mod
1
go.mod
|
@ -17,6 +17,7 @@
|
||||||
module code.vikunja.io/api
|
module code.vikunja.io/api
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
4d63.com/tz v1.1.0
|
||||||
code.vikunja.io/web v0.0.0-20200618164749-a5f3d450d39a
|
code.vikunja.io/web v0.0.0-20200618164749-a5f3d450d39a
|
||||||
gitea.com/xorm/xorm-redis-cache v0.2.0
|
gitea.com/xorm/xorm-redis-cache v0.2.0
|
||||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
|
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
|
||||||
|
|
4
go.sum
4
go.sum
|
@ -1,3 +1,7 @@
|
||||||
|
4d63.com/embedfiles v0.0.0-20190311033909-995e0740726f h1:oyYjGRBNq1TxAIG8aHqtxlvqUfzdZf+MbcRb/oweNfY=
|
||||||
|
4d63.com/embedfiles v0.0.0-20190311033909-995e0740726f/go.mod h1:HxEsUxoVZyRxsZML/S6e2xAuieFMlGO0756ncWx1aXE=
|
||||||
|
4d63.com/tz v1.1.0 h1:Hi58WbeFjiUH4XOWuCpl5iSzuUuw1axZzTqIfMKPKrg=
|
||||||
|
4d63.com/tz v1.1.0/go.mod h1:SHGqVdL7hd2ZaX2T9uEiOZ/OFAUfCCLURdLPJsd8ZNs=
|
||||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg=
|
cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg=
|
||||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
|
|
|
@ -26,6 +26,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"4d63.com/tz"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -159,7 +160,7 @@ var timezone *time.Location
|
||||||
// it way easier, especially when testing.
|
// it way easier, especially when testing.
|
||||||
func GetTimeZone() *time.Location {
|
func GetTimeZone() *time.Location {
|
||||||
if timezone == nil {
|
if timezone == nil {
|
||||||
loc, err := time.LoadLocation(ServiceTimeZone.GetString())
|
loc, err := tz.LoadLocation(ServiceTimeZone.GetString())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Error parsing time zone: %s", err)
|
fmt.Printf("Error parsing time zone: %s", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|
Loading…
Reference in a new issue