Fullcalendar - Event Spanning All Day Are One Day Too Short
Solution 1:
Based on the eventDataTransform function you could add 1 day if your event is allDay. Note that this will only affect rendering.
eventDataTransform: function(event) {
if(event.allDay) {
event.end = moment(event.end).add(1, 'days')
}
returnevent;
}
Solution 2:
I believe this a conscious design decision, in that all end dates are to be regarded as exclusive, based on discussions like this and this, i.e. so despite being an all day event, your end date is not regarded as included (inclusive) of the dates tagged. e.g. If you have a start date of 2015-03-01 00:00:00
and an end date of 2015-03-02 00:00:00
the span is only one day.
This seems to coincide with the version 2 upgrade to using moment.js. So it would appear you will either need to add '23:59:59' to your end date, or to find a a different way of specifying the end date, e.g. as a duration of two days added to the start date?
Solution 3:
on ajax GET all events add one day
moment(end_date, 'YYYY-MM-DD').add(1, 'days').format('YYYY-MM-DD HH:mm:SS')
on ajax POST (update) subtract(1, 'days')
moment(eventChange_end, 'YYYY-MM-DD').subtract(1, 'days').format('YYYY-MM-DD HH:mm:SS')
Post a Comment for "Fullcalendar - Event Spanning All Day Are One Day Too Short"