Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change timezone in Arshaw FullCalendar

From my understanding, Arshaw FullCalendar displays events according to the timezone of the local computer's operating system. I assume this is done by the javascript Date() object, which also is based on the local computer's operating system. I have an application that has group calendars and a group timezone, I want to be able to force every local Arshaw Calendar to display according to that group's time-zone, no matter what timezone that computer is. How do you do this?

Note: I've looked through the documentation fairly thoroughly, and found no such option. I'm hoping that javascript has something equivalent to php's date_default_timezone_set(), which seems to me the way this could be solved.

*Edit 1/31/2013 12:23pm CST: I am sending everything to the calendar as unix timestamps, so I assume the option ignoreTimezone would not apply here, as described in this stackoverflow thread: jQuery FullCalendar timezone synchronization

like image 507
Colin Brogan Avatar asked Jan 31 '13 18:01

Colin Brogan


People also ask

How do I hide time in fullCalendar?

$('#calendar'). fullCalendar({ displayEventTime : false }); That should hide the start time in the title event.

What is JavaScript fullCalendar?

FullCalendar is a JavaScript library that seamlessly integrates with such popular JavaScript frameworks as Vue, React, Angular.

How do I start and end date in fullCalendar?

We can get start date by getView event with intervalStart. We can get end date by getView event with intervalEnd. var month = $('#calendar'). fullCalendar('getView').


1 Answers

You should probably try to set the option "ignoreTimezone" to "false" and give to Arshaw FullCalendar date in ISO8601.

You can get more information about that here: http://arshaw.com/fullcalendar/docs/event_data/ignoreTimezone/

To convert unix timestamps to ISO8601, you can use this in javascript:

var d = new Date(1360412434000).toISOString();

This is ECMAScript 5. See here for compatibility and fallback code: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toISOString

like image 187
Code-Source Avatar answered Oct 22 '22 17:10

Code-Source