Skip to content

Add time-zone field on user#837

Merged
jmilljr24 merged 11 commits intorubyforgood:mainfrom
RJV333:819_add_default_pacific_timezone
Feb 6, 2026
Merged

Add time-zone field on user#837
jmilljr24 merged 11 commits intorubyforgood:mainfrom
RJV333:819_add_default_pacific_timezone

Conversation

@RJV333
Copy link
Contributor

@RJV333 RJV333 commented Feb 2, 2026

What is the goal of this PR and why is this important?

#819 Sets Pacific Time as the default time zone for the app.

Pivoting to using time-zone field on users with a site default of Pacific time.

Screenshot 2026-02-06 at 1 42 31 PM Screenshot 2026-02-06 at 1 11 50 PM

@jmilljr24
Copy link
Collaborator

Timezones make my head spin. I believe you are correct that config.time_zone only affects rails time not the DB time. However thoughtbot recommends against changing this.

The default time zone in Rails is UTC. As tempting as it may seem, it is best to leave the application-wide time zone as UTC and instead allow each individual user to set their own time zone.

I'm not sure if there would be any consequences of setting time_zone now and adding a user setting later.

@maebeale
Copy link
Collaborator

maebeale commented Feb 4, 2026

oh, fascinating, @jmilljr24 !

@RJV333 what do you think? i'm leaning toward not doing this systemwide (and removing the other places we're saying PST explicitly too) and instead moving the user-specific TZ stuff to top of the queue.

any chance you'd want to pick that up (regardless of if we do or don't set system TZ)?

@RJV333
Copy link
Contributor Author

RJV333 commented Feb 5, 2026

oh, fascinating, @jmilljr24 !

@RJV333 what do you think? i'm leaning toward not doing this systemwide (and removing the other places we're saying PST explicitly too) and instead moving the user-specific TZ stuff to top of the queue.

any chance you'd want to pick that up (regardless of if we do or don't set system TZ)?

Thanks for the helpful feedback @jmilljr24 and @maebeale, and I agree. I'm pivoting this PR to track user-specific 'time-zone' like the blog suggests. It looks like there's some whackness with the specs right now that I think is unrelated to these changes, but I'll prioritize finishing this. In summary I'm planning to finish:

  • Adding a 'time_zone' column to the users table with default 'Pacific Time'
  • Update application_controller to 'use' a user's time_zone when they're performing an action
  • Update user form to adjust time_zone if they want to change from Pacific
  • Update specs around creating, storing, and retrieving event datetimes from different user time_zones
  • Update Event 'show' to include the timezone an event is being displayed in for extra clarity.

@RJV333 RJV333 marked this pull request as draft February 5, 2026 04:28
@RJV333 RJV333 marked this pull request as ready for review February 6, 2026 18:43
@jmilljr24 jmilljr24 changed the title Update config with default Pacific Timezone Add time-zone field on user Feb 6, 2026
Copy link
Collaborator

@jmilljr24 jmilljr24 left a comment

Choose a reason for hiding this comment

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

@RJV333 Niice!

@jmilljr24 jmilljr24 merged commit 79180cf into rubyforgood:main Feb 6, 2026
3 checks passed
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.

3 participants