Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding data into each day's cell, in fullCalendar

Tags:

fullcalendar

I have additional data (in my case its a number) which is obtained via a javascript function - which i would like to display within each day's cell.

so for example - if the day number is in the top right corner, i would like this displayed in the top left - automatically for each day.

I see there is the dayRender method, which seems exactly what i need. but i am not sure of the syntax to add the text, and define the location.

something like this fails (obviously..):

... //// within  $('#calendar').fullCalendar({

        dayRender: function (date, cell) {
            var cellYear = date.getFullYear();
            var cellMonth = date.getMonth() + 1;
            var cellDay = date.getDate();

            cell.html(ReturnCellNumber(cellDay,cellMonth,cellYear));

        },

thanks!

like image 879
kneidels Avatar asked Mar 22 '23 12:03

kneidels


1 Answers

for future generations.... this is what can be done:

cell.prepend('<span class="selector">' + ReturnCellNumber(cellDay,cellMonth,cellYear) + '</span>');
like image 160
kneidels Avatar answered Apr 25 '23 00:04

kneidels