ensure that only proper dates are accepted