format dates for validation
adjust validation logic