bun-activitypub/js/relative-time.js
Gordon Pedersen 6647dabdc8 Added eleventy templates from death.id.au
Needed a little modification here and there to make it work with the activity pub data structure, but it's looking pretty good!
2023-09-27 17:06:56 +10: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);