Ken Mankoff <[email protected]> writes:
> I'd like to compute Org clock-tables for a time range, and rather than
> hard-coding :tstart 2025-01-01 :tend 2025-01-31, I'd like to specify these in
> the section PROPERTY drawer. This lets me access these in a {{{macro}}} and
> use them elsewhere on an invoice. Is this possible?
Not directly.
But you can, for example, create an src block that will generate the
clock table with appropriate parameters:
* test
:PROPERTIES:
:begin: 2025-01-01
:end: 2025-01-06
:END:
#+begin_src emacs-lisp :results value raw drawer
(format "#+BEGIN: clocktable :scope file :tstart \"%s\" :tend \"%s\"
,#+END:"
(org-entry-get nil "BEGIN")
(org-entry-get nil "END"))
#+end_src
#+RESULTS:
:results:
#+BEGIN: clocktable :scope file :tstart "2025-01-01" :tend "2025-01-06"
#+CAPTION: Clock summary at [2025-03-29 Sat 19:46]
| Headline | Time |
|--------------+-----------|
| *Total time* | *0h 0min* |
#+END:
:end:
--
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>