aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-07-06 01:05:10 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-07 13:10:38 +0200
commit84325a9712e269594c7ae0320a89f3aab8da5563 (patch)
treed3edf959d44d028ecbec10a145cbde63d131021c
parentTODO's in html. (diff)
downloadcalp-84325a9712e269594c7ae0320a89f3aab8da5563.tar.gz
calp-84325a9712e269594c7ae0320a89f3aab8da5563.tar.xz
Fix UNTIL parsinrg for RRULE:s.
-rw-r--r--module/vcomponent/recurrence/parse.scm14
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))