From 8ee7b1603d23297a6c183105f79b1290ce9828bf Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 21 Mar 2020 21:11:01 +0100 Subject: 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 --- src/Wallabag/CoreBundle/Entity/Entry.php | 2 +- src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 19045798..0e19a0c2 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -552,7 +552,7 @@ class Entry * * @return Entry */ - public function setCreatedAt(\DateTime $createdAt) + public function setCreatedAt(\DateTimeInterface $createdAt) { $this->createdAt = $createdAt; diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php index 365804dd..61ad99a8 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php @@ -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', -- cgit v1.2.3