From c7880093faceb0eb662907a97ad67cf9d2c23dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 27 Apr 2020 03:02:19 +0200 Subject: Filter to only relevant timezones in ics output. --- module/output/ical.scm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'module/output') 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)) -- cgit v1.2.3