Events not showing in order of time
My events aren't showing in order by time. The json file is correct (and in order). Is there a way to sort by time?

{ "date": "2016-08-22 8:00:00", "endtime": "", "title": "Mass ", "description": "Location: Church", "url": "" }, { "date": "2016-08-22 9:00:00", "endtime": "", "title": "Spanish Prayer Group in De Moor Room ", "description": "Location: De Moor Room", "url": "" }, { "date": "2016-08-22 10:00:00", "endtime": "", "title": "Small Church Communities (Krenz) in Room 2 - CMO ", "description": "Location: Room 2 - CMO", "url": "" }, { "date": "2016-08-22 10:00:00", "endtime": "", "title": "Women's Guild Meeting in Room 5 - CMO ", "description": "Location: Room 5 - CMO", "url": "" }, { "date": "2016-08-22 18:00:00", "endtime": "", "title": "Cub Scouts 355 Pack Meeting in Resource Room 1 & 2 ", "description": "Location: Verhoeven Room", "url": "" },
Solved the issue. The date string needed to be converted to a date object in order to be read correctly.
function sortJson(a, b){ var DateObj; if ( typeof a.date === 'string' ) { //convert to object DateObj = Date.parse(date); return a.DateObj> b.DateObj ? 1 : -1; } return a.date > b.date ? 1 : -1; }