Now using moment's isBefore() function to do the date comparison in sorting