Fix date conversion for invalid dates