GitHub

Relative Time

Auto-updating relative time display with long, short, and narrow formats.

<rhx-relative-time>

Examples

Long (Default)

Future

Short

Narrow

Auto Numeric

Properties

Property Type Default Description
rhx-date DateTimeOffset - The date/time to display relative to now
rhx-format string long Format style: long, short, narrow
rhx-numeric string always Numeric mode: always, auto

Accessibility

  • Renders as a <time> element with a datetime attribute for machine readability.
  • Auto-updates via JavaScript without triggering screen reader live region announcements.
  • The visible text is always human-readable (e.g. "3 hours ago") for all users.