diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-04-12 02:20:07 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-04-21 15:16:42 +0200 |
commit | 41758ba541ba70f243f6094aeeb197bcad7cc080 (patch) | |
tree | ec4e36a24b2c4113d85b1905bba45ddaf6f5d59f /module/datetime.scm | |
parent | Simplify week-day-name. (diff) | |
download | calp-41758ba541ba70f243f6094aeeb197bcad7cc080.tar.gz calp-41758ba541ba70f243f6094aeeb197bcad7cc080.tar.xz |
datetime->decimal-hour correct time for hours without days.
Diffstat (limited to 'module/datetime.scm')
-rw-r--r-- | module/datetime.scm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/module/datetime.scm b/module/datetime.scm index 140c05db..5d953cad 100644 --- a/module/datetime.scm +++ b/module/datetime.scm @@ -560,7 +560,7 @@ (let ((date-diff (cond [start-date (let* ((end-date (date+ start-date (get-date dt)))) - (days-in-interval start-date end-date)) ] + (1- (days-in-interval start-date end-date))) ] [(or (not (zero? (month (get-date dt)))) (not (zero? (year (get-date dt))))) (scm-error 'misc-error "datetime->decimal-hour" @@ -569,7 +569,7 @@ #f)] [else (day (get-date dt))]))) (+ (time->decimal-hour (get-time% dt)) - (* (1- date-diff) 24)))) + (* date-diff 24)))) ;; Returns a list of all dates from start to end. ;; both inclusive |