FullCalendar: Default timezone irrespective of client's location

被刻印的时光 ゝ 提交于 2019-12-06 14:53:08

I believe this can be done by specifying the timezone string when you initialize your calendar:

$('#calendar-selector-id-name').fullCalendar({
    timezone: 'American/Indiana/Indianapolis'
});

You mentioned the gcal.js and so, I am wondering if this needs to be defined like:

$('#calendar-selector-id-name').fullCalendar({
    timezone: 'American/Indiana/Indianapolis',
    eventSources:[{
        url: 'https://www.google.com/calendar/feeds/...',
        currentTimezone: 'American/Indiana/Indianapolis'
    }]
});

Demo

Docs

Timezone problems when using Google Calendar #1801

EDIT

@jaykumarark did some further research and dug up the following:

Google Calendar - htmlLink not always defined #2844

Which revealed that for GoogleApps calendars, an initialized htmlLink variable is not provided for events that only share free/busy information, and hide event details.

Jay also noted discovering the following work-around:

"commenting line 144 in gcal.js //url=injectQsComponent(url, 'ctz=' + timezoneArg); I could represent times in a particular timezone irrespective of location."

So, in summary:

  • Currently, setting timezone, irrelevant of location, seems to work fine with GoogleApps calendars, as long one of the 3 "Share all information, ..." sharing settings is selected.
  • Adam Shaw has acknowledged the issue of htmlLink requiring an existence check, i.e. at some point the javascript error will be addressed.
  • Jay has provided a work-around, for those looking to implement a synonymous solution.

Please refer to comments below for additional information/clarifications.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!