Compare endDate instead of startDate for sort