mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-30 18:49:41 +02:00
* multiple recipes per day * fix update * meal-planner rewrite * disable meal-tests * spacing Co-authored-by: hay-kot <hay-kot@pm.me>
50 lines
1.1 KiB
Vue
50 lines
1.1 KiB
Vue
<template>
|
|
<v-card>
|
|
<v-card-title class="headline">
|
|
{{ $t("meal-plan.edit-meal-plan") }}
|
|
</v-card-title>
|
|
<v-divider></v-divider>
|
|
|
|
<v-card-text>
|
|
<MealPlanCard v-model="mealPlan.planDays" />
|
|
<v-row align="center" justify="end">
|
|
<v-card-actions>
|
|
<v-btn color="success" text @click="update">
|
|
{{ $t("general.update") }}
|
|
</v-btn>
|
|
<v-spacer></v-spacer>
|
|
</v-card-actions>
|
|
</v-row>
|
|
</v-card-text>
|
|
</v-card>
|
|
</template>
|
|
|
|
<script>
|
|
import { api } from "@/api";
|
|
import { utils } from "@/utils";
|
|
import MealPlanCard from "./MealPlanCard";
|
|
export default {
|
|
components: {
|
|
MealPlanCard,
|
|
},
|
|
props: {
|
|
mealPlan: Object,
|
|
},
|
|
mounted() {
|
|
console.log(this.mealPlan);
|
|
},
|
|
methods: {
|
|
formatDate(timestamp) {
|
|
let dateObject = new Date(timestamp);
|
|
return utils.getDateAsPythonDate(dateObject);
|
|
},
|
|
async update() {
|
|
if (await api.mealPlans.update(this.mealPlan.uid, this.mealPlan)) {
|
|
this.$emit("updated");
|
|
}
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style></style>
|