class Form(Form):
plan_start = DateField('Plan Start', validators=[Required()])
this code will render this html.
<input id="plan_start" name="plan_start" type="text" value="">
My question is: why the type is text
and not date
?
I only can get this resolved by passing explicitly the type='date'
in template.
{% raw form.plan_start.label %}{% raw form.plan_start(type='date') %}
You can use the DateField from html5.
from wtforms.fields.html5 import DateField
class Form(Form):
plan_start = DateField('Plan Start', validators=[Required()])