diff --git a/frontend/src/services/taskCollection.ts b/frontend/src/services/taskCollection.ts index 2cc39773f..f83dac2e2 100644 --- a/frontend/src/services/taskCollection.ts +++ b/frontend/src/services/taskCollection.ts @@ -4,7 +4,7 @@ import TaskModel from '@/models/task' import type {ITask} from '@/modelTypes/ITask' export interface TaskFilterParams { - sort_by: ('start_date' | 'done' | 'id' | 'position' | 'kanban_position')[], + sort_by: ('start_date' | 'end_date' | 'due_date' | 'done' | 'id' | 'position' | 'kanban_position')[], order_by: ('asc' | 'desc')[], filter: string, filter_include_nulls: boolean, diff --git a/frontend/src/views/tasks/ShowTasks.vue b/frontend/src/views/tasks/ShowTasks.vue index f947696db..0a5318051 100644 --- a/frontend/src/views/tasks/ShowTasks.vue +++ b/frontend/src/views/tasks/ShowTasks.vue @@ -173,7 +173,7 @@ function setShowNulls(show: boolean) { }) } -async function loadPendingTasks(from: string, to: string) { +async function loadPendingTasks(from: Date|string, to: Date|string) { // FIXME: HACK! This should never happen. // Since this route is authentication only, users would get an error message if they access the page unauthenticated. // Since this component is mounted as the home page before unauthenticated users get redirected @@ -187,16 +187,18 @@ async function loadPendingTasks(from: string, to: string) { order_by: ['asc', 'desc'], filter: 'done = false', filter_include_nulls: showNulls, + s: '', } if (!showAll.value) { - params.filter += ` && due_date < '${to}'` + + params.filter += ` && due_date < '${to instanceof Date ? to.toISOString() : to}'` // NOTE: Ideally we could also show tasks with a start or end date in the specified range, but the api // is not capable (yet) of combining multiple filters with 'and' and 'or'. if (!showOverdue) { - params.filter += ` && due_date > '${from}'` + params.filter += ` && due_date > '${from instanceof Date ? from.toISOString() : from}'` } }