Sha256: 3d347571456684272a7a3a5120a3d29b33a0930e43238195797796d978032771

Contents?: true

Size: 715 Bytes

Versions: 1

Compression:

Stored size: 715 Bytes

Contents

module Icalendar
  module Recurrence
    module EventExtensions
      def start
        dtstart
      end

      def start_time
        TimeUtil.to_time(start)
      end

      def end
        dtend
      end

      def occurrences_between(begin_time, closing_time, spans: false)
        schedule.occurrences_between(begin_time, closing_time, spans: spans)
      end

      def schedule
        @schedule ||= Schedule.new(self)
      end

      def tzid
        ugly_tzid = dtstart.ical_params.fetch("tzid", nil)
        return nil if ugly_tzid.nil?

        Array(ugly_tzid).first.to_s.gsub(/^(["'])|(["'])$/, "")
      end
    end
  end

  class Event
    include Icalendar::Recurrence::EventExtensions
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
icalendar-recurrence-1.1.3 lib/icalendar/recurrence/event_extensions.rb