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).
Context
PR #157 converted every relative or
title-only date inapps/webto<time dateTime={iso} title={formatAbsoluteDate(iso)}>{formatRelativeTime(iso)}</time>— 13 sites after the sweep, acrossActivityCard,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
RelativeTimecomponent (apps/web/src/components/RelativeTime.tsx) takingisoand an optionalclassName, rendering the<time>withdateTime, the absolutetitle, and the relative text; optionally aprefixprop for "posted", "joined", etc. Migrate the 13 sites.Deferred from
plans/a11y-mechanical.md(PR #157).