Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fullcalendar shows wrong day in month view

I'm using Fullcalendar within a Asp.Net project and I'm using the function 'events' to refresh items in my calendar.

I'm putting events in myArray to pass it in the callback function as below:

var event = {
                title: 'Disponível',
                start: moment(horario.DtInicio),
                end: moment(horario.DtFim),
            }
myArray.push(event);

where horario.DtInicio and horario.DtFim is a Asp.Net json Date (eg. "/Date(1423321200000)/")

When I show callendar in month view, this date shows in 02/06/2015 (mm/dd/yyyy), but when I toggle to other view, this event shows in 02/07/2015. The real date is 02/07/2015.

Has anyone faced this situation?

like image 813
Gabriel Avatar asked Feb 07 '15 16:02

Gabriel


1 Answers

Try to set the timezone for the calendar:

$('#calendar').fullcalendar({
    timezone : 'local',
    ...
});
like image 160
RodrigoDela Avatar answered Sep 22 '22 11:09

RodrigoDela