I am looking at the debug page of the official FullCalendar site. I want to schedule an event from 22/09/2015 to 30/09/2015 (dd/mm/yyyy). But it only shows up for dates from 22/09/2015 to 29/09/2015 - 30/09/2015 is missing.
Here is the code:
$(function() { // document ready
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultDate: '2014-11-12',
editable: true,
eventLimit: true, // allow "more" link when too many events
events: [
{
title: 'Meeting',
start: '2015-09-22',
end: '2015-09-30'
}
]
});
});
Here is an image of the output:
What is the problem with this code?
Don't think of the dates as discrete days, but as a continium in time. The date 2015-09-30
is implicitly given the time 00:00:00
, i.e. midnight. This means that the event will not actually extend to the 30th, but en just when that day starts.
This gives you a simple solution. Just end the event one day later:
end: '2015-10-01'
Or, take it from the documentation:
It is the moment immediately after the event has ended. For example, if the last full day of an event is Thursday, the exclusive end of the event will be 00:00:00 on Friday!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With