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
This commit is contained in:
Lunny Xiao 2019-08-15 22:46:21 +08:00 committed by GitHub
parent 5a44be627c
commit 85202d4784
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
77 changed files with 770 additions and 662 deletions

View file

@ -11,7 +11,7 @@ import (
"time"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/modules/timeutil"
)
// env keys for git hooks need
@ -140,7 +140,7 @@ func PushUpdateAddTag(repo *Repository, gitRepo *git.Repository, tagName string)
IsDraft: false,
IsPrerelease: false,
IsTag: true,
CreatedUnix: util.TimeStamp(createdAt.Unix()),
CreatedUnix: timeutil.TimeStamp(createdAt.Unix()),
}
if author != nil {
rel.PublisherID = author.ID
@ -151,7 +151,7 @@ func PushUpdateAddTag(repo *Repository, gitRepo *git.Repository, tagName string)
}
} else {
rel.Sha1 = commit.ID.String()
rel.CreatedUnix = util.TimeStamp(createdAt.Unix())
rel.CreatedUnix = timeutil.TimeStamp(createdAt.Unix())
rel.NumCommits = commitsCount
rel.IsDraft = false
if rel.IsTag && author != nil {