Fullcalendar vue component and events as a function

Viewed 182

i'm playing around with fullcalendar's vue component
In detail, i'm trying to load events by using events (as a function)

my code looks like this:

 events: function (info, successCallback, failureCallback) {
                    let start = moment(info.start.valueOf()).format('YYYY-MM-DD');
                    let end = moment(info.end.valueOf()).format('YYYY-MM-DD');
                    axios.get(route('api.apps.fuhrpark2.buchungen'),{
                        params: {
                            start: start,
                            end: end
                        }
                    })
                    .then(response => {                    
                        console.log('event feed success');
                        console.log(response.data);                            
                        successCallback(response.data);
                    }).catch(err =>{
                        console.log('event feed error');
                        console.log(err.response);
                        failureCallback(err);
                    }); 
                }

In console i see the fetched data:

event feed success
app.js:75467 
[Array(3)]
0: Array(3)
0: {title: "Sebastian (FFHK 2051)", start: "2020-04-02T22:00:00", end: "2020-04-11T07:01:00"}
1: {title: "Sebastian (FFHK 2051)", start: "2020-03-31T08:00:00", end: "2020-03-31T09:00:00"}
2: {title: "Sebastian (FFHK 2052)", start: "2020-03-31T08:00:00", end: "2020-03-31T09:00:00"}
length: 3
__proto__: Array(0)
length: 1
__proto__: Array(0)

It looks like the data is properly fetched, but no events are rendered. I guess the successCallback(response.data) should initiate the rending, right? But it does not...any hints would be highly appreciated.
Thanks!

0 Answers
Related