Bug 127290 - Next occurrence prior to event start date
Summary: Next occurrence prior to event start date
Status: CONFIRMED
Alias: None
Product: kresources
Classification: Miscellaneous
Component: framework (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-14 03:03 UTC by Randy Pearson
Modified: 2006-11-02 19:06 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Prevent negative periods patch (457 bytes, patch)
2006-05-14 03:08 UTC, Randy Pearson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Pearson 2006-05-14 03:03:10 UTC
Version:           svn 3.5 branch (using KDE Devel)
Installed from:    Compiled sources

The next occurrence calculation for events with an UNTIL clause in the RRULE will return a date before the event start date.  When using COUNT in the RRULE, the next occurrence is correct.

The RecurrenceRule::getNextValidDateInterval() function is using a negative periods value and applying it to the start date.

This event has a problem:


Next Occurrence: 05/15/06 03:30 pm

BEGIN:VEVENT
DTSTAMP:20060513T185001Z
ORGANIZER;CN=Randy Pearson:MAILTO:randy@bamafolks.com
CREATED:20051221T222431Z
UID:libkcal-343789519.333
SEQUENCE:1
LAST-MODIFIED:20051221T222548Z
SUMMARY:Intro to Java
CLASS:PUBLIC
PRIORITY:5
RRULE:FREQ=WEEKLY;UNTIL=20060918T050000Z;BYDAY=MO,WE
EXDATE;VALUE=DATE:20060904
DTSTART:20060821T203000Z
DTEND:20060821T233000Z
TRANSP:OPAQUE
BEGIN:VALARM
DESCRIPTION:
ACTION:DISPLAY
TRIGGER;VALUE=DURATION:-PT2H
END:VALARM

END:VEVENT

However, this event works correctly:

Next Occurrence: 08/21/06 08:00 am

BEGIN:VEVENT
DTSTAMP:20060513T185001Z
ORGANIZER;CN=Randy Pearson:MAILTO:randy@bamafolks.com
CREATED:20051207T152831Z
UID:libkcal-2096248965.836
SEQUENCE:1
LAST-MODIFIED:20060222T225404Z
SUMMARY:UNIX Hands-On (Northrup-Grummond)
LOCATION:UAH
CLASS:PUBLIC
PRIORITY:5
RRULE:FREQ=WEEKLY;COUNT=5;BYDAY=MO,TU,WE,TH,FR
DTSTART:20060821T130000Z
DTEND:20060821T170000Z
TRANSP:OPAQUE
BEGIN:VALARM
DESCRIPTION:
ACTION:DISPLAY
TRIGGER;VALUE=DURATION:-PT30M
END:VALARM

END:VEVENT
Comment 1 Randy Pearson 2006-05-14 03:08:49 UTC
Created attachment 16081 [details]
Prevent negative periods patch

When the event has not yet started, toDate is the current system time, which
results in a negative value for periods.  This patch prevents a negative
addition.
Comment 2 Reinhold Kainhofer 2006-11-02 19:06:41 UTC
Reassigning all KOrganizer bug reports and wishes to the newly created 
korganizer-devel mailing list.