refactored date constraint so that it ignores white space value for isValid test if is_optional is true