trying to configure if statement to throw error if date picker is not set