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::DEFAULT_FEEDBACK_OPTIONS, Effective::FormInput::DEFAULT_INPUT_GROUP_OPTIONS, Effective::FormInput::EMPTY_HASH, Effective::FormInput::EXCLUSIVE_CLASS_PREFIXES, Effective::FormInput::EXCLUSIVE_CLASS_SUFFIXES, Effective::FormInput::HORIZONTAL_LABEL_OPTIONS, Effective::FormInput::HORIZONTAL_WRAPPER_OPTIONS, Effective::FormInput::INLINE_LABEL_OPTIONS, Effective::FormInput::VERTICAL_WRAPPER_OPTIONS

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



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

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