While I have seen this question answered in several other posts, my case seems to be slightly different due to the data that I am receiving from Twitter.
Below is the logic I am using in order to sort the JavaScript Array object, however the problem seems to be that the logic isn't actually sorting the data due to the type of format the date is.
Sample format of the raw date from twitter: Mon Jan 18 17:24:46 +0000 2016
var UserArraySorted = UserArray.sort(function(a,b){
return new Date(a.createddate.substring(0,20)) - new Date(b.createddate.substring(0,20));
});
for(i=0;i < UserArraySorted.length;i++){//Perform some logic here}
Is there anyway to sort my array based on the createddate field I have specified in my code?