aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/recurrence/generate.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-12-23 11:32:26 +0100
committerHugo Hörnquist <hugo@hornquist.se>2019-12-23 11:32:26 +0100
commite547f5d4d9e8f95cf302b4e050f954631d94c328 (patch)
treeb7a5329bd2d31b117afc8937bad618de93b5eff3 /module/vcomponent/recurrence/generate.scm
parentFix reccuring events with exceptions. (diff)
downloadcalp-e547f5d4d9e8f95cf302b4e050f954631d94c328.tar.gz
calp-e547f5d4d9e8f95cf302b4e050f954631d94c328.tar.xz
Fix invalid logic in reccurence generation.
Diffstat (limited to 'module/vcomponent/recurrence/generate.scm')
-rw-r--r--module/vcomponent/recurrence/generate.scm19
1 files changed, 9 insertions, 10 deletions
diff --git a/module/vcomponent/recurrence/generate.scm b/module/vcomponent/recurrence/generate.scm
index 0ad30c84..081c250f 100644
--- a/module/vcomponent/recurrence/generate.scm
+++ b/module/vcomponent/recurrence/generate.scm
@@ -90,16 +90,15 @@
((e _)
(let ((expected-start (attr e 'DTSTART)))
;; If we have alternatives, check them
- (cond [(attr e 'X-HNH-ALTERNATIVES)
- (lambda (alternatives)
- ;; A recurrence id matching the expected time means that
- ;; we have an actuall alternative/exception, use that
- ;; instead of the regular event.
- (find (lambda (alt) (time=? expected-start (attr alt 'RECURRENCE-ID)))
- alternatives))
- => identity]
- ;; If we did't have an exception just return the regular event.
- [else e]))))
+ (or (and=> (attr e 'X-HNH-ALTERNATIVES)
+ (lambda (alternatives)
+ ;; A recurrence id matching the expected time means that
+ ;; we have an actuall alternative/exception, use that
+ ;; instead of the regular event.
+ (find (lambda (alt) (time=? expected-start (attr alt 'RECURRENCE-ID)))
+ alternatives)))
+ ;; If we did't have an exception just return the regular event.
+ e))))
;; Event x Rule → Bool (continue?)
(match-lambda