【发布时间】:2022-01-12 10:33:19
【问题描述】:
更新
项目以点而不是背景颜色显示,因为它们是根据一天中的时间构建的。删除时间,使start 只是日期(即2021-12-07),然后他们按预期正确获得背景颜色,所以现在的问题变成了如何获得背景颜色,即使他们有一天中的时间.. .
参考
- change the background color of the events in FullCalendar,和
- https://fullcalendar.io/docs/eventBackgroundColor
我已将 backgroundColor 值添加到我的事件中,但这似乎只会改变事件上的点:
您会注意到使用extendedProps 设置背景颜色也不起作用。
这是我的事件数组;如何让 fullcalendar 更改活动的背景颜色?
events: [
{
title: 'event1',
start: '2021-12-07T08:00:00',
backgroundColor: '#ff00ff'
},
{
title: 'event3',
start: '2021-12-07T09:00:00',
backgroundColor: '#4d96f1'
},
{
title: 'event2',
start: '2021-12-08T08:00:00',
backgroundColor: '#00ff00',
extendedProps: {
backgroundColor: '#00ff00'
},
}
],
【问题讨论】:
标签: javascript fullcalendar fullcalendar-5