1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-21 22:29:39 +02:00
mealie/frontend/src/components/MealPlan/MealPlanEditor.vue

42 lines
951 B
Vue
Raw Normal View History

2020-12-24 16:37:38 -09:00
<template>
<v-card>
2021-01-08 19:57:28 -09:00
<v-card-title class="headline"> Edit Meal Plan </v-card-title>
<v-divider></v-divider>
2020-12-24 16:37:38 -09:00
<v-card-text>
<MealPlanCard v-model="mealPlan.meals" />
<v-row align="center" justify="end">
<v-card-actions>
<v-btn color="success" text @click="update"> 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,
},
methods: {
formatDate(timestamp) {
let dateObject = new Date(timestamp);
return utils.getDateAsPythonDate(dateObject);
},
async update() {
await api.mealPlans.update(this.mealPlan.uid, this.mealPlan);
this.$emit("updated");
},
},
};
</script>
<style>
</style>