2013-05-27 2 views
0

달력 렌더링에 arshaw fullcalendar api를 사용하고 있습니다. 오늘은 강조 표시되어 있습니다. 똑같은 날짜 목록이 있는데, 나는 주간보기에서 강조하고 싶다. 또한 날짜는 다른 주에있을 수 있습니다. 도움을 주시면 감사하겠습니다. 고맙습니다.arshaw fullcalendar에서 날짜 강조 표시

답변

1

안녕하세요 당신은 viewDisplay 콜백 내부에 약간의 해킹으로 사용자 정의 하이라이트를 렌더링 할 수 있습니다

agendaWeek 및 agendaDay를 들어
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

그것이 fullcalendar.js 파일을 변경 할 수 있습니다 볼 수 있습니다.

는 FC-일 - 하이라이트 CSS에서 그 일에 부여 할 색상을 추가

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

highlightDays fullcalendar.js의 updateCells에서

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

() 메소드라고 fullcalendar 위해 추가 있었던 파라미터 전달 수업으로

background-color: #dddddd; 
관련 문제