diff --git a/src/hooks/useAnimation.ts b/src/hooks/useAnimation.ts index 02ca2a6..d444363 100644 --- a/src/hooks/useAnimation.ts +++ b/src/hooks/useAnimation.ts @@ -39,20 +39,19 @@ function buildFrames(periodDays: number): TimeFrame[] { }); } - // 30 days → weekly frames + // 30 days → half-week frames (3.5 days ≈ 9–10 frames) + const HALF_WEEK = 3.5 * 86_400_000; const frames: TimeFrame[] = []; let cursor = start; - let week = 1; while (cursor < now) { const from = cursor; - const to = Math.min(cursor + 7 * 86_400_000, now); + const to = Math.min(cursor + HALF_WEEK, now); frames.push({ - label: `Semaine ${week} · ${fmt(from, { day: 'numeric', month: 'short' })} – ${fmt(to - 1, { day: 'numeric', month: 'short' })}`, + label: `${fmt(from, { day: 'numeric', month: 'short' })} – ${fmt(to - 1, { day: 'numeric', month: 'short' })}`, from, to, }); cursor = to; - week++; } return frames; }