事件不会在议程中呈现周视图,也不会在完整日历中呈现议程日视图



事件在month、basicWeek和basicDay视图中正确呈现;但是,allDay设置为false(具有特定时间(的事件不会出现在agendaweek或agendaDay视图中。我已经检查了JSON,并确认allDay被正确设置为布尔值。alldayDefault设置为false。我甚至为agendaWeek和agendaDay视图定义了特定的时间间隔。我已经在谷歌上搜索了这个问题,目前的解决方案往往源于对allDayDefault或allDaySlot参数的处理。对我来说似乎没有什么问题。如果有任何见解,我将不胜感激。">

    <script> 
    $(document).ready(function() {
        var date = new Date();
        var d = date.getDate();
        var m = date.getMonth();
        var y = date.getFullYear();

        var calendar = $("#calendar").fullCalendar({
            defaultView: "month",
            weekends: true,
            minTime: 6,
            maxTime: 23,
            height: 620,
            allDayDefault: false,
            header: {
                    left: "prev,next today",
                    center: "title",
                    right: "month,agendaWeek,agendaDay"
            },
            editable: true,
            events: "../getCalendarEvents.php",
            eventLimit: true,
            views: {
                agendaWeek: {
                    minTime: 6,
                    maxTime: 23
                },
                agendaDay: {
                    minTime: 6,
                    maxTime: 23
                }
            },

            // Convert the allDay from string to boolean
            eventRender: function(event, element, view) {
                if (event.allDay === 'true') 
                {
                    event.allDay = true;
                } else 
                {
                    event.allDay = false;
                }
            },
            selectable: true,
            selectHelper: true,
            select: function(start, end, allDay) 
            {
                var start = moment(start).format("MM/DD/YYYY");
                var end   = moment(end).format("MM/DD/YYYY");
                window.location = 'calendar_addEvent_template.php?start=' + start + '&end=' + end;
                calendar.fullCalendar('unselect');
            },
            eventDrop: function(event, delta) 
            {
               var start = $.fullCalendar.formatDate(event.start, "yyyy-MM-dd HH:mm:ss");
               var end = $.fullCalendar.formatDate(event.end, "yyyy-MM-dd HH:mm:ss");
               $.ajax({
                   url: '../eventUpdate.php',
                   data: 'title='+ event.title+'&start='+ start +'&end='+ end +'&id='+ event.id ,
                   type: "POST",
                   success: function(json) 
                   {
                        alert("Updated Successfully");
                   }
               });
            },
            eventResize: function(event) {
               var start = $.fullCalendar.formatDate(event.start, "yyyy-MM-dd HH:mm:ss");
               var end = $.fullCalendar.formatDate(event.end, "yyyy-MM-dd HH:mm:ss");
               $.ajax({
                    url: 'eventUpdate.php',
                    data: 'title='+ event.title+'&start='+ start +'&end='+ end +'&id='+ event.id ,
                    type: "POST",
                    success: function(json) 
                    {
                        alert("Updated Successfully");
                    }
               });
            }
      });
 });

我一遍又一遍地教自己同样的课。阅读*(手册!

我更改了mintime和maxtime 的视图特定选项

来自

    views: {
                week: {
                    minTime: "6”,
                    maxTime: "23"
                },
                day: {
                    minTime: "6",
                    maxTime: "23"
                }
            },

    views: {
                week: {
                    minTime: "06:00:00",
                    maxTime: "23:00:00"
                },
                day: {
                    minTime: "06:00:00",
                    maxTime: "23:00:00"
                }
            },

和中提琴!我希望这能节省一些时间。

您是否以这种格式加载事件?我知道你提到过你做过,但仔细检查一下,因为你的代码似乎有效,至少在jFiddle上为我找到了一些添加的事件(注意,一开始一定要使用这些确切的引用,因为即使更改jQuery版本也会导致奇怪的错误(:

<script src="http://www.arshaw.com/js/fullcalendar-1.5.3/fullcalendar/fullcalendar.min.js"></script>
<link href="http://arshaw.com/js/fullcalendar-1.5.3/fullcalendar/fullcalendar.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

http://jsfiddle.net/omikey/pm4ajohL/

相关内容

  • 没有找到相关文章

最新更新