Sort By Date
changed the comparator
sortByDate function