Function: icalendar-dates-until

icalendar-dates-until is a byte-compiled function defined in icalendar-utils.el.gz.

Signature

(icalendar-dates-until START END &optional LOCALLY)

Documentation

Return a list of icalendar-date values between START and END.

START and END may be either icalendar-date or icalendar-date-time values. START is an inclusive lower bound, and END is an exclusive upper bound. (Note, however, that if END is a date-time and its time is after midnight, then its date will be included in the returned list.)

If LOCALLY is non-nil and START and END are date-times, these will be interpreted into Emacs local time, so that the dates returned are valid for the local time zone.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/icalendar-utils.el.gz
(defun ical:dates-until (start end &optional locally)
  "Return a list of `icalendar-date' values between START and END.

START and END may be either `icalendar-date' or `icalendar-date-time'
values.  START is an inclusive lower bound, and END is an exclusive
upper bound.  (Note, however, that if END is a date-time and its time is
after midnight, then its date will be included in the returned list.)

If LOCALLY is non-nil and START and END are date-times, these will be
interpreted into Emacs local time, so that the dates returned are valid
for the local time zone."
  (require 'icalendar-recur) ; avoid circular requires
  (declare-function icalendar-recur-subintervals-to-dates "icalendar-recur")
  (declare-function icalendar-recur-make-interval "icalendar-recur")

  (when locally
    (when (cl-typep start 'ical:date-time)
      (setq start (ical:date/time-to-local start)))
    (when (cl-typep end 'ical:date-time)
      (setq end (ical:date/time-to-local end))))
  (cl-typecase start
    (ical:date
     (cl-typecase end
       (ical:date
        (icalendar-recur-subintervals-to-dates
         (list
          (icalendar-recur-make-interval
           (ical:date-to-date-time start)
           (ical:date-to-date-time end)))))
       (ical:date-time
        (icalendar-recur-subintervals-to-dates
         (list
          (icalendar-recur-make-interval (ical:date-to-date-time start) end))))))
    (ical:date-time
     (cl-typecase end
       (ical:date
        (icalendar-recur-subintervals-to-dates
         (list
          (icalendar-recur-make-interval start (ical:date-to-date-time end)))))
       (ical:date-time
        (icalendar-recur-subintervals-to-dates
         (list (icalendar-recur-make-interval start end))))))))