Commit ea938577 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt

add exact time formatting to time component

parent f6e6e034
......@@ -27,6 +27,14 @@
default: null
},
invert: Boolean,
exactOptions: {
type: Object,
default: () => ({
dateStyle: 'long',
timeStyle: 'short'
})
},
useExact: Boolean,
useRelative: Boolean,
useDistance: Boolean,
useAutoDistance: Boolean
......@@ -45,6 +53,8 @@
return Math.abs(differenceInCalendarDays(date, reference)) > 7
? formatRelative(date, reference, opts)
: formatDistance(date, reference, opts)
} else if (this.useExact) {
return date.toLocaleDateString(this.$i18n.locale, this.exactOptions)
} else {
return format(date, opts)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment