diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-11-08 14:50:02 -0800 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-11-08 14:50:02 -0800 |
commit | cafbd1f5a7e60d931e4dbd700b12e5f50319340d (patch) | |
tree | 10379ec3d0ced6dbdc1da2b78071added257f101 /app/Filter | |
parent | 5e98a66aeb108b84ca4f2ae824c0a191fbd514cd (diff) |
Improve iCalendar feed to include tasks with start/end date and due date with a time
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; |