Sonata Admin Bundle: DatePicker range

前端 未结 5 1986
长情又很酷
长情又很酷 2020-12-08 15:05

How would I create a doctrine_orm_datetime_range filter in the Sonata Admin Bundle which uses the jQuery UI datepicker?

I tried the following, but it do

5条回答
  •  青春惊慌失措
    2020-12-08 15:23

    I know that it's old topic, but it helps me a bit anyway, so maybe it will help somebody in the future.

    I've find a way to set up a date format for datepicker:

    $datagridMapper->add('createdAt', 'doctrine_orm_date_range', [
        'field_type'=>'sonata_type_date_range_picker',
        'field_options' => [
            'field_options' => [
                'format' => 'yyyy-MM-dd'
            ]
        ]
    ]);
    

    On default that format parametr is set up in Sonata\CoreBundle\Form\Type\DatePickerType.

提交回复
热议问题