I’m using the calendar component in a Framework7 V5.7.12-project.
It’s initialized via app.calendar.create and has an event listener for the monthYearChangeStart event.
If the event is triggered a function is called that retrieves new calendar events via AJAX and writes them into params.events and after that the update-method of the calendar object is called.
That works fine and the new events are shown and I can navigate through the months with the arrows in the toolbar. But swiping doesn’t work after the update-method of the calendar has been called. If I comment out the call of the update method I still can swipe but of course the new events are not shown. It worked in a Framework7 v4-project.
function community_calendar_termine_monat(jahr,monat) {
app.request.promise({
url: ...
...
}).then(function(res) {
var termine=res.data.termine;
var events=[];
for (var i=0;i<termine.length;i++) {
var d=termine[i].datum;
var event={
date: d,
color: '#082846'
}
events.push(event);
}
community_calendar.params.events=events;
community_calendar.update();
});
}
The update of the events is working and I still can navigate through the calendar with the arrows in the toolbar but not when I swipe. If I comment out community_calendar.update() swiping still works.