bun-activitypub/js/relative-time.js

6 lines
242 B
JavaScript
Raw Permalink Normal View History

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