From e273d848f4b0a9ef51bcab5dc9bddefe4c4af200 Mon Sep 17 00:00:00 2001 From: imfu Date: Tue, 22 Dec 2020 19:39:14 +0800 Subject: [PATCH] fix: can not set todo when week mode --- src/component/v2/plugins/todo.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/component/v2/plugins/todo.js b/src/component/v2/plugins/todo.js index c278575..c7f8187 100644 --- a/src/component/v2/plugins/todo.js +++ b/src/component/v2/plugins/todo.js @@ -33,7 +33,10 @@ function filterTodos({ curYear, curMonth, exsitedTodos, toSetTodos }) { function updateDatePropertyOfTodoLabel(todos, dates, showLabelAlways) { const datesInfo = [...dates] for (let todo of todos) { - let target = datesInfo[todo.date - 1] + let targetIdx = datesInfo.findIndex( + item => dateUtil.toTimeStr(item) === dateUtil.toTimeStr(todo) + ) + let target = datesInfo[targetIdx] if (!target) continue if (showLabelAlways) { target.showTodoLabel = true