In case if the code above does not work, then try to change same code:
if ('datetime*' == $type && empty($value)) {
$result['valid'] = false;
$result['reason'][$name] = wpcf7_get_message('invalid_required');
}
if (! empty($value) && ! self::is_valid_date($value)) {
$result['valid'] = false;
$result['reason'][$name] = wpcf7_get_message('invalid_datetime');
}
to
if ('datetime*' == $type && empty($value)) {
$result->invalidate($tag,wpcf7_get_message('invalid_required'));
}
if (! empty($value) && ! self::is_valid_date($value)) {
$result->invalidate($tag,wpcf7_get_message('invalid_datetime'));
}
That’s obviously for new version of wpcf7