使用单元格背景颜色标记 fullcalender 中的重叠事件
我使用 fullcalendar 将不同旅行的不同日期显示为一个事件。 在某些时候,人们可以选择参加不同的旅行,因为活动地点有时会重叠。这意味着,例如,同一天发生两个事件
是否可以更改单元格的背景颜色以将其指出?
例如,13-14 日。十月的事件是重叠的。因此,不同的背景颜色(例如黄色)会使其变得清晰。
I'm using fullcalendar to show different dates of different tours as an event.
At some point people have the choice of joining a different tour, because the location of the event is overlapping for some days. That means, for example, two events at the same day
Is it possible to change the background color of the cell to point it out ?
For example, on 13-14. October the events are overlapping. Therefor a different background color like yellow would make it clear.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在 fullcalendar.css 中添加一行
然后您必须以编程方式将此类添加到您的 JSON 回复中,这样它看起来或多或少就像
我们评论中讨论的那样,您将必须生成一个单独的提要,甚至可能注入将这些事件在您计算的相交日期上添加到您现有的提要中。
display:none 是为了不显示实际事件 - 我们只使用它,因此它将颜色应用于它覆盖的单元格
添加这些事件应该非常简单。
但艰苦的工作必须在服务器端完成,计算在哪里插入这些隐藏事件
FullCalendar 中没有内置函数来执行此操作。
You need to add a line to the fullcalendar.css
Then you will have to programatically add this class to your JSON reply so it looks like this more or less
Like discussed in our comments, you will have to generate a separate feed or maybe even inject into your existing feeds these events on your calculated intersected dates.
The display:none is the so that the actual event does not show- we only use that so it applies the colour to the cells it overlays
Adding these events should be pretty straight forward.
But the hard work will have to be done server side calculating where to insert these hidden events
There is no built in function in FullCalendar to do this.