| Issue 484: | Browser timezone as parameter | |
| 1 person starred this issue and may be notified of changes. | Back to list |
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
May 12, 2010
Then you don't have to rewrite the complete function which will look in 99% of the implementations the same....
May 12, 2010
Well, that's why this is implemented, Adam cannot add a function for each particular need of everyone...
May 12, 2010
Which function he should implement? I think you didn't understand what I mean....
May 12, 2010
Indeed, my bad...
Jul 5, 2010
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
|
|
| ► Sign in to add a comment |