Handle invalid dates