Parse RecurrenceRule in SQL

8 posts, 0 answers
  1. Denis Buchwald
    Denis Buchwald avatar
    28 posts
    Member since:
    Apr 2010

    Posted 09 Oct 2015 Link to this post

    I'm trying to parse out RecurrenceRule in SQL to get actual occurrences. Is there a component that would do that for me? I'm trying to build a query that would return all appointment occurrences similarly DDay.iCal works in C#.

     

     

     

    Please I've already tried Telerik's recurrenceEngine.dll and it's not working. I was told that this component only works with RAD Scheduler. Here is the thread: 

    http://www.telerik.com/forums/sql-reporting-display-all-recurring-appointments#CrfU3SbKNEOrM_GiLOj9Sg​

  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 13 Oct 2015 Link to this post

    Hello Denis,

    We do not have a special component that would expand the events in SQL. You will need to use custom solution in this case.

    Another option is to modify the recurrence rule generated by the Kendo UI Scheduler (Scheduler UI for ASP.NET MVC) and include the required DTSTART and DTEND options. In general, the Kendo Scheduler supports such recurrence rule format and it will work with them. The modifications can be done either during event save or in the save event:
    Please note that custom solutions fall out the scope of the standard support service.

    Regards,
    Georgi Krustev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Denis Buchwald
    Denis Buchwald avatar
    28 posts
    Member since:
    Apr 2010

    Posted 19 Nov 2015 in reply to Georgi Krustev Link to this post

    Georgi:

     Could you provide an example of modifying Recurrence rule to add DTSTART/DTEND options?

     

    Denis

  5. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 23 Nov 2015 Link to this post

    Hello Denis,

    Here is a simple Dojo demo that shows how to add DTSTART/DTEND in the beginning of the of the recurrence rule field:
    Regards,
    Georgi Krustev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Denis Buchwald
    Denis Buchwald avatar
    28 posts
    Member since:
    Apr 2010

    Posted 24 Nov 2015 in reply to Georgi Krustev Link to this post

    Georgi:

    I took a look at SchedulerBuilder class and it doesn't have a member function "Save". SchedulerBuilder is in a namespace Kendo.Mvc.UI.Fluent which is in Kendo.Mvc assembly Version=2015.3.930.545:

     

    namespace Kendo.Mvc.UI.Fluent
    {
        public class SchedulerBuilder<TModel> : WidgetBuilderBase<Scheduler<TModel>, SchedulerBuilder<TModel>> where TModel : class, ISchedulerEvent
        {
            public SchedulerBuilder(Scheduler<TModel> component);
     
            public SchedulerBuilder<TModel> AllDayEventTemplate(string allDayEventTemplate);
            public SchedulerBuilder<TModel> AllDayEventTemplateId(string allDayEventTemplateId);
            public SchedulerBuilder<TModel> AllDaySlot(bool allDaySlot);
            public SchedulerBuilder<TModel> AutoBind(bool autoBind);
            public SchedulerBuilder<TModel> BindTo(IEnumerable<TModel> dataSource);
            public SchedulerBuilder<TModel> CurrentTimeMarker(bool enabled);
            public SchedulerBuilder<TModel> CurrentTimeMarker(Action<SchedulerCurrentTimeMarkerSettingsBuilder> configurator);
            public SchedulerBuilder<TModel> DataSource(Action<SchedulerAjaxDataSourceBuilder<TModel>> configurator);
            public SchedulerBuilder<TModel> Date(DateTime date);
            public SchedulerBuilder<TModel> DateHeaderTemplate(string dateHeaderTemplate);
            public SchedulerBuilder<TModel> DateHeaderTemplateId(string dateHeaderTemplateId);
            public SchedulerBuilder<TModel> Editable(bool isEditable);
            public SchedulerBuilder<TModel> Editable(Action<SchedulerEditableSettingsBuilder<TModel>> configurator);
            public SchedulerBuilder<TModel> EndTime(DateTime endTime);
            public SchedulerBuilder<TModel> EndTime(int hours, int minutes, int seconds);
            public SchedulerBuilder<TModel> Events(Action<SchedulerEventBuilder> clientEventsAction);
            public SchedulerBuilder<TModel> EventTemplate(string eventTemplate);
            public SchedulerBuilder<TModel> EventTemplateId(string eventTemplateId);
            public SchedulerBuilder<TModel> Group(Action<SchedulerGroupBuilder> configuration);
            public SchedulerBuilder<TModel> GroupHeaderTemplate(string groupHeaderTemplate);
            public SchedulerBuilder<TModel> GroupHeaderTemplateId(string groupHeaderTemplateId);
            public SchedulerBuilder<TModel> Height(int height);
            public SchedulerBuilder<TModel> MajorTick(int majorTick);
            public SchedulerBuilder<TModel> MajorTimeHeaderTemplate(string majorTimeHeaderTemplate);
            public SchedulerBuilder<TModel> MajorTimeHeaderTemplateId(string majorTimeHeaderTemplateId);
            public SchedulerBuilder<TModel> Max(DateTime date);
            public SchedulerBuilder<TModel> Messages(Action<SchedulerMessagesBuilder> addViewAction);
            public SchedulerBuilder<TModel> Min(DateTime date);
            public SchedulerBuilder<TModel> MinorTickCount(int minorTickCount);
            public SchedulerBuilder<TModel> MinorTimeHeaderTemplate(string minorTimeHeaderTemplate);
            public SchedulerBuilder<TModel> MinorTimeHeaderTemplateId(string minorTimeHeaderTemplateId);
            public SchedulerBuilder<TModel> Mobile();
            public SchedulerBuilder<TModel> Mobile(MobileMode type);
            public SchedulerBuilder<TModel> Pdf(Action<PDFSettingsBuilder> configurator);
            public SchedulerBuilder<TModel> Resources(Action<SchedulerResourceFactory<TModel>> addResourceAction);
            public SchedulerBuilder<TModel> Selectable(bool selectable);
            public SchedulerBuilder<TModel> ShowWorkHours();
            public SchedulerBuilder<TModel> ShowWorkHours(bool value);
            public SchedulerBuilder<TModel> Snap(bool isSnapable);
            public SchedulerBuilder<TModel> StartTime(DateTime startTime);
            public SchedulerBuilder<TModel> StartTime(int hours, int minutes, int seconds);
            public SchedulerBuilder<TModel> Timezone(string timezone);
            public SchedulerBuilder<TModel> Toolbar(Action<SchedulerToolbarFactory<TModel>> addToolbarAction);
            public SchedulerBuilder<TModel> Views(Action<SchedulerViewFactory<TModel>> addViewAction);
            public SchedulerBuilder<TModel> Width(int width);
            public SchedulerBuilder<TModel> WorkDayEnd(DateTime workDayEnd);
            public SchedulerBuilder<TModel> WorkDayEnd(int hours, int minutes, int seconds);
            public SchedulerBuilder<TModel> WorkDayStart(DateTime workDayStart);
            public SchedulerBuilder<TModel> WorkDayStart(int hours, int minutes, int seconds);
            public SchedulerBuilder<TModel> WorkWeekEnd(int workWeekEndDay);
            public SchedulerBuilder<TModel> WorkWeekStart(int workWeekStartDay);
        }
    }

  7. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 26 Nov 2015 Link to this post

    Hello Denis,

    The ASP.NET MVC wrappers has a dedicated Events builder method that defines the widget events. You can find more details here: You can define the save event using the Events Save method:
    Regards,
    Georgi Krustev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  8. Denis Buchwald
    Denis Buchwald avatar
    28 posts
    Member since:
    Apr 2010

    Posted 03 Dec 2015 in reply to Georgi Krustev Link to this post

    I have modified scheduler_save event adding an extra code to modify RecurrenceRule and save it. Now this rule can be parsed by ExpandRecurrence function in SQL server. But the problem is that MVC Scheduler is not able to read it and display it on the screen. Browser is not reporting any errors. It seems that MVC Scheduler engine can't handle the following Recurrence Rule:

    DTSTART:20151202T020000Z  DTEND:20151202T023000Z  RRULE:FREQ=WEEKLY;INTERVAL=2;BYDAY=TH

    (Note that there are line breaks after letters "Z" in this string, otherwise ExpandRecurrence function will not parse if these line breaks are missing)

     Here is the code I've added to my Scheduler_save function:

    var event = e.event;
    var recurrenceRule = event.recurrenceRule;
     
    if (recurrenceRule.substr(0, 7) !== "DTSTART") {
        var dtstart = "DTSTART:" + kendo.toString(toUTC(event.start), "yyyyMMddTHHmmssZ");
        var dtend = "DTEND:" + kendo.toString(toUTC(event.end), "yyyyMMddTHHmmssZ");
        event.recurrenceRule = dtstart + "\r\n" + dtend + "\r\nRRULE:" + recurrenceRule;
    }

    So the question is - how to make sure the rule is read and displayed by MVC Scheduler and is also parsed out by ExpandRecurrence function?

  9. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 07 Dec 2015 Link to this post

    Hello Denis,

    The widget works properly with a modified recurrence rule. Here is a Dojo demo that uses a remote service and the series is correctly created and expanded even though the recurrence rule is modified: Here is a screencast showing that:
    Could you modify the demo or send us a repo application that we can review locally? This will help us a lot to narrow the problem down and find a feasible solution promptly.

    Regards,
    Georgi Krustev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET MVC is VS 2017 Ready