WIP: Parse string into ts

Rather than using a Unix timestamp, which makes a different ts
depending on the system timezone, due to an issue in ts.el (which I
hope to fix soon).
This commit is contained in:
Adam Porter 2021-07-05 02:29:45 -05:00
parent 5924b37cb7
commit 3d6747f427

View file

@ -41,25 +41,11 @@
;;;; Functions
(let ((print-level nil)
(print-length nil))
(ert-deftest org-ql--normalize-query ()
(should (equal (org-ql--normalize-query '(or (ts-active :on "2019-01-01")
(ts-a :on "2019-01-01")
(ts-inactive :on "2019-01-01")
(ts-i :on "2019-01-01")))
`(or (ts :type active
:from ,(make-ts :unix 1546322400.0)
:to ,(make-ts :unix 1546408799.0))
(ts :type active
:from ,(make-ts :unix 1546322400.0)
:to ,(make-ts :unix 1546408799.0))
(ts :type inactive
:from ,(make-ts :unix 1546322400.0)
:to ,(make-ts :unix 1546408799.0))
(ts :type inactive
:from ,(make-ts :unix 1546322400.0)
:to ,(make-ts :unix 1546408799.0)))))))
(ert-deftest org-ql--normalize-query ()
(should (equal (org-ql--normalize-query '(ts-active :on "2019-01-01"))
`(ts :type active
:from ,(ts-apply :hour 0 :minute 0 :second 0 (ts-parse "2019-01-01"))
:to ,(ts-apply :hour 23 :minute 59 :second 59 (ts-parse "2019-01-01"))))))
;;;; Footer