mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-04 16:09:59 +00:00
fix: formatted edited time
This commit is contained in:
parent
cedb511681
commit
c4af4a610e
2 changed files with 3 additions and 3 deletions
|
@ -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