Multiple pointers to fullCalendar

Since the documentation for nowIndicator is very small ... is there a way to show a similar element, like nowIndicator, on the same page?

For example ... I want to show green starting at 01:00, and I want to show blue starting at 12:00

+7
javascript jquery fullcalendar fullcalendar-scheduler fullcalendar-2
source share
1 answer

I'm not sure if this is the best solution, it is more like hacking. The idea is to change the background color to today's row. Thus, you select all rows, because the time interval is 30 minutes, you will get 96 elements. (48 per day) the first 24 you do not need, because it was the day before. You will need elements 25-73 because now these are strings.

I wrote this function that will be called on every dayRender .

 function colorToday() { var color = '#EEEEEE'; var fullArray = $('.fc-slats tr .fc-widget-content:nth-child(2)'); var todayArray = fullArray.slice(24, 72); for(var i = 0; i < todayArray.length; i++) { var data = $(todayArray[i]); $(data).css('background', color); } } 

And add this to the options:

 dayRender: function (element) { colorToday(); } 

This is JSFIDDLE As I said, I'm not sure if this is the best solution, but it works. Hope will help you.

+4
source share

All Articles