How to mark "current time" in calendar view and custom titles
I've been amazed at the flexibility of FullCalendar so far, but the following two elements have me stuck;
Is there any way to make the current time display in bold in the day view where it lists hours, without too much hackery?
Is there any way to change the title of the calendar element, so far it only takes on placeholder "variables" that are replaced with month names or similar, but I'd love the ability to specify my own header for them (This is easily done by adding it above the element, but if it's possible to add it within then why not, r开发者_开发技巧ight?)
For #1 Agenda DAY view I see this code
<tr class="fc-slot22 ">
<th class="fc-agenda-axis fc-widget-header">11am</th>
<td class="fc-widget-content"><div style="position:relative"> </div></td>
</tr>
<tr class="fc-slot23 fc-minor">
<th class="fc-agenda-axis fc-widget-header"> </th>
<td class="fc-widget-content"><div style="position:relative"> </div></td>
</tr>
<tr class="fc-slot24 ">
<th class="fc-agenda-axis fc-widget-header">12pm</th>
<td class="fc-widget-content"><div style="position:relative"> </div></td>
</tr>
so we need to look at THs:
var nowHours = new Date().getHours();
var hourAMPM = (nowHours>12)?(nowHours-12)+"pm":nowHours+"am";
if (nowHours===12) hourAMPM ="12pm";
$("th").removeClass("nowtime");
$("th").contains(hourAMPM).addClass("nowtime");
For #1 to bold calendar current DAY change
.fc-state-highlight {
background: none repeat scroll 0 0 #FFFFCC;
}
to
.fc-state-highlight {
background: none repeat scroll 0 0 #FFFFCC;
font-weight: bold;
}
For #2 you could change
<span class="fc-header-title">
<h2>April·2011</h2>
</span>
to whatever you want after creating the calendar
精彩评论