Hi, I'm working with the framwork symfony3 and I'm having problems with a date type field that I use datepicker for when I select the date in the calendar, what I get is a string and I really need it to be date type and because of this It gives me an error that the field is not valid. I use the bootstrap-material-datetimepicker and moment libraries for the calendar Form
- ->add('fechainicio', 'Symfony\Component\Form\Extension\Core\Type\DateType', array(
'format'=>'yyyy-MM-dd',
'widget'=>'single_text'))
Twig template view
<div class="col-lg-4 col-md-3 col-sm-3 col-xs-6">
<div class="form-group form-float">
<div class="form-line " >
{{ form_widget(form.fechainicio,{'attr':{'class': 'datepicker form-control','placeholder':'Fecha Inicio del Proyecto'}})}}
{{ form_errors(form.fechainicio) }}
</div>
</div>
</div>