Answer the question
In order to leave comments, you need to log in
How to properly set up range date filter in SonataAdminBundle?
Who is familiar with SonataAdminBundle do not pass by)
There is a filter in the Admin class
protected function configureDatagridFilters(DatagridMapper $datagridMapper)
{
$datagridMapper
->add('createdAt', 'doctrine_orm_date_range', array('field_type'=>'sonata_type_date_range_picker',))
;
}
Answer the question
In order to leave comments, you need to log in
This is due to the fact that sonata intl is connected.
We need to make the same format for picker and backend.
->add(
'createdAt',
'doctrine_orm_date_range',
[],
'sonata_type_date_range_picker',
[
'field_options_start' => [
'format' => 'dd.MM.yyyy'
],
'field_options_end' => [
'format' => 'dd.MM.yyyy'
]
]
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question