feat(filters): allow filtering by created and updated task fields

Resolves https://kolaente.dev/vikunja/vikunja/issues/2768
This commit is contained in:
kolaente
2024-10-18 15:15:19 +02:00
parent a9f1a3a8c5
commit 29b9001078
4 changed files with 8 additions and 2 deletions

View File

@@ -31,6 +31,8 @@ const showDocs = ref(false)
<li><code>labels</code>: {{ $t('filters.query.help.fields.labels') }}</li>
<li><code>project</code>: {{ $t('filters.query.help.fields.project') }}</li>
<li><code>reminders</code>: {{ $t('filters.query.help.fields.reminders') }}</li>
<li><code>created</code>: {{ $t('filters.query.help.fields.created') }}</li>
<li><code>updated</code>: {{ $t('filters.query.help.fields.updated') }}</li>
</ul>
<p>{{ $t('filters.query.help.canUseDatemath') }}</p>
<p>{{ $t('filters.query.help.operators.intro') }}</p>

View File

@@ -6,6 +6,8 @@ export const DATE_FIELDS = [
'endDate',
'doneAt',
'reminders',
'created',
'updated',
]
export const ASSIGNEE_FIELDS = [

View File

@@ -459,7 +459,9 @@
"assignees": "The assignees of the task",
"labels": "The labels associated with the task",
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query"
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
"created": "The time and date when the task was created",
"updated": "The time and date when the task was last changed"
},
"operators": {
"intro": "The available operators for filtering include:",

View File

@@ -212,7 +212,7 @@ func (t *Task) ReadAll(_ *xorm.Session, _ web.Auth, _ string, _ int, _ int) (res
}
func getFilterCond(f *taskFilter, includeNulls bool) (cond builder.Cond, err error) {
field := "`" + f.field + "`"
field := "tasks.`" + f.field + "`"
if f.field == taskPropertyBucketID {
field = "task_buckets.`bucket_id`"
}