aboutsummaryrefslogtreecommitdiff
path: root/module/datetime.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-03-25 00:04:31 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2020-03-25 00:04:31 +0100
commiteb7bcbe84fa6f40202ab22a77318eb1034630e1e (patch)
treed4189cf6d4f694bfe782fa22e2ed3bfdd8e8f168 /module/datetime.scm
parentFix bug in date-difference. (diff)
downloadcalp-eb7bcbe84fa6f40202ab22a77318eb1034630e1e.tar.gz
calp-eb7bcbe84fa6f40202ab22a77318eb1034630e1e.tar.xz
Improve *->decimal-hour procedures.
Diffstat (limited to 'module/datetime.scm')
-rw-r--r--module/datetime.scm21
1 files changed, 0 insertions, 21 deletions
diff --git a/module/datetime.scm b/module/datetime.scm
index aa9a15f1..ac826601 100644
--- a/module/datetime.scm
+++ b/module/datetime.scm
@@ -650,27 +650,6 @@
-;; @example
-;; (time->decimal-hour #10:30:00) ; => 10.5
-;; @end example
-(define-public (time->decimal-hour time)
- (exact->inexact (+ (hour time)
- (/ (minute time) 60)
- (/ (second time) 3600))))
-
-(define-public (datetime->decimal-hour dt)
- (unless (and (zero? (month (get-date dt)))
- (zero? (year (get-date dt))))
- (error "Multi-month intervals not yet supported" dt))
- ;; TODO
- ;; (date-difference #2020-12-31 #2020-01-01) ; => 0000-11-30
- ;; to get number of days in diff-time we need to count number of days
- ;; in each month from start and forward
- (+ (time->decimal-hour (get-time% dt))
- (* (day (get-date dt)) 24)))
-
-
-
;;; Parsers for vcomponent usage
;; substring to number, local here