From 3f2056bbf930050ed2d0fc96c40c9dc0df17ea82 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 28 Nov 2020 15:52:15 +0100 Subject: [PATCH] Show done at in task detail view --- src/models/task.js | 2 ++ src/services/task.js | 1 + src/views/tasks/TaskDetailView.vue | 10 ++++++++++ 3 files changed, 13 insertions(+) diff --git a/src/models/task.js b/src/models/task.js index 9f036937..0b1c8e42 100644 --- a/src/models/task.js +++ b/src/models/task.js @@ -69,6 +69,7 @@ export default class TaskModel extends AbstractModel { this.created = new Date(this.created) this.updated = new Date(this.updated) + this.doneAt = this.doneAt ? new Date(this.doneAt) : null } defaults() { @@ -77,6 +78,7 @@ export default class TaskModel extends AbstractModel { title: '', description: '', done: false, + doneAt: null, priority: 0, labels: [], assignees: [], diff --git a/src/services/task.js b/src/services/task.js index 99feb4d5..108861ae 100644 --- a/src/services/task.js +++ b/src/services/task.js @@ -39,6 +39,7 @@ export default class TaskService extends AbstractService { model.endDate = !model.endDate ? null : formatISO(new Date(model.endDate)) model.created = formatISO(new Date(model.created)) model.updated = formatISO(new Date(model.updated)) + model.doneAt = formatISO(new Date(model.doneAt)) // remove all nulls, these would create empty reminders for (const index in model.reminderDates) { diff --git a/src/views/tasks/TaskDetailView.vue b/src/views/tasks/TaskDetailView.vue index ece1681a..2e0826ba 100644 --- a/src/views/tasks/TaskDetailView.vue +++ b/src/views/tasks/TaskDetailView.vue @@ -317,6 +317,10 @@ Updated {{ updatedSince }} +

@@ -462,6 +466,12 @@ export default { updatedFormatted() { return this.formatDate(this.task.updated) }, + doneSince() { + return this.formatDateSince(this.task.doneAt) + }, + doneFormatted() { + return this.formatDate(this.task.doneAt) + }, }, methods: { loadTask() {