death.id.au/js/relative-time.js
2022-11-30 16:48:51 +11:00

6 lines
No EOL
242 B
JavaScript

document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('time').forEach(time => {
const datetime = luxon.DateTime.fromISO(time.getAttribute('datetime'))
time.innerText = datetime.toRelative()
});
}, false);