struct

TCal::TimePeriod

Inherits TCal::Period < Struct < Value < Object

An interval between two Time.

Constants

EARLY_HOUR = 7
LATE_HOUR = 22

Constructors

new(start : T, end __arg0 : T)
Source

Instance methods

all_day

Returns a period that starts and ends at midnight on the same dates as this one. If any part of the end date is covered, the resulting period will cover the entire day, ending at midnight of the next day.

Source
each_month

Iterates over each month in the interval, #at_beginning_of_month. Includes the months containing both the start and end of the interval. Note since the end time is exclusive, if it is exactly at the beginning of a month, that month will not be included.

Source
each_sunday_week

Iterates over each week in the interval, #at_beginning_of_sunday_week. Includes the weeks containing both the start and end of the interval. Note since the end time is exclusive, if it is exactly at the beginning of a week, that week will not be included.

Source
snap_to_midnight

If this period's start or end fall within the period from LATE_HOUR to EARLY_HOUR, returns a new period with the offending field(s) set to midnight.

If this would result in an empty period, instead returns self.

Source
split_at_sunday

Splits this period at Saturday/Sunday boundaries.

Source
to_date_period

Converts this period to a DatePeriod, discarding the time information.

Source