Skip to content
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

feat: add support for Dataview tasks #209

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

8bitbuddhist
Copy link

This PR adds support for tasks formatted using Dataview. It supports [due:: YYYY-MM-DD] and [time:: HH:mm] fields. It also supports daily note links (e.g. [due:: [[2024-12-13]]]).

@uphy
Copy link
Owner

uphy commented Dec 24, 2024

ref: #147

@uphy
Copy link
Owner

uphy commented Dec 24, 2024

- [ ] task1 [due:: [[2025-01-01]]] [time:: 07:51]

It seems that this task title contains unexpected characters ]].

image

Comment on lines 17 to 35
get dateTrigger() {
return this.get("date-trigger", "due:: ");
}

get dateFormat() {
return this.get("date-format", "YYYY-MM-DD");
}

get timeTrigger() {
return this.get("time-trigger", "time:: ");
}

get timeFormat() {
return this.get("time-format", "HH:mm");
}

get linkDateToDailyNote() {
return this.get("link-date-to-daily-note", false);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find these settings from Dataview plugin.
Are these settings correct?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are no such settings in Dataview plugin, I feel we need these settings in obsidian-reminder plugin.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

due is part of the shorthand syntax Dataview supports for tasks. I couldn't find a property built into Dataview specifically for tracking completion dates, but they use shorthand fields in their examples, so I think it's ok to include.

For time, there isn't a field like this in Dataview, but it's technically possible to track times using properties. I thought it would be better to include a time field as an option, but it might be better to wait until it's officially supported by the Tasks plugin first.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the explanation.

This code likely references my Kanban integration code. The original code retrieves the Kanban plugin's settings object and adjusts the reminder plugin's behavior to match the Kanban plugin.

However, this Dataview integration code references a setting that doesn't actually exist, so it always defaults and is meaningless.

image

As mentioned above, a new setting likely needs to be created for the obsidian-reminder plugin.

@uphy uphy added the enhancement New feature or request label Dec 24, 2024
@8bitbuddhist 8bitbuddhist marked this pull request as draft January 2, 2025 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants