added the relative time javascript
All checks were successful
/ weblog.lol (push) Successful in 9s

This commit is contained in:
Gordon Pedersen 2024-05-07 16:50:12 +10:00
parent 2334583345
commit 19de9f12a4

View file

@ -32,5 +32,13 @@ Title: Landing Page Template
<p>Made with <a href="https://weblog.lol">weblog.lol</a>.</p>
</footer>
<script src="https://cdn.jsdelivr.net/npm/luxon/build/global/luxon.min.js" crossorigin="anonymous"></script>
<script>
document.querySelectorAll('time:not(.dt-start):not(.dt-end)').forEach(time => {
const datetime = luxon.DateTime.fromISO(time.getAttribute('datetime'))
time.innerText = datetime.toRelative()
});
</script>
</body>
</html>