Function: org-cmp-ts
org-cmp-ts is a byte-compiled function defined in org-agenda.el.gz.
Signature
(org-cmp-ts A B TYPE)
Documentation
Compare the timestamps values of entries A and B.
When TYPE is "scheduled", "deadline", "timestamp" or
"timestamp_ia", compare within each of these type. When TYPE
is the empty string, compare all timestamps without respect of
their type.
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-agenda.el.gz
(defsubst org-cmp-ts (a b type)
"Compare the timestamps values of entries A and B.
When TYPE is \"scheduled\", \"deadline\", \"timestamp\" or
\"timestamp_ia\", compare within each of these type. When TYPE
is the empty string, compare all timestamps without respect of
their type."
(cl-flet ((get-timestamp (entry)
(or (and (string-match type (or (get-text-property 1 'type entry) ""))
(get-text-property 1 'ts-date entry))
(if org-agenda-sort-notime-is-late most-positive-fixnum -1))))
(let ((ta (get-timestamp a))
(tb (get-timestamp b)))
(cond ((< ta tb) -1)
((< tb ta) +1)))))