Personal Git forge.

Code git clone ssh://git.poy.ooo:6969/~poyo/farga ZIP
static/js/time.js / 508B #22367420
Raw
// time.js - licensed under GNU AGPLv3 (Poyo)// <script src="/static/js/time.js" defer></script>// all it does is replace all .local-time instances in with the correct localized time.// EXAMPLE: <time class="local-time" datetime="{{.CreatedAt}}">{{.CreatedAt}}</time>document.querySelectorAll(".local-time").forEach(el => {    const date = new Date(el.dateTime);    el.textContent = new Intl.DateTimeFormat(undefined, {        dateStyle: "medium",        timeStyle: "short"    }).format(date);});