On 2010-02-02 16:24:41, fglock@gmail.com wrote:
Show quoted text> This is explained in the POD, you can adjust "week_start_day" to the
> expected behaviour:
>
> ---
> The "week_start_day" Parameter
>
> "mo" - this is the default. The first week is one that starts in
> monday ...
> ---
>
Hello Flavio,
so using week_start_day => "mo" and not using week_start_day at all
should give the same result? But it isn't:
#!/usr/bin/perl -w
use DateTime::Event::Recurrence;
use Test::More qw(no_plan);
my $set1 = DateTime::Event::Recurrence->monthly(weeks => 2, days => 2,
week_start_day => "mo");
my $set2 = DateTime::Event::Recurrence->monthly(weeks => 2, days => 2);
is($set1->next(DateTime->new(year => 2010, month => 6, day =>1))->datetime,
$set2->next(DateTime->new(year => 2010, month => 6, day =>1))->datetime);
__END__
not ok 1
# Failed test at /tmp/date.pl line 20.
# got: '2010-06-08T00:00:00'
# expected: '2010-06-15T00:00:00'
1..1
# Looks like you failed 1 test of 1.
Regards,
Slaven
Show quoted text>
> 2010/1/31 Slaven_Rezic via RT <bug-DateTime-Event-
> Recurrence@rt.cpan.org>:
> > Sun Jan 31 13:09:37 2010: Request 54166 was acted upon.
> > Transaction: Ticket created by SREZIC
> > Queue: DateTime-Event-Recurrence
> > Subject: Unexpected result for ->monthly call with weeks and
> days parameters
> > Broken in: 0.16
> > Severity: (no value)
> > Owner: Nobody
> > Requestors: SREZIC@cpan.org
> > Status: new
> > Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=54166 >
> >
> >
> > With the following script I would like to get the second Tuesday of
> June
> > 2010 (similar to the example in the module's Pod):
> >
> > #!/usr/bin/perl -w
> > use DateTime::Event::Recurrence;
> > use Test::More qw(no_plan);
> > my $set = DateTime::Event::Recurrence->monthly(weeks => 2, days =>
> 2);
> > is($set->next(DateTime->new(year => 2010, month => 6, day =>
> > 1))->datetime, "2010-06-08T00:00:00");
> > __END__
> >
> > But the resulting day is the third Tuesday of June.
> >
> > Regards,
> > Slaven
> >
> >