mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-23 09:31:04 +00:00
Fix wrong reading time when apply filters
This commit is contained in:
parent
f97653c895
commit
d8f8a59010
1 changed files with 10 additions and 0 deletions
|
@ -35,6 +35,16 @@ class EntryFilterType extends AbstractType
|
|||
{
|
||||
$builder
|
||||
->add('readingTime', NumberRangeFilterType::class, [
|
||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
||||
$value = $values['value'];
|
||||
|
||||
$min = (int) ($value['left_number'][0] * $this->user->getConfig()->getReadingSpeed());
|
||||
$max = (int) ($value['right_number'][0] * $this->user->getConfig()->getReadingSpeed());
|
||||
|
||||
$expression = $filterQuery->getExpr()->between($field, $min, $max);
|
||||
|
||||
return $filterQuery->createCondition($expression);
|
||||
},
|
||||
'label' => 'entry.filters.reading_time.label',
|
||||
])
|
||||
->add('createdAt', DateRangeFilterType::class, [
|
||||
|
|
Loading…
Reference in a new issue