Function: org-agenda-entry-get-agenda-timestamp

org-agenda-entry-get-agenda-timestamp is a byte-compiled function defined in org-agenda.el.gz.

Signature

(org-agenda-entry-get-agenda-timestamp EPOM)

Documentation

Retrieve timestamp information for sorting agenda views.

Given an element, point, or marker EPOM, returns a cons cell of the timestamp and the timestamp type relevant for the sorting strategy in org-agenda-sorting-strategy-selected.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-agenda.el.gz
(defun org-agenda-entry-get-agenda-timestamp (epom)
  "Retrieve timestamp information for sorting agenda views.
Given an element, point, or marker EPOM, returns a cons cell of the
timestamp and the timestamp type relevant for the sorting strategy in
`org-agenda-sorting-strategy-selected'."
  (let (ts ts-date-type)
    (save-match-data
      (cond ((org-em 'scheduled-up 'scheduled-down
		     org-agenda-sorting-strategy-selected)
	     (setq ts (org-entry-get epom "SCHEDULED")
		   ts-date-type " scheduled"))
	    ((org-em 'deadline-up 'deadline-down
		     org-agenda-sorting-strategy-selected)
	     (setq ts (org-entry-get epom "DEADLINE")
		   ts-date-type " deadline"))
	    ((org-em 'ts-up 'ts-down
		     org-agenda-sorting-strategy-selected)
	     (setq ts (org-entry-get epom "TIMESTAMP")
		   ts-date-type " timestamp"))
	    ((org-em 'tsia-up 'tsia-down
		     org-agenda-sorting-strategy-selected)
	     (setq ts (org-entry-get epom "TIMESTAMP_IA")
		   ts-date-type " timestamp_ia"))
	    ((org-em 'timestamp-up 'timestamp-down
		     org-agenda-sorting-strategy-selected)
	     (setq ts (or (org-entry-get epom "SCHEDULED")
			  (org-entry-get epom "DEADLINE")
			  (org-entry-get epom "TIMESTAMP")
			  (org-entry-get epom "TIMESTAMP_IA"))
		   ts-date-type ""))
	    (t (setq ts-date-type "")))
      (cons (when ts (ignore-errors (org-time-string-to-absolute ts)))
	    ts-date-type))))