Check if the supplied date is valid