feat(status): add edit indicator for detail
This commit is contained in:
parent
0ada9e0448
commit
d146b5b730
5 changed files with 30 additions and 9 deletions
|
@ -1,6 +1,12 @@
|
|||
import type { Ref } from 'vue'
|
||||
import type { Account, Relationship, Status } from 'masto'
|
||||
|
||||
declare module 'masto' {
|
||||
interface Status {
|
||||
editedAt?: string
|
||||
}
|
||||
}
|
||||
|
||||
// @unocss-include
|
||||
export const STATUS_VISIBILITIES = [
|
||||
{
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
import type { MaybeRef } from '@vueuse/core'
|
||||
|
||||
export const useFormattedDateTime = (
|
||||
value: MaybeRef<string | Date>,
|
||||
value: MaybeRef<string | Date | undefined>,
|
||||
options: Intl.DateTimeFormatOptions = { dateStyle: 'long', timeStyle: 'medium' },
|
||||
) => {
|
||||
const formatter = Intl.DateTimeFormat(undefined, options)
|
||||
return computed(() => formatter.format(new Date(resolveUnref(value))))
|
||||
return computed(() => {
|
||||
const v = resolveUnref(value)
|
||||
return v ? formatter.format(new Date(v)) : ''
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue