death.id.au/js/relative-time.js

6 lines
242 B
JavaScript
Raw Normal View History

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