From 0c91aabf778a92a458fbfd243ab198b2ce7b1a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 11 Nov 2020 01:00:12 +0100 Subject: Start byday. --- module/calp/html/vcomponent.scm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'module') 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) -- cgit v1.2.3