Correct the date filtering