From 21e5ec22fb810782003dcccf327d140465ac18c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 14 Feb 2020 00:23:49 +0100 Subject: Reimplement date/time formatting in event list. --- module/output/html.scm | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'module') diff --git a/module/output/html.scm b/module/output/html.scm index 42290ed9..48dd27f9 100644 --- a/module/output/html.scm +++ b/module/output/html.scm @@ -174,17 +174,14 @@ (date->string e))))] [else (date->string s)]))] [else ; guaranteed datetime - ;; TODO rewrite this - (values (time->string (get-time (attr ev 'DTSTART))) - (time->string (get-time (attr ev 'DTEND)))) - #; - (let* ((fmt (if (date/-timestring (attr ev 'DTSTART) fmt)) - (end (date/-time->string (attr ev 'DTEND) fmt))) - (values start end))])) + (let ((s (attr ev 'DTSTART)) + (e (attr ev 'DTEND))) + (let ((s-str (time->string (get-time s) "~H:~M")) + (e-str (time->string (get-time e) "~H:~M"))) + (if (date= (get-date s) (get-date e)) + (values s-str e-str) + (values (string-append (date->string (get-date s) "~Y-~m-~d ") s-str) + (string-append (date->string (get-date e) "~Y-~m-~d ") e-str)))))])) ;; For sidebar, just text -- cgit v1.2.3