Module: TZInfoExtension::InstanceMethods

Included in:
ActiveSupport::TimeZone, TZInfo::Timezone
Defined in:
lib/has_zone/tzinfo.rb

Instance Method Summary collapse

Instance Method Details

#abbreviationsObject



27
28
29
30
31
32
33
34
35
36
# File 'lib/has_zone/tzinfo.rb', line 27

def abbreviations
  date = Time.now.utc.beginning_of_year
  abbreviations = []
  period = period_for_local(date)
  while not(abbreviations.include? period.abbreviation)
    abbreviations << period.abbreviation
    break unless (period = next_period(period))
  end
  abbreviations
end

#next_period(period) ⇒ Object



22
23
24
25
# File 'lib/has_zone/tzinfo.rb', line 22

def next_period(period)
  period_end = period.utc_end
  period_end ? period_for_utc(period_end + 1.day) : nil
end