From 4ff1a4de51d1697910da57a1f3a8192344cb9ddd Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Thu, 4 Jul 2024 17:05:33 +0000 Subject: [PATCH] remove old "Z" string adjustments --- frontend/components/Domain/Recipe/RecipeLastMade.vue | 8 ++------ frontend/components/Domain/Recipe/RecipeTimelineItem.vue | 4 ++-- .../components/Domain/ShoppingList/ShoppingListItem.vue | 2 +- frontend/pages/shopping-lists/_id.vue | 1 - frontend/pages/user/profile/api-tokens.vue | 2 +- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/frontend/components/Domain/Recipe/RecipeLastMade.vue b/frontend/components/Domain/Recipe/RecipeLastMade.vue index 0811e48b2ff..608cdbb037a 100644 --- a/frontend/components/Domain/Recipe/RecipeLastMade.vue +++ b/frontend/components/Domain/Recipe/RecipeLastMade.vue @@ -102,7 +102,7 @@ {{ $globals.icons.calendar }} - {{ $t('recipe.last-made-date', { date: value ? new Date(value+"Z").toLocaleDateString($i18n.locale) : $t("general.never") } ) }} + {{ $t('recipe.last-made-date', { date: value ? new Date(value).toLocaleDateString($i18n.locale) : $t("general.never") } ) }} @@ -199,11 +199,7 @@ export default defineComponent({ await userApi.recipes.updateLastMade(props.recipe.slug, newTimelineEvent.value.timestamp); // update recipe in parent so the user can see it - // we remove the trailing "Z" since this is how the API returns it - context.emit( - "input", newTimelineEvent.value.timestamp - .substring(0, newTimelineEvent.value.timestamp.length - 1) - ); + context.emit("input", newTimelineEvent.value.timestamp); } // update the image, if provided diff --git a/frontend/components/Domain/Recipe/RecipeTimelineItem.vue b/frontend/components/Domain/Recipe/RecipeTimelineItem.vue index 26e6d7d1906..180859d476d 100644 --- a/frontend/components/Domain/Recipe/RecipeTimelineItem.vue +++ b/frontend/components/Domain/Recipe/RecipeTimelineItem.vue @@ -8,7 +8,7 @@ {{ $globals.icons.calendar }} - {{ new Date(event.timestamp+"Z").toLocaleDateString($i18n.locale) }} + {{ new Date(event.timestamp).toLocaleDateString($i18n.locale) }} {{ $globals.icons.calendar }} - {{ new Date(event.timestamp+"Z").toLocaleDateString($i18n.locale) }} + {{ new Date(event.timestamp || "").toLocaleDateString($i18n.locale) }} diff --git a/frontend/components/Domain/ShoppingList/ShoppingListItem.vue b/frontend/components/Domain/ShoppingList/ShoppingListItem.vue index 31b23e622d1..30cd3c292da 100644 --- a/frontend/components/Domain/ShoppingList/ShoppingListItem.vue +++ b/frontend/components/Domain/ShoppingList/ShoppingListItem.vue @@ -75,7 +75,7 @@ - {{ $t("shopping-list.completed-on", {date: new Date(listItem.updateAt+"Z").toLocaleDateString($i18n.locale)}) }} + {{ $t("shopping-list.completed-on", {date: new Date(listItem.updateAt || "").toLocaleDateString($i18n.locale)}) }} diff --git a/frontend/pages/shopping-lists/_id.vue b/frontend/pages/shopping-lists/_id.vue index 8cea41faf0c..c7be3ace534 100644 --- a/frontend/pages/shopping-lists/_id.vue +++ b/frontend/pages/shopping-lists/_id.vue @@ -868,7 +868,6 @@ export default defineComponent({ // set a temporary updatedAt timestamp prior to refresh so it appears at the top of the checked items item.updateAt = new Date().toISOString(); - item.updateAt = item.updateAt.substring(0, item.updateAt.length-1); } // make updates reflect immediately diff --git a/frontend/pages/user/profile/api-tokens.vue b/frontend/pages/user/profile/api-tokens.vue index 8b6d21b361b..baeda6f6f2c 100644 --- a/frontend/pages/user/profile/api-tokens.vue +++ b/frontend/pages/user/profile/api-tokens.vue @@ -51,7 +51,7 @@ {{ token.name }} - {{ $t('general.created-on-date', [$d(new Date(token.createdAt+"Z"))]) }} + {{ $t('general.created-on-date', [$d(new Date(token.createdAt))]) }}