Skip to content

Use Time.zone.today instead of Date.today - #436

Open
cycomachead wants to merge 1 commit into
mainfrom
time-zone-today
Open

cycomachead wants to merge 1 commit into
mainfrom
time-zone-today

Conversation

@cycomachead

Copy link
Copy Markdown
Member

Replaces #393 with a fresh change on current main.

Date.today uses the server's time zone, not the app's config.time_zone. When the two differ, "is the conference over?"-style checks can be off by a day around midnight, and specs can fail on non-UTC dev machines.

  • Replace all Date.today with Time.zone.today in app/, lib/, and spec/ (105 call sites)
  • Enable Rails/Date in .rubocop.yml so new Date.today calls get flagged

Unlike #393, this leaves the CI screenshot upload step alone.

Testing: spec/models, the admin cfps/conferences/registration_periods controller specs, and the registration feature specs pass (865 examples, 0 failures). RuboCop reports no new offenses on the changed files.

🤖 Generated with Claude Code

Date.today uses the machine's time zone rather than the app's
config.time_zone, so date checks can be off by a day around midnight
when the two differ (and specs can flake on non-UTC dev machines).
Replace every Date.today with Time.zone.today and enable the
Rails/Date cop so new ones are flagged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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