Welcome to the ODK forum, @mahrukh! We're glad you're here. When you get a chance, please introduce yourself on this other forum thread. I'd also encourage you to add a real picture as your avatar because it helps build community!
What have you tried so far? This should certainly be possible.
Constraints are described in the documentation: https://docs.opendatakit.org/form-logic/#validating-and-restricting-responses
And there are a number of forum threads discussing constraints involving dates:
https://forum.getodk.org/search?q=date%20constraint