From 84325a9712e269594c7ae0320a89f3aab8da5563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 6 Jul 2020 01:05:10 +0200 Subject: Fix UNTIL parsinrg for RRULE:s. --- module/vcomponent/recurrence/parse.scm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'module/vcomponent/recurrence/parse.scm') diff --git a/module/vcomponent/recurrence/parse.scm b/module/vcomponent/recurrence/parse.scm index a6a3ef9c..9019ae7e 100644 --- a/module/vcomponent/recurrence/parse.scm +++ b/module/vcomponent/recurrence/parse.scm @@ -78,12 +78,14 @@ (let* (((key val) kv)) (let-lazy ((symb (string->symbol val)) - ;; TODO this is an ugly hack. - ;; But sending in datetime-parser instead - ;; leads to dependency problems in vcomponent. - (date (catch 'parse-error - (lambda () (parse-ics-datetime val)) - (lambda _ (parse-ics-date val)))) + ;; NOTE until MUST have the same value type as DTSTART + ;; on the object. Idealy we would save that type and + ;; check it here. That however is impractical since we + ;; might encounter the RRULE field before the DTSTART + ;; field. + (date (if (= 8 (string-length val)) + (parse-ics-date val) + (parse-ics-datetime val))) (day (rfc->datetime-weekday (string->symbol val))) (days (map parse-day-spec (string-split val #\,))) (num (string->number val)) -- cgit v1.2.3