4
votes

In version 1.6 of Arshaw's fullcalender plugin he added the dayRender callback.

This callback only works for basicweek and basicday view.
But I need this callback for agendaDay and agendaWeek.

I like to change the background color of a special cell.
For example, for next monday 8.00 am to 11.00 am in red.

Any callbacks I can use?

3

3 Answers

0
votes

There are not any callbacks you can use. You can read this and get the idea, but it is based in a previous version of fullcalendar

0
votes

I made a simple solution.
On 1.6 version of fullCalendar.js on line 3266 i add this line of code:

trigger('dayRender', t, date, $(bodyCell)); 

and that make dayRender to trigger as event with same parameters (I use the event for coloring bg of days cells)

That line goes inside the for colCnt inside updateCells(), just above of the code setDayID(headCell.add(bodyCell), date);

0
votes

In version 1.6, there is no direct callback method to do it. If you are using fullcalendar.min.js, you can do it by creating a function like :-

function yourfunction(currentDate)
{
    // your code
}

and place it above the

<script src="/fullcalendar/fullcalendar/fullcalendar.min.js" type="text/javascript"></script>

Then find the code "l(){var t,e,n,r,a=f(new Date);" in fullcalendar.min.js and call your function before closing tag of function "l". Your code will look like this :-

l(){var t,e,n,r,a=f(new Date);if(Qe){var o=un(N(0),Ke);Je?o+=Ge:o=Ge+o,ee.find(".fc-week-number").text(o)}for(t=0;Le>t;t++)r=N(t),e=ne.eq(t),e.html(un(r,$e)),n=ae.eq(t),+r==+a?n.addClass(Ye+"-state-highlight fc-today"):n.removeClass(Ye+"-state-highlight fc-today"),yourfunction(r)==false?n.addClass("fc-disabled"):n.removeClass('fc-disabled'),$(e.add(n),r)}

I am adding class to disable the day. Good luck..!!