In my flask app I have a WTForm with two date pickers for a 'start date' and an 'end date'. What is the best way to validate that the 'end date' is not earlier than the 'start date'?
from flask_wtf import FlaskForm
from wtforms.fields.html5 import DateField
from wtforms import SubmitField
class Form(FlaskForm):
startdate_field = DateField('Start Date', format='%Y-%m-%d')
enddate_field = DateField('End Date', format='%Y-%m-%d')
submit_field = SubmitField('Simulate')
The only thing I found on this topic was this validator:
wtforms_html5.DateRange
Found here: https://pypi.org/project/wtforms-html5/0.1.3/ but it seems to be an old version of wtforms-html5.