我整合了jQuery插件FullCalendar,總的來說它非常簡單。然而,我遇到了將事件添加到日曆的問題。我正在使用ASP.NET MVC 1.0,並發現並遵循此post。jQuery FullCalendar JSON約會問題
我將JSON返回給FullCalendar並且事件越來越受限,但它們都顯示爲全天事件。我將日期格式化爲ISO8601格式,如其網站上所記錄的那樣。
日曆的Javascript
$('#calendar').fullCalendar({
events: "/Calendar/GetEvents/"
});
JsonResult
public JsonResult GetEvents(double start, double end)
{
var fromDate = Utility.Dates.ConvertFromUnixTimestamp(start);
var toDate = Utility.Dates.ConvertFromUnixTimestamp(end);
List<GenericEventList> events = GETGENERICLISTOFEVENTS();
return Json(events.ToArray());
}
JSON結果值
[{"id":2,"title":"Test Event","start":"2010-03-14T11:00:00","end":"2010-03-14T16:00:00"},
{"id":3,"title":"Test Event1asasas","start":"2010-03-14T10:00:00","end":"2010-03-14T14:00:00"},
{"id":4,"title":"Test Event12","start":"2010-03-14T16:00:00","end":"2010-03-14T17:00:00"},
{"id":6,"title":"Test Event1aaa","start":"2010-03-14T10:00:00","end":"2010-03-14T14:00:00"}]
任何HEL p是真正的讚賞!
我發現使用上面的博客鏈接和這個博客條目一起幫助讓我的日曆工作。 http://john0831.wordpress.com/2010/07/19/asp-net-mvc-jquery-and-fullcalendar/ – 2011-02-17 17:07:29