This article suggests using the RecurrenceRule class (provided with the UI for ASP.NET AJAX product). The problem I'm having is not all recurrence expressions generated by Kendo Web Scheduler parse correctly using this class, e.g.:
Parse success: FREQ=DAILY;INTERVAL=3;WKST=MO
Parse success: FREQ=WEEKLY;INTERVAL=3;BYDAY=WE;WKST=MO
ERROR - Parse exception: FREQ=MONTHLY;BYMONTHDAY=5
ERROR - Parse exception: FREQ=WEEKLY;BYDAY=MO
Is the RecurrenceRule class able to parse all expressions generated by Kendo Web Scheduler?
If not, what do suggest is the best approach to take and do you have a regex definition for the recurrence rule pattern in Kendo Web?
10 Answers, 1 is accepted
Kendo Scheduler supports expanding recurrence event only on client-side. The supported recurrence rule is defined in RFC 5545.
Regarding your specific question, I will need more information in order to continue our investigation. It will be very helpful if you can send us your test project, where the required functionality is implemented.
As a side note, you can try DDay.iCal library which is open source. I attached a simple test project to this message.
Regards,
Georgi Krustev
Telerik
The objective here is to figure out which scheduled events will fire in the next week using server side code that runs periodically.
Also, can you attach DDay.iCal test project mentioned in your reply - it's not attached.
thanks
Probably something went wrong with the attachment. Sorry for that. I attached it again.
As to the exceptions thrown by RecurrenceRule.TryParse, I noticed that it is caused when INTERVAL rule is missing. If you want to use the RecurrenceRule.TryParse method, you will need to add it manually.
Let me know if I can be of any further help.
Regards,
Georgi Krustev
Telerik
Georgi:
What is INTERVAL?
And how to set it?
Does it have any meaning to the rule? Is it going to impact the way RecurrenceRule parses? Is it going to limit occurrences in any way?
Georgi:
Why recurrence rule "FREQ=DAILY;INTERVAL=1" still fails to parse?
I would suggest you refer to the iCal specs for more details about the recurrence rules.
With regards to the DDay.iCal issue, I would suggest you refer to the library help and forums for further help.
Regards,
Georgi Krustev
Telerik
Hello, I am the same issue, I need with a recurrence rule get all the dates to create in DB a specific event for each one, but this code ever return null RecurrenceRule, I read ICal spec and exist a function to determine conflict with getOcurrence with a date range, but nothing like I need.
RecurrenceRule recRule = null;
var b = RecurrenceRule.TryParse(recurrenceRule, out recurrenceRule);
I try manually like this post : http://stackoverflow.com/questions/23729725/telerik-recurrencerule-tryparse-not-working
but still not working
I need the funcionallity to do anything like that
public static IEnumerable<Tuple<DateTime, DateTime>> GetRecurrenceValuesAndRuleAndGetRecurrenceDates(DateTime recurrenceStart, DateTime recurrenceEnd
, string recurrenceRule)
{
Func<DateTime, DateTime, DateTime> mergeDate
= (dateValues, hourValues) => new DateTime(dateValues.Year, dateValues.Month, dateValues.Day, hourValues.Hour, hourValues.Minute, 0);
//var rrule = string.Format("DTSTART:{0:yyyyMMddTHHmmssZ}\r\nDTEND:{1:yyyyMMddTHHmmssZ}\r\nRRULE:{2}", recurrenceStart, recurrenceEnd, recurrenceEnd);
RecurrenceRule recRule = null;
var b = RecurrenceRule.TryParse(recurrenceRule, out recurrenceRule);
foreach (var date in recRule.Occurrences)
{
var tempStart = mergeDate.Invoke(date, recurrenceStart);
var tempEnd = mergeDate.Invoke(date, recurrenceEnd);
yield return new Tuple<DateTime, DateTime>(tempStart, tempEnd);
}
}
Please i need support becasue I cant save an scheduler event like one unique record in my database.
Regards.
In general, the Kendo UI Scheduler widget expands recurring events on the client. In other words our built-in recurrence engine works only on the client. The generated recurrence rules follow the RFC5545 specifications, which should be enough to use a compatible library that could expand the events on the server.
I am afraid that we would not be able to provide more detailed steps as the desired functionality is not supported by the Kendo UI library and as such falls out of the scope of the entitled support service. If you need further assistance on the subject, please contact our Professional Services.
Regards,
Georgi Krustev
Telerik by Progress