I am having problems with the following code in my form class.
date = DateField(u'Date', validators=[DataRequired(),
DateRange(max=date.today(), min=(date.today() - timedelta(days=7)))])
It is a flask app, using flask-wtf, wtf-components(for DateRange).
date is part of a form for time submission and I am trying to limit the time entry to the last seven days. When I submit the form, it doesn't validate and I get a message below the input saying "Date must be between 2016-09-24 and 2016-10-01."
It seems like the date is a few days behind todays date. I thought it may be a problem with the form creation being cached somehow? I then reloaded the web app and it the form submission worked. Anyone know what may be going on here?