Class: ActiveSupport::TimeZone

Inherits:
Object
  • Object
show all
Defined in:
lib/mark_facets/rails/time_zones.rb

Class Method Summary collapse

Class Method Details

.all_with_us_firstObject



5
6
7
8
9
# File 'lib/mark_facets/rails/time_zones.rb', line 5

def all_with_us_first
  zones = [ActiveSupport::TimeZone.us_zones.dup].flatten
  ActiveSupport::TimeZone.all.each {|z| zones << z unless zones.include?(z)}
  return zones
end

.options_for_selectObject



11
12
13
# File 'lib/mark_facets/rails/time_zones.rb', line 11

def options_for_select
  ActiveSupport::TimeZone.all_with_us_first.collect{|x| [x.to_s, x.name]}
end