fix(kiwi-fe): MealPlanView strict TS split index type narrowing

This commit is contained in:
pyr0ball 2026-04-14 15:55:38 -07:00
parent 33c619b6b5
commit fdc477b395

View file

@ -102,7 +102,7 @@ async function onNewPlan() {
// Compute Monday of current week (getDay: 0=Sun, 1=Mon...) // Compute Monday of current week (getDay: 0=Sun, 1=Mon...)
const monday = new Date(today) const monday = new Date(today)
monday.setDate(today.getDate() - ((day + 6) % 7)) monday.setDate(today.getDate() - ((day + 6) % 7))
const weekStart = monday.toISOString().split('T')[0] const weekStart = monday.toISOString().split('T')[0] ?? monday.toISOString().slice(0, 10)
await store.createPlan(weekStart, ['dinner']) await store.createPlan(weekStart, ['dinner'])
} }