(define-module (vcomponent) :use-module (util) :use-module (util app) :use-module (srfi srfi-1) :use-module (srfi srfi-41) :use-module (srfi srfi-41 util) :use-module (datetime) :use-module (datetime util) :use-module (vcomponent base) :use-module (vcomponent parse) :use-module (vcomponent load) :use-module ((vcomponent recurrence) :select (generate-recurrence-set repeating?)) :use-module ((vcomponent datetime) :select (ev-timestream regular) (map (@ (vcomponent recurrence) generate-recurrence-set) repeating) ))) (define-method (init-app calendar-files) (setf 'calendars (load-calendars calendar-files)) (setf 'events (concatenate ;; TODO does this drop events? (map (lambda (cal) (filter (lambda (o) (eq? 'VEVENT (type o))) (children cal))) (getf 'calendars)))) (setf 'fixed-and-repeating-events (let* ((repeating regular (partition repeating? (getf 'events)))) ;; (report-time! "Sorting") ;; NOTE There might be instances where we don't care if the ;; collection if sorted, but for the time beieng it's much ;; easier to always sort it. (list (sort*! regular date/-time