Class: MrCommon::Timezone
- Inherits:
-
Object
- Object
- MrCommon::Timezone
- Defined in:
- app/models/mr_common/timezone.rb
Overview
Helper class for building time zone select options. Pares down the list by grouping locations that share ones or offsets.
Class Method Summary collapse
-
.time_zone_options ⇒ Array<String>
List of time zone names ordered by offset.
-
.time_zone_select_options ⇒ Array<Array<String, String>>
List of label value pairs for building time zone select options ordered by offset.
Class Method Details
.time_zone_options ⇒ Array<String>
Returns list of time zone names ordered by offset.
9 10 11 |
# File 'app/models/mr_common/timezone.rb', line 9 def filtered_time_zones.collect(&:name) end |
.time_zone_select_options ⇒ Array<Array<String, String>>
Returns list of label value pairs for building time zone select options ordered by offset.
15 16 17 18 19 |
# File 'app/models/mr_common/timezone.rb', line 15 def filtered_time_zones.collect do |tz| ["(UTC#{tz_utc_offset(tz)}) #{tz_friendly_name(tz)}", tz.name] end end |