Skip to content

Show how long ago a task was created on the card🗂️ #79

Description

@anoopcodehack

File: client/src/components/Board/TaskCard.jsx

createdAt exists in MongoDB but never shown on card.
Show "2 hours ago" or "3 days ago" at the bottom.

Fix: Write a simple timeAgo function:
const timeAgo = (date) => {
const diff = Date.now() - new Date(date)
const days = Math.floor(diff / 86400000)
return days === 0 ? "today" : ${days}d ago
}
~8 lines, no package needed!

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions