feat(grid): exclude current month from grid and scoring calculations

This commit is contained in:
Michael committed 2026-02-21 15:13:29 +01:00
1 parent 1c5fe4499a
commit c1bd0ae097
2 files changed
+14 -1

No files matched your search

@@ -24,7 +24,9 @@ import { AiInsightBlock } from "@/features/ai-copilot/components/ai-insight-bloc
function getLast12Months(): string[] {
const months: string[] = [];
const now = new Date();
for (let i = 11; i >= 0; i--) {
// On commence à i=12 (il y a 12 mois) et on finit à i=1 (le mois dernier)
// pour exclure le mois en cours (i=0)
for (let i = 12; i >= 1; i--) {
const d = new Date(now.getFullYear(), now.getMonth() - i, 1);
months.push(`${d.getFullYear()}${String(d.getMonth() + 1).padStart(2, "0")}`);
}