I have come across an issue in which the exceptions for a given recurrence rule are not being programmatically generated properly. The date portion is correct (that is, the date at which the exception is supposed to occur), but the time is wrong. I'm likely doing something wrong (as RadScheduler can figure out the correct time), but I wasn't able to track down a solution.
The initial recurrence rule (programmatically created from a database record) is this:
DTSTART:20100115T090000Z
DTEND:20100115T170000Z
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,FR
When I go to add an exception for this weekly recurring event on 1/20/2009, RadScheduler gives me this new rule on the OnAppointmentUpdated event:
DTSTART:20100115T090000Z
DTEND:20100115T170000Z
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,FR
EXDATE:20100120T090000Z
Obviously, I trust that RadScheduler is doing the right thing here.
In order to capture exceptions (in this case a delete), I insert a new row into my table with the exception start date 1/20/2009 9:00 a.m., and an end date 1/20/2009 5:00 p.m. (to maintain the parent event duration), with a foreign key to the parent event. When I generate the new recurrence rule for the parent event, I find the exception and attempt to add it to the recurrence rule programmatically using the exception start DateTime (in this case, the one mentioned above in bold)...
a la...
| rule.Exceptions.Add(exception.StartDate); |
This is the result immediately following the call above:
DTSTART:20100115T090000Z
DTEND:20100115T170000Z
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,FR
EXDATE:20100120T170000Z
They are identical apart from the exception date time. I don't know why the end time for the relation is being used on the exception. I have stepped through my code to verify that the DateTime object being used to generate the exception is indeed correct (and it is). The recurrence rule should have no notion of the exception end time unless it is being inherited from the recurrence start DateTime.
Just in case this is helpful, I am using the ASP.NET Ajax Q2 2009 version of the Telerik controls.
Am I missing something obvious?