Fullcalendar 在月视图完整日历中仅显示全天事件

Fullcalendar 在月视图完整日历中仅显示全天事件,fullcalendar,Fullcalendar,如何在完整日历月视图中仅显示allDay=true事件,在其他视图中显示剩余的非全天事件作为usal您可以通过在类似eventRender的回调中检查view.name来完成此操作。看看这把小提琴: 希望这有帮助 $('#外部事件div.external-event')。每个(函数(){ $('#external-events div.external-event').each(function() { // store data so the calendar knows t

如何在完整日历月视图中仅显示allDay=true事件,在其他视图中显示剩余的非全天事件作为usal

您可以通过在类似eventRender的回调中检查view.name来完成此操作。看看这把小提琴:

希望这有帮助

$('#外部事件div.external-event')。每个(函数(){
 $('#external-events div.external-event').each(function() {
        // store data so the calendar knows to render an event upon drop
        $(this).data('event', {
            title: $.trim($(this).text()), // use the element's text as the event title
            stick: true // maintain when user navigates (see docs on the renderEvent method)
        });
        // make the event draggable using jQuery UI
        $(this).draggable({
            zIndex: 1111999,
            revert: true,      // will cause the event to go back to its
            revertDuration: 0  //  original position after the drag
        });
    });
    /* initialize the calendar
     -----------------------------------------------------------------*/
    var date = new Date();
    var d = date.getDate();
    var m = date.getMonth();
    var y = date.getFullYear();
    $('#calendar').fullCalendar({
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek'
        },
        editable: true,
        droppable: true, // this allows things to be dropped onto the calendar
        drop: function() {
            // is the "remove after drop" checkbox checked?
            if ($('#drop-remove').is(':checked')) {
                // if so, remove the element from the "Draggable Events" list
                $(this).remove();
            }
        },
        eventDrop: function(event, delta, revertFunc) {
            alert( event.id );
            $.ajax({
                type: "POST",
                url: "${pageContext.request.contextPath}/task/periodic-task-update",
                data : {
                    id : event.id , 
                    date :event.start.format()
                },
                success: function(data) {
                     if(data=='Task Period Succesfully Changed'){
                        toastr.success("Task Period Succesfully Changed.");
                    }else{
                        toastr.success("Something Wrong");
                        revertFunc();
                    } 
                },
                error: function(data,textStatus,xhr) {
                    toastr.success("Something Wrong");
                    revertFunc();
                }       
            });
        },
        events: [
                <c:forEach var='periodicTask' items='${periodicTaskTemplates}'>
                    <c:forEach  varStatus="i" begin = "1" end = "12">
                        { id: '${periodicTask.id}', title: '${periodicTask.task}', start: new Date(y,  '${i.index}', '${periodicTask.startDate}'), end: new Date(y, '${i.index}', '${periodicTask.lastDate}') ,type:'${periodicTask.description}',location:'${periodicTask.location.name}'},
                    </c:forEach>
                </c:forEach>`
        ],
    });
//存储数据,以便日历知道在删除时呈现事件 $(此).data('事件'{ title:$.trim($(this).text()),//使用元素的文本作为事件标题 stick:true//在用户导航时进行维护(请参阅renderEvent方法中的文档) }); //使用jQuery UI使事件可拖动 $(此)。可拖动({ zIndex:1111999, revert:true,//将导致事件返回其初始状态 revertDuration:0//拖动后的原始位置 }); }); /*初始化日历 -----------------------------------------------------------------*/ 变量日期=新日期(); var d=date.getDate(); var m=date.getMonth(); var y=date.getFullYear(); $(“#日历”).fullCalendar({ 标题:{ 左:“上一个,下一个今天”, 中心:'标题', 右图:“月,agendaWeek” }, 是的, droppable:true,//这允许将内容拖放到日历上 drop:function(){ //是否选中了“删除后删除”复选框? 如果($('#drop remove')。是(':checked')){ //如果是,请从“可拖动事件”列表中删除该元素 $(this.remove(); } }, eventDrop:函数(事件、增量、恢复函数){ 警报(event.id); $.ajax({ 类型:“POST”, url:“${pageContext.request.contextPath}/task/定期任务更新”, 数据:{ id:event.id, 日期:event.start.format() }, 成功:功能(数据){ 如果(数据==“任务周期成功更改”){ 成功(“任务周期成功更改”); }否则{ 追求成功(“某些错误”); revertFunc(); } }, 错误:函数(数据、文本状态、xhr){ 追求成功(“某些错误”); revertFunc(); } }); }, 活动:[ {id:'${periodicTask.id}',标题:'${periodicTask.task}',开始:新日期(y,'${i.index}','${periodicTask.startDate}',结束:新日期(y,'${i.index}','${periodicTask.lastDate}',键入:'${periodicTask.description}',位置:'${periodicTask.location.name}, ` ], });
此函数实现jstl标记库小提琴坏了