diff options
Diffstat (limited to 'app/Filter')
-rw-r--r-- | app/Filter/BaseFilter.php | 4 | ||||
-rw-r--r-- | app/Filter/TaskDueDateRangeFilter.php | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/app/Filter/BaseFilter.php b/app/Filter/BaseFilter.php index e029f4e1..2687d903 100644 --- a/app/Filter/BaseFilter.php +++ b/app/Filter/BaseFilter.php @@ -51,7 +51,7 @@ abstract class BaseFilter * * @access public * @param Table $query - * @return \Kanboard\Core\Filter\FilterInterface + * @return $this */ public function withQuery(Table $query) { @@ -64,7 +64,7 @@ abstract class BaseFilter * * @access public * @param string $value - * @return \Kanboard\Core\Filter\FilterInterface + * @return $this */ public function withValue($value) { diff --git a/app/Filter/TaskDueDateRangeFilter.php b/app/Filter/TaskDueDateRangeFilter.php index a6aefbe2..a4250f80 100644 --- a/app/Filter/TaskDueDateRangeFilter.php +++ b/app/Filter/TaskDueDateRangeFilter.php @@ -32,6 +32,11 @@ class TaskDueDateRangeFilter extends BaseFilter implements FilterInterface */ public function apply() { + $this->query->beginOr(); + $this->query->isNull(TaskModel::TABLE.'.date_started'); + $this->query->eq(TaskModel::TABLE.'.date_started', 0); + $this->query->closeOr(); + $this->query->gte(TaskModel::TABLE.'.date_due', is_numeric($this->value[0]) ? $this->value[0] : strtotime($this->value[0])); $this->query->lte(TaskModel::TABLE.'.date_due', is_numeric($this->value[1]) ? $this->value[1] : strtotime($this->value[1])); return $this; |