-Added enddate sorting