From 7428d25fed09ab07b99896529b4bf616813df14d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 11 Nov 2020 00:32:30 +0100 Subject: Add @select for RRULE options. --- module/calp/html/vcomponent.scm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'module') diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm index 94e4a6cf..2c98afc4 100644 --- a/module/calp/html/vcomponent.scm +++ b/module/calp/html/vcomponent.scm @@ -373,10 +373,13 @@ ,(case key ((freq) `(select (option "-") - ,@(map (lambda (x) `(option (@ (value ,x)) + ,@(map (lambda (x) `(option (@ (value ,x) + ,@(awhen (prop event 'RRULE) + (awhen (rrule:freq it) + (awhen (eq? it x) + '((selected)))))) ,(string-titlecase (symbol->string x)))) - ;; TODO selected '(SECONDLY MINUTELY HOURLY DAILY WEEKLY MONTHLY YEARLY)))) @@ -407,10 +410,13 @@ (value ,(awhen (prop event 'RRULE) (or (rrule:interval it) "")))))) ((wkst) - ;; TODO selected `(select (option "-") ,@(map (lambda (i) - `(option (@ (value ,i)) + `(option (@ (value ,i) + ,@(awhen (prop event 'RRULE) + (awhen (rrule:wkst it) + (awhen (eqv? it i) + '((selected)))))) ,(week-day-name i))) (iota 7)))) ((byday) 1 #| TODO |#) -- cgit v1.2.3