2015-08-27 19 views
0

对于我的Google日历使用FullCalendar,我希望完全忽略本地时区,并始终在美国/芝加哥时间显示时间。弹出窗口中的一致时区

我实际上并不担心日历本身 - 它工作正常。我正在尝试使弹出窗口正确显示。只要我登录Google帐户,时间就会显示“本地”时间。但是我的许多访客不会有Google帐户,当他们打开弹出窗口时,它总是显示GMT时间。

如何让弹出窗口始终显示“America/Chicago”?这是FullCalendar问题还是Google问题?

+0

这真的是StackOverflow的问题吗? – 5208760

回答

0

据fullcalendar在文档: http://fullcalendar.io/docs/timezone/timezone/

你有方法/参数时区,让您在参数设置“美国/芝加哥”

这是从他们的榜样采取:

function renderCalendar() { 
      $('#calendar').fullCalendar({ 
       header: { 
        left: 'prev,next today', 
        center: 'title', 
        right: 'month,agendaWeek,agendaDay' 
       }, 
       defaultDate: '2015-02-12', 
       timezone: currentTimezone, //Here you can set timezone to 'America/Chicago' 
       editable: true, 
       eventLimit: true, // allow "more" link when too many events 
       events: { 
        url: 'php/get-events.php', 
        error: function() { 
         $('#script-warning').show(); 
        } 
       }, 
       loading: function(bool) { 
        $('#loading').toggle(bool); 
       }, 
       eventRender: function(event, el) { 
        // render the timezone offset below the event title 
        if (event.start.hasZone()) { 
         el.find('.fc-title').after(
          $('<div class="tzo"/>').text(event.start.format('Z')) 
         ); 
        } 
       } 
      }); 
     } 

并且相应地,相同的参数可用于谷歌日程表例如: http://fullcalendar.io/docs/google_calendar/

+0

谢谢!我曾看过这个,但实际上无法让它改变。结果我的谷歌驱动器(我的日历托管在哪里)没有运行在我的桌面上,因此没有更新。我最终只是改变了html中的event.url以包含+'&ctz = America/Chicago',并且也做到了这一点。我现在可以回去尝试编辑JavaScript,现在我发现我的用户错误。再次感谢! – Trey