From eb7bcbe84fa6f40202ab22a77318eb1034630e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 25 Mar 2020 00:04:31 +0100 Subject: Improve *->decimal-hour procedures. --- module/datetime.scm | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'module/datetime.scm') 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 -- cgit v1.2.3