Skip to content

dates: compare election day by date, not by time of day - #631

Open
arpitjain099 wants to merge 1 commit into
18F:mainfrom
arpitjain099:election-day-compare-by-date
Open

arpitjain099 wants to merge 1 commit into
18F:mainfrom
arpitjain099:election-day-compare-by-date

Conversation

@arpitjain099

Copy link
Copy Markdown

getNextElectionDay builds its dates at midnight UTC but compares them against the current instant, so from a millisecond past midnight on election day the election already counts as past and the helper jumps to the next cycle. On election day itself, Charlie's home tab tells people the next election day is in 2028 while they are out voting, and a restart that morning schedules the #general-talk reminder for 2028 as well.

Comparing at day granularity keeps the whole of election day reading as today. The day after still rolls forward.

The new case sets the clock to 10am eastern on 3 November 2026, which is the default reminder time. It fails on main and passes with the change.


Checklist:

  • Code has been formatted with prettier
  • [na] The OAuth wiki
    page has been updated if Charlie needs any new OAuth events or scopes
  • [na] The Environment Variables
    wiki page has been updated if new environment variables were introduced
    or existing ones changed
  • [na] The dev wiki has been updated, e.g.:
    • local development processes have changed
    • major development workflows have changed
    • internal utilities or APIs have changed
    • testing or deployment processes have changed
  • [na] If appropriate, the NIST 800-218 documentation has been updated

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099
arpitjain099 requested a review from a team as a code owner October 21, 2026 14:17
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.

1 participant