【问题标题】:Fullcalendar is not displaying eventsFullcalendar 不显示事件
【发布时间】:2011-03-06 14:25:01
【问题描述】:

我在使用 FullCalendar 时遇到问题,它不显示我的活动。我知道事件数据的格式可能有误,但我看不出应该是什么格式。

下面的代码是我的代码的简化版:

jQuery('#cal').fullCalendar({
                defaultView: 'agendaDay',
                axisFormat: 'H', //,'h(:mm)tt',
                timeFormat: {
                    agenda: 'H' //h:mm{ - h:mm}'
                },

                firstHour: 18,
                eventSources: 
                   [{"id":64,"title":"TestUser","start":"2011-03-08T02:00:00.0000000","end":"2011-03-08T04:00:00.0000000","allDay":false},{"id":65,"title":"TestUser","start":"2011-03-07T10:00:00.0000000","end":"2011-03-07T12:00:00.0000000","allDay":false}]
                ,
                eventClick: function (calEvent, jsEvent, view) {
                    jQuery('#divEventTitle').html(calEvent.title);
                    showEvent(calEvent);
                    jQuery('#divEvent').dialog();
                },
                theme: true,
                header: false,
                height: 450
            });

【问题讨论】:

    标签: jquery asp.net-mvc fullcalendar


    【解决方案1】:

    当直接传递事件数据时,要使用的属性是“events”而不是“eventSources”。

    另外,您告诉它向您显示“agendaDay”,它只会在一个小时一个小时的视图中显示当前日期。由于今天是 3 月 6 日,而您的活动是在 3 月 7 日和 8 日进行的,因此它们不会在初始页面加载时显示。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-27
      • 1970-01-01
      • 1970-01-01
      • 2011-11-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多