how can I create an array in the format below:
var options =
[
{
title: 'Laziness',
start: new Date(y, m, d, 12, 0),
allDay: false
},
{
title: 'Dizziness,Sleepiness',
start: new Date(y, m, d+1, 19, 0),
allDay: false
},
{
title: 'Click for Google',
start: new Date(y, m, 28),
url: 'http://google.com/'
}
];
I've tried like that:
for(var i in data)
{
options = {
title:data[i].eventNames,
start:data[i].eventDates
};
}
but it doesn't display in correct format, how can I implement this
You can create options before loop, and then in loop push objects: