2016-03-08 144 views
5

我已经设置;FullCalendar忽略时区

var calendar = $('#calendar').fullCalendar({ 
      axisFormat: 'HH:mm', 
      timezone:false, 
      ignoreTimezone: true,... 

所以我希望它用本地时间设置,但它不是..当我选择压延事件对象日期时间提前2小时。我认为它是因为我的时区为UTC + 2,但我不想把它添加任何东西我想无论我选择在日历中..这怎么看.. (我选择星期一下午23时30分,但活动日期为:周二凌晨01:30) enter image description here

我看到浏览器那个对象(Moment)有一个属性_isUTC:true ..我认为这是我的问题,但我怎样才能将它设置为false?

+0

timezone参数应该是false,请检查http://fullcalendar.io/docs/timezone/timezone/。还有一个演示:http://fullcalendar.io/js/fullcalendar-2.6.0/demos/timezones.html –

+0

我也使用它,编辑帖子,但没有改变仍然增加2小时选定的日期 – TyForHelpDude

+0

如果你设置世界标准时间? –

回答

11

您可以在fullcalendar配置中设置本地到时区。

timezone:'local', 

它的工作原理!

2

而不是使用“timezone:'local'”,有时您可能希望在精确时刻对象上使用“moment.local()”将其标志“isUTC”设置为false。