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/user_heatmap.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/user_heatmap.go')
-rw-r--r-- | models/user_heatmap.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/models/user_heatmap.go b/models/user_heatmap.go index 3fdabbbf79..b511b5fa62 100644 --- a/models/user_heatmap.go +++ b/models/user_heatmap.go @@ -6,13 +6,13 @@ package models import ( "code.gitea.io/gitea/modules/setting" - "code.gitea.io/gitea/modules/util" + "code.gitea.io/gitea/modules/timeutil" ) // UserHeatmapData represents the data needed to create a heatmap type UserHeatmapData struct { - Timestamp util.TimeStamp `json:"timestamp"` - Contributions int64 `json:"contributions"` + Timestamp timeutil.TimeStamp `json:"timestamp"` + Contributions int64 `json:"contributions"` } // GetUserHeatmapDataByUser returns an array of UserHeatmapData @@ -35,7 +35,7 @@ func GetUserHeatmapDataByUser(user *User) ([]*UserHeatmapData, error) { sess := x.Select(groupBy+" AS timestamp, count(user_id) as contributions"). Table("action"). Where("user_id = ?", user.ID). - And("created_unix > ?", (util.TimeStampNow() - 31536000)) + And("created_unix > ?", (timeutil.TimeStampNow() - 31536000)) // * Heatmaps for individual users only include actions that the user themself // did. |