mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-23 04:35:02 +08:00
feat(tasks): highlight overdue tasks
This commit is contained in:
parent
64647df043
commit
e7601f65bb
@ -69,6 +69,10 @@ const TPL = `
|
|||||||
margin-top: 0.1rem;
|
margin-top: 0.1rem;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.note-detail-task-list .task-container li.overdue .due-date {
|
||||||
|
color: #fd8282;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
@ -76,8 +80,15 @@ const TPL = `
|
|||||||
function buildTasks(tasks: FTask[]) {
|
function buildTasks(tasks: FTask[]) {
|
||||||
let html = '';
|
let html = '';
|
||||||
|
|
||||||
|
const now = dayjs();
|
||||||
for (const task of tasks) {
|
for (const task of tasks) {
|
||||||
html += `<li class="task" data-task-id="${task.taskId}">`;
|
const classes = ["task"];
|
||||||
|
|
||||||
|
if (task.dueDate && dayjs(task.dueDate).isBefore(now, "days")) {
|
||||||
|
classes.push("overdue");
|
||||||
|
}
|
||||||
|
|
||||||
|
html += `<li class="${classes.join(" ")}" data-task-id="${task.taskId}">`;
|
||||||
html += `<input type="checkbox" class="check" ${task.isDone ? "checked" : ""} />`;
|
html += `<input type="checkbox" class="check" ${task.isDone ? "checked" : ""} />`;
|
||||||
html += task.title;
|
html += task.title;
|
||||||
if (task.dueDate) {
|
if (task.dueDate) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user