aboutsummaryrefslogtreecommitdiff
path: root/module/calp/html/vcomponent.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-11-11 01:00:12 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2020-11-11 01:00:12 +0100
commit0c91aabf778a92a458fbfd243ab198b2ce7b1a16 (patch)
tree6aa4b93ebf6a6b99f38c9e4b2523cfdab7827c02 /module/calp/html/vcomponent.scm
parentAdd @select for RRULE options. (diff)
downloadcalp-0c91aabf778a92a458fbfd243ab198b2ce7b1a16.tar.gz
calp-0c91aabf778a92a458fbfd243ab198b2ce7b1a16.tar.xz
Start byday.
Diffstat (limited to 'module/calp/html/vcomponent.scm')
-rw-r--r--module/calp/html/vcomponent.scm24
1 files changed, 23 insertions, 1 deletions
diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm
index 2c98afc4..ea3f9629 100644
--- a/module/calp/html/vcomponent.scm
+++ b/module/calp/html/vcomponent.scm
@@ -419,7 +419,29 @@
'((selected))))))
,(week-day-name i)))
(iota 7))))
- ((byday) 1 #| TODO |#)
+
+ ((byday)
+ (let ((input (lambda* (optional: (byday '(#f . #f)) key: final?)
+ `(div (@ (class "unit" ,(if final? " final" "")))
+ ;; TODO make this thiner, and clearer that
+ ;; it belongs to the following dropdown
+ (input (@ (type number)
+ (value ,(awhen (car byday) it))))
+ (select (option "-")
+ ,@(map (lambda (i)
+ `(option (@ (value ,i)
+ ,@(if (eqv? i (cdr byday))
+ '((selected)) '()))
+ ,(week-day-name i)))
+ (iota 7)))))))
+ `(div (@ (class "input-list"))
+ ,@(cond ((and=> (prop event 'RRULE)
+ rrule:byday)
+ => (lambda (it) (map input it)))
+ (else '()))
+
+ ,(input final?: #t))))
+
((bysecond byminute byhour
bymonthday byyearday
byweekno bymonth bysetpos)