FulLCalendar 5: different colors for per event source don't show up in month view

73 views Asked by At

I have two event sources, configured like so:

this.eventSources = {
        1: {
            id: 1,
            color: '#228B22',
            textColor: '#000000',
            backgroundColor: '#90EE90',
            url: this.config.loadUrl,
            startParam: 'from',
            endParam: 'to',
            extraParams: {
                client_id: 0,
                agenda_item_type_id: 1
            }
        },
        2: {
            id: 2,
            color: '#0e64a0',
            textColor: '#000000',
            backgroundColor: '#87CEFA',
            url: this.config.loadUrl,
            startParam: 'from',
            endParam: 'to',
            extraParams: {
                client_id: 0,
                agenda_item_type_id: 2
            }
        }
    };

I set them before calender.render() like so:

Object.values(this.agendaItemTypes).forEach(itemType => {
    if (itemType.initiallyVisible) {
        this.calendar.addEventSource(this.eventSources[itemType.id]);
    }
});

this.calendar.render();

This works fine. After the initial render, only initiallyVisible events are displayed. Using checkboxes I can toggle visibility per event type, which almost works as expected. Only the colors don't show up as intended. Using the standard theme, the bullets in dayGridMonth view, are displayed in the configured color. Other than that, events are displayed in the default colors, seemingly ignoring the textColor and backgroundColor of the event source.

Did I miss something in the documentation or is there something obvious I'm doing wrong?

0

There are 0 answers