class TZInfo::TimezonePeriod

Public Instance Methods

daylight() click to toggle source
# File lib/icalendar/tzinfo.rb, line 85
def daylight
    day = Icalendar::Daylight.new
    if dst?
        day.timezone_name = abbreviation.to_s
        day.timezone_offset_from = start_transition.offset_from
        day.timezone_offset_to = start_transition.offset_to
        day.dtstart = start_transition.dtstart
        day.recurrence_rules = start_transition.rrule
    else
        day.timezone_name = abbreviation.to_s.sub("ST","DT")
        day.timezone_offset_from = end_transition.offset_from
        day.timezone_offset_to = end_transition.offset_to
        day.dtstart = end_transition.dtstart
        day.recurrence_rules = end_transition.rrule
    end
    return day
end
standard() click to toggle source
# File lib/icalendar/tzinfo.rb, line 103
def standard
    std = Icalendar::Standard.new
    if dst?
        std.timezone_name = abbreviation.to_s.sub("DT","ST")
        std.timezone_offset_from = end_transition.offset_from
        std.timezone_offset_to = end_transition.offset_to
        std.dtstart = end_transition.dtstart
        std.recurrence_rules = end_transition.rrule
    else
        std.timezone_name = abbreviation.to_s
        std.timezone_offset_from = start_transition.offset_from
        std.timezone_offset_to = start_transition.offset_to
        std.dtstart = start_transition.dtstart
        std.recurrence_rules = start_transition.rrule
    end
    return std
end