Calendar Page loading from Ajax


#1

Hi there!

I’m still dealing with FW7 basics…

Does anyone can help me on how to configure this page (from FW7 kitchen sink), to load data from an Ajax JSON?

I did some tests and could load the events, but I have no idea on how do use “new date” in JSON (or how to convert them).

I searched on older posts but couldn’t find…

Thanks in advance!


#2

try like this:

// use your JSON data to populate the array 
let arratWithEvents - [..JSONData]

// array items should be like:
{
  date: yourDateHere,
  color: 'yourColorHere'
}

// Add the events to the cal
calendarEvents.params.events = arratWithEvents 

// after updating/adding your events update the cal
calendarEvents.update()