Compact relative-time string for transaction ages, position open dates, graduation timestamps -- anywhere a dapp shows "how long ago".
Web3.Ui.RelativeTime.view { nowSec = model.nowSec, atSec = tx.timestamp }
--> "2m ago" / "3h ago" / "1d ago" / "Apr 12"For non-Html callers (e.g., row labels):
Web3.Ui.RelativeTime.format { nowSec = model.nowSec, atSec = tx.timestamp }
--> "2m ago"CSS class on the rendered span: web3-relativetime. The full RFC-style
timestamp (ISO-like seconds) is set as a title attribute for hover.
Pure helper: convert a Unix-seconds delta into a human string.
Buckets:
Negative deltas (future) render as "in Ns" / "in Nm" / etc.
Render the relative time string inside a span with a
titleshowing the absolute Unix seconds for accessibility / hover.