brackt/app/lib
Chris Parsons d546585fb6
Fix event date display off-by-one for late-night events in UTC-negative timezones (#147)
Events saved at 10 PM PDT (UTC-7) cross UTC midnight, so eventDate is stored
as the next UTC calendar day (e.g. March 28 10 PM PDT → eventDate "2026-03-29").
Displaying that date string via parseISO() gives March 29 local midnight, so
the events list showed "Mar 29" when the user expected "Mar 28".

Fix: when eventStartsAt is available, derive the display date from it directly
(format(new Date(eventStartsAt), ...)) rather than from the stored eventDate
string. This correctly converts the UTC timestamp to the user's local calendar
date. Date-only events (no eventStartsAt) are unchanged and continue to use
parseISO(eventDate).

Also tighten the getDisplayDate() guard: replace a misleading try/catch (new
Date() never throws) with an explicit isNaN check, and replace a non-null
assertion (eventDate!) with null-coalescing in the admin events list.

Tests cover both UTC and PDT environments and are timezone-independent.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 11:18:16 -07:00
..
__tests__ Fix event date display off-by-one for late-night events in UTC-negative timezones (#147) 2026-03-15 11:18:16 -07:00
bracket-templates.ts feat: add FIFA World Cup 48-team bracket template with group stage and projected scoring 2026-02-14 22:30:12 -08:00
color-hash.ts User/chris/bracket UI redesign (#95) 2026-03-09 22:44:33 -07:00
date-utils.ts Add event_starts_at timestamp to scoring events for sub-day ordering (#146) 2026-03-15 10:22:42 -07:00
draft-eligibility.ts Implement Omni League Draft Eligibility Rules 2025-10-24 21:12:07 -07:00
draft-order.ts Add browser push notifications toggle to draft page (#11) 2026-02-20 19:30:53 -08:00
draft-timer.ts Add draft clock UI, Fischer increment timer logic, and security fixes (#19) 2026-02-21 16:51:12 -08:00
owner-map.ts Display team owner names instead of team names in draft UI (#24) 2026-02-22 16:56:07 -08:00
scoring-types.ts feat: Add scoring rules editor to league settings and creation pages 2025-10-29 00:04:27 -07:00
season-helpers.server.ts feat: add recharts library and implement PointProgressionChart component for historical views 2025-11-14 21:18:34 -08:00
standings-display.ts feat: improve league home standings and sports seasons UX (#65) 2026-03-07 15:57:51 -08:00
utils.ts feat: add theme system with dark mode support and navbar component 2025-10-10 23:30:26 -07:00