Class: RiCal::Component::Timezone::DaylightPeriod

Inherits:
RiCal.TimezonePeriod
  • Object
show all
Defined in:
lib/ri_cal/component/timezone/daylight_period.rb

Overview

  • ©2009 Rick DeNatale, All rights reserved. Refer to the file README.txt for the license

A DaylightPeriod is a TimezonePeriod during which daylight saving time is in effect

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.entity_nameObject

:nodoc: all


9
10
11
# File 'lib/ri_cal/component/timezone/daylight_period.rb', line 9

def self.entity_name #:nodoc:
  "DAYLIGHT"
end

Instance Method Details

#dst?Boolean


13
14
15
# File 'lib/ri_cal/component/timezone/daylight_period.rb', line 13

def dst?
  true
end

#swallows_local?(local, std_candidate) ⇒ Boolean


17
18
19
20
21
# File 'lib/ri_cal/component/timezone/daylight_period.rb', line 17

def swallows_local?(local, std_candidate)
  ([local.year, local.month, local.day] == [dtstart.year,dtstart.month, dtstart.day]) && 
     local >= dtstart_property &&
     local.advance(:seconds => (std_candidate.utc_total_offset - utc_total_offset)) < dtstart_property
end