Is it possible to set the timezone used on the dashboard? #1028
Answered
by
bensheldon
alexandergitter
asked this question in
Q&A
-
Timestamps in my database and in how the Rails app uses them are in UTC. |
Beta Was this translation helpful? Give feedback.
Answered by
bensheldon
Aug 4, 2023
Replies: 1 comment 1 reply
-
Interesting! There isn't currently a supported way to do that (maybe there should be), but here's a workaround: # config/initializers/good_job.rb
Rails.application.config.to_prepare do
class GoodJob::ApplicationController < ActionController::Base
CUSTOM_TIMEZONE = "America/Los_Angeles"
around_action :set_custom_timezone
def set_custom_timezone
original_timezone = Time.zone
Time.zone = CUSTOM_TIMEZONE
yield
ensure
Time.zone = original_timezone
end
end
end |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
alexandergitter
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Interesting! There isn't currently a supported way to do that (maybe there should be), but here's a workaround: