toOccurrence
Converts the scheduler event to a event occurrence. Method will remove recurrenceRule
, recurrenceException
options, will add a recurrenceId
field and will set id
to the default one.
Parameters
options Object
Additional options passed to the SchedulerEvent constructor.
uid
property of the event will be preserved.
Returns
kendo.data.SchedulerEvent
the occurrence.
Example - create occurrence from a scheduler event
<script>
var event = new kendo.data.SchedulerEvent({
id: 1,
title: "Task1",
start: new Date(2013, 10, 11, 12),
end: new Date(2013, 10, 11, 14),
recurrenceRule: "FREQ=DAILY"
});
var occurrence = event.toOccurrence();
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(occurrence.id); //logs default id
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(occurrence.recurrenceId); //logs id of the head. In this case '1'
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(occurrence.recurrenceRule); //logs 'null'
</script>