feat: formatted date times one website

This commit is contained in:
Leyla Becker 2026-02-19 16:32:11 -06:00
parent dffd14a19f
commit 927f13b623
5 changed files with 51 additions and 17 deletions

View file

@ -136,6 +136,28 @@
</script>
{% endif %}
<script>
document.querySelectorAll('.localizable-time').forEach(function(el) {
var iso = el.getAttribute('datetime');
if (!iso) return;
try {
var date = new Date(iso);
if (isNaN(date.getTime())) return;
var options = {
year: 'numeric',
month: 'long',
day: 'numeric',
hour: 'numeric',
minute: '2-digit',
timeZoneName: 'short'
};
el.textContent = date.toLocaleString(undefined, options);
} catch (e) {
// Keep server-rendered fallback on error
}
});
</script>
<footer>
<div>
<!-- Social Things -->