diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b33c0bcea..2c1f400aa 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-01-13 Carsten Dominik + + * org.el (org-time=, org-time<, org-time<=, org-time>) + (org-time>=, org-time<>): Make sure both values are dates. + 2009-01-11 Carsten Dominik * org-archive.el (org-extract-archive-heading): Allow %s for file diff --git a/lisp/org.el b/lisp/org.el index 21c5175d6..f9db5162b 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9575,16 +9575,16 @@ also TODO lines." (defun org-string>= (a b) (not (string< a b))) (defun org-string> (a b) (and (not (string= a b)) (not (string< a b)))) (defun org-string<> (a b) (not (string= a b))) -(defun org-time= (a b) (= (org-2ft a) (org-2ft b))) -(defun org-time< (a b) (< (org-2ft a) (org-2ft b))) -(defun org-time<= (a b) (<= (org-2ft a) (org-2ft b))) -(defun org-time> (a b) (> (org-2ft a) (org-2ft b))) -(defun org-time>= (a b) (>= (org-2ft a) (org-2ft b))) -(defun org-time<> (a b) (org<> (org-2ft a) (org-2ft b))) +(defun org-time= (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (= a b))) +(defun org-time< (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (< a b))) +(defun org-time<= (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (<= a b))) +(defun org-time> (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (> a b))) +(defun org-time>= (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (>= a b))) +(defun org-time<> (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (org<> a b))) (defun org-2ft (s) "Convert S to a floating point time. If S is already a number, just return it. If it is a string, parse -it as a time string and apply `float-time' to it. f S is nil, just return 0." +it as a time string and apply `float-time' to it. If S is nil, just return 0." (cond ((numberp s) s) ((stringp s)