Modify function return in FullCalendar

0

I'm trying to make a script that goes to my database and returns the data through a function. Following:

events: function(start, end, timezone) {
  // var convert = 
  moment(start).tz("America/Cuiaba").format("YYYY-MM-DD HH:mm");
  $.ajax({
    url: "/Home/Eventos",
    dataType: "json",
    data: {
      start: start.unix(),
      end: end.unix()
    },
    success: function(doc) {
      var events = [];
      $(doc).find('event').each(function() {
        var start = moment(doc.start).tz("America/Cuiaba").format("HH:mm");
        var end = moment(doc.end).tz("America/Cuiaba").format("HH:mm");
        events.push({
          title: $(this).attr('title'),
          start: start,
          end: end // will be parsed
        });;
      });
    }
  });
},

The complete script with the calendar is here . I inserted a Gist to not get too long.

    
asked by anonymous 22.05.2017 / 22:39

0 answers