change the date comparison function