Install the Fullcalendar plugin database by time zone (GMT + 8)

I use the Fullcalendar plugin:

http://fullcalendar.io/

The problem is that I found the calendar quite confusing since when I click on 00:00 it is 8:00 in the morning if I register the date

How to limit the display date in the same way as the time zone, so if I click on 00:00, is it actually 00:00 GMT + 8 instead of 08:00 GMT + 8?

Thanks for the help.

+5
source share
2 answers

You can use as:

<?php $datetime = new DateTime('now', 'America/Chicago'); $datetime_string = $datetime->format('c'); ?> $('#calendar').fullCalendar({ now: <?php echo json_encode($datetime_string) ?> }); 
+7
source

You must set the 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 the time zone property, your calendar will work in that time zone.

Check out the official demo here - DEMO

+4
source

Source: https://habr.com/ru/post/1238791/


All Articles