I am trying to display multiple event from few objects into fullcalendar.
This is my event sources
this.state = {
calendarEvents2: {
"events": [{
"id": 10,
"subtasks": [{
"id": 29,
"days": 1,
"start": "2021-01-12T00:00:00+00:00",
"end": "2021-01-12T00:00:00+00:00",
}],
},
{
"id": 20,
"subtasks": [],
},
{
"id": 6,
"subtasks": [{
"id": 21,
"days": 2,
"start": "2021-01-04T00:00:00+00:00",
"end": "2021-01-05T00:00:00+00:00",
},
{
"id": 23,
"days": 3,
"start": "2021-01-04T00:00:00+00:00",
"end": "2021-01-06T00:00:00+00:00",
}]
}
}
}
I need to dislay all the subtask into the calendar.
<FullCalendar
defaultView="dayGridMonth"
header={{
left: "prev,next today",
center: "title",
right: "dayGridMonth,timeGridWeek,timeGridDay,listWeek"
}}
editable={true}
droppable={true}
plugins={[dayGridPlugin, interactionPlugin]}
events={this.state.calendarEvents2}
/>
I have no idea how to format the calendarEvents2 data to fit FullCalendar data configuration. I have tried to read the documentation on eventDataSources, eventSources, yet quite blurr.. Really appreciate any help..Thank you