From 76ed747603f02265c091f48df7fa9ccefbd06406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 4 Aug 2020 22:04:13 +0200 Subject: Events per day now in correct spots. --- module/output/html.scm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/module/output/html.scm b/module/output/html.scm index a77b634c..4a6096e3 100644 --- a/module/output/html.scm +++ b/module/output/html.scm @@ -487,7 +487,7 @@ long-event-groups (iota (length long-event-groups) 1)) ,@(map (lambda (day-date i) - `(div (@ (style "grid-area:time " ,(floor i)) + `(div (@ (style "grid-area:time " ,i) (class "cal-cell cal-cell-time")) (time (@ (class "date-info " ,(if (or (date< day-date start-date) @@ -504,17 +504,28 @@ `(span (@ (class "year-number")) ", " ,(date->string day-date "~Y")))))) (date-range pre-start post-end) - (iota (length (date-range pre-start post-end)) 1 1/7)) + (map floor (iota (length (date-range pre-start post-end)) 1 1/7))) ,@(stream->list (stream-map (match-lambda* [((day-date . events) i) - `(div (@ (style "grid-area:short " ,(floor (/ i 7))) + (format (current-error-port) "> ~a: ~a~%" day-date + (string-join (map (extract 'SUMMARY) (stream->list events)) + ", " 'infix)) + `(div (@ (style "grid-area:short " ,i) (class "cal-cell cal-cell-short")) ,@(stream->list (stream-map make-small-block events)))]) short-event-groups - (stream-from 1)))))) + ;; Natural numbers from 1 and up, each number repeated 7 times. + (stream-unfold + cdr ; map + (const #t) ; continue? + (lambda (x) ; gen next + (if (= 6 (car x)) + (cons 0 (1+ (cdr x))) + (cons (1+ (car x)) (cdr x)))) + (cons 0 1))))))) -- cgit v1.2.3