Class: Effective::FormInputs::TimeZoneSelect

Inherits:
Select show all
Defined in:
app/models/effective/form_inputs/time_zone_select.rb

Constant Summary

Constants inherited from Select

Select::INCLUDE_NULL

Constants inherited from Effective::FormInput

Effective::FormInput::BLANK, Effective::FormInput::EXCLUSIVE_CLASS_PREFIXES, Effective::FormInput::EXCLUSIVE_CLASS_SUFFIXES

Instance Attribute Summary

Attributes inherited from Effective::FormInput

#name, #options

Class Method Summary collapse

Methods inherited from Select

#ajax?, #assign_options_collection!, #build_input, #input_html_options, #input_js_options

Methods inherited from CollectionInput

#assign_options_collection!, #assign_options_collection_methods!, #collection_options, #custom?, #group_label_method, #group_method, #grouped?, #html_options, #initialize, #inline?, #label_method, #option_key_method, #option_value_method, #options_collection, #polymorphic?, #polymorphic_id_method, #polymorphic_id_value, #polymorphic_type_method, #polymorphic_type_value, #polymorphic_value, #translate, #value_method

Methods inherited from Effective::FormInput

#feedback_options, #hint_options, #initialize, #input_group_options, #input_html_options, #input_js_options, #label_options, #to_html, #wrapper_options

Constructor Details

This class inherits a constructor from Effective::FormInputs::CollectionInput

Class Method Details

.time_zone_collectionObject



5
6
7
8
9
10
11
# File 'app/models/effective/form_inputs/time_zone_select.rb', line 5

def self.time_zone_collection
  date = Time.zone.now

  ActiveSupport::TimeZone.all.map do |tz|
    ["(UTC #{date.in_time_zone(tz).strftime('%:z')}) #{tz.name}", tz.name]
  end
end