admin管理员组文章数量:1401965
I am using Fullcalendar plugin:
/
The problem is ,I found the calendar is quite confusing, as when I click on 00:00 am , it is 8:00 a.m if I logging the date
How to restrict the display date is same as the timezone, so that if I click on 00:00 , it is actually 00:00 GMT+8 , instead of 08:00 GMT + 8 ?
Thanks for helping.
I am using Fullcalendar plugin:
http://fullcalendar.io/
The problem is ,I found the calendar is quite confusing, as when I click on 00:00 am , it is 8:00 a.m if I logging the date
How to restrict the display date is same as the timezone, so that if I click on 00:00 , it is actually 00:00 GMT+8 , instead of 08:00 GMT + 8 ?
Thanks for helping.
Share Improve this question asked Dec 21, 2015 at 1:36 user3538235user3538235 2,0196 gold badges28 silver badges55 bronze badges 3- 1 Have you tried to change the Timezone? fullcalendar.io/docs/timezone/timezone – Vidhyut Pandya Commented Dec 23, 2015 at 6:33
- 1 share your current code snippet – Venkat.R Commented Dec 26, 2015 at 17:14
- 1 setting parameter "timezone: false" in the calender script should do. – DpEN Commented Dec 27, 2015 at 6:54
2 Answers
Reset to default 7 +50You can use like:
<?php
$datetime = new DateTime('now', 'America/Chicago');
$datetime_string = $datetime->format('c');
?>
$('#calendar').fullCalendar({
now: <?php echo json_encode($datetime_string) ?>
});
You have to set timezone property of this plugin. Like this -
var currentTimezone = "Asia/Bangkok";
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
timezone: currentTimezone, << SET TIMEZONE HERE
editable: true,
selectable: true,
eventLimit: true, // allow "more" link when too many events
});
After setting timezone property your calendar will work base on that timezone.
Check official demo here - DEMO
本文标签: phpSet javascript Fullcalendar plugin base on timezone (GMT8)Stack Overflow
版权声明:本文标题:php - Set javascript Fullcalendar plugin base on timezone (GMT + 8) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744327424a2600794.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论