Issue 576: timestamp passed in ajax POST wrong
Status:  Done
Owner: ----
Closed:  Aug 2010
Reported by sylvia.a...@gmail.com, Jul 27, 2010
hey

first of all thanks for your awesome plugin it's so easy to implement :-)

i've implemented it grabbing the data via json and then thought "hold on"...something is wrong here...and there is :-)

i've made a screenshot of your site (see attached) which highlights what's wrong: as you can see the calendar displays july 2010. however, the timestamps passed in the POST resolve to totally random dates that have nothing to do with july:

start=1277593200 translates to Saturday, June 26th 2010, 23:00:00 (GMT)
end=1281222000 translates to Saturday, August 7th 2010, 23:00:00 (GMT)

the same is happening on my local implementation of your plugin.

since you know your code much better than i do it would be great if you could commit a patch for this as it's quite an essential bug!

thanks
sissi
fullcalendar_timestamp-issue.jpg
219 KB   View   Download
Jul 29, 2010
#1 sylvia.a...@gmail.com
I've fixed it temporary by using date, works for my set-up but might break when other data needs to be fetched:

//params[options.startParam] = Math.round(eventStart.getTime() / 1000);
//params[options.endParam] = Math.round(eventEnd.getTime() / 1000);
params.start = Math.round(date.getTime() / 1000);
Aug 26, 2010
Project Member #2 adamrs...@gmail.com
the timestamps fullcalendar is sending are the start of the first visible day (june 27th) and the end of the last visible day (aug 8), according to the browser's local time (this off one hour... are you in a +1 timezone?)

fullcalendar still needs to render events on the all the *visible* days, like june 27th, so it still needs the data for them.

if you dont want fullcalendar to render events on days other than the current month, this issue is for you...
https://code.google.com/p/fullcalendar/issues/detail?id=166
Status: Done
May 20, 2013
#3 jfr...@gmail.com
Hi,

I had the same issue, I received the start and stop timestamps according to browser's local timezone. I did the following to solve it:

$(document).ready(function() {
        var offset = new Date().getTimezoneOffset();
        $('#calendar').fullCalendar({
               ......
               events: "/app/get_events?offset="+offset,
               .....

And in the server side (Python):
    calendar_start = int(request.GET.get('start', None))
    calendar_end = int(request.GET.get('end', None))
    offset = int(request.GET.get('offset', None))

    cal_inicio = datetime.datetime.fromtimestamp(calendar_start) - datetime.timedelta(minutes=offset)
    cal_termino = datetime.datetime.fromtimestamp(calendar_end) - datetime.timedelta(minutes=offset)

Hope this helps!!!