diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-02-21 20:10:02 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-11 19:58:54 +0200 |
commit | cef4f5e55406246698c6cf8b3391c458e2b4668e (patch) | |
tree | abdcc48d75662ceea3627c8e6540d8c55583388e /module/vcomponent/recurrence/internal.scm | |
parent | Extend `for'-macro to allow improper list elements. (diff) | |
download | calp-cef4f5e55406246698c6cf8b3391c458e2b4668e.tar.gz calp-cef4f5e55406246698c6cf8b3391c458e2b4668e.tar.xz |
Allow shorter byday when constructing recurrence rules.
Diffstat (limited to 'module/vcomponent/recurrence/internal.scm')
-rw-r--r-- | module/vcomponent/recurrence/internal.scm | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/module/vcomponent/recurrence/internal.scm b/module/vcomponent/recurrence/internal.scm index 94c4cccf..9bf425ac 100644 --- a/module/vcomponent/recurrence/internal.scm +++ b/module/vcomponent/recurrence/internal.scm @@ -79,9 +79,18 @@ ;; to prevent creation of invalid rules. ;; This was made apparent when wkst was (incorrectly) set to MO, ;; which later crashed generate-recurrence-set. - (make-recur-rule% freq until count interval bysecond byminute byhour - byday bymonthday byyearday byweekno bymonth bysetpos - wkst)) + + ;; Allow `(cons #f day)' to be written as just `day'. + (let ((byday* (if byday + (map (lambda (day) + (if (number? day) + (cons #f day) + day)) + byday) + #f))) + (make-recur-rule% freq until count interval bysecond byminute byhour + byday* bymonthday byyearday byweekno bymonth bysetpos + wkst))) ;; only print fields with actual values. (set-record-type-printer! |