DateTime::Event::ICal - Perl DateTime extension for computing rfc2445 recurrences. |
DateTime::Event::ICal - Perl DateTime extension for computing rfc2445 recurrences.
use DateTime; use DateTime::Event::ICal; my $dt = DateTime->new( year => 2000, month => 6, day => 20, );
my $set = DateTime::Event::ICal->recur( dtstart => $dt, freq => 'daily', bymonth => [ 10, 12 ], byhour => [ 10 ] );
my $dt_next = $set->next( $dt );
my $dt_previous = $set->previous( $dt );
my $bool = $set->contains( $dt );
my @days = $set->as_list( start => $dt1, end => $dt2 );
my $iter = $set->iterator;
while ( my $dt = $iter->next ) { print ' ', $dt->datetime; }
This module provides convenience methods that let you easily create
DateTime::Set
objects for rfc2445 style recurrences.
DateTime::Set
object representing the
given recurrence.
my $set = DateTime::Event::ICal->recur( %args );
This method takes parameters which correspond to the rule parts specified in section 4.3.10 of RFC 2445. Rather than rewrite that RFC here, you are encouraged to read that first if you want to understand what all these parameters represent.
This datetime is not included in the recurrence, unless it satisfies the recurrence's rules.
A set can thus be used for creating exclusion rules (rfc2445
exrule
), which don't include dtstart
.
"yearly", "monthly", "weekly", "daily", "hourly", "minutely", "secondly"
See the DateTime::Event::Recurrence
documentation for more details
on what these mean.
So if you specify a ``freq'' of ``yearly'' and an ``interval'' of 3, that means a recurrence that occurs every three years.
Note: this parameter is not yet implemented
See RFC 2445, section 4.3.10 for more details.
The day of week may have a prefix:
"1tu", # the first tuesday of month or year "-2we" # the second to last wednesday of month or year
See RFC 2445, section 4.3.10 for more details.
Day -1 is last day of month or year.
See RFC 2445, section 4.3.10 for more details.
The first week of year is week 1.
The default week start day is monday.
Week -1 is the last week of year.
See RFC 2445, section 4.3.10 for more details.
Month -1 is December.
See RFC 2445, section 4.3.10 for more details.
See RFC 2445, section 4.3.10 for more details.
Flavio Soibelmann Glock fglock@pucrs.br
The API was developed with help from the people in the datetime@perl.org list.
Copyright (c) 2003 Flavio Soibelmann Glock. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
datetime@perl.org mailing list
DateTime Web page at http://datetime.perl.org/
DateTime
DateTime::Event::Recurrence - simple rule-based recurrences
DateTime::Format::ICal - can parse rfc2445 recurrences
DateTime::Set - recurrences defined by callback subroutines
DateTime::Event::Cron - recurrences defined by ``cron'' rules
DateTime::SpanSet
RFC2445 - Internet Calendaring and Scheduling Core Object Specification - http://www.ietf.org/rfc/rfc2445.txt
DateTime::Event::ICal - Perl DateTime extension for computing rfc2445 recurrences. |