Json file format

I’m just trialing the Event Calendar. Trying to load a simple json file but no events are showing. No console errors. Calendar loads fine.

Code:

mobiscroll.util.http.getJson('https://sandbox.triptakers.travel/dmxConnect/api/Tripbits/tb_calendar.php', function (events) {
        inst.setEvents(events);
    }, 'json');

JSON

{
"custom": [
{
"start": "2021-01-23T17:00:00Z",
"end": "2021-01-31T15:00:00Z",
"title": "Millie's House",
"color": "#517ed6"
},
{
"start": "2021-01-23T16:30:00Z",
"end": "2021-01-31T16:30:00Z",
"title": "Budget Car Rental",
"color": "#c749bd"
},
{
"start": "2021-01-24T11:00:00Z",
"end": "2021-01-31T11:00:00Z",
"title": "Alys Beach Bike Shop",
"color": "#FF4500"
}
]
}

Any help would be most appreciated.

Hi,

You have a specific structure in the sample JSON you sent, the events are listed under the custom property.

So the correct code would look like this:

mobiscroll.util.http.getJson('https://sandbox.triptakers.travel/dmxConnect/api/Tripbits/tb_calendar.php', function (data) {
        inst.setEvents(data.custom);
    }, 'json');

Thanks Isti!!! You’re officially my favorite person today. :grinning: Have a good one.