org-ql icon indicating copy to clipboard operation
org-ql copied to clipboard

Support for `org-extend-today-until` in time-based and planning predicates

Open wedens opened this issue 5 years ago • 2 comments

Currently, today is time from 00:00 to 23:59, but I consider "today" to be finished when I go to sleep which happens at 1-2:00AM.

It'd be great to make today make use of org-extend-today-until or add it as another predicate.

Is there a workaround I can use until there is a solution in org-ql itself?

wedens avatar Jul 14 '20 04:07 wedens

That's a useful feature to many users, but supporting special features like that makes the code complicated, which is one of the reasons I started this project, to avoid such complexity and special cases.

Probably the more "idiomatic" way to do such a thing in this package would be to use the from/to arguments to the ts predicate appropriately. That is, generate the timestamps for the range you want, including any extension past midnight, and make a query sexp using them. You could write a function that returns such a sexp and use its value as an argument to org-ql functions, or in another query sexp.

alphapapa avatar Jul 17 '20 17:07 alphapapa

I've changed my mind about this. I still want to limit the number of such options added to org-ql, but this one in particular is very useful. If it were implemented, it would mean a query like (scheduled :to today) would work as intended with the value of org-extend-today-until, rather than the user having to change the query after midnight.

I'm not sure of the best way to support this feature yet, but I do want to (selfishly, because I find myself using the option now sometimes).

alphapapa avatar Apr 12 '24 08:04 alphapapa