From 0ca329218e5f1192cbfe95537a6e35d3503b58bc Mon Sep 17 00:00:00 2001 From: kevin olson Date: Fri, 23 Aug 2024 20:40:48 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20proper=20redirect=20and=20date=20fi?= =?UTF-8?q?x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/shot/ShotForm.vue | 2 +- app/pages/index.vue | 6 ++++-- app/utils/shared.ts | 2 -- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/components/shot/ShotForm.vue b/app/components/shot/ShotForm.vue index 9dd7d77..b65db02 100644 --- a/app/components/shot/ShotForm.vue +++ b/app/components/shot/ShotForm.vue @@ -28,7 +28,7 @@ const create = async () => useApi() .setForm(form?.value) .api>( route.params.user ? `/api/user/${route.params.user}/shot` : '/api/shot', - { method: 'POST', body: { ...state, date: toUtc(state.date) } }, + { method: 'POST', body: { ...state, date: new Date(`${state.date}T00:00:00`).toISOString() } }, ) .then(() => emit('created')) diff --git a/app/pages/index.vue b/app/pages/index.vue index 12ca153..2e43681 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -1,13 +1,15 @@ diff --git a/app/utils/shared.ts b/app/utils/shared.ts index f1e5fe6..965b4b3 100644 --- a/app/utils/shared.ts +++ b/app/utils/shared.ts @@ -5,8 +5,6 @@ import type { CookieOptions } from '#app' export type HeaderIconLink = HeaderLink & { icon: string } -export const toUtc = (date: string) => new Date((new Date(date)).getTime() + (new Date(date)).getTimezoneOffset() * 60000) - export const links: HeaderIconLink[] = [ { label: 'Home',