diff options
-rw-r--r-- | src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php index dcdb3ab7..5c2216cf 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php | |||
@@ -35,6 +35,16 @@ class EntryFilterType extends AbstractType | |||
35 | { | 35 | { |
36 | $builder | 36 | $builder |
37 | ->add('readingTime', NumberRangeFilterType::class, [ | 37 | ->add('readingTime', NumberRangeFilterType::class, [ |
38 | 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { | ||
39 | $value = $values['value']; | ||
40 | |||
41 | $min = (int) ($value['left_number'][0] * $this->user->getConfig()->getReadingSpeed()); | ||
42 | $max = (int) ($value['right_number'][0] * $this->user->getConfig()->getReadingSpeed()); | ||
43 | |||
44 | $expression = $filterQuery->getExpr()->between($field, $min, $max); | ||
45 | |||
46 | return $filterQuery->createCondition($expression); | ||
47 | }, | ||
38 | 'label' => 'entry.filters.reading_time.label', | 48 | 'label' => 'entry.filters.reading_time.label', |
39 | ]) | 49 | ]) |
40 | ->add('createdAt', DateRangeFilterType::class, [ | 50 | ->add('createdAt', DateRangeFilterType::class, [ |