Another attempt at fixing date validation