From f565cfce7a66197c639be659284975a949ecd353 Mon Sep 17 00:00:00 2001 From: Florian Dupret <34862846+sephrat@users.noreply.github.com> Date: Fri, 23 Apr 2021 15:18:03 +0200 Subject: [PATCH] Localize date in meal planner --- frontend/src/components/MealPlan/MealPlanNew.vue | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/MealPlan/MealPlanNew.vue b/frontend/src/components/MealPlan/MealPlanNew.vue index e3938f318..a3fe90949 100644 --- a/frontend/src/components/MealPlan/MealPlanNew.vue +++ b/frontend/src/components/MealPlan/MealPlanNew.vue @@ -143,10 +143,10 @@ export default { return dateDif; }, startComputedDateFormatted() { - return this.formatDate(this.startDate); + return this.formatDate(this.actualStartDate); }, endComputedDateFormatted() { - return this.formatDate(this.endDate); + return this.formatDate(this.actualEndDate); }, filteredRecipes() { const recipes = this.items.filter(x => !this.usedRecipes.includes(x)); @@ -214,14 +214,7 @@ export default { formatDate(date) { if (!date) return null; - const [year, month, day] = date.split("-"); - return `${month}/${day}/${year}`; - }, - parseDate(date) { - if (!date) return null; - - const [month, day, year] = date.split("/"); - return `${year}-${month.padStart(2, "0")}-${day.padStart(2, "0")}`; + return this.$d(date); }, getNextDayOfTheWeek(dayName, excludeToday = true, refDate = new Date()) { const dayOfWeek = [