summaryrefslogtreecommitdiffstats
path: root/models/release.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-08-15 22:46:21 +0800
committerGitHub <noreply@github.com>2019-08-15 22:46:21 +0800
commit85202d4784758573f80f93dbbda97a444e7ece99 (patch)
tree7957506de8657463e79f121e1b79567ef1cc84a1 /models/release.go
parent5a44be627c055d3e9eb406ec4a91579de78b6910 (diff)
downloadgitea-85202d4784758573f80f93dbbda97a444e7ece99.tar.gz
gitea-85202d4784758573f80f93dbbda97a444e7ece99.zip
Display ui time with customize time location (#7792)
* display ui time with customize time location * fix lint * rename UILocation to DefaultUILocation * move time related functions to modules/timeutil * fix tests * fix tests * fix build * fix swagger
Diffstat (limited to 'models/release.go')
-rw-r--r--models/release.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/models/release.go b/models/release.go
index ecb9d1e44a..7ef0134c9d 100644
--- a/models/release.go
+++ b/models/release.go
@@ -14,7 +14,7 @@ import (
"code.gitea.io/gitea/modules/process"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
- "code.gitea.io/gitea/modules/util"
+ "code.gitea.io/gitea/modules/timeutil"
"xorm.io/builder"
)
@@ -32,13 +32,13 @@ type Release struct {
Title string
Sha1 string `xorm:"VARCHAR(40)"`
NumCommits int64
- NumCommitsBehind int64 `xorm:"-"`
- Note string `xorm:"TEXT"`
- IsDraft bool `xorm:"NOT NULL DEFAULT false"`
- IsPrerelease bool `xorm:"NOT NULL DEFAULT false"`
- IsTag bool `xorm:"NOT NULL DEFAULT false"`
- Attachments []*Attachment `xorm:"-"`
- CreatedUnix util.TimeStamp `xorm:"INDEX"`
+ NumCommitsBehind int64 `xorm:"-"`
+ Note string `xorm:"TEXT"`
+ IsDraft bool `xorm:"NOT NULL DEFAULT false"`
+ IsPrerelease bool `xorm:"NOT NULL DEFAULT false"`
+ IsTag bool `xorm:"NOT NULL DEFAULT false"`
+ Attachments []*Attachment `xorm:"-"`
+ CreatedUnix timeutil.TimeStamp `xorm:"INDEX"`
}
func (r *Release) loadAttributes(e Engine) error {
@@ -137,13 +137,13 @@ func createTag(gitRepo *git.Repository, rel *Release) error {
}
rel.Sha1 = commit.ID.String()
- rel.CreatedUnix = util.TimeStamp(commit.Author.When.Unix())
+ rel.CreatedUnix = timeutil.TimeStamp(commit.Author.When.Unix())
rel.NumCommits, err = commit.CommitsCount()
if err != nil {
return fmt.Errorf("CommitsCount: %v", err)
}
} else {
- rel.CreatedUnix = util.TimeStampNow()
+ rel.CreatedUnix = timeutil.TimeStampNow()
}
return nil
}