From e7601f65bbb54fec8e4b4056c1d03405fdb33785 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 25 Feb 2025 19:55:10 +0200 Subject: [PATCH] feat(tasks): highlight overdue tasks --- src/public/app/widgets/type_widgets/task_list.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/public/app/widgets/type_widgets/task_list.ts b/src/public/app/widgets/type_widgets/task_list.ts index 42e754c8e..4344d1f39 100644 --- a/src/public/app/widgets/type_widgets/task_list.ts +++ b/src/public/app/widgets/type_widgets/task_list.ts @@ -69,6 +69,10 @@ const TPL = ` margin-top: 0.1rem; vertical-align: middle; } + + .note-detail-task-list .task-container li.overdue .due-date { + color: #fd8282; + } `; @@ -76,8 +80,15 @@ const TPL = ` function buildTasks(tasks: FTask[]) { let html = ''; + const now = dayjs(); for (const task of tasks) { - html += `
  • `; + const classes = ["task"]; + + if (task.dueDate && dayjs(task.dueDate).isBefore(now, "days")) { + classes.push("overdue"); + } + + html += `
  • `; html += ``; html += task.title; if (task.dueDate) {