Browse Source

Merge pull request #301 from afro88/move_timezone_to_env

Moved timezone setting to .env
Andrew Cantino 11 years ago
parent
commit
8685093db7
2 changed files with 4 additions and 2 deletions
  1. 3 1
      .env.example
  2. 1 1
      config/application.rb

+ 3 - 1
.env.example

@@ -63,7 +63,6 @@ SMTP_ENABLE_STARTTLS_AUTO=true
 # The address from which system emails will appear to be sent.
 EMAIL_FROM_ADDRESS=from_address@gmail.com
 
-
 ###########################
 #      Agent Logging      #
 ###########################
@@ -105,3 +104,6 @@ ENABLE_INSECURE_AGENTS=false
 # Tools.  Specify a dot(1) command path built with SVG support
 # enabled.
 #USE_GRAPHVIZ_DOT=dot
+
+# Timezone. Use `rake time:zones:local` or `rake time:zones:all` to get your zone name
+TIMEZONE="Pacific Time (US & Canada)"

+ 1 - 1
config/application.rb

@@ -18,7 +18,7 @@ module Huginn
 
     # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
     # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
-    config.time_zone = 'Pacific Time (US & Canada)'
+    config.time_zone = ENV['TIMEZONE'].present? ? ENV['TIMEZONE'] : "Pacific Time (US & Canada)"
 
     # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
     # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]