FullCalendar:无论客户身在何处,默认时区 [英] FullCalendar: Default timezone irrespective of client's location
问题描述
我正在尝试使用fullcalendar
创建约会计划应用程序.我只想在所有位置的一个时区(即EST)中代表日历上的时隙.因此,即使来自PST区域的人正在查看日历,时间也应该在EST中.另外,即使他/她安排了点击广告位,时间也应该在EST中.无论位置如何,如何为日历设置默认时区.
I am trying to create an appointment-scheduling application with fullcalendar
. I want to represent time-slots on the calendar in only one timezone(i.e., EST) across all locations. So even if a person from PST zone is viewing the calendar, the times should be in EST. Also, even he/she schedules clicks a slot, the time should be in EST. How can I set a default time-zone for the calendar irrespective of location.
推荐答案
我相信可以通过在初始化日历时指定时区字符串来实现:
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'
});
您提到了gcal.js
,所以,我想知道是否需要这样定义:
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'
}]
});
编辑
@jaykumarark做了一些进一步的研究,并挖掘了以下内容:
@jaykumarark did some further research and dug up the following:
其中透露,对于GoogleApps日历,未为仅共享忙/闲信息并隐藏事件详细信息的事件提供初始化的htmlLink
变量.
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还指出发现了以下解决方法:
Jay also noted discovering the following work-around:
"gcal.js中的注释行144 //url=injectQsComponent(url, 'ctz=' + timezoneArg);
无论位置如何,我都可以表示特定时区中的时间."
"commenting line 144 in gcal.js //url=injectQsComponent(url, 'ctz=' + timezoneArg);
I could represent times in a particular timezone irrespective of location."
因此,总而言之:
- 当前,设置时区(与位置无关)似乎可行 只要使用3个全部共享"之一,就可以使用GoogleApps日历 信息,..."共享设置已选中.
- 亚当·肖承认以下问题:
htmlLink
需要存在性检查,即在某个时候 javascript错误将得到解决. - Jay已为那些希望实施的人提供了一种解决方法 同义的解决方案.
- 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.
这篇关于FullCalendar:无论客户身在何处,默认时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!