Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts-active not recognizing timestamps with time range #301

Closed
exot opened this issue Sep 7, 2022 · 3 comments
Closed

ts-active not recognizing timestamps with time range #301

exot opened this issue Sep 7, 2022 · 3 comments

Comments

@exot
Copy link

exot commented Sep 7, 2022

Hey,

I think in org-ql (version 20220825.2155 from melpa), the current regexps for timestamps do not cover the case when the timestamp contains a time range:

#+begin_src emacs-lisp :results value
(org-ql-query
  :select (org-entry-get (point) "ITEM")
  :from (current-buffer)
  :where '(ts-active :from "2022-09-07"))
#+end_src

#+RESULTS:
#+begin_src emacs-lisp
((headline
  (:raw-value "Test 2" :begin 589 :end 597 :pre-blank 0 :contents-begin 598 :contents-end 598 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 589 :title
              (#("Test 2" 0 6
                 (:parent #1))))))
#+end_src

* Test 1
<2022-09-07 Wed 14:00-15:00>

* Test 2
<2022-09-07 Wed 14:00>--<2022-09-07 Wed 15:00>

Updating org-ql-regexp-part-ts-time before loading org-ql seems to fix this:

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

Could you please include this fix if it's correct?

Thanks,

  Daniel

@alphapapa
Copy link
Owner

Hello,

Please see #237. Thanks.

@exot
Copy link
Author

exot commented Sep 10, 2022

Thanks for the pointer, I (obviously) missed that … and I thought I had looked for similar issues, but I even missed #300.

Sorry for the noise

  Daniel

@alphapapa
Copy link
Owner

No problem, I appreciate the report. Apparently I really need to do something about this problem. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants