fullcalendar在月视图中水平渲染事件。 (同一表格单元格)

如何在同一个表格单元格中呈现当天的事件?

我正在尝试:

渲染1

但结果却是:

渲染2

我尝试使用eventAfterRender,更改类…但总是相同的结果。

所以你现在正在使用一个新的插件。 希望答案可以帮助某人根据您的问题获得相同的结果。

所以我试着玩插件并做一些调整。 我使用完整的日历3.0.1非缩小版本。 我打开fullcalendar.js完整的日历不会在日期容器’td’中呈现’events’。 所以我重写了一些代码。

我把线5445换成了打击。 将属性“data-date”更改为“id”

' id="' + date.format('YYYY-MM-DD') + '"' + 

第6039行是将事件呈现给日历的方法。 我把它改成了以下。

 fgSegHtml: function(seg, disableResizing) { // Find the td with 'id date' that i changes above and append the span to the date as per the received events. I have also added the className that got from the json events file, so that we can write styles for the classname to make it interactive. $('#' + seg.event.start._i.split('T')[0]).append(' '); return false; // Stop default event rendering 

还添加了一些样式来正确显示它,即对齐中心,边距等。

  

然后你可以实现类似下面的东西。 如果您有任何疑问,请与我们联系。 (现在我已经在’event-dot’类中添加了dot的颜色。你可以使用事件json中附加的不同’className’来编写不同的点颜色)

在此处输入图像描述

要在所选日期进行舍入选择,可以使用fullcalendar中的“dayClick”方法。 只需谷歌它,你可以找到很多方法来实现这一点,通过使用jQuery添加样式到选定的日期。