aboutsummaryrefslogtreecommitdiff
path: root/module/calp/html/view/calendar/week.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-08-20 18:20:00 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2021-08-20 18:20:00 +0200
commit1273a3624f1b7099cd3bab4b35e66ab9eb427c2a (patch)
treeb2c79c259310515e633c4857b620344c213dddf6 /module/calp/html/view/calendar/week.scm
parentRefactor read-file to use string ports. (diff)
downloadcalp-1273a3624f1b7099cd3bab4b35e66ab9eb427c2a.tar.gz
calp-1273a3624f1b7099cd3bab4b35e66ab9eb427c2a.tar.xz
Make zero-length events be part of day flow.
Since not all zero-length events are at midnight/doesn't have a time component, they are now placed on the correct position of each day, with a dummy-length of 1 hour.
Diffstat (limited to 'module/calp/html/view/calendar/week.scm')
-rw-r--r--module/calp/html/view/calendar/week.scm13
1 files changed, 11 insertions, 2 deletions
diff --git a/module/calp/html/view/calendar/week.scm b/module/calp/html/view/calendar/week.scm
index fb28923e..556c3d85 100644
--- a/module/calp/html/view/calendar/week.scm
+++ b/module/calp/html/view/calendar/week.scm
@@ -71,11 +71,17 @@
(define (lay-out-day day)
(let* (((day-date . events) day)
(time-obj (datetime date: day-date))
+ (short-events (stream->list events))
+ #;
(zero-length-events short-events
(partition event-zero-length? (stream->list events))))
- (fix-event-widths! short-events event-length-key:
- (lambda (e) (event-length/day day-date e)))
+ (fix-event-widths!
+ short-events
+ event-length-key: (lambda (e)
+ (if (event-zero-length? e)
+ (time hour: 1)
+ (event-length/day day-date e))))
`(div (@ (class "events event-container") (id ,(date-link day-date))
(data-start ,(date->string day-date))
@@ -83,6 +89,7 @@
,@(map (lambda (time)
`(div (@ (class "clock clock-" ,time))))
(iota 12 0 2))
+ #;
(div (@ (class "zero-width-events"))
,(map make-block zero-length-events))
,@(map (lambda (e) (create-block day-date e)) short-events))))
@@ -117,6 +124,8 @@
(make-block
ev `((class
+ ,(when (event-zero-length? ev)
+ " zero-length")
,(when (date<? (as-date (prop ev 'DTSTART)) date)
" continued")
,(when (and (prop ev 'DTEND) (date<? date (as-date (prop ev 'DTEND))))