feat: Add days in the past selector on meal planner (#6857)

Co-authored-by: Michael Genson <genson.michael@gmail.com>
This commit is contained in:
Arnas Savickas
2026-03-26 21:09:52 +02:00
committed by GitHub
parent 9f47f38176
commit 41c3f1fced
4 changed files with 33 additions and 7 deletions

View File

@@ -15,7 +15,7 @@
<v-container class="px-0 d-flex align-center" height="56px">
<v-row no-gutters style="width: 100%;">
<v-col cols="10" class="d-flex align-center">
<p class="pl-2 my-1">
<p class="pl-2 my-1" :class="{ 'text-primary': isToday(day.date) }">
{{ $d(day.date, "short") }}
</p>
</v-col>
@@ -51,6 +51,8 @@
</template>
<script setup lang="ts">
import { isSameDay } from "date-fns";
import type { MealsByDate } from "./types";
import type { ReadPlanEntry } from "~/lib/api/types/meal-plan";
import GroupMealPlanDayContextMenu from "~/components/Domain/Household/GroupMealPlanDayContextMenu.vue";
@@ -126,4 +128,8 @@ const plan = computed<Days[]>(() => {
return acc;
}, [] as Days[]);
});
const isToday = (date: Date) => {
return isSameDay(date, new Date());
};
</script>