RecurrenceRule parsing

9 posts, 1 answers
  1. gunnisen
    gunnisen avatar
    25 posts
    Member since:
    Oct 2006

    Posted 11 Sep 2013 Link to this post

    Hello!

    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

  2. Answer
    Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 13 Sep 2013 Link to this post

    Hello Gunnar,

     
    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
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. gunnisen
    gunnisen avatar
    25 posts
    Member since:
    Oct 2006

    Posted 15 Sep 2013 Link to this post

    Georgi, thanks, this is great! I'm well on my way to a working solution now. 

    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
  5. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 18 Sep 2013 Link to this post

    Hello Gunnar,

     
    Could you elaborate more on "creating reports on resource usage" ? Nevertheless, I believe that there is no such server logic.

    Regards,
    Georgi Krustev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. gunnisen
    gunnisen avatar
    25 posts
    Member since:
    Oct 2006

    Posted 18 Sep 2013 Link to this post

    Good morning!

    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
  7. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 19 Sep 2013 Link to this post

    Hello again 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.

    Regards,
    Georgi Krustev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  8. Aaron
    Aaron avatar
    14 posts
    Member since:
    Jan 2012

    Posted 01 Oct 2013 Link to this post

    Hi,

    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?
  9. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 02 Oct 2013 Link to this post

    Hello Aaron,

     
    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.

    Regards,
    Georgi Krustev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  10. gunnisen
    gunnisen avatar
    25 posts
    Member since:
    Oct 2006

    Posted 02 Oct 2013 Link to this post

    I'm expanding on the client and sending to the server now, and it certainly works, but I can confirm that the bandwidth load is indeed significant.  :-)

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

    Best regards,
      Gunnar

Back to Top
Kendo UI is VS 2017 Ready