diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-09-09 00:56:05 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-09-09 00:56:05 +0200 |
commit | 16f3c44f43fe6a5f1163e3e95559b76c40b91d7a (patch) | |
tree | 88a06b9bad2d14e641b685f1b5e6630b66c05db5 /module/c | |
parent | HTML add description on existing events. (diff) | |
download | calp-16f3c44f43fe6a5f1163e3e95559b76c40b91d7a.tar.gz calp-16f3c44f43fe6a5f1163e3e95559b76c40b91d7a.tar.xz |
HTML Better RRULE formatting.
Diffstat (limited to '')
-rw-r--r-- | module/calp/html/vcomponent.scm | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm index 49b24fbc..c4e15374 100644 --- a/module/calp/html/vcomponent.scm +++ b/module/calp/html/vcomponent.scm @@ -4,6 +4,7 @@ :use-module (srfi srfi-1) :use-module (srfi srfi-41) :use-module (datetime) + :use-module ((text util) :select (add-enumeration-punctuation)) :use-module (calp html util) :use-module ((calp html config) :select (edit-mode)) :use-module ((calp html components) :select (btn tabset)) @@ -190,7 +191,26 @@ (define (repeat-info event) `(div (@ (class "eventtext")) (h2 "Upprepningar") - (pre ,(prop event 'RRULE)))) + (table (@ (class "recur-components")) + ,@((@@ (vcomponent recurrence internal) map-fields) + (lambda (key value) + `(tr (@ (class ,key)) (th ,key) + (td + ,(case key + ((wkst) (week-day-name value)) + ((until) (if (date? value) + (date->string value) + (datetime->string value))) + ((byday) (add-enumeration-punctuation + (map (lambda (pair) + (string-append + (if (car pair) + (format #f "~a " (car pair)) + "") + (week-day-name (cdr pair)))) + value))) + (else (->string value)))))) + (prop event 'RRULE))))) (define-public (popup ev id) |