Adding a class to past events using Fullcalendar with Google Calendar

我是研究僧i 提交于 2019-12-04 11:18:52

it would be best to add the class to the "className" attribute of the event object http://arshaw.com/fullcalendar/docs/event_data/Event_Object/

As per FullCalendar v1.6.4

Style past events in css:

.fc-past{background-color:red;}

Style future events in css:

.fc-future{background-color:red;}
medinauta

I did it (hard coding):

  1. Before rendering:

    var hoy = new Date;// get today's date
    hoy = parseInt((hoy.getTime()) / 1000); //get today date in unix
    
  2. When creating the html, inside the "for":

    unixevent = parseInt((event.end.getTime()) / 1000) //event date in Unix
    if (unixevent < hoy) {className += 'fc-passed ';} //add class if event is old
    
  3. Add a new "fc-passed" class in the css file.

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