adding data into each day's cell, in fullCalendar

霸气de小男生 提交于 2020-01-14 12:38:13

问题


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!


回答1:


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

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


来源:https://stackoverflow.com/questions/20197000/adding-data-into-each-days-cell-in-fullcalendar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!