Skip to content

Commit 95d615e

Browse files
authored
Merge pull request #179 from SIT-DigiCre/fix/mattermost_remind
Fix mattermost remind
2 parents bd1cdc1 + 20a894e commit 95d615e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/mattermost/post_mattermost_cmd.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ func PostMattermostCmd(ctx echo.Context, dbClient db.TransactionClient, requestB
2121
lines := strings.Split(decode, "\n")
2222
infos := strings.Split(lines[0], " ")
2323
if requestBody.Command == "/remind" {
24-
remindDate, rerr := time.Parse("2006-01-02T15:04", infos[0])
24+
jst, _ := time.LoadLocation("Asia/Tokyo")
25+
remindDate, rerr := time.ParseInLocation("2006-01-02T15:04", infos[0], jst)
2526
channelName := requestBody.ChannelName
2627
if 3 <= len(infos) {
27-
channelName = infos[1][1:]
28+
channelName = infos[2][1:]
2829
}
2930
if rerr != nil {
3031
return api.ResPostMattermostCmd{}, &response.Error{Code: http.StatusInternalServerError, Level: "Error", Message: "時刻のパースに失敗しました", Log: rerr.Error()}

0 commit comments

Comments
 (0)