feat: relative timestamps in reader (Release 2)

Add Alpine.js directive x-relative-time that converts absolute dates
to human-friendly relative strings: just now, 5m, 3h, 2d, Mar 3.
Updates every 60s for posts less than 24h old. Server-rendered absolute
time stays as no-JS fallback and hover tooltip.

Applied to item cards, quote embeds, and notification cards.

Bump version to 2.5.2.

Confab-Link: http://localhost:8080/sessions/e9d666ac-3c90-4298-9e92-9ac9d142bc06
This commit is contained in:
Ricardo
2026-03-03 13:34:01 +01:00
parent 02d449d03c
commit e34d9c124d
6 changed files with 93 additions and 4 deletions

View File

@@ -68,7 +68,7 @@
{# Timestamp #}
{% if item.published %}
<time datetime="{{ item.published }}" class="ap-notification__time">
<time datetime="{{ item.published }}" class="ap-notification__time" x-data x-relative-time>
{{ item.published | date("PPp") }}
</time>
{% endif %}