Fullcalendar event's end time is missing

后端 未结 5 1189

I run Fullcalendar wih this options

defaultEventMinutes:30,
timeFormat: \'HH:mm { - HH:mm}\',

I have some events (30 min long each), but on

5条回答
  •  星月不相逢
    2020-12-03 19:05

    The answer of Regin did not work for me (I assume a newer version of FullCalendar).

    I've found two solutions.

    First, the easiest one that maintains most of the styling for short events. This styles it back to the defaults:

    .fc-time-grid-event.fc-short .fc-time span {
        display: inline;
    }
    
    .fc-time-grid-event.fc-short .fc-time:before {
        content: normal;
    }  
    
    .fc-time-grid-event.fc-short .fc-time:after {
        content: normal;
    }
    

    Secondly you could add the following logic to the eventAfterRender. Please note this might have other effects where certain styling of small items will be different, but if this is not a big issue in your environment then this works perfectly.

    eventAfterRender: function (event, $el, view) {
                    $el.removeClass('fc-short');
                }
    

提交回复
热议问题