Skip to content

Conversation

@RyanMorash
Copy link

@RyanMorash RyanMorash commented Aug 5, 2025

This pull request updates the date and time handling in script.js to consistently use UTC instead of local time. This ensures that daily game logic and word selection are consistent for all users, regardless of their timezone. The most important changes are:

Resolves issue #15

Consistent UTC Date Handling:

  • Changed the calculation of firstgameMilli to use Date.UTC for a timezone-independent epoch.
  • Updated getGameNumber and getAbsoluteDate to use UTC-based setters (setUTCHours, setUTCMinutes, etc.) instead of local time setters. [1] [2]
  • Modified the game timer logic to increment the date using setUTCDate instead of setDate.

Word Selection Consistency:

  • In getWordOfTheDay, updated the random seed for practice mode to use the UTC date, ensuring the same word is selected regardless of the user's local time.

Copilot AI review requested due to automatic review settings August 5, 2025 00:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request standardizes date and time handling to use UTC across the application to ensure consistent behavior for all users regardless of their time zone. This addresses daily game logic, timer functionality, and word selection to prevent discrepancies between users in different time zones.

  • Converted date initialization and calculations from local time to UTC
  • Updated game timer logic to use UTC date incrementing
  • Modified practice mode word selection to use UTC-based random seeding

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