From 0450798c5ea4c5a1a233045d82541f00dbde6ae8 Mon Sep 17 00:00:00 2001 From: limes Date: Tue, 18 Aug 2026 17:06:01 +0200 Subject: [PATCH] fix: unformatted date/timezone --- src/pages/account/index.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/pages/account/index.vue b/src/pages/account/index.vue index e6507cf..979760d 100644 --- a/src/pages/account/index.vue +++ b/src/pages/account/index.vue @@ -4,6 +4,8 @@ import { watchImmediate } from '@vueuse/core'; import { AlertDialog } from 'reka-ui/namespaced'; import type { ApiAccountUpdateRequest } from '~~/shared/api-types'; +const { locale } = useI18n(); + const authStore = useAuthStore(); const toasts = useToasts(); const route = useRoute(); @@ -133,6 +135,16 @@ const { execute: executeUnlinkDiscord, isLoading: isLoadingUnlink } = useAsync({ } }); +function parseBirthday(iso: string): string { + const s = iso.split('-'); + + const y = Number(s[0]); + const m = Number(s[1]) - 1; + const d = Number(s[2]); + + return new Date(Date.UTC(y, m, d)).toLocaleDateString(locale as unknown as string); +} + useHead({ title: `Account` }); @@ -294,7 +306,7 @@ useHead({ {{ $t("account.settings.settingCards.birthDate") }}

- {{ profile.birthday }} + {{ parseBirthday(profile.birthday) }}

  • @@ -318,7 +330,7 @@ useHead({ {{ $t("account.settings.settingCards.timezone") }}

    - {{ profile.timezone }} + {{ profile.timezone.replaceAll('_', ' ') }}