fix: formatted edited time
This commit is contained in:
parent
cedb511681
commit
c4af4a610e
|
@ -6,8 +6,8 @@ const { status } = defineProps<{
|
|||
inline: boolean
|
||||
}>()
|
||||
|
||||
const editedAt = $computed(() => status.editedAt)
|
||||
const formatted = useFormattedDateTime(status.editedAt)
|
||||
const editedAt = computed(() => status.editedAt)
|
||||
const formatted = useFormattedDateTime(editedAt)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { MaybeComputedRef, UseTimeAgoOptions } from '@vueuse/core'
|
||||
|
||||
export const useFormattedDateTime = (
|
||||
value: MaybeComputedRef<string | Date | undefined>,
|
||||
value: MaybeComputedRef<string | Date | undefined | null>,
|
||||
options: Intl.DateTimeFormatOptions = { dateStyle: 'long', timeStyle: 'medium' },
|
||||
) => {
|
||||
const formatter = Intl.DateTimeFormat(undefined, options)
|
||||
|
|
Loading…
Reference in a new issue