我正在尝试将fullcalender集成到php mysql.我使用了以下代码.我想格式化日期,它将以格式yyyy/mm/dd格式化,但是当我使用格式语句时,代码无法正常工作.如果我删除它似乎工作的格式日期,但在数据库中插入0000/0000/000 00:00.
我的代码:
// Convert the allDay from string to boolean
eventRender: function(event, element, view) {
if (event.allDay === 'true') {
event.allDay = true;
}
else {
event.allDay = false;
}
},
selectable: true,
selectHelper: true,
select: function(start, end, allDay) {
var title = prompt('Sample Textbox:');
if (title) {
start = $.fullCalendar.formatDate(start, "yyyy-MM-dd HH:mm:ss");
end = $.fullCalendar.formatDate(end, "yyyy-MM-dd HH:mm:ss");
$.ajax({
url: 'http://localhost/fullcalendar/demos/add_events.php',
data: 'title='+ title+'&start='+ start +'&end='+ end ,
type: "POST",
success: function(json) {
alert('Added Successfully');
alert(json);
}
}); …Run Code Online (Sandbox Code Playgroud)