Reuse common dateStyle

This commit is contained in:
2025-08-14 20:20:54 +02:00
parent 24f933fbaa
commit 5146e8e490
7 changed files with 24 additions and 69 deletions
+6 -16
View File
@@ -1,4 +1,6 @@
<script setup lang="ts">
import { fullDate } from '~~/server/utils/date';
const { loggedIn } = useUserSession();
const { data, pending, refresh } = await useFetch('/api/home');
const { t, d } = useI18n();
@@ -39,20 +41,14 @@ watch(loggedIn, () => refresh());
<p v-if="hunt.start">
{{
t('page.home.start', {
start: d(hunt.start, {
dateStyle: 'medium',
timeStyle: 'medium'
})
start: d(hunt.start, fullDate)
})
}}
</p>
<p v-if="hunt.end">
{{
t('page.home.end', {
start: d(hunt.end, {
dateStyle: 'medium',
timeStyle: 'medium'
})
start: d(hunt.end, fullDate)
})
}}
</p>
@@ -99,20 +95,14 @@ watch(loggedIn, () => refresh());
<p v-if="hunt.start">
{{
t('page.home.start', {
start: d(hunt.start, {
dateStyle: 'medium',
timeStyle: 'medium'
})
start: d(hunt.start, fullDate)
})
}}
</p>
<p v-if="hunt.end">
{{
t('page.home.end', {
start: d(hunt.end, {
dateStyle: 'medium',
timeStyle: 'medium'
})
start: d(hunt.end, fullDate)
})
}}
</p>