Update FullCalendar With Firebase On New Event
I'm trying to build a schedule app with full calendar and Firebase. But I can not get the the calendar to update on changes (events added/deleted/moved). The changes are reflected
Solution 1:
In the fullCalendar documentation, I found:
Event Sources should be dynamically manipulated through methods like addEventSource and removeEventSource. Thusly, dynamic setting of the following options is not applicable:
- events
- eventSources
Therefore I think you need to use an EventSourceObject and do something like this:
// firebase.js
// (Inside 'value' callback):
var newEventSource = {events: snap.val()};
calendar.render(newEventSource);
// calendar.js
exports.render = function(newSource) {
$calendar.fullCalendar('removeEventSources');
$calendar.fullCalendar('addEventSource', newSource);
};
Post a Comment for "Update FullCalendar With Firebase On New Event"