From 009e9b54552d726c12322391724e31cd5f57c08a Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 10 Mar 2024 12:16:21 +0100 Subject: [PATCH] fix(filters): correctly use date filters in gantt chart --- docs/content/doc/usage/filters.md | 2 ++ frontend/src/views/project/helpers/useGanttFilters.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/content/doc/usage/filters.md b/docs/content/doc/usage/filters.md index 81627da49..b7885efc9 100644 --- a/docs/content/doc/usage/filters.md +++ b/docs/content/doc/usage/filters.md @@ -33,6 +33,8 @@ The available fields for filtering include: You can date math to set relative dates. Click on the date value in a query to find out more. +All strings must be either single-word or enclosed in `"` or `'`. This extends to date values like `2024-03-11`. + ## Operators The available operators for filtering include: diff --git a/frontend/src/views/project/helpers/useGanttFilters.ts b/frontend/src/views/project/helpers/useGanttFilters.ts index b245a16f5..dfe8ccd8b 100644 --- a/frontend/src/views/project/helpers/useGanttFilters.ts +++ b/frontend/src/views/project/helpers/useGanttFilters.ts @@ -79,7 +79,7 @@ function ganttFiltersToApiParams(filters: GanttFilters): TaskFilterParams { return { sort_by: ['start_date', 'done', 'id'], order_by: ['asc', 'asc', 'desc'], - filter: 'start_date >= ' + isoToKebabDate(filters.dateFrom) + ' && start_date <= ' + isoToKebabDate(filters.dateTo), + filter: 'start_date >= "' + isoToKebabDate(filters.dateFrom) + '" && start_date <= "' + isoToKebabDate(filters.dateTo) + '"', filter_include_nulls: filters.showTasksWithoutDates, } }