Skip Menu |

This queue is for tickets about the Date-Manip CPAN distribution.

Report information
The Basics
Id: 59132
Status: resolved
Priority: 0/
Queue: Date-Manip

People
Owner: Nobody in particular
Requestors: jon [...] hogue.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 6.11
Fixed in: (no value)



Subject: sample frequencies from Date::Manip::Recur don't appear to be working
When it fails, I get the error, [frequency] Invalid frequency string at ./test_dmr.pl line 24. Fails for these: the first of every month every other day the 4th Thursday of each month every other Friday every 3 weeks on Thursday Works for these: every day last Thursday of each month # HERE'S MY TEST SCRIPT #!/usr/local/bin/perl use Date::Manip::Recur; $recur = new Date::Manip::Recur; my $base = '01/01/2010'; my $start = '01/01/2010'; my $end = '01/01/2011'; my @test_data = ( 'the first of every month', 'every other day', 'the 4th Thursday of each month', 'every other Friday', 'every day', 'every 3 weeks on Thursday', 'last Thursday of each month', '2nd Thursday of each month' ); foreach my $td ( @test_data ) { print "Test Data: $td\n"; my $err = $recur->parse( $td, $base, $start, $end ); warn $recur->err() if $err; print join ",", map { $_->printf('%D') } $recur->dates(); print "\n"; }
I'd classify this as a documentation bug. I've made the documentation clearer. Basically, the English (or other language) parsing for recurrences is extremely limited (as opposed to the date parsing where parsing is quite complete). I use common strings describing recurring events in the docs for clarity, but when it comes to actually parsing them, very few of them can be parsed directly. For the most part, you have to use the frequency notation described in the document. So, the string 'the first of every month' can't be parsed directly. Instead, you'll need to use the notation '0:1*0:1:0:0:0'. I've updated the docs to be much clearer. Sorry for the confusion.
Subject: Re: [rt.cpan.org #59132] sample frequencies from Date::Manip::Recur don't appear to be working
Date: Tue, 06 Jul 2010 15:05:31 -0400
To: bug-Date-Manip [...] rt.cpan.org
From: Jon Hogue <jon [...] hogue.org>
that makes sense. maybe, I can write an extension that adds the english to '0:1*0:1:0:0:0' translation. being able to use english here could drastically simplify user interfaces. On 7/6/10 2:55 PM, Sullivan Beck via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=59132> > > I'd classify this as a documentation bug. I've made the documentation > clearer. > > Basically, the English (or other language) parsing for recurrences is > extremely limited (as opposed to the date parsing where parsing is quite > complete). I use common strings describing recurring events in the docs > for clarity, but when it comes to actually parsing them, very few of > them can be parsed directly. For the most part, you have to use the > frequency notation described in the document. > > So, the string 'the first of every month' can't be parsed directly. > Instead, you'll need to use the notation '0:1*0:1:0:0:0'. > > I've updated the docs to be much clearer. Sorry for the confusion. > >
Some sort of wrapper might be very useful. I don't have time to write it myself right now... there are a number of higher priority things that I want to do with Date::Manip, but later, if you (or someone else hasn't already addressed it), I may do so.