0
有沒有辦法用datetimepicker添加事件到fullcalendar(http://trentrichardson.com/examples/timepicker/)?
我需要一個按鈕來顯示datetimepicker onclick,然後用戶可以選擇日期和時間並將其插入與fullcalendar連接的數據庫中。用datetimepicker添加fullcalendar事件
這是我fullcalendar代碼(一部分):
events: {
url: 'events.php',
cache: true,
type: 'POST',
data:{userid:uid}
},
eventRender: function(event, element, view) {
if(event.status == 'open') {
element.css('background-color', 'green');
}
},
selectable: true,
selectHelper: true,
select: function(start, end, allDay) {
var status = 'open';
var userid= <?php echo "$userid"; ?>;
if (status) {
var start = $.fullCalendar.formatDate(start, "yyyy-MM-dd HH:mm:ss");
var end = $.fullCalendar.formatDate(end, "yyyy-MM-dd HH:mm:ss");
$.ajax({
url: 'events_add.php',
data: 'status='+ status+'&start='+ start +'&end='+ end +'&userid='+ userid,
type: "POST",
success: function(json) {
alert('Added Successfully');
}
});
calendar.fullCalendar('renderEvent',{
title: title,
status: status,
start: start,
end: end,
allDay: allDay
},
true);
}
calendar.fullCalendar('unselect');
},
和的DateTimePicker電話:
$('#datepicker').datetimepicker();