From 0d7e25b674827b9382a13415ccbf03942fffba9c Mon Sep 17 00:00:00 2001 From: Richard Towers Date: Tue, 16 Jul 2024 13:20:07 +0100 Subject: [PATCH] Explicitly set config.time_zone to UTC --- config/application.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 5cbe7c6b4..207d692e9 100644 --- a/config/application.rb +++ b/config/application.rb @@ -47,7 +47,15 @@ class Application < Rails::Application config.assets.prefix = "/assets/travel-advice-publisher" config.slimmer.use_cache = true - # config.time_zone = "Central Time (US & Canada)" + + # Even though most GOV.UK apps use the London time_zone, travel-advice-publisher does want to + # present times in UTC (as it's an international audience), so we set that as the default time_zone + initializer "publishing_api.configure_timezone", + after: "govuk_app_config.configure_timezone", + before: "active_support.initialize_time_zone" do + config.time_zone = "UTC" + end + # config.eager_load_paths << Rails.root.join("extras") end end