Skip to content

Date field type format option changes input type to 'text' #8726

Closed
@tiriana

Description

@tiriana

When i do:

    $builder->add('submittedAt_min',
                    'date',
                    array('widget' => 'single_text', 'label' => 'my label', 'attr' => array('placeholder' => 'my placeholder')));

i get:

    <input type="date" placeholder="my placeholder" required="required" name="es_app_filter[submittedAt_min]" id="es_app_filter_submittedAt_min" class="hasDatepicker">

The type is "date"

But when I add format option to field:

    $builder->add('submittedAt_min',
                    'date',
                    array('format' => 'dd-MM-yyyy', 'widget' => 'single_text', 'label' => 'my label', 'attr' => array('placeholder' => 'my placeholder')));

I get:

      <input type="text" placeholder="my placeholder" required="required" name="es_app_filter[submittedAt_min]" id="es_app_filter_submittedAt_min">

the input type is now 'text'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions