From 3d3963e53cb0646ded92c871a6ea7636b25714b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 17 May 2021 01:07:09 +0200 Subject: Cleanup + fix for wholeday checkbox. --- module/calp/html/vcomponent.scm | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'module') diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm index 7530de91..787c4501 100644 --- a/module/calp/html/vcomponent.scm +++ b/module/calp/html/vcomponent.scm @@ -168,17 +168,23 @@ (input (@ (type "date") (value ,(date->string (as-date start))))) (input (@ (type "time") - (value ,(time->string (as-time start))))))) - - ,@(with-label - "Sluttid" - `(div (@ (class "date-time bind") - (data-bindby "bind_date_time") - (name "dtend")) - (input (@ (type "date") - ,@(when end `((value ,(date->string (as-date end))))))) - (input (@ (type "time") - ,@(when end `((value ,(time->string (as-time end))))))))) + (value ,(time->string (as-time start) "~H:~M")) + ,@(when (date? start) '((disabled))) + )))) + + ;; TODO some way to add an endtime if missing beforehand + ;; TODO, actually proper support for event without end times + ,@(when end + (with-label + "Sluttid" + `(div (@ (class "date-time bind") + (data-bindby "bind_date_time") + (name "dtend")) + (input (@ (type "date") + (value ,(date->string (as-date end))))) + (input (@ (type "time") + (value ,(time->string (as-time end) "~H:~M")) + ,@(when (date? end) '((disabled)))))))) (div ,@(with-label @@ -186,7 +192,8 @@ `(input (@ (type "checkbox") (class "bind") (data-bindby "bind_wholeday") - (name "wholeday"))))) + (name "wholeday") + ,@(when (date? start) '((checked))))))) )) -- cgit v1.2.3