Skip to content

RelativeTime component for the 13 <time dateTime title> sites #168

Description

@themightychris

Context

PR #157 converted every relative or title-only date in apps/web to <time dateTime={iso} title={formatAbsoluteDate(iso)}>{formatRelativeTime(iso)}</time> — 13 sites after the sweep, across ActivityCard, HelpWantedCard, BlogIndex, BlogDetail, Account, AccountClaim, StaffAccountClaimQueue, PersonDetail, ProjectDetail.

Problem

Three attributes and two formatter calls per site, all identical. The next date rendered in the app will likely drop one of them (that is exactly how three sites were missed on the first pass of #157).

Proposal

A RelativeTime component (apps/web/src/components/RelativeTime.tsx) taking iso and an optional className, rendering the <time> with dateTime, the absolute title, and the relative text; optionally a prefix prop for "posted", "joined", etc. Migrate the 13 sites.

Deferred from plans/a11y-mechanical.md (PR #157).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions