mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Clean up timezone selector
This commit is contained in:
@@ -365,6 +365,11 @@ module LanguagesHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def timezone_options
|
def timezone_options
|
||||||
ActiveSupport::TimeZone.all.map { |tz| [ tz.name + " (#{tz.tzinfo.identifier})", tz.tzinfo.identifier ] }
|
ActiveSupport::TimeZone.all
|
||||||
|
.sort_by { |tz| [ tz.utc_offset, tz.name ] }
|
||||||
|
.map do |tz|
|
||||||
|
name = tz.name.split(" - ").first.gsub(" (US & Canada)", "")
|
||||||
|
[ "(#{tz.formatted_offset}) #{name}", tz.tzinfo.identifier ]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user