NAME
Net::ICal::Recurrence -- Represent a single recurrence rule
SYNOPSIS
use Net::ICal::Recurrence;
$rrule = new Net::ICal::Recurrence([ OPTION_PAIRS ]) ;
WARNING
This implementation of Recurrences needs serious work and refactoring for clarity. The API is not stable. Patches and suggestions welcome.
DESCRIPTION
Recurrence holds a single recurrence property, ala section 4.3.10 of RFC 2445.
CONSTRUCTOR
new([ OPTIONS_PAIRS ])
Create a new recurrence rule. Values for any of the accessors (below) may be specified at intialization time.
new_from_ical($ical_string)
Create a new recurrence rule from an iCalendar string.
as_ical_value()
Return an iCal format RRULE string
by()
Return a hash reference containing the BY* elements. Keys are DAY, MONTH, etc., and the values are hashrefs with one key per element. E.g., a RRULE with BYMONTH=6,8;BYDAY=1MO,2WE,FR would be structured as follows:
{
DAY => { MO => 1, WE => 2, FR => undef },
MONTH => { 6 => undef, 8 => undef }
}
METHODS
All of the methods that set multi-valued attributes (e.g., bysecond) accept either a single value or a reference to an array.
freq (FREQ)
Specify the frequency of the recurrence. Allowable values are:
SECONDLY MINUTELY HOURLY DAILY WEEKLY MONTHLY YEARLY
count(N)
Specify that the recurrence rule occurs for N recurrences, at most. May not be used in conjunction with until.
until(ICAL_TIME)
Specify that the recurrence rule occurs until ICAL_TIME at the latest. ICAL_TIME is a Net::ICal::Time object. May not be used in conjunction with count.
interval(N)
Specify how often the recurrence rule repeats. Defaults to '1'.
bysecond([ SECOND , ... ])
Specify the valid of seconds within a minute. SECONDs range from 0 to 59. Use an arrayref to specify more than one value.
byminute([ MINUTE , ... ])
Specify the valid of minutes within an hour. MINUTEs range from 0 to 59. Use an arrayref to specify more than one value.
byhour([ HOUR , ... ])
Specify the valid of hours within a day. HOURs range from 0 to 23. Use an arrayref to specify more than one value.
byday([ WDAY , ... ])
Specify the valid weekdays. Weekdays must be one of
MO TU WE TH FR SA SU
and may be preceded with an ordinal week number. If the recurrence frequency is MONTHLY, the ordinal specifies the valid week within the month. If the recurrence frequency is YEARLY, the ordinal specify the valid week within the year. A negative ordinal specifys an offset from the end of the month or year.
bymonthday([ MONTHDAY, ... ])
Specify the valid days within the month. A negative number specifies an offset from the end of the month.
byyearday([ YEARDAY, ... ])
Specify the valid day(s) within the year (i.e., 1 is January 1st). A negative number specifies an offset from the end of the year.
byweekno([ WEEKNO, ... ])
Specify the valid week(s) within the year. A negative number specifies an offset from the end of the year.
bymonth([ MONTH, ... ])
Specify the valid months within the year.
bysetpos([ N, ... ])
Specify the valid recurrences for the recurrence rule. Use this when you need something more complex than INTERVAL. N may be negative, and would specify an offset from the last occurrence specified by another attribute (-1 is the last occurrence).
wkst(WEEKDAY)
Specify the starting day of the week as applicable to week calculations. The default is MO. The allowable options are the same weekday codes as for byday.
INTERNAL-ONLY METHODS
These still need to be documented and/or revamped to be more readable by mere mortals.
_create($classname, $arghashref)
A background method to new() that creates the internal data storage map for Class::MethodMapper.
_positive_int_set
Set a value only if it's a positive integer (ala 1*DIGIT)
_multi_fixed_range_set
Set a value only if it falls within a range (inclusive)
_multi_match_set
Set a value if all of the elements match a regular expression
_multi_ordinal_range_set
Set a value if all of the elements are within a range, regardless of sign
_supplement_queue
TODO: document this routine and refactor it.
_order_days_of_week
Order a set of weekdays according to the WKST setting in the rule E.g., if MO is the first day of the week, and we're given TU, TH, FR, SU then return 1, 3, 4, and 6 (the zero-index offsets from Monday)
_first_day_of_next_week
TODO: document the parameters for this.
_first_day_of_next_month
TODO: document the parameters for this.
_tz_dow
Return the day of the week that this time falls on, adjusted for time zone
_days_till_next_week
TODO: document the parameters for this.
_compute_set_of_days
TODO: document the parameters for this.