What I’m trying to do
Using the Tasks plugin, create a filter which shows all unfinished tasks due in the “next N days”, where N is currently 90, but I will need over values of N for other filters.
Things I have tried
None of the built-in filters offer a way to express “now plus N days”, so I’m trying to write a custom function.
description regex matches /#todo(?!\S)/
not done
# 86400 seconds == 24 hours
# echo "$( date +%s ) + 86400 * 90" | bc => 1781626874
filter by function \
const limit = 1781626874 ; \
return ( task.due.format('X') <= limit ) ;
This seems to work, in that it shows all tasks whose due date is before that specific timestamp, however I have to manually update the limit value every day.
Is there a way to calculate “now plus N days”, at the time the query is executed?
As a side note … I am a programmer by trade, but I’m not a javascript programmer.