Last active
September 9, 2016 12:18
-
-
Save vishnukumarpv/59e495631c3b58a047097497c4f51e3b to your computer and use it in GitHub Desktop.
Full calendar get all events as JSON string for ajax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var allVideosInGrid = function(){return calenderID.fullCalendar('clientEvents') }; | |
console.log(allVideosInGrid());//[Object, Object, Object, Object, Object, Object] => JSONstring | |
var vidOBJ=allVideosInGrid(); | |
var json = JSON.stringify(vidOBJ.map(function(e) { | |
return { | |
videoId:e.videoId, | |
title: e.title, | |
start: e.start, | |
end: e.end, | |
videoLength:e.videoLength | |
}; | |
})); | |
console.log(json); /* | |
[{"videoId":"127","title":"Video 4","start":"2016-01-04T09:00:00","end":"2016-01-04T10:00:00","videoLength":"150"},{"videoId":"127","title":"Video 4","start":"2016-01-07T09:00:00","end":"2016-01-07T10:00:00","videoLength":"150"},{"videoId":"127","title":"Video 4","start":"2016-01-11T09:00:00.000Z","end":"2016-01-11T10:00:00.000Z","videoLength":"150"},{"videoId":"127","title":"Video 4","start":"2016-01-18T09:00:00.000Z","end":"2016-01-18T10:00:00.000Z","videoLength":"150"},{"videoId":"127","title":"Video 4","start":"2016-01-14T09:00:00.000Z","end":"2016-01-14T10:00:00.000Z","videoLength":"150"},{"videoId":"127","title":"Video 4","start":"2016-01-21T09:00:00.000Z","end":"2016-01-21T10:00:00.000Z","videoLength":"150"}] | |
*/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment