7 Answers, 1 is accepted
The following article demonstrates how to retrieve the current date range.
An example on how to subscribe to the Scheduler events in MVC project is described in the following demo.
I hope that the provided information will be helpful.
Regards,
Neli
Progress Telerik

Hi Neli,
Thank you for your reply. It is helpful but I have other similar questions here.
How about I want to get all the date & time (calendar events) for the recurring schedule?
Besides that, is it any other ways to get all the date & time directly from C# without subscribing to the Scheduler javascript event? For eg: a helper method to generate the date & time using the record in DB? I need to use all the date & time information to generate data in another detail table in C#.
Thank you.
If I understand correctly, you need to retrieve the date and time of all the recurring events.
In case you need to retrieve the data about all initial recurring events, you can use DataSource data() method.
var
scheduler = $(
'#scheduler'
).data(
'kendoScheduler'
);
var
data = scheduler.dataSource.data();
Next you can filter all the events, by checking their recurrence rule:
var
recurring = data.filter(e => e.recurrenceRule !=
null
&& e.recurrenceRule !=
""
);
Then, you can access the start and end time of all the events
recurring.forEach(
function
(e){
console.log(
'START: '
+ e.start +
' END: '
+ e.end);
})
In the linked Dojo example the start and end time of all recurring events will be console logged on button click. The approach in MVC project will be the same.
In case you need to retrieve the data about all occurrences of the events, you can use the occurrencesInRange method. This method returns a list of the event occurrences for specified range. You will need to filter the events, by checking if they have recurrenceRule or recurrenceId. Note, that the result of this method is scoped to the currently displayed view.
var
events = scheduler.occurrencesInRange(
new
Date(
"2013/6/5"
),
new
Date(
"2013/6/10"
));
var
ocurrencies = events.filter(e => e.recurrenceRule !=
null
&&
e.recurrenceRule != undefined ||
e.recurrenceId);
In the Dojo example linked here, the recurring event occurrences are console logged.
I am afraid, that the data about the recurring events could not be retrieved directly from the C# code. In order to get the data regarding the recurring event occurrencies you will need to do it client-side, as it is described above.
Regards,
Neli
Progress Telerik

Hi Neli,
The occurrencesInRange method is helpful. But as what you wrote, it is scoped to currently displayed view only.
Any other methods that will return beyond the scope? For e.g. date range?
Thank you very much.
I am afraid that Scheduler API does not provide methods to check all occurrences of recurring event, that are not part of the currently displayed view.
I would suggest you to log the idea as a feature request in our Feedback portal. Based on the support it receives from the community, we will decide on whether to proceed with its implementation or not.
Regards,
Neli
Progress Telerik

Hi Neli,
Is this still un-solved or anything we can do to generate the recurrence dates beyond the front-view? Please suggest. Thanks
Regards,
Hi Sean,
The occurrences of the recurring events in the Scheduler could be retrieved through the occurrenceInRange method. As it is written in my previous replies the result is scoped to the currently displayed view. So, the specified range should be within the view's time range. I am afraid that I could not suggest a workaround in order to retrieve all the occurrences that are not part of the currently displayed view.
If you think, that such functionality would add value to the widget, I would suggest you log your idea as a feature request on our Feedback portal. This way the other users could vote for the idea. if the community shows interest in having such a feature, we will consider enhancing the component.
Regards,
Neli
Progress Telerik
Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).