-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #392 from alphagov/better-timezone-config
Configure time_zone with govuk_time_zone
- Loading branch information
Showing
5 changed files
with
38 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
module GovukTimezone | ||
def self.configure(config) | ||
case config.time_zone | ||
when "UTC" | ||
Rails.logger.info "govuk_app_config changing time_zone from UTC (the default) to London" | ||
when "London" | ||
Rails.logger.info "govuk_app_config always sets time_zone to London - there is no need to set config.time_zone in your app" | ||
raise "govuk_app_config prevents configuring time_zone with config.time_zone - use config.govuk_time_zone instead" unless config.time_zone == "UTC" | ||
|
||
if config.respond_to?(:govuk_time_zone) && config.govuk_time_zone.present? | ||
config.time_zone = config.govuk_time_zone | ||
else | ||
raise "govuk_app_config prevents configuring time_zones other than London - config.time_zone was set to #{config.time_zone}" | ||
Rails.logger.info 'govuk_app_config changing time_zone from UTC (the rails default) to London (the GOV.UK default). Set config.govuk_time_zone = "UTC" if you need UTC.' | ||
config.time_zone = "London" | ||
end | ||
|
||
config.time_zone = "London" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module GovukAppConfig | ||
VERSION = "9.13.1".freeze | ||
VERSION = "9.14.0".freeze | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters