I found thisthis code to group JSON data by any Key. Use it in your code to group the results by DayOfWeek
.
getListItems('MyMeetings','?select=Title,DayOfWeek',
function(items){
var daysOfWeek = groupBy(items, function(item){
return [item.DayOfWeek];
});
console.log(daysOfWeek);
},
function(error){
console.log(JSON.stringify(error));
}
);
function groupBy( array , f )
{
var groups = {};
array.forEach( function( o )
{
var group = JSON.stringify( f(o) );
groups[group] = groups[group] || [];
groups[group].push( o );
});
return Object.keys(groups).map( function( group )
{
return groups[group];
})
}