aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/chouette/stop_area.rb
diff options
context:
space:
mode:
authorZog2018-01-08 11:06:20 +0100
committerZog2018-01-11 21:55:48 +0100
commitef3942099583f86d3f355a1bac8d99ce16cd2de3 (patch)
tree0519d8d4d4495da9acc7d0e02e36a2f68028c527 /app/models/chouette/stop_area.rb
parent1fd6d7d0cfb63b024860d1c29fca089432fce2e1 (diff)
downloadchouette-core-ef3942099583f86d3f355a1bac8d99ce16cd2de3.tar.bz2
Refs #5493 @1h; Use local time in the Journeys editor
We store UTC times in the database though
Diffstat (limited to 'app/models/chouette/stop_area.rb')
-rw-r--r--app/models/chouette/stop_area.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/chouette/stop_area.rb b/app/models/chouette/stop_area.rb
index 52602be9f..b16bbb487 100644
--- a/app/models/chouette/stop_area.rb
+++ b/app/models/chouette/stop_area.rb
@@ -358,11 +358,17 @@ module Chouette
update_attribute :deleted_at, Time.now
end
+
def country_name
return unless country_code
country = ISO3166::Country[country_code]
country.translations[I18n.locale.to_s] || country.name
end
+
+ def time_zone_formatted_offset
+ return nil unless time_zone.present?
+ ActiveSupport::TimeZone[time_zone].formatted_offset
+ end
end
end