aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/recurrence/internal.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-11-29 22:57:06 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2020-11-29 22:57:06 +0100
commit6c2f567d311a80ada265f026cec800309efbeaaf (patch)
treeb26d738ef02a5101c8fd31e892b2c1917e373d09 /module/vcomponent/recurrence/internal.scm
parentgetopt 'options' option on values. (diff)
downloadcalp-6c2f567d311a80ada265f026cec800309efbeaaf.tar.gz
calp-6c2f567d311a80ada265f026cec800309efbeaaf.tar.xz
Generated xcal now has by*-rules correct.
Diffstat (limited to 'module/vcomponent/recurrence/internal.scm')
-rw-r--r--module/vcomponent/recurrence/internal.scm33
1 files changed, 23 insertions, 10 deletions
diff --git a/module/vcomponent/recurrence/internal.scm b/module/vcomponent/recurrence/internal.scm
index 1a2abd85..8e84a8b6 100644
--- a/module/vcomponent/recurrence/internal.scm
+++ b/module/vcomponent/recurrence/internal.scm
@@ -88,8 +88,8 @@
(string-upcase
(week-day-name value 2
locale: (make-locale (list LC_TIME) "C")))]
- [(byday)
- (string-join (map byday->string value) ",")]
+ ;; [(byday)
+ ;; (string-join (map byday->string value) ",")]
[(freq count interval)
(format #f "~a" value)]
[(until)
@@ -120,14 +120,27 @@
(define-public (recur-rule->rrule-sxml rrule)
(map-fields
(lambda (field value)
- (if (string-ci=? "UNTIL" (symbol->string field))
- `(until
- ,(if (date? value)
- (date->string value "~Y-~m-~d")
- (datetime->string
- value "~Y-~m-~dT~H:~M:~S~Z")))
- `(,(downcase-symbol field)
- ,(field->string field value))))
+ (cond [(string-ci=? "UNTIL" (symbol->string field))
+ `(until
+ ,(if (date? value)
+ (date->string value "~Y-~m-~d")
+ (datetime->string
+ value "~Y-~m-~dT~H:~M:~S~Z")))]
+ [(string-ci=? "BYDAY" (symbol->string field))
+ (map (lambda (v)
+ `(,(downcase-symbol field)
+ ,(byday->string v)))
+ value)
+ ]
+ [(string-ci=? "BY" (substring (symbol->string field)
+ 0 2))
+ (map (lambda (v)
+ `(,(downcase-symbol field)
+ ,v))
+ value)]
+ [else
+ `(,(downcase-symbol field)
+ ,(field->string field value))]))
rrule))