Fullcalendar: getClasses fails with an error if event.className is a string after calling updateEvent

Created on 12 Jan 2018  路  3Comments  路  Source: fullcalendar/fullcalendar

According to the Event Object docs className is allowed to be a string, but this results in an error in getClasses when calling updateEvent on an event with a string as className. (See the console for the error)

Fullcalendar test case
Scheduler test case

TypeError: CreateListFromArrayLike called on non-object at TimelineEventRenderer.EventRenderer.getClasses (fullcalendar.js:4451) at TimelineEventRenderer.EventRenderer.getSegClasses (fullcalendar.js:4377) at TimelineEventRenderer.fgSegHtml (scheduler.js:1463) at TimelineEventRenderer.EventRenderer.renderFgSegEls (fullcalendar.js:4346) at TimelineEventRenderer.EventRenderer.renderFgRanges (fullcalendar.js:4274) at TimelineEventRenderer.EventRenderer.render (fullcalendar.js:4263) at ResourceRow.DateComponent.executeEventRender (fullcalendar.js:8831) at ResourceRow.executeEventRender (scheduler.js:4883) at ResourceTimelineView.executeEventRender (scheduler.js:3375) at Object.func (fullcalendar.js:3721)

Event Model Reproducing

Most helpful comment

Seems to have been introduced in v3.6.0. If anyone bumps into this in the meantime, workaround is to set your string classname as an array:
event.className = 'class';
->
event.className = ['class'];

All 3 comments

Thanks for the detailed report.

Seems to have been introduced in v3.6.0. If anyone bumps into this in the meantime, workaround is to set your string classname as an array:
event.className = 'class';
->
event.className = ['class'];

Does anyone know if this is the case in v4? with event.setProp('className', notArray) ?

Was this page helpful?
0 / 5 - 0 ratings