feat: timed calendar events with DST-aware timezones #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ada/nba-calendar-utility:feat/timed-events"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Changes calendar events from all-day to timed events that appear at the scheduled game time, with daylight saving time handled automatically.
How
src/timezones.js— maps every NBA and WNBA team tricode to its IANA timezone (e.g. NYK → America/New_York, PHX → America/Phoenix)Game.toCalendarEvent()to use Google Calendar'sdateTime + timeZoneformat instead ofdate(all-day)Intl.DateTimeFormatwith the home team's timezoneDST handling
Google Calendar uses the
timeZonefield to display the event at the correct wall-clock time for the viewer. DST transitions are handled by the IANA timezone database — for example:Phoenix (Arizona) never observes DST, which is handled correctly by using
America/Phoenixinstead ofAmerica/Denver.Files changed
src/timezones.js(new) — team tricode to IANA timezone mappingsrc/game.js— toCalendarEvent() now produces timed events with timezoneREADME.md— updated description to reflect timed events