diff --git a/server/command.go b/server/command.go index 3c3e869..1f1759d 100755 --- a/server/command.go +++ b/server/command.go @@ -2,6 +2,7 @@ package main import ( "strings" + "time" "github.com/mattermost/mattermost-server/v6/model" "github.com/mattermost/mattermost-server/v6/plugin" @@ -31,7 +32,7 @@ func (p *Plugin) ExecuteCommand(c *plugin.Context, args *model.CommandArgs) (*mo } T, locale := p.translation(user) - location := p.location(user) + location, _ := time.LoadLocation(p.location(user).String()) command := strings.Trim(args.Command, " ") if strings.Trim(command, " ") == "/"+CommandTrigger { diff --git a/server/occurrence.go b/server/occurrence.go index d5a0ee5..95daf1a 100755 --- a/server/occurrence.go +++ b/server/occurrence.go @@ -592,7 +592,7 @@ func (p *Plugin) at(when string, user *model.User) (times []time.Time, err error func (p *Plugin) atEN(when string, user *model.User) (times []time.Time, err error) { T, _ := p.translation(user) - location := p.location(user) + location, _ := time.LoadLocation(p.location(user).String()) whenTrim := strings.Trim(when, " ") whenSplit := strings.Split(whenTrim, " ") @@ -1254,7 +1254,7 @@ func (p *Plugin) formatWhenEN(username string, when string, occurrence string, s return "" } T, _ := p.translation(user) - location := p.location(user) + location, _ := time.LoadLocation(p.location(user).String()) now := time.Now().In(location) t, _ := time.Parse(time.RFC3339, occurrence) diff --git a/server/scheduler.go b/server/scheduler.go index ed9d574..7e1e451 100755 --- a/server/scheduler.go +++ b/server/scheduler.go @@ -16,7 +16,7 @@ func (p *Plugin) ScheduleReminder(request *ReminderRequest, channelId string) (* return nil, uErr } T, _ := p.translation(user) - location := p.location(user) + location, _ := time.LoadLocation(p.location(user).String()) if pErr := p.ParseRequest(request); pErr != nil { p.API.LogError(pErr.Error())