Skip to content

Instantly share code, notes, and snippets.

@couchoud
Created September 14, 2010 18:08
Show Gist options
  • Save couchoud/579489 to your computer and use it in GitHub Desktop.
Save couchoud/579489 to your computer and use it in GitHub Desktop.
function recordingsByDate(recording_list) {
// collapse data into a dictionary of Array's
var dict = {},
date = null;
$(recording_list).each(function(i, val){
date = this.YOUR_DATE_NORMALIZATION_FUNCTION(); // returns something like 'May 1, 2002'
if(!dict[date]){
dict[date] = [];
}
dict[date].push(this);
});
return dict;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment