class TZInfo::TimezoneTransitionInfo

Public Instance Methods

dtstart() click to toggle source
# File lib/icalendar/tzinfo.rb, line 78
def dtstart
    local_start.to_datetime.strftime("%Y%m%dT%H%M%S")
end
offset_from() click to toggle source
# File lib/icalendar/tzinfo.rb, line 57
def offset_from
    a = previous_offset.utc_total_offset
    sprintf("%2.2d%2.2d", (a / 3600).to_i, ((a / 60) % 60).to_i)
end
offset_to() click to toggle source
# File lib/icalendar/tzinfo.rb, line 62
def offset_to
    a = offset.utc_total_offset
    sprintf("%2.2d%2.2d", (a / 3600).to_i, ((a / 60) % 60).to_i)
end
rrule() click to toggle source
# File lib/icalendar/tzinfo.rb, line 67
def rrule 
    start = local_start.to_datetime
    # this is somewhat of a hack, but seems to work ok
    [sprintf(
            "FREQ=YEARLY;BYMONTH=%d;BYDAY=%d%s",
            start.month, 
            ((start.day - 1)/ 7).to_i + 1,
            start.strftime("%a").upcase[0,2]
            )]
end