每当我把时间放在开始和结束时,事件都不会调整大小。但是当时间是00:00:00时,我现在可以调整它的大小。
然后它在时间00:00:00时有效。
我的完整代码:
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'today add_event',
center: 'prev title next',
right: 'month,basicWeek,basicDay'
},
eventOrder: 'start',
editable: true,
eventLimit: true,
selectable: true,
selectHelper: true,
select: function(start, end) {
$('#ModalAdd #start').val(moment(start).format('YYYY-MM-DD HH:mm:ss'));
$('#ModalAdd #end').val(moment(end).format('YYYY-MM-DD HH:mm:ss'));
$('#ModalAdd').modal('show');
},
eventRender: function(event, element) {
element.bind('dblclick', function() {
$('#ModalEdit #id').val(event.id);
$('#ModalEdit #start').val(event.start.format('dddd, MMM DD-YYYY'));
$('#ModalEdit #end').val(event.end.format('dddd, MMM DD-YYYY'));
});
},
eventDrop: function(event, delta, revertFunc) {
edit(event);
}
eventResize: function(event,dayDelta,minuteDelta,revertFunc) {
edit(event);
},
events: [
<?php
foreach($events as $event):
$start = explode(" ", $event['start']);
$end = explode(" ", $event['end']);
if($start[1] == '00:00:00'){
$start = $start[0];
}else{
$start = $event['start'];
}
if($end[1] == '00:00:00'){
$end = $end[0];
}else{
$end = $event['end'];
}
?>
{
id: '<?php echo $event['id']; ?>',
title: '<?php echo $event['title']; ?>',
start: '<?php echo $start; ?>',
end: '<?php echo $end; ?>',
},
<?php endforeach;?>
],
});
function edit(event){
start = event.start.format('YYYY-MM-DD HH:mm:ss');
if(event.end){
end = event.end.format('YYYY-MM-DD HH:mm:ss');
}
else{
end = start;
}
id = event.id;
Event = [];
Event[0] = id;
Event[1] = start;
Event[2] = end;
$.ajax({
url: 'editEventDate.php',
type: "POST",
data: {
Event:Event}
,
success: function(rep) {
if(rep == 'OK'){
}
else{
alert('Could not be saved. try again.');
}
}
}
);
}
}
);
请帮我弄清问题是什么。我无法将时间添加到开始和结束日期。