alphapapa / org-ql

A searching tool for Org-mode, including custom query languages, commands, saved searches and agenda-like views, etc.
GNU General Public License v3.0
1.35k stars 104 forks source link

Timestamp predicates ignore timestamps with start and end times #358

Closed kamidon closed 11 months ago

kamidon commented 11 months ago

The timestamp predicates appear to ignore timestamps that contain both a start and end time. That is, they work for a timestamped item like:

* Meet Peter at the movies
<2006-11-01 Wed 19:15>

but not for a timestamped item like:

* Discussion on climate change
<2006-11-02 Thu 20:00-22:00>

These examples are taken from the org-mode manual timestamps page.

This appears to be because org-ql-regexp-part-ts-time does not allow for the optional end time to be specified. If I make the following binding before loading org-ql things mostly work as I would expect for timestamps with both start and end times:

 (setq org-ql-regexp-part-ts-time
       (rx " " (repeat 1 2 digit) ":" (repeat 2 digit)
           (optional "-" (repeat 1 2 digit) ":" (repeat 2 digit))))

This is sufficient for what I need right now. However, I suspect that the :to and :from arguments to these predicates might need to adjust their behavior slightly for timestamps with a duration like this so I am not submitting a "fix" for this problem that just updates the regular expression definition.

alphapapa commented 11 months ago

Hi,

Thanks for the well-written report. This appears to be the same issue covered in #237, so I'm closing this as a duplicate of that. I do intend to fix it, but I haven't had much time to work on this project recently. Thanks for your patience.