1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00

Clean up timezone selector

This commit is contained in:
Josh Pigford 2025-02-03 09:46:40 -06:00
parent a1065fde83
commit 4a768d0358

View file

@ -365,6 +365,11 @@ module LanguagesHelper
end
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