add validation to datetime fields