简体   繁体   中英

How to decorate a date range filter with a date picker in SONATA ADMIN

I want to have a date picker for one my 'date range' filters but instead i have a choice type for different part of my date when I'm using this code:

$datagridMapper->add('movementDate','doctrine_orm_date_range')

and I had this result:

Sonata 中的默认日期范围过滤器

So how can I make it display a date picker?

$datagridMapper->add('movementDate','doctrine_orm_date_range',[
                'field_type'=>'sonata_type_date_range_picker',
                'field_options' => [
                    'field_options' => [
                        'format' => 'yyyy-MM-dd'
                    ]
                ]
            ])
    $datagridMapper->add('movementDate', DateRangeFilter::class,[
                'field_type'=> DateRangePickerType::class,
                'field_options' => [
                    'field_options' => [
                        'format' => 'dd.MM.yyyy'
                    ]
                ]
            ])

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM