I'm using the FullCalendar module for Drupal 7. What I would like to do is not to show the events in the calendar but instead mark the days which has events on them by bold-marking that 开发者_开发技巧day (the number), or changing the background color for that day (square) or something. The question is, in which files should I change to achieve this? Been looking through most of the files but I can't figure it out.
Any ideas?
It sounds like you could do this by customising the Jquery calendar being created by the full calendar module. To do this using fullcalendar will mean writing some javascript instead of the usual php for drupal.
Looking at the documentation for full calendar plugin, it seems that it would be possible to could define a new View (this is a "view" in fullcalendar in javascript, not a drupal view), based on existing month view.
http://arshaw.com/fullcalendar/
See page on basic usage, you'll need to edit the javascript in the drupal module in a similar way to the following:
http://arshaw.com/fullcalendar/docs/usage/
In here, you could create a callback function eventRender() which is called before each event is displayed on the calendar. In this function, check for the value of view.name to see if your new view is currently selected.
Use the event object passed to work out the date of the event (compare event date with date view.visStart to work out the day number N) and make the changes to the appearance of the calendar using jquery selectors on .fc-day(N). You could use css class to restyle the number, or background of the day. By returning false for all events, the normal box with text for the event will not be shown.
To allow people to view the events, set up a callback function to respond to dayClick(). Use this to detect clicks on a day and to zoom in by switching to the day view for that particular date.
You might also need to set up a callback on viewDisplay which clears off your extra css classes, or divs from the calendar, when the date range or view changes.
An alternative to just changing css to indicate events, would be to render each event small divs within the day using icons, and use the qtip hover effect mentioned on the eventRender documentation here. http://arshaw.com/fullcalendar/docs/event_rendering/eventRender/
精彩评论