Expand activity strip to nine months

This commit is contained in:
Georg Bauer
2026-07-31 10:56:44 +02:00
parent 82fadda983
commit 4e4dfb0db9
4 changed files with 13 additions and 14 deletions

View File

@@ -587,7 +587,7 @@ fn activity_detail(activity: &models::Activity) -> String {
}
fn heat_cells(data: &[models::UserHeatmapData]) -> (Vec<HeatCell>, i64) {
const DAYS: i64 = 6 * 31;
const DAYS: i64 = 9 * 31;
let latest = data
.iter()
.filter_map(|entry| entry.timestamp)
@@ -771,13 +771,13 @@ mod tests {
},
];
let (cells, total) = heat_cells(&heatmap);
assert_eq!((cells.len(), total), (186, 5));
assert_eq!((cells.len(), total), (279, 5));
assert_eq!(
(
cells[184].level,
cells[184].timestamp,
cells[184].contributions,
cells[185].level,
cells[277].level,
cells[277].timestamp,
cells[277].contributions,
cells[278].level,
),
(1, 100 * 86_400, 1, 4)
);