Issue 484: Browser timezone as parameter
Status:  Done
Owner: ----
Closed:  Jul 2010
Reported by allon.mo...@gmail.com, May 12, 2010
Additionally to the "start" and "end" parameter an additional parameter 
which defines the browser timezone should be specified by fullcalendar 
when it fetches the JSON data. This is neccessary when the server is in a 
total different timezone than the visitor. The url should for example look 
like
/myfeed.php?start=1262332800&end=1265011200&btz=240&_=1263178646

the code which sould be changed is in the file 
http://github.com/tpruvot/fullcalendar/blob/gcalendar/src/main.js at line 
411 and should be 
params['btz'] = eventEnd.getTimezoneOffset();

The code in myfeed.php should then look like

$startDate = $_GET['start']; 
$endDate = $_GET['end']; 
$browserTz = $_GET['btz']; 
if(!empty($browserTz)) 
$browserTz = $browserTz * -60; 
else 
$browserTz = 0; 
  
$serverOffset = 3600;
$startDate = $startDate + $browserTz - $serverOffset; 
$endDate = $endDate + $browserTz - $serverOffset; 
 
Here is the docu I'm talking about 
http://arshaw.com/fullcalendar/docs/event_data/events_json_feed/
May 12, 2010
#1 naunaud...@gmail.com
Why don't you use this?
http://arshaw.com/fullcalendar/docs/event_data/events_function/

You can specify more parameters without the need to change a line in fullCalendar.

May 12, 2010
#2 allon.mo...@gmail.com
Then you don't have to rewrite the complete function which will look in 99% of the
implementations the same....
May 12, 2010
#3 naunaud...@gmail.com
Well, that's why this is implemented, Adam cannot add a function for each particular
need of everyone...
May 12, 2010
#4 allon.mo...@gmail.com
Which function he should implement? I think you didn't understand what I mean....
May 12, 2010
#5 naunaud...@gmail.com
Indeed, my bad...
Jul 5, 2010
Project Member #6 adamrs...@gmail.com
hello allon, sorry it has taken so long to get back to you. i understand your problem, but i would like to propose 2 better solutions (neither of which are implemented yet, but hope to get to them at some point)...

1. https://code.google.com/p/fullcalendar/issues/detail?id=336
would let the client/server use arbitrary timezones and fullcalendar would handle the conversion

2. https://code.google.com/p/fullcalendar/issues/detail?id=386
would be a much cleaner way to introduce new parameters to the ajax request

please let me know if you disagree.

ps- thanks again for the support :)
Status: Done
Jul 5, 2010
#7 allon.mo...@gmail.com
I'm sure timezone support is somewhat essential for a calendar application like fullcalendar is....so I hope  issue 336  is coming in the next release ;-)
 Issue 386  would be definitely giving developers more flexibility......