【发布时间】:2009-10-09 14:07:55
【问题描述】:
我正在使用 asp.net mvc 列出 jquery 完整日历中的事件。下面是我用来通过来自 mvc 的 json 列出事件的脚本。
$('#calendar').fullCalendar({
theme: true,
editable: true,
disableDragging: true,
disableResizing: true,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
events: function(start, end, callback) {
// do some asynchronous ajax
$.getJSON("/User/GetEvents/",
{
start: dateFormat(start.getTime()),
end: dateFormat(end.getTime())
},
function(result) {
// then, pass the CalEvent array to the callback
callback(result);
})
},
eventClick : function(event) {
editEventShow(event);
},
dayClick : function(dayDate){
addEventShow(dayDate, this);
}
});
但是上面的脚本没有在日历中显示任何事件。我在上面的脚本中做错了什么?
【问题讨论】:
-
能否也包含来自“/User/GetEvents/”的示例输出?
-
下面是来自 json 的响应:[{"id":1,"title":"Event from Controller","allDay":true,"date":"\/Date(-62135596800000 )\/","start":"\/Date(1255012357109)\/","end":"\/Date(1255185157109)\/","editable":true}]
-
当我使用 firebug 调试脚本时,它显示默认日期(Fri Jan 01 1255 00:00:00 GMT+0530(印度标准时间))。如何解析 json 结果中的日期?
标签: jquery asp.net-mvc json calendar fullcalendar