Function: diary-icalendar-format-time-range

diary-icalendar-format-time-range is a byte-compiled function defined in diary-icalendar.el.gz.

Signature

(diary-icalendar-format-time-range START END &optional OMIT-START-DATE)

Documentation

Format a time range for the diary.

START and END should be icalendar-date-time values where the date part is the same. (If they are not on the same date, nil is returned; use diary-icalendar-format-time-block-sexp to make a diary S-exp for this range instead.)

The date is only formatted once, and the time is formatted as a range, like:
  STARTDATE STARTTIME-ENDTIME
If OMIT-START-DATE is non-nil, STARTDATE will be omitted.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/diary-icalendar.el.gz
(defun di:format-time-range (start end &optional omit-start-date)
  "Format a time range for the diary.

START and END should be `icalendar-date-time' values where the date part
is the same.  (If they are not on the same date, nil is returned; use
`diary-icalendar-format-time-block-sexp' to make a diary S-exp for this
range instead.)

The date is only formatted once, and the time is formatted as a range, like:
  STARTDATE STARTTIME-ENDTIME
If OMIT-START-DATE is non-nil, STARTDATE will be omitted."
  (when (equal (ical:date/time-to-date start) (ical:date/time-to-date end))
    (format "%s%s-%s"
            (if omit-start-date ""
              (concat (di:format-date start) " "))
            (di:format-time-as-local start)
            (di:format-time-as-local end))))