Function: diary-icalendar-marking-dates-of
diary-icalendar-marking-dates-of is a byte-compiled function defined
in diary-icalendar.el.gz.
Signature
(diary-icalendar-marking-dates-of COMPONENT INDEX)
Documentation
Return the dates in COMPONENT that should be marked in the calendar.
INDEX should be a parse tree index containing the time zone definition
relevant to COMPONENT; see icalendar-parse-and-index. The dates to
mark are derived from COMPONENT's start and end date and time, and any
recurrences it has within the year currently displayed by the calendar.
No dates are returned if COMPONENT's icalendar-transp property has the
value "TRANSPARENT" (which means the component does not form a block
of busy time on a schedule), or if COMPONENT is an icalendar-vjournal
and diary-icalendar-import-vjournal-as-nonmarking is non-nil.
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/diary-icalendar.el.gz
(defun di:marking-dates-of (component index)
"Return the dates in COMPONENT that should be marked in the calendar.
INDEX should be a parse tree index containing the time zone definition
relevant to COMPONENT; see `icalendar-parse-and-index'. The dates to
mark are derived from COMPONENT's start and end date and time, and any
recurrences it has within the year currently displayed by the calendar.
No dates are returned if COMPONENT's `icalendar-transp' property has the
value \"TRANSPARENT\" (which means the component does not form a block
of busy time on a schedule), or if COMPONENT is an `icalendar-vjournal'
and `diary-icalendar-import-vjournal-as-nonmarking' is non-nil."
(ical:with-component component
((ical:dtstart :first dtstart-node :value dtstart)
(ical:dtend :first dtend-node :value dtend)
(ical:due :value due)
(ical:duration :value duration)
(ical:rdate :first rdate)
(ical:rrule :first rrule)
(ical:transp :value transparency))
(let* ((start-tz (ical:with-param-of dtstart-node 'ical:tzidparam
(ical:index-get index :tzid value)))
(end
(cond
(dtend dtend)
(due due)
(duration (ical:date/time-add-duration dtstart duration start-tz))))
dates)
(unless (or (equal transparency "TRANSPARENT")
(and di:import-vjournal-as-nonmarking
(ical:vjournal-component-p component)))
;; Mark the start date(s) for every (marking) entry:
(setq dates (if end
(ical:dates-until dtstart end t)
(list (ical:date/time-to-date
(ical:date/time-to-local dtstart)))))
;; Mark the dates for any recurrences in the displayed calendar year:
(let ((year (when (boundp 'displayed-year) ; bound by calendar
displayed-year)))
(when (and year (or rdate rrule))
(let* ((low (list 1 1 year))
(high (list 12 31 year))
(recs (icr:recurrences-in-window-w/end-times
low high component start-tz)))
(dolist (rec recs)
(setq dates (append (ical:dates-until (car rec) (cadr rec) t)
dates)))))))
dates)))