From 29fd746dd3c16509c15c297bad108e7877489a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 4 May 2020 20:09:44 +0200 Subject: Add ability to download ics in entirety. --- module/entry-points/server.scm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'module/entry-points/server.scm') diff --git a/module/entry-points/server.scm b/module/entry-points/server.scm index f1a5466d..919dc936 100644 --- a/module/entry-points/server.scm +++ b/module/entry-points/server.scm @@ -120,13 +120,15 @@ headers: `((location . ,location))) "")) - ;; TODO export all events in interval (GET "/calendar" (start end) (return '((content-type text/calendar)) (with-output-to-string (lambda () - (ical-main (parse-iso-date start) - (parse-iso-date end)))))) + (if (or start end) + (print-events-in-interval + (aif start (parse-iso-date it) (current-date)) + (aif end (parse-iso-date it) (current-date))) + (print-all-events)))))) ;; TODO this fails if there's a period in the uid. (GET "/calendar/:uid{.*}.ics" (uid) -- cgit v1.2.3