开发者

mark overlapping events in fullcalender with cell background color

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开发者_StackOverflow社区 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.


You need to add a line to the fullcalendar.css

.fc-state-intersect
{
    background: green;
    display:none;
}

Then you will have to programatically add this class to your JSON reply so it looks like this more or less

... {"title":"Intersect",
     "start":"2011-05-04T00:00:00",
     "end":"2011-05-04T00:00:00",
     "allDay":true,
      "className":".fc-state-intersect" <-- 
...

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜