显示全天allDay中所有事件的ui日历不工作



我的cordova应用程序中有Fullcalendar,我正在尝试使用agendaWeek视图,但无论何时呈现事件,它都在全天部分。我已经将allDay添加到JSON数据中,并将其设置为false,但这仍然没有解决问题。

事件脚本:

    $scope.eventSources = [
{
    events: function(start, end, callback) 
    {
        $.ajax({
            url: 'url/calendarConnect.php',
            type: 'POST',
            dataType: 'json',
            success: function(response) 
            {
                var events = [];
                $(response.events).each(function() 
                {
                    events.push
                        ({
                        id: $(this).attr('ID'),
                        class_id: $(this).attr('class_id'),
                        title: $(this).attr('title'),
                        start: $(this).attr('start'),
                        end: $(this).attr('end'),
                        allDay: $(this).attr('allDay')
                        });
                });
                var userTable = $.grep(events, function (a)
                {
                    return a.class_id == $scope.Current.currentUser;
                });
                callback(userTable);
            }    
        });
    }
}
]

JSON字符串:

{"success":1,"message":"Details Available!","events":
[{"ID":"1","title":"Example Class  12345","start":"2014-08-29 09:00:00","class_id":"12345","end":"2014-08-29 17:00:00","allDay":"false"},
{"ID":"2","title":"Example Class 53870","start":"2014-08-13 00:00:00","class_id":"53870","end":"2014-08-13 00:00:00","allDay":"false"},
{"ID":"3","title":"Example Event ","start":"2014-08-13 12:00:00","class_id":"54321","end":"2014-08-13 13:00:00","allDay":"false"},
{"ID":"11","title":"Testing 123","start":"2014-08-13 00:00:00","class_id":"19224","end":"2014-08-13 23:59:00","allDay":"false"},
{"ID":"12","title":"Test Class Sept","start":"2014-09-23 13:00:00","class_id":"53870","end":"2014-09-23 14:00:00","allDay":"false"},
{"ID":"14","title":"Employ ability Skills w/J","start":"2014-09-12 07:00:00","class_id":"53870","end":"2014-09-12 09:00:00","allDay":"false"}]}

我对这个插件不是很熟悉,我读过的任何东西都不适合我。任何帮助都将不胜感激。

Update:我认为这与"中返回的"allDay"因此被解释为字符串有关,我该如何在php中更改它?

一个修复方法是,在服务器端更改它的代价是在数组中将allDay设置为false。这是一个潜在的解决方案,但不是我问题的答案。问题是因为"false"的响应被解释为字符串,如果您可以删除",那么它应该可以工作。

相关内容

  • 没有找到相关文章

最新更新