i'm using jQuery fullcalendar on a ReactJs component.
i have a <div id="calendar"></div>
on the render method
and on componentDidUpdate , i updated the calendar with the following codes:
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
events: _this.state.events,
defaultView:'month',
displayEventTime: false,
editable: false,
droppable: false,
durationEditable: false
});
and it shows "undefined" character on title. where did i go wrong? and how to debug where the undefined string came from?
currently, i made a hacked solution to remove all undefined string from the title by adding the following:
viewRender: function(view, element) {
//note: this is a hack, i don't know why the view title keep showing "undefined" text in it.
//probably bugs in jquery fullcalendar
$('.fc-center')[0].children[0].innerText = view.title.replace(new RegExp("undefined", 'g'), ""); ;
},
is there any better solution?
i'm using jquery FullCalendar v2.9.1
with the following sample data on the events:
[{"start":"2017-03-24T00:00:00.000Z","end":"2017-03-26T00:00:00.000Z","title":"Open house","description":"Bali 1 open house"}]
note: I ended up dumping the jquery full calendar in favor of react-big-calendar.