Re: DateTime::Format::ICal bug : DTSTART value in recurrences not converted to DateTime

2009-02-18 Thread Flavio S. Glock
This is an intentional feature - DTSTART is not an RRULE component.

An iCalendar text looks like:

 DTSTART:19870405T02
 RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4

reference: http://www.ietf.org/rfc/rfc2445.txt

Flávio S. Glock

2009/2/18 Olivier Mengué olivier.men...@gmail.com:
 Hi,

 I have a problem with this expression (Second wednesday of every month, at
 20:00) that I'm using with DateTime::Format::ICal-parse_recurrence() :
 FREQ=MONTHLY;BYDAY=2WE;DTSTART=20090201T20Z;COUNT=12

 Here is the test case:
 perl -MDateTime::Format::ICal -e
 DateTime::Format::ICal-parse_recurrence(recurrence='FREQ=MONTHLY;BYDAY=2WE;DTSTART=20090201T20Z;COUNT=12')
 The 'start' parameter (20090201t20z) to DateTime::Span::from_datetimes
 was a 'scalar', which is not one of the allowed types: object
  at C:/strawberry/perl/site/lib/DateTime/Span.pm line 37
DateTime::Span::from_datetimes(undef, 'start', '20090201t20z')
 called at C:/strawberry/perl/site/lib/DateTime/Event/ICal.pm line 515
DateTime::Event::ICal::recur('DateTime::Event::ICal', 'freq', 'monthly',
 'byday', 'ARRAY(0x11f805c)', 'dtstart', '20090201t20z') called at
 C:/strawberry/perl/site/lib/DateTime/Event/ICal.pm line 501
DateTime::Event::ICal::recur('DateTime::Event::ICal', 'count', 12,
 'freq', 'monthly', 'byday', 'ARRAY(0x11f805c)', 'dtstart',
 '20090201t20z', ...) called at
 C:/strawberry/perl/site/lib/DateTime/Format/ICal.pm line 173
DateTime::Format::ICal::parse_recurrence(undef, 'recurrence',
 'FREQ=MONTHLY;BYDAY=2WE;DTSTART=20090201T20Z;COUNT=12', 'dtstart',
 'DateTime=HASH(0x11f772c)') called at C:/Documents and
 Settings/omengue/Documents/Eclipse/Test POE Scheduler/test-ical-recur.pl
 line 31


 It looks like a conversion of the string value of dtstart to a DateTime
 object is missing...

 Olivier
 http://o.mengue.free.fr/



Re: DateTime::Format::ICal bug

2005-07-01 Thread David Sweet
 A test script illustrating the error would be handy.  Also, please 
send this to [EMAIL PROTECTED]


 Thanks,

 -dave

Sure.

To use the test script you will have to save the attached in the same 
directory as the test script.


Here's the test script (test_ical.pl):
#!/usr/local/bin/perl
$FILE=B8E24C3AF01492459438BFA2D6ECBF736B6C16;
use iCal::Parser;
$parser=iCal::Parser-new();
$vcal=$parser-parse($FILE);

bash-2.03$ ./test_ical.pl
Invalid ICal datetime string (20050629T21,20050630T21)
Attempt to free unreferenced scalar.
bash-2.03$
BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:Microsoft CDO for Microsoft Exchange
VERSION:2.0
BEGIN:VTIMEZONE
TZID:GMT -0800 (Standard) / GMT -0700 (Daylight)
BEGIN:STANDARD
DTSTART:16010101T02
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T02
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=4;BYDAY=1SU
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20050628T121735Z
DTSTART;TZID=GMT -0800 (Standard) / GMT -0700 (Daylight):20050628T21
SUMMARY:UPS plan swaps start
UID:{AC9770BF-F577-4DFB-A39D-01B6B51BF3F2}
ORGANIZER;CN=noc-cal:MAILTO:[EMAIL PROTECTED]
LOCATION:bug 85119
DTEND;TZID=GMT -0800 (Standard) / GMT -0700 (Daylight):20050628T213000
RRULE:FREQ=DAILY;UNTIL=20050704T04Z;INTERVAL=1;WKST=SU
EXDATE;TZID=GMT -0800 (Standard) / GMT -0700 (Daylight):20050629T21,2
 0050630T21
DESCRIPTION:
SEQUENCE:0
PRIORITY:5
CLASS:
CREATED:20050628T121735Z
LAST-MODIFIED:20050628T121735Z
STATUS:TENTATIVE
TRANSP:OPAQUE
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-INSTTYPE:1
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-OWNERAPPTID:-1
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT00H15M00S
END:VALARM
END:VEVENT
BEGIN:VEVENT
X-MICROSOFT-CDO-MODPROPS:BEGIN,class,dtend,dtstart,END,recurrence-id,summar
 y,x-microsoft-cdo-busystatus,x-microsoft-cdo-importance,x-microsoft-cdo-in
 sttype
DTSTAMP:20050628T121735Z
DTSTART;TZID=GMT -0800 (Standard) / GMT -0700 (Daylight):20050701T21
SUMMARY:UPS plan swap ends (PCA-BETA2)
UID:{AC9770BF-F577-4DFB-A39D-01B6B51BF3F2}
ORGANIZER;CN=noc-cal:MAILTO:[EMAIL PROTECTED]
LOCATION:bug 85119
DTEND;TZID=GMT -0800 (Standard) / GMT -0700 (Daylight):20050701T213000
DESCRIPTION:
RECURRENCE-ID;TZID=GMT -0800 (Standard) / GMT -0700 (Daylight):20050701T2
 1
SEQUENCE:0
PRIORITY:5
CLASS:
CREATED:20050628T121735Z
LAST-MODIFIED:20050628T121735Z
STATUS:TENTATIVE
TRANSP:OPAQUE
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-INSTTYPE:3
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-OWNERAPPTID:-1
END:VEVENT
BEGIN:VEVENT
X-MICROSOFT-CDO-MODPROPS:BEGIN,class,dtend,dtstart,END,recurrence-id,summar
 y,x-microsoft-cdo-busystatus,x-microsoft-cdo-importance,x-microsoft-cdo-in
 sttype
DTSTAMP:20050628T121735Z
DTSTART;TZID=GMT -0800 (Standard) / GMT -0700 (Daylight):20050702T21
SUMMARY:UPS plan swap ends (PICKUPS-BETA2)
UID:{AC9770BF-F577-4DFB-A39D-01B6B51BF3F2}
ORGANIZER;CN=noc-cal:MAILTO:[EMAIL PROTECTED]
LOCATION:bug 85119
DTEND;TZID=GMT -0800 (Standard) / GMT -0700 (Daylight):20050702T213000
DESCRIPTION:
RECURRENCE-ID;TZID=GMT -0800 (Standard) / GMT -0700 (Daylight):20050702T2
 1
SEQUENCE:0
PRIORITY:5
CLASS:
CREATED:20050628T121735Z
LAST-MODIFIED:20050628T121735Z
STATUS:TENTATIVE
TRANSP:OPAQUE
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-INSTTYPE:3
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-OWNERAPPTID:-1
END:VEVENT
BEGIN:VEVENT
X-MICROSOFT-CDO-MODPROPS:BEGIN,class,dtend,dtstart,END,recurrence-id,summar
 y,x-microsoft-cdo-busystatus,x-microsoft-cdo-importance,x-microsoft-cdo-in
 sttype
DTSTAMP:20050628T121735Z
DTSTART;TZID=GMT -0800 (Standard) / GMT -0700 (Daylight):20050703T21
SUMMARY:UPS plan swap ends (INTL-BETA2)
UID:{AC9770BF-F577-4DFB-A39D-01B6B51BF3F2}
ORGANIZER;CN=noc-cal:MAILTO:[EMAIL PROTECTED]
LOCATION:bug 85119
DTEND;TZID=GMT -0800 (Standard) / GMT -0700 (Daylight):20050703T213000
DESCRIPTION:
RECURRENCE-ID;TZID=GMT -0800 (Standard) / GMT -0700 (Daylight):20050703T2
 1
SEQUENCE:0
PRIORITY:5
CLASS:
CREATED:20050628T121735Z
LAST-MODIFIED:20050628T121735Z
STATUS:TENTATIVE
TRANSP:OPAQUE
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-INSTTYPE:3
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-OWNERAPPTID:-1
END:VEVENT
END:VCALENDAR



Re: DateTime::Format::ICal bug

2003-11-10 Thread Flavio S. Glock
Matt Sisk wrote:
 
 At issue seems to be that the parser does not remove the 'RRULE:' part
 from the beginning of a rule before splitting on semicolons.

Fixed in CVS.
 
 Also, while we're at it, when we return these values can we either
 return a scalar when there is only one result (or make use of wantarray)?

Done. In scalar context it will return a single string, which may 
contain embedded newlines.

Thanks.
 
- Flavio S. Glock


Re: DateTime::Format::ICal bug

2003-06-28 Thread Dave Rolsky
On Sat, 28 Jun 2003 [EMAIL PROTECTED] wrote:

 # Failed test (t/01datetime.t at line 87)
 #  got: 'TZID=-0100:19000101T15'
 # expected: '19000101T16Z'
 # Looks like you failed 1 tests of 37.

   my $dt = DateTime-new(
  year = 1900, hour = 15, time_zone = '-0100' );
   is( $ical-format_datetime($dt),
   '19000101T16Z',
   'offset only time zone should be
  formatted as UTC' );

This is actually due to a bug in DateTime::TimeZone.

I'll release a fixed version soon.


-dave

/*===
House Absolute Consulting
www.houseabsolute.com
===*/