使用Google日历使用Fullcalendar为以往的活动添加课程 [英] Adding a class to past events using Fullcalendar with Google Calendar

查看:97
本文介绍了使用Google日历使用Fullcalendar为以往的活动添加课程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想改变过去事件的颜色,我想我需要向他们添加一个类,但那是问题,我是怎么做到的?

I would like to change the color of the past events, I guess I need to add a class to them but that is the problem, how I do that?

推荐答案

我做到了(硬编码):

I did it (hard coding):


  1. 在渲染之前:

  1. Before rendering:

var hoy = new Date;// get today's date
hoy = parseInt((hoy.getTime()) / 1000); //get today date in unix


  • 创建html时,在for

  • 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
    


  • 在css文件中添加一个新的fc-passed类。


  • 这篇关于使用Google日历使用Fullcalendar为以往的活动添加课程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆