Retrieves events that FullCalendar has in memory.

.fullCalendar( ‘clientEvents’ [, idOrFilter ] ) -> Array
This method will return an array of Event Objects that FullCalendar has stored in client-side memory.

If idOrFilter is omitted, all events will be returned.

If idOrFilter is an ID, all events with the same ID will be returned.

idOrFilter may also be a filter function that accepts one Event Object argument and returns true if it should be included in the result set.


dayClick: function(date, jsEvent, view) {
        var events = $('#calendar').fullCalendar('clientEvents', function(event) {
            var eventStart = event.start;
            var eventEnd = event.end ? event.end : null;
            var theDate = date;
            // Make sure the event starts on or before date and ends afterward
            // Events that have no end date specified (null) end that day, so check if start = date
            return (eventStart <= theDate && (eventEnd >= theDate) && !(eventStart < theDate && (eventEnd == theDate))) || (eventStart == theDate && (eventEnd === null));
        console.log(events); // do whatever with the console.log(events[0]._allDay); 


©️2020 CSDN 皮肤主题: 创作都市 设计师:CSDN官方博客 返回首页