In the Profile page → Watched Repositories section, each watched repo shows a "Last checked" timestamp. Currently, it is rendered using .toLocaleTimeString() which only shows the time — for example: "3:45:02 PM".
If a repo was last checked yesterday, 3 days ago, or last week, the user sees no date context at all — just a meaningless time like "11:30:00 AM". This is confusing and unhelpful.
📍 File to Change
frontend/app/(auth)/profile/page.tsx — inside the Watchlist sub-component (around line 271)
🔍 Current Code (line ~271)
<span className="flex items-center gap-1">
<Bell className="w-3 h-3"/>
Last checked: {repo.last_checked_at
? new Date(repo.last_checked_at).toLocaleTimeString() // ← PROBLEM: no date!
: 'Never'}
</span>
✅ What To Do
Option A (Recommended) — Relative time (e.g., "2 hours ago", "3 days ago"):
Add a formatTimeAgo helper (already exists in notifications/page.tsx — you can copy it into frontend/lib/utils.ts to share it):
// In frontend/lib/utils.ts
export function formatTimeAgo(date: Date): string {
const seconds = Math.floor((new Date().getTime() - date.getTime()) / 1000);
if (seconds < 60) return `${seconds}s ago`;
const minutes = Math.floor(seconds / 60);
if (minutes < 60) return `${minutes}m ago`;
const hours = Math.floor(minutes / 60);
if (hours < 24) return `${hours}h ago`;
const days = Math.floor(hours / 24);
return `${days}d ago`;
}
Then use it:
Last checked: {repo.last_checked_at
? formatTimeAgo(new Date(repo.last_checked_at))
: 'Never'}
Option B — Full locale string:
Last checked: {repo.last_checked_at
? new Date(repo.last_checked_at).toLocaleString() // Shows date + time
: 'Never'}
Either option is acceptable — relative time (Option A) is preferred.
🏁 Acceptance Criteria
💡 Technical Hints
- The bug is at line ~271 in
frontend/app/(auth)/profile/page.tsx — find .toLocaleTimeString() and replace it
- The
formatTimeAgo function already exists in frontend/app/(auth)/notifications/page.tsx — no need to write it from scratch, just move it to a shared utility
🚀 Getting Started
- Fork the repository
- Create a branch:
git checkout -b fix/issue-6-watchlist-date-format
- Edit
frontend/app/(auth)/profile/page.tsx
- Optionally, extract
formatTimeAgo to frontend/lib/utils.ts
- Run locally:
cd frontend && npm run dev → navigate to /profile
- Open a Pull Request!
In the Profile page → Watched Repositories section, each watched repo shows a "Last checked" timestamp. Currently, it is rendered using
.toLocaleTimeString()which only shows the time — for example:"3:45:02 PM".If a repo was last checked yesterday, 3 days ago, or last week, the user sees no date context at all — just a meaningless time like
"11:30:00 AM". This is confusing and unhelpful.📍 File to Change
frontend/app/(auth)/profile/page.tsx— inside theWatchlistsub-component (around line 271)🔍 Current Code (line ~271)
✅ What To Do
Option A (Recommended) — Relative time (e.g.,
"2 hours ago","3 days ago"):Add a
formatTimeAgohelper (already exists innotifications/page.tsx— you can copy it intofrontend/lib/utils.tsto share it):Then use it:
Option B — Full locale string:
Either option is acceptable — relative time (Option A) is preferred.
🏁 Acceptance Criteria
last_checked_atisnull, it still shows"Never"Watchlistcomponent inprofile/page.tsxformatTimeAgohelper is extracted tofrontend/lib/utils.tsand imported in bothprofile/page.tsxandnotifications/page.tsx💡 Technical Hints
frontend/app/(auth)/profile/page.tsx— find.toLocaleTimeString()and replace itformatTimeAgofunction already exists infrontend/app/(auth)/notifications/page.tsx— no need to write it from scratch, just move it to a shared utility🚀 Getting Started
git checkout -b fix/issue-6-watchlist-date-formatfrontend/app/(auth)/profile/page.tsxformatTimeAgotofrontend/lib/utils.tscd frontend && npm run dev→ navigate to/profile