Fullcalendar show "end date" one day off
json is jan 12th, to 16th, but the calendar show 12th to 15th
here is the code
var calCon = $('.cal');
calCon.fullCalendar({
prev: 'left-single-arrow',
firstDay: 1,
weekends:true,
weekNumbers:true,
ignoreTimezone:false,
allDayDefault:true,
weekNumberCalculation:"ISO",
defaultView:"basicWeek",
timeFormat: 'H(:mm)',
events: {
url: "/calendarjson.xsp",
cache: false
}
})
here is the json
[{"color":"#3a87ad","id":"123","allday":"1","url":"/...","end":"2015-01-16T10:00:00.0+0100","start":"2015-01-12T09:00:00.0+0100","title":"Thomas Adrian"}]
I am using allDayDefault because time is not important.
What am I doing wrong?
I am using the latest fullcalender 2.2.5
I have tried to change the time but it is still the same
Fullcalendar show "end date" one day off
json is jan 12th, to 16th, but the calendar show 12th to 15th
here is the code
var calCon = $('.cal');
calCon.fullCalendar({
prev: 'left-single-arrow',
firstDay: 1,
weekends:true,
weekNumbers:true,
ignoreTimezone:false,
allDayDefault:true,
weekNumberCalculation:"ISO",
defaultView:"basicWeek",
timeFormat: 'H(:mm)',
events: {
url: "/calendarjson.xsp",
cache: false
}
})
here is the json
[{"color":"#3a87ad","id":"123","allday":"1","url":"/...","end":"2015-01-16T10:00:00.0+0100","start":"2015-01-12T09:00:00.0+0100","title":"Thomas Adrian"}]
I am using allDayDefault because time is not important.
What am I doing wrong?
I am using the latest fullcalender 2.2.5
I have tried to change the time but it is still the same
1 Answer
Reset to default 13FullCalendar.js uses exclusive end moments. The documentation says it here. It means that the end moment of an event does not belong to the time interval from start to end, but marks the point in time right after that interval.
The important point here is that you set default for allDay to true. You use 2015-01-16T10:00:00.0+0100
as endpoint for the event. But an allDay event does NOT keep time information internally in fullCalendar. It strips off the time and only keeps the date. You use 2015-01-16T10:00:00.0+0100
as endpoint. The time is stripped and end is made exclusive which results in 2015-01-15T23:59:59.0+0100
, what is the result you see in your fullCalendar. You should have used 2015-01-17T00:00:00.0+0100
as end for your allDay event, to have it span to January 16th 23:59:59.