Handling cases where dates are not in the YYYYMMDD format