diff options
author | Yi EungJun <eungjun.yi@navercorp.com> | 2015-12-08 12:23:38 +0900 |
---|---|---|
committer | Yi EungJun <eungjun.yi@navercorp.com> | 2015-12-08 13:18:00 +0900 |
commit | b8efeb2e72475378c7f58e1c8367f8b4da9b7efd (patch) | |
tree | 5de438b9f3769ec778f5850ab82b0eaccfed6fa7 /api/post.go | |
parent | 49a459d696fc8fee0b508990fca571fb8d2f2654 (diff) | |
download | chat-b8efeb2e72475378c7f58e1c8367f8b4da9b7efd.tar.gz chat-b8efeb2e72475378c7f58e1c8367f8b4da9b7efd.tar.bz2 chat-b8efeb2e72475378c7f58e1c8367f8b4da9b7efd.zip |
Use local timezone for notification email
Local timezone is better default than UTC because it is common that all
users of a mattermost server live near the server.
Diffstat (limited to 'api/post.go')
-rw-r--r-- | api/post.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/post.go b/api/post.go index ef70e1336..ffb69f382 100644 --- a/api/post.go +++ b/api/post.go @@ -465,8 +465,7 @@ func sendNotificationsAndForget(c *Context, post *model.Post, team *model.Team, teamURL := c.GetSiteURL() + "/" + team.Name // Build and send the emails - location, _ := time.LoadLocation("UTC") - tm := time.Unix(post.CreateAt/1000, 0).In(location) + tm := time.Unix(post.CreateAt/1000, 0) subjectPage := NewServerTemplatePage("post_subject") subjectPage.Props["SiteURL"] = c.GetSiteURL() @@ -498,6 +497,7 @@ func sendNotificationsAndForget(c *Context, post *model.Post, team *model.Team, bodyPage.Props["Minute"] = fmt.Sprintf("%02d", tm.Minute()) bodyPage.Props["Month"] = tm.Month().String()[:3] bodyPage.Props["Day"] = fmt.Sprintf("%d", tm.Day()) + bodyPage.Props["TimeZone"], _ = tm.Zone() bodyPage.Props["PostMessage"] = model.ClearMentionTags(post.Message) bodyPage.Props["TeamLink"] = teamURL + "/channels/" + channel.Name |