Skip to content

fix: show admin dates in algiers time - #76

Merged
Adel2411 merged 2 commits into
devfrom
fix/admin-dates-timezone
Nov 6, 2026
Merged

Adel2411 merged 2 commits into
devfrom
fix/admin-dates-timezone

Conversation

@0xHouss

@0xHouss 0xHouss commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

The production server runs in UTC and the admin pages formatted dates in the server's timezone, so HR saw every submission one hour early (a registration sent at 22:56 showed 21:56), and the date could fall on the previous day for submissions between 00:00 and 01:00.

  • Add src/lib/dates.ts (@date-fns/tz): formatClubTime() shows moments in Africa/Algiers time, formatCalendarDate() shows birth dates (stored as midnight UTC) in UTC so they never shift by a day.
  • Use them in the registrations and recommendations tables, the registration page, the timeline and the users table (a client component, whose dates also depended on the viewer's browser timezone).
  • Unit tests in src/lib/dates.test.ts, passing under TZ=UTC and TZ=America/New_York.

Dates stored in MongoDB were already correct (UTC); only their display changes.

Closes #77

@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
mc-website Ready Ready Preview Nov 6, 2026 12:58am UTC

@0xHouss
0xHouss requested a review from Adel2411 November 5, 2026 23:06
@Adel2411
Adel2411 merged commit f3d2611 into dev Nov 6, 2026
3 checks passed
@Adel2411
Adel2411 deleted the fix/admin-dates-timezone branch November 6, 2026 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants