title: Fullcalendar - can't get events to show asp.net
body: <p>I'm trying to implement fullcalender but I can't get the exemple data to show. I have been following <a href="https://www.codeproject.com/Articles/874283/Event-Calendar-in-ASP-NET-MVC-and-Entity-Framework" rel="nofollow noreferrer">this guide</a>.</p>
  
  <p>I get no errors but the events doesn't show in the calendar. I have tried different solutions but I can't get it to work, also my experience with json is very limited and i would appreciate some help.</p>
  
  <pre><code>    public class CalendarController : BaseController
      {
  
      public ActionResult ShowCalendar()
      {
          return View();
      }
  
      public ActionResult GetMeetings(double start, double end)
      {
          using (var db = new ApplicationDbContext())
          {
              var fromDate = ConvertFromUnixTimestamp(start);
              var toDate = ConvertFromUnixTimestamp(end);
  
              var eventList = GetEvents();
  
              var rows = eventList.ToArray();
              return Json(rows, JsonRequestBehavior.AllowGet);
          }
      }
  
      private static DateTime ConvertFromUnixTimestamp(double timestamp)
      {
          var origin = new DateTime(1970, 1, 1, 0, 0, 0, 0);
          return origin.AddSeconds(timestamp);
      }
              private List&lt;Events&gt; GetEvents()
      {
          List&lt;Events&gt; eventList = new List&lt;Events&gt;();
  
          Events newEvent = new Events
          {
              id = "1",
              title = "Event 1",
              start = DateTime.Now.AddDays(1).ToString("s"),
              end = DateTime.Now.AddDays(1).ToString("s"),
              allDay = false
          };
  
          eventList.Add(newEvent);
  
          newEvent = new Events
          {
              id = "1",
              title = "Event 3",
              start = DateTime.Now.AddDays(2).ToString("s"),
              end = DateTime.Now.AddDays(3).ToString("s"),
              allDay = false
          };
  
          eventList.Add(newEvent);
  
          return eventList;
      }
  </code></pre>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;head&gt;
  
      @section scripts{
          &lt;link rel='stylesheet' href='fullcalendar/fullcalendar.css' /&gt;
          &lt;script src='lib/jquery.min.js'&gt;&lt;/script&gt;
          &lt;script src='lib/moment.min.js'&gt;&lt;/script&gt;
          &lt;script src='fullcalendar/fullcalendar.js'&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
  
              $(document).ready(function () {
                  $('#calendar').fullCalendar({
                      theme: true,
                      header: {
                          left: 'prev, next, today',
                          center: 'title',
                          right: 'month, agendaWeek, agendaDay'
                      },
                      buttonText: {
                          prev: '&lt;',
                          next: '&gt;'
                      },
                      defaultView: 'month',
                      editable: false,
                      weekMode: 'liquid',
                      //allDaySlot: false,
                      selectTable: true,
                      //slotMinutes: 15,
                      events: function (start, end, timezone, callback) {
                          $.ajax({
                              url: "/calendar/getmeetings/",
                              type: 'GET',
                              dataType: 'json',
                              success: function (start, end, timezone, callback) {
                                  alert('success');
                              },
                              error: function (start, end, timezone, callback) {
                                  alert('there was an error while fetching events!');
                              },
                              data: {
                                  // our hypothetical feed requires UNIX timestamps
                                  start: start.unix(),
                                  end: end.unix()
                              }
  
                          });
                      }
                  });
              });
  
          &lt;/script&gt;
      }
  &lt;/head&gt;
  &lt;br /&gt;
  &lt;div class="jumbotron"&gt;
      &lt;h1&gt;Event Calendar&lt;/h1&gt;
      &lt;div id="calendar"&gt;&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>