Fix createdAt date range filter

- hiddenName has been disabled in order to fix the missing date range
  values when using the material theme
- data format has been changed to 'Y-m-d' in order to comply with the
  browser date input default format
- tests: date() and strtotime have been replaced with DateTime-related
  objects

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
Kevin Decherf
2020-03-21 21:11:01 +01:00
parent ef81e3c89b
commit 8ee7b1603d
6 changed files with 28 additions and 16 deletions

View File

@ -552,7 +552,7 @@ class Entry
*
* @return Entry
*/
public function setCreatedAt(\DateTime $createdAt)
public function setCreatedAt(\DateTimeInterface $createdAt)
{
$this->createdAt = $createdAt;

View File

@ -75,16 +75,16 @@ class EntryFilterType extends AbstractType
->add('createdAt', DateRangeFilterType::class, [
'left_date_options' => [
'attr' => [
'placeholder' => 'dd/mm/yyyy',
'placeholder' => 'yyyy-mm-dd',
],
'format' => 'dd/MM/yyyy',
'format' => 'yyyy-MM-dd',
'widget' => 'single_text',
],
'right_date_options' => [
'attr' => [
'placeholder' => 'dd/mm/yyyy',
'placeholder' => 'yyyy-mm-dd',
],
'format' => 'dd/MM/yyyy',
'format' => 'yyyy-MM-dd',
'widget' => 'single_text',
],
'label' => 'entry.filters.created_at.label',