aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/xcal/parse.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-11-05 23:45:48 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2020-11-05 23:45:48 +0100
commit0e429de91e57c2445df4fdf2227f65af3e396d9c (patch)
tree9151ec03d773a70944e363855c5b9c296e6fce17 /module/vcomponent/xcal/parse.scm
parentFix tidsrapport --output flag. (diff)
parentAdd comment about freeform fields. (diff)
downloadcalp-0e429de91e57c2445df4fdf2227f65af3e396d9c.tar.gz
calp-0e429de91e57c2445df4fdf2227f65af3e396d9c.tar.xz
Merge branch 'front'
Diffstat (limited to 'module/vcomponent/xcal/parse.scm')
-rw-r--r--module/vcomponent/xcal/parse.scm17
1 files changed, 15 insertions, 2 deletions
diff --git a/module/vcomponent/xcal/parse.scm b/module/vcomponent/xcal/parse.scm
index 17c684fc..6b877b9f 100644
--- a/module/vcomponent/xcal/parse.scm
+++ b/module/vcomponent/xcal/parse.scm
@@ -25,7 +25,10 @@
;; TODO possibly trim whitespace on text fields
[(cal-address uri text unknown) (car value)]
- [(date) (parse-iso-date (car value))]
+ [(date)
+ ;; TODO this is correct, but ensure remaining types
+ (hashq-set! props 'VALUE "DATE")
+ (parse-iso-date (car value))]
[(date-time) (parse-iso-datetime (car value))]
@@ -108,6 +111,12 @@
data '(AUDIO DISPLAY EMAIL NONE)))
[else data]))
+;; Note
+;; This doesn't verify the inter-field validity of the object,
+;; meaning that value(DTSTART) == DATE and value(DTEND) == DATE-TIME
+;; are possibilities, which other parts of the code will crash on.
+;; TODO
+;; since we are feeding user input into this it really should be fixed.
(define-public (sxcal->vcomponent sxcal)
(define type (symbol-upcase (car sxcal)))
(define component (make-vcomponent type))
@@ -147,7 +156,11 @@
(set! (prop* component tag*)
(make-vline tag*
(handle-tag
- tag (handle-value type params value))
+ tag (let ((v (handle-value type params value)))
+ ;; TODO possibly more list fields
+ (if (eq? tag 'categories)
+ (string-split v #\,)
+ v)))
params)))))])))
;; children