5
votes

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?

2
Hi, I also am experiencing this issue with FullCalendar 2.2.6. I tried @RodrigoDela's suggestion of setting the timezone to 'local' but this did not help.jkndrkn
@jkndrkn maybe you could post a fiddle, so that we can reproduce your problem?RodrigoDela
@RodrigoDela, my issue was related to an out-of-date version of moment.jsjkndrkn
Does anybody got any answer to resolve it?Akash

2 Answers

8
votes

Try to set the timezone for the calendar:

$('#calendar').fullcalendar({
    timezone : 'local',
    ...
});
0
votes

As RodrigoDela suggested, try setting your timezone. If that does not help, then try what worked for me.

Setting the timezone alone to "local" did not fix the issue for me. Updating moment.js from 2.8.3 to 2.8.4 did fix the issue.

For reference, I am running the following versions of FullCalendar and its dependencies:

  • FullCalendar 2.2.6
  • jQuery 2.1.3
  • jQuery UI 1.10.4
  • moment.js 2.8.4

Additional details regarding my debugging process and fix here.