diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-04-27 03:02:19 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-04-27 03:02:19 +0200 |
commit | c7880093faceb0eb662907a97ad67cf9d2c23dd3 (patch) | |
tree | 161834eaefaa8e301fea8984ac140d22658622cc /module/output | |
parent | Add final-event-occurence procedure. (diff) | |
download | calp-c7880093faceb0eb662907a97ad67cf9d2c23dd3.tar.gz calp-c7880093faceb0eb662907a97ad67cf9d2c23dd3.tar.xz |
Filter to only relevant timezones in ics output.
Diffstat (limited to '')
-rw-r--r-- | module/output/ical.scm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/module/output/ical.scm b/module/output/ical.scm index 66fa1e40..822d929d 100644 --- a/module/output/ical.scm +++ b/module/output/ical.scm @@ -194,13 +194,22 @@ CALSCALE:GREGORIAN\r '("dummy" "local"))) (define-public (print-components-with-fake-parent events) + + ;; The events are probably sorted before, but until I can guarantee + ;; that we sort them again here. We need them sorted from earliest + ;; and up to send the earliest to zoneinfo->vtimezone + (set! events (sort* events date/-time<=? (extract 'DTSTART))) + (print-header) (let ((tz-names (get-tz-names events))) (for-each component->ical-string - (map (lambda (name) (zoneinfo->vtimezone *zoneinfo* name)) + ;; TODO we realy should send the earliest event from each timezone here. + (map (lambda (name) (zoneinfo->vtimezone *zoneinfo* name (car events))) tz-names))) + (for-each component->ical-string events) + (print-footer)) |