嗨,伙计们,我有一点问题。我正在设置我的 Fullcalendar,与数据库连接并且一切都显示良好,现在我在更新和添加新事件方面没有什么问题(以 24 小时格式和 allday:false
而不是 alert(event.id + ' wasmoved ' + delta + ' days\n' + '(应该可能更新你的数据库)'); 我需要调用我的 createevent.php?id=$id&start=$star&end=$end
我的json:
[{"id":"2","title":"hair cut Mike","start":"2013-02-02T13:30:00+01:00","end":"2013-02-02T15:30:00+01:00","color":"blue","allDay":false},{"id":"1","title":"hair cut Steve","start":"2013-02-02T09:30:00+01:00","end":"2013-02-02T10:30:00+01:00","color":"red","allDay":false}]
我也需要这个来创建新事件,我被放置了可选择的 jQuery,然后工作(输入对话框)。
<script type='text/javascript'>
$(document).ready(function () {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
allDaySlot: true,
allDayText: 'Volledige dag',
firstHour: 8,
slotMinutes: 30,
defaultEventMinutes: 120,
axisFormat: 'HH:mm',
timeFormat: {
agenda: 'H:mm{ - h:mm}'
},
dragOpacity: {
agenda: .5
},
minTime: 0,
maxTime: 24,
selectable: true,
selectHelper: true,
select: function (start, end, allDay) {
var title = prompt('Event Title:');
if (title) {
calendar.fullCalendar('renderEvent', {
title: title,
start: start,
end: end,
allDay: false
},
true // make the event "stick"
);
}
calendar.fullCalendar('unselect');
},
events: "json-events.php",
eventDrop: function (event, delta) {
alert(event.id + ' was moved ' + delta + ' days\n' +
'(should probably update your database)');
},
timeFormat: 'H:mm',
loading: function (bool) {
if (bool) $('#loading').show();
else $('#loading').hide();
}
});
});