Skip to content
Snippets Groups Projects
Commit 1f38aa73 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

fix: ensure datetime attribute contains timezone offset

parent 98341a4d
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
</template>
<script lang="ts" setup>
import { formatISO } from 'date-fns'
import { computed } from 'vue'
import { useI18n } from '@/i18n'
import { ensureDate } from '@/util'
......@@ -14,9 +15,7 @@ const props = defineProps<{
}>()
const { locale } = useI18n()
const datetime = computed(() => ensureDate(props.time))
const isoRepresentation = computed(() =>
typeof props.time === 'string' ? props.time : props.time.toISOString(),
)
const isoRepresentation = computed(() => formatISO(datetime.value))
const title = computed(() =>
datetime.value.toLocaleString(locale.value, { dateStyle: 'full', timeStyle: 'medium' }),
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment