returns a collection of events which occur during the specified period
from | Date | the start date of the period |
to | Date | the end date of the period |
array | an array of event objects |
var evs = scheduler.getEvents(new Date(2013,1,10),new Date(2013,2,10));
for (var i=0; i<evs.length; i++){
alert(evs[i].text);
}
// or
var evs = scheduler.getEvents();// will return all events
If support for recurring events is activated, the "from-to" parameters are required for the getEvents method.
var today = scheduler.date.day_start(new Date());
var nextWeek = scheduler.date.add(today, 1, "week");
var events = scheduler.getEvents(today, nextWeek);
Otherwise, the getEvents() method will return an empty array because the recurring extension allows setting endless sequences of events while the method can't return an endless array.
If recurring events are disabled, the method will work correctly as with parameters as without them. But in case you don't specify any parameters, the method will return all events.
Back to top