I am using FullCalendar with the ability to drop external events onto the calendar: http://arshaw.com/js/fullcalendar-1.5.2/demos/external-dragging.html
When a new event is dropped, it has a start time but no end time. It seems that all these events are "all day" events by default. I tried changing the allDay callback to false: http://arshaw.com/fullcalendar/docs/dropping/drop/
...but it hasn't helped. I'm trying to get it to where when a new event is dropped onto the calendar, it's end time is set for 30 minutes after the drop time (ie. the setting of my defaultEventMinutes) http://arshaw.com/fullcalendar/docs/agenda/defaultEventMinutes/
Anyone know how to do this?
Here is my current fullcalendar function:
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'agendaWeek,agendaDay'
},
events: {
url: 'json-events.php',
type: 'POST',
data: {
},
error: function() {
alert('there was an error while fetching events!');
},
},
allDaySlot: false,
defaultView: 'agendaWeek',
slotMinutes: 15,
firstDay: '<?php echo $config->week_start; ?>',
minTime: '<?php echo $config->day_start; ?>',
maxTime: '<?php echo $config->day_end; ?>',
defaultEventMinutes: 30,
aspectRatio: 1.1,
titleFormat: {
month: 'MMMM yyyy',
week: "MMMM dd[ yyyy]{ '—'[ MMMM] dd, yyyy}",
day: 'dddd MMM dd, yyyy'
},
columnFormat: {
month: 'ddd', // Mon
week: 'ddd M/dd', // Mon 9/07
day: 'dddd M/dd' // Monday 9/07
},
editable: true,
droppable: true,
drop: function(date, allDay) {
var originalEventObject = $(this).data('eventObject');
var copiedEventObject = $.extend({}, originalEventObject);
copiedEventObject.start = date;
//copiedEventObject.allDay = allDay; // Can I make this 30min by default drop?
copiedEventObject.end = (date.getTime() + 1800000)/1000;
copiedEventObject.group_id = $(this).attr("name"); // Group ID
addEvent(copiedEventObject); // Add the event to the db
$('#calendar').fullCalendar('renderEvent', copiedEventObject, true);
if ($('#drop-remove').is(':checked')) {
$(this).remove();
}
}
});