diff options
author | Unknwon <u@gogs.io> | 2015-08-24 21:01:23 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-24 21:01:23 +0800 |
commit | 87152f89ba313446fcf1c92ee40c404645c188f5 (patch) | |
tree | 007baed2e30555be8ae970e770f124beb8561086 /models/release.go | |
parent | 0b97290c07a0551a207b187432b014443e016237 (diff) | |
download | gitea-87152f89ba313446fcf1c92ee40c404645c188f5.tar.gz gitea-87152f89ba313446fcf1c92ee40c404645c188f5.zip |
fix release created timezone issue
Diffstat (limited to 'models/release.go')
-rw-r--r-- | models/release.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/models/release.go b/models/release.go index 012b6cc5c4..027491d9dc 100644 --- a/models/release.go +++ b/models/release.go @@ -10,6 +10,8 @@ import ( "strings" "time" + "github.com/go-xorm/xorm" + "github.com/gogits/gogs/modules/git" ) @@ -37,6 +39,13 @@ type Release struct { Created time.Time `xorm:"CREATED"` } +func (r *Release) AfterSet(colName string, _ xorm.Cell) { + switch colName { + case "created": + r.Created = regulateTimeZone(r.Created) + } +} + // IsReleaseExist returns true if release with given tag name already exists. func IsReleaseExist(repoId int64, tagName string) (bool, error) { if len(tagName) == 0 { |