DayRender for the agenda

In version 1.6 of the Arshaw Fullcalender plugin, he added a dayRender callback.

This callback only works for viewing basicweek and basicday.
But I need this callback for the agenda and the agenda.

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

Any callbacks I can use?

+4
source share
3 answers

There are no callbacks you can use. You can read this one and get this idea, but it is based on a previous version of fullcalendar

0
source

I made a simple decision.

In version 1.6 of fullCalendar.js, on line 3266, I will add this line of code:

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

and which cause dayRender to fire as an event with the same parameters (I use the event to color the bg cells of the days)

This line is inside colCnt inside updateCells() , just above the setDayID(headCell.add(bodyCell), date) code setDayID(headCell.add(bodyCell), date) ;

0
source

In version 1.6 there is no direct callback method for this. If you use fullcalendar.min.js, you can do this by creating a function such as: -

 function yourfunction(currentDate) { // your code } 

and put it over

 <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 the function before closing the tag for the 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 a class to disable the day. Good luck .. !!

0
source

All Articles