@@ -10,14 +10,12 @@ import (
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/mattermost/mattermost-server/server/v8/model"
|
||||
"github.com/mattermost/mattermost-server/server/v8/playbooks/server/app"
|
||||
"github.com/mattermost/mattermost-server/server/v8/playbooks/server/config"
|
||||
"github.com/mattermost/mattermost-server/server/v8/playbooks/server/playbooks"
|
||||
"github.com/mattermost/mattermost-server/server/v8/playbooks/server/timeutils"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@@ -693,14 +691,8 @@ func (h *PlaybookHandler) getTopPlaybooksForUser(c *Context, w http.ResponseWrit
|
||||
h.HandleErrorWithCode(w, c.logger, http.StatusBadRequest, "unable to get user", err)
|
||||
return
|
||||
}
|
||||
timezone, err := timeutils.GetUserTimezone(user)
|
||||
if err != nil {
|
||||
h.HandleErrorWithCode(w, c.logger, http.StatusBadRequest, "unable to get user timezone", err)
|
||||
return
|
||||
}
|
||||
if timezone == nil {
|
||||
timezone = time.Now().UTC().Location()
|
||||
}
|
||||
timezone := user.GetTimezoneLocation()
|
||||
|
||||
// get unix time for duration
|
||||
startTime, appErr := model.GetStartOfDayForTimeRange(timeRange, timezone)
|
||||
if appErr != nil {
|
||||
@@ -750,14 +742,8 @@ func (h *PlaybookHandler) getTopPlaybooksForTeam(c *Context, w http.ResponseWrit
|
||||
h.HandleErrorWithCode(w, c.logger, http.StatusBadRequest, "unable to get user", err)
|
||||
return
|
||||
}
|
||||
timezone, err := timeutils.GetUserTimezone(user)
|
||||
if err != nil {
|
||||
h.HandleErrorWithCode(w, c.logger, http.StatusBadRequest, "unable to get user timezone", err)
|
||||
return
|
||||
}
|
||||
if timezone == nil {
|
||||
timezone = time.Now().UTC().Location()
|
||||
}
|
||||
timezone := user.GetTimezoneLocation()
|
||||
|
||||
// get unix time for duration
|
||||
startTime, appErr := model.GetStartOfDayForTimeRange(timeRange, timezone)
|
||||
if appErr != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user