Donmclean
4/1/2016 - 8:04 PM

Sort by date and alphabetically

Sort by date and alphabetically

yourArray.sort(function(a, b) {
    var adate = /* ...parse the date in a.date... */new Date(),
        bdate = /* ...parse the date in b.date... */new Date(),
        rv = adate - bdate;
    if (rv === 0) {
        rv = a.title.localeCompare(b.title);
    }
    return rv;
});