views:

391

answers:

2

Using FullCalendar, is there any way I can programmatically colorize specific days differently than the rest of the days? For example, in the "month" or "week" views, I'd like to colorize days with no events on them "red", and days with some events (but not yet a full schedule) "yellow". Days with a full schedule would be colorized normally (white background). Are there any callbacks or CSS tags I can take advantage of to add this behavior? Thank you.

+1  A: 

FullCalendar seems to be a very robust jquery calendar and editing the source code for this could cause you some pain down the road when it is updated by the author. My suggestion would be to email the author and ask for the feature to be added, or some information on how to edit the fields how you need.

Second idea would be to look at what css selectors are produced when each of your situations are met and change background colors to suit the situation. That would leave the FullCal source free for updating and give you what you need.

Hope that helps.

gravityone
A: 

I agree with gravityone's original response. You can track the feature request.

I don't believe there's a error proof way of implementing this type of feature without core code modification. I think the closest you can come now is something like the following. However, you'll need to build these calls to addClass() using your event source(s). This only works on the full calendar view and "breaks" when you have a day of the month that appears twice in the view (from the previous or next month).

$("div.fc-day-number:contains('15')").parent().addClass("vacation");

<style>
            .fc-grid .vacation {
                background-color:#F00;
            }
</style>
Josh Metcalfe