I am developing an ASP.NET MVC app in C# using the Kendo Scheduler. One of the requirements is that when an event is created/edited, the app should check for any overlapping events, and warn the user if any exist. This seems quite complex to me, given that both the event being created/edited and events already in the database can have recurrency rules...
So: Is there some recommended approach to tackling this sort of problem? Is there something built into Kendo UI that I could take advantage of? Or does anyone know of a third-party iCal RRULE parser or something that I could incorporate into my app?
Any and all suggestions appreciated! :-)
Best regards,
Gunnar
8 Answers, 1 is accepted
As there could be events with or without recurring rule option, first you will need to expand all recurring events and check whether there is any overlapping. You can expand events using the built-in recurring framework used by the Scheduler. Try the SchedulerDataSource expand method (currently not documented), which accepts start and end date and return a list of expanded events:
var scheduler = $("#scheduler").data("kendoScheduler");
var events = scheduler.dataSource.expand(new Date(2013, 8, 1), new Date(2013, 9, 31));
Regards,
Georgi Krustev
Telerik

I need similar functionality for creating reports on resource usage. Is there something along the same lines which can be used server-side?
Best regards
Gunnar
Could you elaborate more on "creating reports on resource usage" ? Nevertheless, I believe that there is no such server logic.
Georgi Krustev
Telerik

It's just that I need to create reports on the usage of the various rooms (my resources) for a given time period, and for that I will need access to all events including expanded recurring ones. As my app is ASP.NET MVC, my initial thought was to somehow retrieve the events in a "ReportsController", create a viewmodel with whatever data is needed for the report (summing the hours used per room etc.), and pass that to a view (which could then perhaps use DataViz for some snazzy graphics).
;-)
There's probably some clever way to pass the expanded events from the Scheduler view to my ReportsController, I just haven't figured it out yet. Any hints will be appreciated, but I realize this hardly belongs in this thread anymore, so I'll stop here. ;-)
Thank you so much for your perseverance, Georgi, you've been extremely helpful.
Best regards,
Gunnar
Well, you can expand events on the client and send them to the server. The other options is to send only the start/end period and expand events on the server. It is up to you. If you need more help on this you can contact our premium services, which can help with the custom solution.
Georgi Krustev
Telerik

I am also looking for some sort of serverside solution to get a list of resources attached to calendar date. Any of you guys can provide more details about how you would use the clientside expand functionality on the server?
If you would like to use the client-side expanding functionality, then you can try the expand method of the SchedulerDataSource. Thus you can get list of occurrences. From here, you can send those events to the server and manipulate them (there will be a significant load of the bandwidth though). Another option is to expand events on the server using a third party library. What server library you will use is up to you.
Georgi Krustev
Telerik

Any suggestions for a good 3rd party library for expanding events on the server, anyone?
Best regards,
Gunnar