From 7fc38f667b3937c0760c1eee1a8cb0fda3135e3b Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 21 Mar 2020 00:43:01 +0100 Subject: misc: reindent EntryFilterType Signed-off-by: Kevin Decherf --- .../CoreBundle/Form/Type/EntryFilterType.php | 29 +++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php index 17070c59..365804dd 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php @@ -73,23 +73,22 @@ class EntryFilterType extends AbstractType 'label' => 'entry.filters.reading_time.label', ]) ->add('createdAt', DateRangeFilterType::class, [ - 'left_date_options' => [ - 'attr' => [ - 'placeholder' => 'dd/mm/yyyy', - ], - 'format' => 'dd/MM/yyyy', - 'widget' => 'single_text', + 'left_date_options' => [ + 'attr' => [ + 'placeholder' => 'dd/mm/yyyy', ], - 'right_date_options' => [ - 'attr' => [ - 'placeholder' => 'dd/mm/yyyy', - ], - 'format' => 'dd/MM/yyyy', - 'widget' => 'single_text', + 'format' => 'dd/MM/yyyy', + 'widget' => 'single_text', + ], + 'right_date_options' => [ + 'attr' => [ + 'placeholder' => 'dd/mm/yyyy', ], - 'label' => 'entry.filters.created_at.label', - ] - ) + 'format' => 'dd/MM/yyyy', + 'widget' => 'single_text', + ], + 'label' => 'entry.filters.created_at.label', + ]) ->add('domainName', TextFilterType::class, [ 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { $value = $values['value']; -- cgit v1.2.3 From ef81e3c89b00712476b0698e7c9057fc05a2e1c9 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 21 Mar 2020 21:09:57 +0100 Subject: tests: replace baggy theme used in EntryController tests Signed-off-by: Kevin Decherf --- .../CoreBundle/Resources/views/themes/material/Entry/entries.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig index 3906e1e0..540381b6 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig @@ -39,7 +39,7 @@
    {% for entry in entries %} -
  • +
  • {% if listMode == 1 %} {% include "@WallabagCore/themes/material/Entry/_card_list.html.twig" with {'entry': entry} only %} {% elseif not entry.previewPicture is null and entry.mimetype starts with 'image/' %} -- cgit v1.2.3 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') 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