From 1c93aab7e09cc0fe2b129824586a1d31332d7e8e Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 30 Jun 2020 09:55:46 +0200 Subject: [PATCH] Fix not loading timezones on all operating systems --- go.mod | 1 + go.sum | 4 ++++ pkg/config/config.go | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 46e90018..89b7d09b 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,7 @@ module code.vikunja.io/api require ( + 4d63.com/tz v1.1.0 code.vikunja.io/web v0.0.0-20200618164749-a5f3d450d39a gitea.com/xorm/xorm-redis-cache v0.2.0 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 diff --git a/go.sum b/go.sum index 0b2bb87d..96dec51c 100644 --- a/go.sum +++ b/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.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= diff --git a/pkg/config/config.go b/pkg/config/config.go index 1ffbd2b1..c2e89088 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -26,6 +26,7 @@ import ( "strings" "time" + "4d63.com/tz" "github.com/spf13/viper" ) @@ -159,7 +160,7 @@ var timezone *time.Location // it way easier, especially when testing. func GetTimeZone() *time.Location { if timezone == nil { - loc, err := time.LoadLocation(ServiceTimeZone.GetString()) + loc, err := tz.LoadLocation(ServiceTimeZone.GetString()) if err != nil { fmt.Printf("Error parsing time zone: %s", err) os.Exit(1)