Function: diary-icalendar-sort-by-start-ascending
diary-icalendar-sort-by-start-ascending is a byte-compiled function
defined in diary-icalendar.el.gz.
Signature
(diary-icalendar-sort-by-start-ascending C1 C2)
Documentation
Sort iCalendar component C1 before C2 if C1 starts strictly before C2.
Components with no start date/time are sorted after components that do.
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/diary-icalendar.el.gz
(defun di:sort-by-start-ascending (c1 c2)
"Sort iCalendar component C1 before C2 if C1 starts strictly before C2.
Components with no start date/time are sorted after components that do."
(let ((c1start (ical:with-property-of c1 'ical:dtstart nil value))
(c2start (ical:with-property-of c2 'ical:dtstart nil value)))
(cond ((and c1start c2start)
(ical:date/time< c1start c2start))
;; order anything with a start before anything without:
(c1start t)
(c2start nil)
;; otherwise they can stay as-is:
(t t))))