2010-08-24 57 views
0

由于某些原因,fullcalendar将不会在basicDay视图中显示7PM后发生的任何事件。 事件在月视图中显示,但不在basicDay视图中显示。FullCalendar with Gcal将不会在basicDay视图下午7点后显示事件

任何想法,将不胜感激。

这是我的代码。我在同一页面上有两个日历。第一个是月视图,第二个是basicDay视图。

$(document).ready(function() { 

    // page is now ready, initialize the calendar... 

    $('#calendar').fullCalendar({ 
    weekMode:'variable', 
    events: $.fullCalendar.gcalFeed(
    "http://www.google.com/calendar/feeds/google_account/public/basic" 
    ), 
    eventClick: function(event) { 
    if (event.url) { 
    window.open(event.url,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=750, height=450"); 
    return false; 
    } 
    } 
    }); 

    $('#calendar_min').fullCalendar({ 
    height:193, 
    header:false, 
     defaultView: 'basicDay', 
    events: $.fullCalendar.gcalFeed(
    "http://www.google.com/calendar/feeds/google_account/public/basic" 
    ), 
    eventClick: function(event) { 
    if (event.url) { 
    window.open(event.url,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=750, height=450"); 
    return false; 
    } 
    } 
    }); 
}); 

回答

0

你会得到什么错误?当我在晚上7点后将您的谷歌饲料替换为事件时,它显示正常。 (虽然你的例子有一个额外的)};需要删除。

 $('#calendar_min').fullCalendar({ 
      height: 193, 
      header: false, 
      defaultView: 'basicDay', 
      events: [ 
      { 
       title: 'Day', 
       start: new Date(y, m, d, 20), 
       end: new Date(y, m, d, 21), 
       description: 'long description3', 
       id: 2 
      }], 
      eventClick: function(event) { 
       if (event.url) { 
        window.open(event.url, "_blank", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=750, height=450"); 
        return false; 
       } 
      } 
     }); 
0

我有一个类似的问题。 Google日历时区为EDT,显示屏中缺少最近4小时的事件。

我改变了fullcalendar.js(849行)中的fetchAndRenderEvents()来解决这个问题。

它是:

function fetchAndRenderEvents() { 
     fetchEvents(currentView.start, currentView.end); 
      // ... will call reportEvents 
      // ... which will call renderEvents 
    } 

我加一天的currentView.end

function fetchAndRenderEvents() { 
    // Add 1 day to end to ensure all events are fetched when the time zone is applied. 
    fetchEvents(currentView.start, currentView.end.add(1, 'days')); 
     // ... will call reportEvents 
     // ... which will call renderEvents 
} 
相关问题