aboutsummaryrefslogtreecommitdiff
path: root/module/output
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-03-22 22:15:55 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2020-03-22 22:15:55 +0100
commitaa2a1e907843b7f3bc7984b32fd0344c9cf24a94 (patch)
treeef17a1f678fcf3da695d08c0cfd26f83d65a8f2b /module/output
parentevent-length/clapmed works marginally better. (diff)
downloadcalp-aa2a1e907843b7f3bc7984b32fd0344c9cf24a94.tar.gz
calp-aa2a1e907843b7f3bc7984b32fd0344c9cf24a94.tar.xz
Date difference once again returns dates.
Diffstat (limited to 'module/output')
-rw-r--r--module/output/html.scm9
1 files changed, 4 insertions, 5 deletions
diff --git a/module/output/html.scm b/module/output/html.scm
index 4ed44587..baa2915f 100644
--- a/module/output/html.scm
+++ b/module/output/html.scm
@@ -180,8 +180,8 @@
(define (create-top-block start-date end-date ev)
- ;; TODO
- (define total-length (exact->inexact (/ (date-difference (date+ end-date (date day: 1)) start-date) 3600)))
+ ;; NOTE be vary of api changes to date-diffenence
+ (define total-length (* 24 (day (date-difference (date+ end-date (date day: 1)) start-date))))
(define style
(format #f "top:~,3f%;height:~,3f%;left:~,3f%;width:~,3f%;"
@@ -274,9 +274,8 @@
;; @end example
;; date, date → int
(define (days-between start-date end-date)
- ;; TODO do rounding better
- (inexact->exact (ceiling (1+ (exact->inexact (/ (date-difference end-date start-date)
- 86400))))))
+ ;; TODO be vary if date-difference changes again
+ (1+ (day (date-difference end-date start-date))))
;; date, date → [list date]
(define (date-range start end)