From 3a1f58037dbc6f89066b5c18a02cf2990db664c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20D=C5=BEoi=C4=87?= <37804613+mariodz95@users.noreply.github.com> Date: Fri, 18 Jul 2025 21:40:35 +0200 Subject: [PATCH] fix: meal planner date range is correctly set (#5725) Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com> --- frontend/pages/household/mealplan/planner.vue | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/frontend/pages/household/mealplan/planner.vue b/frontend/pages/household/mealplan/planner.vue index 8b3a708dc..273a466d4 100644 --- a/frontend/pages/household/mealplan/planner.vue +++ b/frontend/pages/household/mealplan/planner.vue @@ -115,15 +115,11 @@ export default defineNuxtComponent({ const weekRange = computed(() => { const sorted = [...state.value.range].sort((a, b) => a.getTime() - b.getTime()); - if (sorted.length === 2) { - return { - start: sorted[0], - end: sorted[1], - }; - // return { - // start: parseYYYYMMDD(sorted[0]), - // end: parseYYYYMMDD(sorted[1]), - // }; + const start = sorted[0]; + const end = sorted[sorted.length - 1]; + + if (start && end) { + return { start, end }; } return { start: new Date(),