aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--module/vcomponent/recurrence/internal.scm33
-rw-r--r--static/rrule.js7
2 files changed, 24 insertions, 16 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))
diff --git a/static/rrule.js b/static/rrule.js
index 2f2120e3..abc648af 100644
--- a/static/rrule.js
+++ b/static/rrule.js
@@ -19,12 +19,6 @@ class RRule {
'bymonthday', 'byyearday', 'byweekno',
'bymonth', 'bysetpos', 'wkst']
- /*
- TODO multi valued byhour should be represented as
- <byhour>1</byhour><byhour>2</byhour>
- NOT as <byhour>1,2</byhour> as it currently does.
- */
-
constructor() {
this.listeners = {}
@@ -37,6 +31,7 @@ class RRule {
TODO many of the fields should be wrapped
in type tags. e.g. <until> elements are either
<date> or <date-time>, NOT a raw date.
+ by* fields should be wrapped with multiple values.
*/
get: () => this['_' + f],
set: (v) => {