diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-07-06 01:05:10 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-07-07 13:10:38 +0200 |
commit | 84325a9712e269594c7ae0320a89f3aab8da5563 (patch) | |
tree | d3edf959d44d028ecbec10a145cbde63d131021c /module | |
parent | TODO's in html. (diff) | |
download | calp-84325a9712e269594c7ae0320a89f3aab8da5563.tar.gz calp-84325a9712e269594c7ae0320a89f3aab8da5563.tar.xz |
Fix UNTIL parsinrg for RRULE:s.
Diffstat (limited to 'module')
-rw-r--r-- | module/vcomponent/recurrence/parse.scm | 14 |
1 files changed, 8 insertions, 6 deletions
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)) |