public ActionResult GetEvents() { var events = GoogleCalendarSyncer.GetEvents(this); //return Json(events, JsonRequestBehavior.AllowGet); return(View(events)); }
public JsonResult GetNextEvent() { var events = GoogleCalendarSyncer.GetEvents(this); var nextEvent = events.Where(x => x.Start.DateTime.HasValue) .Select(x => new { start = x.Start.DateTimeRaw, title = x.Summary }) .OrderBy(x => x.start).FirstOrDefault(); return(Json(nextEvent, JsonRequestBehavior.AllowGet)); }