FullCalendar.js: Rendering background with time labels?

本小妞迷上赌 提交于 2019-12-04 07:39:21
slicedtoad

Adding time labels to background events doesn't come "out of the box" but it's easy enough to do with the eventRender callback.

eventRender: function(event, element, view ){
    if(event.rendering === "background"){
        // Just add some text or html to the event element.
        element.append( event.start.format('HH:mm') + " - " + 
                       event.end.format('HH:mm'));
    }
},

You can of course add a span or two if you want better formatting.

Here's a JSFiddle with it working (Using the same base code as your other question)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!