FullCalendar 与 Gcal 不会在 basicDay 视图中显示晚上 7 点之后的事件

发布于 2024-09-15 08:24:14 字数 1169 浏览 13 评论 0原文

由于某种原因,fullcalendar 不会在 basicDay 视图中显示晚上 7 点之后发生的任何事件。 事件显示在月视图中,但不在基本日视图中。

任何想法将不胜感激。

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

  $(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;
    }
   }
  });
 });

For some reason fullcalendar won't display any events that occur after 7PM in the basicDay view.
The events show up in month view, but not in basicDay view.

Any thoughts would be appreciated.

Here is my code. I have two calendars on the same page. The first one is month view, the second is basicDay view.

  $(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;
    }
   }
  });
 });

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

春花秋月 2024-09-22 08:24:14

这是因为您位于 EST。创建新活动时,时间为格林尼治标准时间 (GMT) 中午 12:00,因此 -5 小时 = 晚上 7 点。您可能想查看使用ignoreTimezone http://arshaw.com/fullcalendar/docs/event_data/< /a>

This is caused because you're located in EST. When creating a new event the time is 12:00am GMT, so -5 hours = 7pm. You may want to look at using ignoreTimezone at http://arshaw.com/fullcalendar/docs/event_data/

拔了角的鹿 2024-09-22 08:24:14

你遇到什么错误?当我用晚上 7 点后的活动替换你的 google feed 时,它显示正常。 (虽然你的例子有一个额外的)};需要将其删除。

       $('#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;
                }
            }
        });

What error are you getting? When I replace your google feed with an event after 7pm it displays fine. (Although your example has an extra )}; that needs to be removed.

       $('#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;
                }
            }
        });
2024-09-22 08:24:14

我有类似的问题。 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
}

I had a similar issue. The Google Calendar timezone was EDT and the last 4 hours of event were missing from the display.

I changed fetchAndRenderEvents() in fullcalendar.js (line 849) to fix the issue.

It was:

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

I added one day to the 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
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文