Skip to content

Instantly share code, notes, and snippets.

@ckahle33
Created August 12, 2014 02:07
Show Gist options
  • Select an option

  • Save ckahle33/d644d69acf89953bb77d to your computer and use it in GitHub Desktop.

Select an option

Save ckahle33/d644d69acf89953bb77d to your computer and use it in GitHub Desktop.
success: function( json ) {
window.sessions = json;
for (var i = 0; i < window.sessions.objects.length; i++) {
window.events = [];
window.events.push({
start: window.sessions.objects[i].startDateTime,
end: window.sessions.objects[i].endDateTime,
});
console.log(window.events);
}
},
error: function( xhr, status, errorThrown ) {
mlg_ajax_error_thrown( xhr, status, errorThrown );
return false;
},
// code to run regardless of success or failure
complete: function( xhr, status ) {
}
});
if ($(window).width() >= 768) {
$('#calendar').fullCalendar({
defaultView: 'basicWeek',
// aspectRatio: 5,
height: 600,
columnFormat: {
week: 'ddd'
},
header: {
center: 'title',
right: 'next',
left: 'prev'
},
events: [
window.events
]
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment