core/time_format library
Functions
-
relativeTime(
DateTime time, DateTime now) → String -
Formats
timeas a compact relative age fromnow(e.g.5m ago,2h ago,3d ago). Pure for unit testing — the live caller passesDateTime.now(). -
untilExpiry(
DateTime expiresAt, DateTime now) → String -
Formats a Duration until expiry as
in 5m/in 2h/expired.