I added Exceptions trough RecurrenceRule.Exceptions.Add, but when I use the ToString, the EXDATEs are off by a day.
This is my Exceptions collection,
2/21/2009
2/24/2009
3/7/2009
3/13/2009
3/20/2009
3/27/2009
but the resulting string is
DTSTART:20090213T160000Z
DTEND:20090213T160000Z
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,FR
EXDATE:20090220T160000Z,20090223T160000Z,20090306T160000Z,20090312T160000Z,20090319T160000Z,20090326T160000Z
This is my Exceptions collection,
2/21/2009
2/24/2009
3/7/2009
3/13/2009
3/20/2009
3/27/2009
but the resulting string is
DTSTART:20090213T160000Z
DTEND:20090213T160000Z
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,FR
EXDATE:20090220T160000Z,20090223T160000Z,20090306T160000Z,20090312T160000Z,20090319T160000Z,20090326T160000Z
6 Answers, 1 is accepted
0
Hello Albert,
Please, try setting TimeZoneOffset="00:00:00". Let us know if the problem still persists.
Regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Please, try setting TimeZoneOffset="00:00:00". Let us know if the problem still persists.
Regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0

Albert
Top achievements
Rank 1
answered on 26 Feb 2009, 01:14 AM
I doubt the will help seeing as the timezoneoffset is a property of the RadScheduler, not the RecurrenceRule. Anyways, tried it and no it is still the same result
0
Hi Albert,
Can you send us the code of your implementation, please?
Kind regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Can you send us the code of your implementation, please?
Kind regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0

Albert
Top achievements
Rank 1
answered on 27 Feb 2009, 01:21 AM
{
RecurrenceRule RecRule = (RecurrenceRule)new MonthlyRecurrenceRule(0, new RecurrenceRange());
.... Some code to get frequency, interval, etc. from database
RecRule = AddExceptionstoRule(RecRule, myCal.id);
string RRule = RecRule.ToString();
//Everything is correct except for the EXDATE string which has hours/days that are off by an hour/day
}
private RecurrenceRule AddExceptionstoRule(RecurrenceRule RecRule, long CalendarID)
{
List<fnbl_pim_calendar_exception> CalendarExceptionCollection = GetCalendarExceptionCollection(CalendarID);
foreach (fnbl_pim_calendar_exception myCalEx in CalendarExceptionCollection)
RecRule.Exceptions.Add(myCalEx.occurrence_date);
return RecRule;
//values in collection are
//2/21/2009
//2/24/2009
//3/7/2009
//3/13/2009
//3/20/2009
//3/27/2009
}
RecurrenceRule RecRule = (RecurrenceRule)new MonthlyRecurrenceRule(0, new RecurrenceRange());
.... Some code to get frequency, interval, etc. from database
RecRule = AddExceptionstoRule(RecRule, myCal.id);
string RRule = RecRule.ToString();
//Everything is correct except for the EXDATE string which has hours/days that are off by an hour/day
}
private RecurrenceRule AddExceptionstoRule(RecurrenceRule RecRule, long CalendarID)
{
List<fnbl_pim_calendar_exception> CalendarExceptionCollection = GetCalendarExceptionCollection(CalendarID);
foreach (fnbl_pim_calendar_exception myCalEx in CalendarExceptionCollection)
RecRule.Exceptions.Add(myCalEx.occurrence_date);
return RecRule;
//values in collection are
//2/21/2009
//2/24/2009
//3/7/2009
//3/13/2009
//3/20/2009
//3/27/2009
}
0
Hello Albert,
We'll consider making this requirement optional and/or state this more clearly in the documentation. I'm sorry for the inconvenience.
Sincerely yours,
Tsvetomir Tsonev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Thank you for sending us the sample code. The problem seems to be that the exception dates are being supplied in Local time. The recurrence-related classes require that dates are UTC. Specifying the type should solve the problem:
DateTime.SpecifyKind(myCalEx.occurrence_date, DateTimeKind.Utc);
We'll consider making this requirement optional and/or state this more clearly in the documentation. I'm sorry for the inconvenience.
Sincerely yours,
Tsvetomir Tsonev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0

Albert
Top achievements
Rank 1
answered on 03 Mar 2009, 01:48 AM
Thanks.