Validating a Date Format with a Datepicker Field

What distinguishes a rubbish date from a legitimate date? If you can articulate that, put it into code.

For example, if it’s that the date can’t be before the current date, you can check that. If it’s that the date can’t be more than 20 years into the future, you can check that. If it’s that the date can never be April 1st, you can check that.

There are tons of examples online about doing date and datetime comparisons in Python that can handle both of those checks and more.

All these checks are done when you’re pulling the date out of the date picker. The date picker itself just makes sure that what the user entered is in valid date format.