diff options
author | Lauris BH <lauris@nix.lv> | 2019-11-05 07:45:48 +0200 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-11-05 00:45:48 -0500 |
commit | a91679c9e337c46ab3e441097236f7a4dc07938d (patch) | |
tree | e6218c8939124477eb32daa96d9c896f97b91ff2 /routers/repo | |
parent | 8d8aecd3cfe842fa9024af0bf568063859741cd9 (diff) | |
download | gitea-a91679c9e337c46ab3e441097236f7a4dc07938d.tar.gz gitea-a91679c9e337c46ab3e441097236f7a4dc07938d.zip |
Add additional periods to activity page (#8829)
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/activity.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/routers/repo/activity.go b/routers/repo/activity.go index e170a91299..0b57d09685 100644 --- a/routers/repo/activity.go +++ b/routers/repo/activity.go @@ -35,6 +35,12 @@ func Activity(ctx *context.Context) { timeFrom = timeUntil.Add(-time.Hour * 168) case "monthly": timeFrom = timeUntil.AddDate(0, -1, 0) + case "quarterly": + timeFrom = timeUntil.AddDate(0, -3, 0) + case "semiyearly": + timeFrom = timeUntil.AddDate(0, -6, 0) + case "yearly": + timeFrom = timeUntil.AddDate(-1, 0, 0) default: ctx.Data["Period"] = "weekly" timeFrom = timeUntil.Add(-time.Hour * 168) @@ -70,6 +76,12 @@ func ActivityAuthors(ctx *context.Context) { timeFrom = timeUntil.Add(-time.Hour * 168) case "monthly": timeFrom = timeUntil.AddDate(0, -1, 0) + case "quarterly": + timeFrom = timeUntil.AddDate(0, -3, 0) + case "semiyearly": + timeFrom = timeUntil.AddDate(0, -6, 0) + case "yearly": + timeFrom = timeUntil.AddDate(-1, 0, 0) default: timeFrom = timeUntil.Add(-time.Hour * 168) } |