The :wagoe/calendar component implements CalendarAdapterProtocol. Take
(ig/ref :wagoe/calendar) and call it through the ports:
(require '[wagoe.calendar.ports :as cal]
'[wagoe.calendar.core.feed :as feed])
;; Export to iCal string
(cal/export-ical calendar events {})
;; Import from iCal string; :timezone places events without a TZID
(cal/import-ical calendar ical-string {:timezone "Europe/Amsterdam"})
;; Ring response for a feed (subscription URL): content type, filename, caching
(feed/ical-response (cal/export-ical calendar events {}) {:filename "appointments.ics"})
An :all-day? true event is written as DTSTART;VALUE=DATE with an exclusive
DTEND, and a VALUE=DATE event is read back :all-day? true. event/all-day?
reads that flag and nothing else.
Import reads a TZID that names an IANA zone, or a Windows one such as
W. Europe Standard Time, with the JVM’s tz rules, whatever the feed’s
VTIMEZONE says, and returns it as :timezone. Any other TZID is read with its
VTIMEZONE, and :timezone is the option’s.
Without Integrant, wagoe.calendar.shell.service offers the same calls.