Modify function return in Fullcalendar

Asked

Viewed 96 times

0

I’m trying to make a script go to my database and return the data through a function. Follows:

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 Calendar is here. Inserted into a Gist so it doesn’t get too long.

  • Could put the part of the fullcalendar?

  • @Guilhermenascimento edited the question, inserting all my code with scripts and there’s this other question here also that is related.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.