Please take a look at the 'week_start_day' options:

http://search.cpan.org/~fglock/DateTime-Event-Recurrence-0.16/lib/DateTime/Event/Recurrence.pm#The_%22week_start_day%22_Parameter

The week_start_day represents how the 'first week' of a period is calculated:

"mo" - this is the default. The first week is one that starts in
monday, and has the most days in this period.

"tu", "we", "th", "fr", "sa", "su" - The first week is one that starts
in this week-day, and has the most days in this period. Works for
weekly and yearly recurrences.

"1tu", "1we", "1th", "1fr", "1sa", "1su" - The first week is one that
starts in this week-day, and has all days in this period. This works
for weekly(), monthly() and yearly() recurrences.

---

I hope it helps,

Flavio S. Glock

2010/9/1 Jon Bjornstad <jbjorns...@vindicia.com>:
> use DateTime::Event::Recurrence;
>
> # Second Tuesday of every month:
> #
> my $set = DateTime::Event::Recurrence->monthly(
>  weeks => 2,
>  days => 2
> );
> my $it = $set->iterator(start => DateTime->now());
> for (1 .. 10) {
>    my $dt = $it->next();
>    print "$dt\n";
> }
>
> 2010-09-14T00:00:00
> 2010-10-12T00:00:00
> 2010-11-09T00:00:00
> 2010-12-14T00:00:00
> 2011-01-11T00:00:00
> 2011-02-15T00:00:00
> 2011-03-15T00:00:00
> 2011-04-12T00:00:00
> 2011-05-10T00:00:00
> 2011-06-14T00:00:00
>
> This correctly prints the remaining second Tuesdays for 2010
> but in 2011 it includes Feb 15th which is the 3rd Tuesday.
> What's up with that?
>
>

Reply via email to