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-02-23 02:53:54 +0100 |
commit | 4ebe7de06d4eba8d346f72c088cd7369515564ff (patch) | |
tree | 06a23b7f2fec2c0d13c2ace2417a76288b54070c /module/vcomponent/recurrence/internal.scm | |
parent | Add (vcomponent create). (diff) | |
download | calp-4ebe7de06d4eba8d346f72c088cd7369515564ff.tar.gz calp-4ebe7de06d4eba8d346f72c088cd7369515564ff.tar.xz |
Allow shorter byday when constructing recurrence rules.
Diffstat (limited to '')
-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! |