forked from kevadesu/forgejo
Add additional periods to activity page (#8829)
This commit is contained in:
parent
8d8aecd3cf
commit
a91679c9e3
3 changed files with 18 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue