Method: TpCommon::Timezones.zone_title

Defined in:
lib/tp_common/timezones.rb

.zone_title(zone) ⇒ Object

Zone title which display in select options. if this zone applied DST, display sun_emoji at tail Display as: title + offset_in_words [+ sun_emoji]



33
34
35
36
37
38
39
40
# File 'lib/tp_common/timezones.rb', line 33

def self.zone_title(zone)
  zone_value = LIST_ZONES[zone]
  return nil unless zone_value

  dst_icon = zone_value[:dst] ? '☀️' : ''

  [zone_value[:title], self.offset_in_words(zone_value[:name]), dst_icon].reject{|part| part.empty? }.join(" ")
end