aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-08-04 22:04:13 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-08-04 22:04:13 +0200
commit76ed747603f02265c091f48df7fa9ccefbd06406 (patch)
treefdd99f4a4014ee7b54050fe2d049107c92a3e203
parentFix row count and height. (diff)
downloadcalp-76ed747603f02265c091f48df7fa9ccefbd06406.tar.gz
calp-76ed747603f02265c091f48df7fa9ccefbd06406.tar.xz
Events per day now in correct spots.
-rw-r--r--module/output/html.scm19
1 files 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)))))))