When using the recurring extension, get_events now requires that you specify the “to” and “from” dates that are optional without the extension.
Is there a reason for this?
I’m not even certain the data calculations are correct when you do provide “to” and “from” as I am seeing recurring events outside the time frame being returned.
I’d like to be able to call scheduler.get_events() to get all of the events.
The following (not really tested) update to get_events in recurring allows this to work:
scheduler.getEvents = function(from, to) {
var result = [];
console.dir(this);
for (var a in this._events) {
var ev = this._events[a];
if (ev && ( (!from && !to) || (ev.start_date < to && ev.end_date > from) )) {
if (ev.rec_pattern && (from && to)) {
if (ev.rec_pattern == "none") continue;
var sev = [];
this.repeat_date(ev, sev, true, from, to);
for (var i = 0; i < sev.length; i++) {
// if event is in rec_markers then it will be checked by himself, here need to skip it
if (!sev[i].rec_pattern && sev[i].start_date < to && sev[i].end_date > from && !this._rec_markers[sev[i].id]) {
result.push(sev[i]);
}
}
} else if (ev.id.toString().indexOf("#") == -1) { // if it's virtual event we can skip it
result.push(ev);
}
}
}
return result;
};