use hooks for datetime, remove alpinejs

This commit is contained in:
2023-03-18 21:36:30 -04:00
parent a54cf8b87d
commit f5f72b53e6
9 changed files with 37 additions and 74 deletions

11
assets/js/date.js Normal file
View File

@ -0,0 +1,11 @@
export default {
displayDate (el) {
const date =
Intl.DateTimeFormat([], { timeZone: 'Etc/UTC', dateStyle: 'short' })
.format(new Date(el.dateTime))
el.innerText = date
},
mounted () { this.displayDate(this.el) },
updated () { this.displayDate(this.el) }
}