File: daylight_period.rb

package info (click to toggle)
mhc 1.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,452 kB
  • sloc: ruby: 12,700; lisp: 7,577; makefile: 70; sh: 68
file content (25 lines) | stat: -rw-r--r-- 764 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module RiCal
  class Component
    class Timezone
      #- ©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 DaylightPeriod < TimezonePeriod #:nodoc: all

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

        def dst?
          true
        end

        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
      end
    end
  end
end