Properly implemented a comparator for LocalDate objects.