[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    Re: [Kde-pim] CalendarLocal::rawEvents()
From:       David Jarvie <lists () astrojar ! org ! uk>
Date:       2003-10-29 11:43:44
[Download RAW message or body]

On Monday 27 Oct 2003 10:15 pm, Allen Winter wrote:
> I think there is a logic bug in CalendarLocal::rawEvents().
>
> I have a recurring event to remind me to pay my mortgage
> on the 20th of every month forever.  I never bothered to put
> an ending date for the recurrence range on this event.
>
> If I call CalendarLocal::rawEvents() using a start datetime
> of 2003-10-27 at 7am and and end datetime of 2003-10-27 at 5pm
> and the inclusive option = false, then the event list comes back
> including my mortgage event.
>
> If, instead, I set the inclusive option=true then the event list does not
> include my mortgage event.
>
> In this case, I think the returned list should not include the mortgage
> event independent of the inclusive option with the start datetime/end
> datetime I specified? Or, maybe not?

The logic in CalendarLocal::rawEvents() seems a bit odd for inclusive=false. 
Here is a list of suspect points:

For non-recurring events:

1)  It returns an event if either its start or end falls within the specified 
start and end datetimes. Why not return the event if its start falls *before* 
and its end falls *after* the specified datetimes?

For recurring events:

1)  It evaluates the event's start and end date by taking the start of the 
event to be the start of the first recurrence, and the end of the event to be 
the *start* of the last recurrence. The end of the event should surely be the 
*end* of the last recurrence.

2)  Provided that the event starts before the end of the specified date range, 
the event is returned if it recurs forever. But if the event has an end date, 
it is only returned if its end date falls *within* the specified date range. 
Why not if its end date falls *after* the specified date range?

3)  Taking the event to extend from the first recurrence to the last with no 
gaps between recurrences isn't necessarily an intuitively obvious way for it 
to function, as your comments illustrate. I have added comments for this 
method to the header file to make it clearer.

--
David Jarvie.

_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic