Hi,
I'm trying to determine whether there is a clash with an occupied time slot when creating an event with a recurrence. I am able to make this determination when dealing with a daily recurrence. When I try using weekly recurrence only the first occurrence is returned and nothing else when using the occurrencesInRange method.
Here is my code:
function scheduler_save(e) {
var scheduler = $("#scheduler").getKendoScheduler();
if (e.event.recurrenceRule != 'undefined' && e.event.recurrenceRule != '') {
var nextOccurrence = e.event.expand(e.event.start, new Date(2999, 0, 1), "Etc/UTC");
for (var idx = 0, length = nextOccurrence.length; idx < length; idx++) {
var occurrences = scheduler.occurrencesInRange(nextOccurrence[idx].start, nextOccurrence[idx].end);
if (occurrences.length > 0) {
msg += nextOccurrence[idx].start + '\n';
}
}
if (nextOccurrence.length > 0) {
alert(msg);
}
}
else {
if (!checkAvailability(e.event.start, e.event.end, e.event, e.event.resources)) {
e.preventDefault();
}
}
}
Would anyone be able to point me in the right direction.
Thank you.
Phil