diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-08-15 22:46:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-15 22:46:21 +0800 |
commit | 85202d4784758573f80f93dbbda97a444e7ece99 (patch) | |
tree | 7957506de8657463e79f121e1b79567ef1cc84a1 /models/pull.go | |
parent | 5a44be627c055d3e9eb406ec4a91579de78b6910 (diff) | |
download | gitea-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/pull.go')
-rw-r--r-- | models/pull.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/models/pull.go b/models/pull.go index 7dd6050c67..8728fa11cb 100644 --- a/models/pull.go +++ b/models/pull.go @@ -23,7 +23,7 @@ import ( "code.gitea.io/gitea/modules/setting" api "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/sync" - "code.gitea.io/gitea/modules/util" + "code.gitea.io/gitea/modules/timeutil" "github.com/Unknwon/com" "github.com/go-xorm/xorm" @@ -72,11 +72,11 @@ type PullRequest struct { ProtectedBranch *ProtectedBranch `xorm:"-"` MergeBase string `xorm:"VARCHAR(40)"` - HasMerged bool `xorm:"INDEX"` - MergedCommitID string `xorm:"VARCHAR(40)"` - MergerID int64 `xorm:"INDEX"` - Merger *User `xorm:"-"` - MergedUnix util.TimeStamp `xorm:"updated INDEX"` + HasMerged bool `xorm:"INDEX"` + MergedCommitID string `xorm:"VARCHAR(40)"` + MergerID int64 `xorm:"INDEX"` + Merger *User `xorm:"-"` + MergedUnix timeutil.TimeStamp `xorm:"updated INDEX"` } // Note: don't try to get Issue because will end up recursive querying. @@ -443,7 +443,7 @@ func (pr *PullRequest) manuallyMerged() bool { } if commit != nil { pr.MergedCommitID = commit.ID.String() - pr.MergedUnix = util.TimeStamp(commit.Author.When.Unix()) + pr.MergedUnix = timeutil.TimeStamp(commit.Author.When.Unix()) pr.Status = PullRequestStatusManuallyMerged merger, _ := GetUserByEmail(commit.Author.Email) |