kneidels
kneidels

Reputation: 914

adding data into each day's cell, in 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!

Upvotes: 4

Views: 5411

Answers (1)

kneidels
kneidels

Reputation: 914

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

cell.prepend('<span class="selector">' + ReturnCellNumber(cellDay,cellMonth,cellYear) + '</span>');

Upvotes: 7

Related Questions