mpcjanssen / simpletask-android

GNU General Public License v3.0
551 stars 128 forks source link

Question: how to search for tasks w/o due date #1220

Open Grydpype opened 1 year ago

Grydpype commented 1 year ago

Dear all,

sometimes I forget to enter a due date into my tasks, so I would like to be able to search for all tasks that do not have a due date. How would I do that? Entering "not due:" into the search field yields alls tasks containing the (sub)string "not".

Any suggestions?

Cheers, Oliver.

mpcjanssen commented 1 year ago

You can do this with a Lua filter. In the filter settings script tab add the following script (don't forget to enable it):

function onFilter(t,f,e)
    return f.due == nil
end 
Grydpype commented 1 year ago

OK, that's interesting; I expected something like "not due:" which is how Sleek does it. I have no experience with Lua yet, so that will be interesting. Are there perhaps some more LUA scripts that might be useful; is there perhaps something like a LUA forum where I could look?

Thanks for the feedback, Oliver.

Grydpype commented 1 year ago

Good morning, I implemented the script; works perfectly.

I moved the LUA-script section to the top in the sorting tab (so it looks like {LUA; due-date; priority; ...}) and hoped that the tasks found by the script would come on top, followed by the remaining tasks as specified by the sort order, but apparently the script is executed and the found tasks are displayed, but then the processing stops.

Is there a script that would get the tasks without a due date, display them first, and then continue with the remaining tasks?

(Or, as an alternative: could there be an option to automatically add today's date as default due date? That would also solve my issue ...)

Cheers, Oliver.