作者:mobiledu2502889283 | 来源:互联网 | 2023-06-07 19:56
通过定义事件源,我已经使我的FullCalendar提要运行良好。从FullCalendar事件对象获取简单的时间戳eventSources:[{events:fun
通过定义事件源,我已经使我的FullCalendar提要运行良好。从FullCalendar事件对象获取简单的时间戳
eventSources: [
{
events: function(start, end, callback) {
$.ajax({
url: svcURL,
dataType: 'json',
type: 'POST',
data: {
start: Math.round(start.getTime()/1000),
end: Math.round(end.getTime()/1000),
sid: %sid%,
csrf_test_name: csrf
},
success: function(json) {
callback(json);
}
});
}
}
我通过复制和粘贴示例获得了我的时间戳。但是,我有我想要使用时间戳以及其他AJAX功能,但不是时间戳我得到的数据的文本版本:
eventClick: function(event) {
if (confirm('Quer mesmo marcar este serviço?')){
markit(event);
}
return false;
}
的eventClick函数传递事件对象,以我的“麦盖提“功能:
function markit(obj){
$.ajax({
url: msvURL,
dataType: 'json',
type: 'POST',
data: {
start: obj.start,
end: obj.end,
sid: obj.sid,
uid: obj.uid,
aid: obj.aid,
csrf_test_name: csrf
},
success: function(json) {
alert('Got it marked!')
}
});
}
正如我所说的,麦盖提功能不及格的‘开始’和‘结束’这样的数据是很难一起工作的时间戳。我如何将时间转换为时间戳?
UPDATE:正在发送的文本版本如下:
Tue Mar 19 2013 09:30:00 GMT-0300 (Hora oficial do Brasil)
虽然我可以解析与PHP,生活就会如果我能与时间戳工作要简单得多。