1
0

fix(task): set done at date when moving a task to the done bucket

Resolves https://github.com/go-vikunja/vikunja/issues/320

(cherry picked from commit bf56311faa55146cac05dbf1ee7e02e542d22a90)
This commit is contained in:
kolaente 2024-08-28 14:18:46 +02:00
parent 499f3f000c
commit c85da01294
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B

View File

@ -17,6 +17,8 @@
package models
import (
"time"
"code.vikunja.io/api/pkg/events"
"code.vikunja.io/api/pkg/user"
"code.vikunja.io/web"
@ -149,12 +151,18 @@ func (b *TaskBucket) Update(s *xorm.Session, a web.Auth) (err error) {
}
if doneChanged {
if task.Done {
task.DoneAt = time.Now()
} else {
task.DoneAt = time.Time{}
}
_, err = s.Where("id = ?", task.ID).
Cols(
"done",
"due_date",
"start_date",
"end_date",
"done_at",
).
Update(task)
if err != nil {