diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/output/html.scm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/module/output/html.scm b/module/output/html.scm index 9f5c7c81..e9b7fd13 100644 --- a/module/output/html.scm +++ b/module/output/html.scm @@ -39,6 +39,17 @@ (/ (minute time) 60) (/ (second time) 3600)))) +(define (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 ((@ (datetime) get-time%) dt)) + (* (day (get-date dt)) 24))) + ;; Retuns an HTML-safe version of @var{str}. (define (html-attr str) (define cs (char-set-adjoin char-set:letter+digit #\- #\_)) |