Skip to content

[Frontend · Shared primitives] Create shared RelativeTime component #286

@amina69

Description

@amina69

Epic: Shared primitives
Labels: ui, phase-2, frontend
Size: XS (~2-4 hours)

Description

Displays a date as relative text ("2 hours ago") updating every minute.

Tasks

  • Accept date: Date | string prop
  • Use date-fns formatDistanceToNow with addSuffix:true
  • Update every 60s via setInterval
  • Show absolute date on hover via title attribute
  • Cleanup interval on unmount
  • Unit test: correct initial output, updates on interval, cleanup

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions