This is a migrated thread and some comments may be shown as answers.

RecurenceRule .ToString is screwed up.

6 Answers 39 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Albert
Top achievements
Rank 1
Albert asked on 25 Feb 2009, 03:46 AM
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

6 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 25 Feb 2009, 02:54 PM
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.
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
Peter
Telerik team
answered on 26 Feb 2009, 04:52 PM
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.
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
}
0
T. Tsonev
Telerik team
answered on 02 Mar 2009, 05:59 PM
Hello Albert,

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.
Tags
Scheduler
Asked by
Albert
Top achievements
Rank 1
Answers by
Peter
Telerik team
Albert
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or