Files
wanderer/assets/js/hooks/clientTime.ts
Dmitry Popov 4136aaad76 Initial commit
2024-09-18 01:55:30 +04:00

12 lines
299 B
TypeScript

export default {
mounted() {
this.updated();
},
updated() {
const dt = new Date(Number(this.el.textContent));
const options = { hour12: false, timeZone: 'UTC' };
this.el.textContent = `${dt.toLocaleString('en-US', options)}`;
this.el.classList.remove('invisible');
},
};