Skip to content

Fix event date filtering for UTC-negative timezones + missing Google token injection for 19hz#65

Closed
ProLoser with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-google-maps-errors
Closed

Fix event date filtering for UTC-negative timezones + missing Google token injection for 19hz#65
ProLoser with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-google-maps-errors

Conversation

Copilot AI commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

The 19hz map showed 0 events when filtering by date because ISO date strings were parsed as UTC midnight, causing an off-by-one day error for users in UTC-negative timezones (San Francisco = UTC-7/UTC-8). Additionally, __GOOGLE_TOKEN__ was never injected into 19hz/index.html during deploy.

Changes

  • Date filter timezone fix (19hz/map.js, map.js): Parse event.date as local time to match how filter dates are already parsed:

    // Before — parses as UTC midnight; getDate() returns 17 in PDT for "2026-03-18"
    let eventDate = new Date(event.date);
    
    // After — parses as local midnight; getDate() returns 18
    let eventDate = new Date(event.date.replace(/-/g, '/'));
  • parseCSVDate ISO string (19hz/map.js): Build the date string directly instead of via toISOString(), which converts local midnight to UTC before formatting:

    // Before
    iso: eventDate.toISOString().split('T')[0]
    // After
    iso: `${year}-${String(month + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`
  • Deploy workflow (deploy.yml): Added 19hz/index.html to the Google token sed replacement; removed redundant duplicate line for __APIFY_TOKEN__.

  • Cache freshness (19hz/map.js, map.js): isFresh(old = 86400) defaulted to 86.4 seconds, not 24 hours — changed to 86400000.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@github-actions

github-actions Bot commented Mar 19, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://ProLoser.github.io/funcheapmap/preview/pr-65/

Built to branch gh-pages at 2026-03-19 06:41 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

… 19hz and main map

Co-authored-by: ProLoser <67395+ProLoser@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Google Maps JavaScript API errors and warnings Fix event date filtering for UTC-negative timezones + missing Google token injection for 19hz Mar 19, 2026
Copilot AI requested a review from ProLoser March 19, 2026 06:40
@ProLoser
ProLoser marked this pull request as ready for review March 19, 2026 06:41
@ProLoser ProLoser closed this Mar 19, 2026
@ProLoser
ProLoser deleted the copilot/fix-google-maps-errors branch March 19, 2026 06:48
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