From aa2a1e907843b7f3bc7984b32fd0344c9cf24a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 22 Mar 2020 22:15:55 +0100 Subject: Date difference once again returns dates. --- module/output/html.scm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'module/output/html.scm') 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) -- cgit v1.2.3