Add tag if for showing task by specific conditions defined in scripts.
Draft example
First, you need to set path to directory where you will be store condition scripts.
For example Conditions in the root of vault.
You can write script tuesday.js to show task only on tuesdays.
// Conditions/tuesday.js
const date = new Date();
const dayOfWeek = date.toLocaleString("en-US", { weekday: "long" });
function showOnTuesday() {
if (dayOfWeek === "Tuesday") {
return true;
}
return false;
}
export default showOnTuesday
Remark: Your function must return boolean value.
And then you can use your condition:
- [ ] do a very important task #if/tuesday
And then if task is not done, it will appear in UI on every tuesday.
You can define different logic like show task on location, weather, time, device conditions etc.
It's all about your imagination and JavaScript API capabilities.
Impact
Impact for users
Pros:
Users can define their personal wanted conditions
Users don't need to wait on new functionality for task conditions
Cons:
Risk of using not verified scripts (How to avoid: write your own scripts or use verified ones)
Learning JavaScript for creating scripts (How to avoid: developers need to create list for verified scripts for common usage)
Impact for development
Pros:
Delegate part of work on plugin to users personal scripts
Decrease unnecessary code growing
Cons:
Increases risk of bugs because of new functionality (How to avoid: cover new functionality by tests)
What kind of feature do you want?
Add tag
if
for showing task by specific conditions defined in scripts.Draft example
First, you need to set path to directory where you will be store condition scripts. For example
Conditions
in the root of vault.You can write script
tuesday.js
to show task only on tuesdays.Remark: Your function must return boolean value.
And then you can use your condition:
And then if task is not done, it will appear in UI on every tuesday.
You can define different logic like show task on location, weather, time, device conditions etc. It's all about your imagination and JavaScript API capabilities.
Impact
Impact for users
Pros:
Cons:
Impact for development
Pros:
Cons:
Additional questions