fix: include activity needed for entire heatmap (#7893)

Problem: Only data from the past 365 days (31536000s) is loaded.
However, on the activity heatmap, there are 53 cols, each is 7 rows, so squares for at most 371 days (32054400s) are on the heatmap.
This results in a few blank squares on the very left side, despite activity.

Solution: Simply changing 31536000s (365d) to 32054400s (371d) to load all the needed activity.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7893
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Granular9241 <granular9241@noreply.codeberg.org>
Co-committed-by: Granular9241 <granular9241@noreply.codeberg.org>
This commit is contained in:
Granular9241 2025-05-21 05:25:39 +02:00 committed by 0ko
parent f3294f0b2d
commit 7fb99379f6
3 changed files with 19 additions and 1 deletions

View file

@ -54,6 +54,10 @@ func TestGetUserHeatmapDataByUser(t *testing.T) {
"multiple actions performed with two grouped together",
10, 10, 3, `[{"timestamp":1603009800,"contributions":1},{"timestamp":1603010700,"contributions":2}]`,
},
{
"test cutoff within",
40, 40, 1, `[{"timestamp":1577404800,"contributions":1}]`,
},
}
// Prepare
require.NoError(t, unittest.PrepareTestDatabase())