diff --git a/README.org b/README.org index 32d6662..92d5cb5 100644 --- a/README.org +++ b/README.org @@ -544,7 +544,8 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.7.2-pre -Nothing new yet. +*Fixes* ++ Timestamp predicates are more tolerant of partial input (e.g. preventing errors while the user is typing a query into ~org-ql-find~). ** 0.7.1 diff --git a/org-ql.el b/org-ql.el index b92784e..e153138 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1286,6 +1286,9 @@ result form." to on)) (when from (setq from (pcase from + ("-" + ;; Ignore, because it means the user is typing a negative number. + nil) ((or 'today "today") (->> (ts-now) (ts-apply :hour 0 :minute 0 :second 0))) ((pred numberp) (->> (ts-now) @@ -1302,6 +1305,9 @@ result form." ((pred ts-p) from)))) (when to (setq to (pcase to + ("-" + ;; Ignore, because it means the user is typing a negative number. + nil) ((or 'today "today") (->> (ts-now) (ts-apply :hour 23 :minute 59 :second 59))) ((pred numberp) (->> (ts-now)