Age restriction on teams?

My platform is a free online tool for sports clubs to administrate their organizations. I am currently struggling with some age restriction basics for teams and I would appreciate your input and help!

A user sets a minimum age to 18 on a team, but the club's rules state that a member can be 17 and join as long as he/she are 18 at a given date during the team's duration. E.g. I have a basket team for youngsters between 18 and 23. It runs from January to July. To join, the members have to be 18 by the end of June.

The issue is related to the creation part of the process. The issue I'm having is on the admins part. How to intuitively make a set of input boxes etc. for the admin to setup the age boundaries for his/her club. How would the creation setup look for this? Or would you approach this differently? A minimum and maximum age with the option of selecting when the minimum age restriction should be met? Something totally different?

I just want to explore some options and hear your opinions on the matter!

Thank you!