WIP
This commit is contained in:
parent
353237e726
commit
dd287beca0
1 changed files with 22 additions and 9 deletions
17
org-ql.el
17
org-ql.el
|
|
@ -1679,13 +1679,26 @@ If ON, return non-nil if entry has a timestamp on date ON.
|
|||
|
||||
FROM, TO, and ON should be either `ts' structs, or strings
|
||||
parseable by `parse-time-string' which may omit the time value."
|
||||
:normalizers ((`(,predicate-names ,(and num-days (pred numberp)))
|
||||
:normalizers
|
||||
((`(,predicate-names ,(and num-days (pred numberp)))
|
||||
;; (clocked) and (closed) implicitly look into the past.
|
||||
(let ((from (->> (ts-now)
|
||||
(ts-adjust 'day (* -1 num-days))
|
||||
(ts-apply :hour 0 :minute 0 :second 0))))
|
||||
`(closed :from ,from))))
|
||||
:preambles ((`(,predicate-names . ,_)
|
||||
:preambles
|
||||
((`(,predicate-names . ,(and rest (guard (or (plist-get rest :from)
|
||||
(plist-get rest :to)
|
||||
(plist-get rest :on)))))
|
||||
;; Use date-optimized timestamp regexp.
|
||||
(-let (((&plist :from :to :on :type) rest))
|
||||
(org-ql--from-to-on)
|
||||
(list :regexp (-let* ((from (or from (ts-adjust 'day (- org-ql-ts-days-from-default) (ts-now))))
|
||||
(to (or to (ts-adjust 'day org-ql-ts-days-to-default (ts-now))))
|
||||
(ts-regexp (org-ql--ts-range-to-regexp from to :type 'inactive)))
|
||||
(rx-to-string `(seq bow (0+ blank) "CLOSED:" (1+ blank) (regexp ,ts-regexp))))
|
||||
:query query)))
|
||||
(`(,predicate-names . ,_)
|
||||
;; Predicate still needs testing.
|
||||
(list :regexp org-closed-time-regexp :query query)))
|
||||
:body
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue