Issue 2516: Date/Time not being correctly displayed on eventRender
Status:  ExportedToGithub
Owner: ----
Closed:  Aug 2015
Reported by j...@mesguymer.co.uk, Jun 11, 2015
Hi

I have a realtime multi timezone application that uses Signal R, all datetimes are broadcast using UTC and manipulated to the correct Timezone using moment timezone. The reason for this is because if we had many people logged on using different timezones, we would have to broadcast each update to the individuals already displaying the correct date time for that person, as oppopsed to 1 broadcast and manipulated client side. The timezone is stored as a string when the user logs in and is not reliant on the browser.

As i understand it FullCalendar will not manipulate the datetime using Timezone(i could be wrong). I checked out the example on your site and all the dates in the JSON are already converted which is not an option for me.

The route i have taken is to manipulate the dates in the eventRender. 

The problem is that when you load for the first time the calendar displays them in UTC, if you change views it corrects it to the right date time. See the below fiddle, it loads as 11am then if you swap views it displays as 2pm which is the desired time. Ive used Istanbul as an example.

http://jsfiddle.net/JGuymer/oa4ahubo/6/

Is this the correct way of doing this? or is this a bug?

Thanks in Advance

James
Jun 11, 2015
#1 j...@mesguymer.co.uk
  $(document).ready(function() {

    
    
        function renderCalendar() {
            $('#calendar').fullCalendar({
                header: {
                    left: 'prev,next today',
                    center: 'title',
                    right: 'month,agendaWeek,agendaDay'
                },
                editable: true,
                timezone: 'Europe/Istanbul',
                eventLimit: true, // allow "more" link when too many events
                events: [{"id":1026,"taskTypeId":4,"title":"(New Appointment)","start":"2015-06-11T11:00:00Z","end":"2015-06-11T12:00:00Z","allDay":false,"url":null,"location":"","people":null,"className":"event-appointment"}],
                eventRender: function(event, el) {

                    //console.log(event);
                    event.start.tz('Europe/Istanbul').format('DD MMM YYYY HH:mm');
                    event.end.tz('Europe/Istanbul').format('DD MMM YYYY HH:mm');
            
                  
                }
            });
        }

        renderCalendar();

    });

Jun 16, 2015
Project Member #2 adamrs...@gmail.com
im having trouble loading the demo in the fiddle. no events are display, and it seems that is being caused by the lack of moment timezone script. can you include it and then report the fiddle link
Status: Reproducing
Labels: Type-Bug
Jun 17, 2015
#3 j...@mesguymer.co.uk
Hi Adam

Thats odd as its working here, ive updated the dates so it appears in the same week now. 

Just to be clear it displays as 11am on 19th June, flick to Week View and back again and it displays in desired time of 2pm. Ive got round this for now by calling the following:

        myCalendar.fullCalendar('changeView', 'agendaWeek');
        myCalendar.fullCalendar('changeView', 'month');

Thanks 
Jun 17, 2015
#4 j...@mesguymer.co.uk
sorry forgot the updated link

http://jsfiddle.net/oa4ahubo/9/
Aug 20, 2015
Project Member #6 adamrs...@gmail.com
Discussion for this issue has moved to the following URL:
https://github.com/fullcalendar/fullcalendar/issues/2781

This is because Google Code is shutting down. Apologies if you are being pestered with these notifications. This is a one-time event.

Happy coding,
Adam
Status: ExportedToGithub