2013-05-27 107 views

回答

1

嗨,你可以渲染自定義突出顯示與viewDisplay回調裏面一個小黑客:

viewDisplay : function(view) { 

      startDate = view.start; 

       var d = startDate.getDate(); 
       var m = startDate.getMonth(); 
       var y = startDate.getFullYear(); 

      cols = $('.fc-view-agendaWeek [class*="fc-col"].fc-widget-content')  

      for(i = 0 ; i< cols.length ; i++){ 

       var colDate = new Date(y, m, d+i); 


       if($.inArray(colDate.getTime() , hightligthedDays) > -1){ 

        $(cols[i]).addClass("fc-state-highlight-other"); 

        } 
       else{ 

        $(cols[i]).removeClass("fc-state-highlight-other"); 

       } 
      } 

      } 

jsfiddle

+0

謝謝。這工作。 :) –

2

對於agendaWeek和agendaDay查看它可以通過改變fullcalendar.js文件成爲可能。

傳遞一個額外的參數設置爲fullcalendar說highlightDays

highlightDays: [0,3,4] // List of days to highlight 0 - Sunday ... 6 - Saturday 

在fullcalendar.js updateCells()方法

if(opt('highlightDays').indexOf(date.getDay()) > -1) 
{ 
    bodyCell.removeClass('ui-widget-content'); 
    bodyCell.addClass('fc-day-highlight'); 
} 

添加顏色,你想給在FC-天高亮CSS那些日子類如

background-color: #dddddd; 
相關問題