On Tue, Mar 21 2017, Matt Lundin wrote:

> You could use something like this and then add user-defined-up or
> user-defined-down where desired in org-agenda-sorting-strategy:
>
> (defun my-sort-by-inactive-timestamp-incl-time (a b)
>   (let* ((ma (get-text-property 1 'org-marker a))
>          (mb (get-text-property 1 'org-marker b))
>          (tsa (with-current-buffer (marker-buffer ma)
>                  (org-entry-get (marker-position ma) "TIMESTAMP_IA")))
>          (tsb (with-current-buffer (marker-buffer mb)
>                  (org-entry-get (marker-position mb) "TIMESTAMP_IA")))
>          (seca (if tsa (org-time-string-to-seconds tsa) 0))
>          (secb (if tsb (org-time-string-to-seconds tsb) 0)))
>     (cond ((> seca secb) 1)
>           ((> secb seca) -1)
>           (t nil))))
>
> (setq org-agenda-cmp-user-defined 'my-sort-by-inactive-timestamp-incl-time)
>
> I imagine there are ways to do this more elegantly (e.g., by iterating
> over a and b), but this gets the job done for me.

This works.  Awesome!  Thanks.  

-- 
Arkady


Reply via email to