We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 201f475 commit acd8dbbCopy full SHA for acd8dbb
1 file changed
app/components/DateTime.vue
@@ -33,11 +33,20 @@ const { locale } = useI18n()
33
34
const relativeDates = useRelativeDates()
35
36
+const dateFormatter = new Intl.DateTimeFormat(locale.value, {
37
+ month: 'short',
38
+ day: 'numeric',
39
+ year: 'numeric',
40
+ hour: 'numeric',
41
+ minute: '2-digit',
42
+ timeZoneName: 'short',
43
+})
44
+
45
// Compute the title - always show full date for accessibility
46
const titleValue = computed(() => {
47
if (props.title) return props.title
- if (typeof props.datetime === 'string') return props.datetime
- return props.datetime.toISOString()
48
+ const date = typeof props.datetime === 'string' ? new Date(props.datetime) : props.datetime
49
+ return dateFormatter.format(date)
50
})
51
</script>
52
0 commit comments