繁体   English   中英

单元格上的BootStrap完整日历CSS

[英]BootStrap Full Calendar CSS on cell

我正在尝试使用引导日历,如果它的时间戳大于今天,我想将单元格颜色设置为绿色

这是

$checkTime > $today
cell.css = green background

我在stackoverflow上看到了这段代码

dayRender: function (date, cell) {
    var today = new Date();
    if (date.getDate() === today.getDate()) {
        cell.css("background-color", "red");
    }
}

我尝试将其添加到之后

                        defaultView: 'month',

所以变成

defaultView: 'month',
dayRender: function (date, cell) {
    var today = new Date();
    if (date.getDate() === today.getDate()) {
        cell.css("background-color", "red");
    }
},

如果我添加dayRender,它将无法正常工作。 日历不会显示

这是我的完整日历代码

$('#calendar').fullCalendar({
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,agendaWeek,agendaDay'
            },
            defaultDate: '<?php echo $today;?>',
                        defaultView: 'month',
            editable: false,
            events: [
                <?php echo $calendar_html;?>
            ],
 eventClick: function(event) {
        if (event.url) {
            window.open(event.url);
            return false;
        }
    }

});

    });

将此添加到我的页面样式中

.fc-before-today {
    background: #ccc;
}

并添加

className:'今天以前的fc'

到我的活动及其运作良好:)经过1个小时的谷歌搜索,找到了答案

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM