diff --git a/apps/mobile/src/app/(tabs)/plan.tsx b/apps/mobile/src/app/(tabs)/plan.tsx index ae97eed..a89bc98 100644 --- a/apps/mobile/src/app/(tabs)/plan.tsx +++ b/apps/mobile/src/app/(tabs)/plan.tsx @@ -59,13 +59,6 @@ function addDays(d: Date, n: number): Date { copy.setDate(copy.getDate() + n); return copy; } -function startOfWeekMonday(d: Date): Date { - const copy = new Date(d); - const dow = (copy.getDay() + 6) % 7; - copy.setDate(copy.getDate() - dow); - copy.setHours(0, 0, 0, 0); - return copy; -} function cap(s: string): string { return s.length ? s[0]!.toUpperCase() + s.slice(1) : s; } @@ -78,7 +71,12 @@ export default function PlanScreen() { const todayKey = toKey(new Date()); const selected = useMemo(() => new Date(`${selectedKey}T00:00:00`), [selectedKey]); - const monday = useMemo(() => startOfWeekMonday(selected), [selected]); + // Veckoplanen startar alltid idag och går 7 dagar framåt (aldrig bakåt i tiden). + const monday = useMemo(() => { + const d = new Date(); + d.setHours(0, 0, 0, 0); + return d; + }, []); const mondayKey = toKey(monday); const weekDays = useMemo(() => Array.from({ length: 7 }, (_, i) => addDays(monday, i)), [monday]);