-
-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set completion when modifying tasks #448
Comments
@blacksmithgu It looks like obsidian-dataview/src/ui/tasks.ts Line 127 in b9ce0e1
|
It does mark it a completed; it just doesn't add the completion date. |
Got it! I was uncertain about the base implementation, I wonder if I've found a bug I can reproduce. Will keep exploring. |
Adding the Completion date to each Task will be nice. Will this happen in the near future? Thank you very much. |
@kngautham potentially! I have some time off coming soon, and this is partially implemented in a branch. @blacksmithgu Any thoughts or guidance on an API like |
We can implement mutating calls (and tasks are easier than for general inline fields), though we need to be a little careful - they don't fit very well into "repeatedly refreshing DataviewJS views". We'd need to add support for adding buttons or something to gate them behind, or also potentially implement one-off script execution. |
Totally - I was expecting this to be additive to the existing checking-the-box behavior. Do you have a way to identify the location of annotations within text already? |
Thank you very much, I will wait |
Yes, the inline field code tracks the position of all task annotations, so it should be as simple as a text replace. |
Sets/removes completion inline annotation on tasks when being checked Adds support for tasks in *-based lists
Sets/removes completion inline annotation on tasks when being checked Adds support for tasks in *-based lists
Cool! I came here to file this exact feature-request and it appears to have been already done. Question: in settings, can a user specify keyword for Thanks for a great plugin! |
I also use the key done rather than completed, so this is configurable. It'll be included in the next release of dataview, I believe. |
Implemented and merged to master thanks to @sheeley! |
Can someone give me an example of how I can use the completion date in dataviewjs? I would like to List all completed tasks of the day. |
This is my daily view, I use let curr = dv.current()
let today = curr.file.day.toISODate()
// TODAY'S TASKS ==============================
let tasks = dv.pages().where(p => {
return !p.ignoreTasks &&
p.file != curr.file
})
.file.tasks
.where(t => {
if (t.due && today == t.due.toISODate()) {
return true
}
if (t.done && today == t.done.toISODate()) {
return true
}
})
.sort(t => t.completed, 'asc')
if (tasks.length) {
dv.header(2, "Tasks")
dv.taskList(tasks, false)
}
// CREATED/UPDATED TODAY
let todayPages = dv.pages().where(p => {
return p.file.name != curr.file.name &&
(p.file.ctime.toISODate() == today || p.file.mtime.toISODate() == today)
})
.sort(p => p.file.mtime, 'desc').file.link
if (todayPages.length > 0) {
dv.header(2, "Today's Notes")
dv.list(todayPages)
}
// CURRENT GOALS ==============================
let goals = dv.page("Current Goals").file.tasks
.sort(t => t.completed, 'asc')
if (goals.length) {
dv.header(2, "[[Current Goals]]")
dv.taskList(goals, false)
} |
When clicking a task's checkbox to complete it, mark it as completed and add a completion date.
The opposite should happen when marking a task as not done.
The text was updated successfully, but these errors were encountered: