uphy / obsidian-reminder

Reminder plugin for Obsidian
https://uphy.github.io/obsidian-reminder/
MIT License
433 stars 32 forks source link

[Feature]: Allow custom checkbox characters marked as "completed" #187

Open KrazyManJ opened 3 months ago

KrazyManJ commented 3 months ago

Goal or desired outcome of this feature

I am using custom checkbox character to determine task as "not-completed" (not completed and won't complete anymore) with character - instead of x between square brackets. Reminder does not take it as "completed", in other words, it still shows pop-up of completing that task, even if I don't want to.

I know that I could just make it ignore, but I've disabled this feature due to my strict ways to complete tasks (not just ignore them easily, move their time or just complete it)

Describe the feature

Expand Regular Expressions to carry other characters as well (all of them, or you will put them manually inside textbox as a string of characters that will be marked by reminder as completed).

Screenshots, mockups, or videos

Tasks in source mode:

image

Tasks in preview mode (made custom snippet for that non-completed task)

image

Popup still shows:

image

axb21 commented 3 weeks ago

+1 on this feature--I'd like to have it as well.

KrazyManJ commented 3 weeks ago

+1 on this feature--I'd like to have it as well.

This project seems as abandoned, because of ancient last release date. I've solved this by manually editing code, where task is considered as checked. This happens in file src/model/format/markdown.ts. Where you can change code of class Todo of function isChecked()...

https://github.com/uphy/obsidian-reminder/blob/e152649ea4502d0bc13e1297e4b020ba2d671e91/src/model/format/markdown.ts#L38-L40

...to this code:

isChecked() {
  return /[^\s]/.test(this.check);
}

I've changed it in file main.js of this plugin from community plugins, this code is on line 9320, but if you use any code editor, you can search for this line.

I'll leave this issue open, if in anytime author of this will return and fixes this.

axb21 commented 3 weeks ago

you can change code of class Todo of function isChecked()...

https://github.com/uphy/obsidian-reminder/blob/e152649ea4502d0bc13e1297e4b020ba2d671e91/src/model/format/markdown.ts#L38-L40

...to this code:

isChecked() {
  return /[^\s]/.test(this.check);
}

I've changed it in file main.js of this plugin from community plugins, this code is on line 9320, but if you use any code editor, you can search for this line.

Ah, thank you so much for this @KrazyManJ! It works like a charm.

If anyone needs a bit more guidance, you can make this change "live" by pathing to $YOUR_VAULT/.obsidian/plugins/obsidian-reminder-plugin, opening main.js in a text editor, and changing line 9321 from return this.check === "x"; to return /[^\s]/.test(this.check);. Then reload Obsidian.

KrazyManJ commented 3 weeks ago

I've changed it in file main.js of this plugin from community plugins, this code is on line 9320, but if you use any code editor, you can search for this line.

@axb21, this is basicaly what I've said, you've just explained it a much better way! Thank you.