aboutsummaryrefslogtreecommitdiff
path: root/module/entry-points/server.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-05-04 20:09:44 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-05-04 20:09:44 +0200
commit29fd746dd3c16509c15c297bad108e7877489a47 (patch)
tree00a49469d9c82a17c67c7eebcc8702f13c8539cb /module/entry-points/server.scm
parentReplace direct output to current-error-port with warnings. (diff)
downloadcalp-29fd746dd3c16509c15c297bad108e7877489a47.tar.gz
calp-29fd746dd3c16509c15c297bad108e7877489a47.tar.xz
Add ability to download ics in entirety.
Diffstat (limited to 'module/entry-points/server.scm')
-rw-r--r--module/entry-points/server.scm8
1 files changed, 5 insertions, 3 deletions
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)