diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-03-23 01:04:56 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-03-23 01:04:56 +0100 |
commit | 8fe0499b6f3cf62e13a42fd7e12080b3b7b5171e (patch) | |
tree | cebe70be3e8cdef4539fc651b083973de47a6f6d /module | |
parent | Hopefully fixed events-between. (diff) | |
download | calp-8fe0499b6f3cf62e13a42fd7e12080b3b7b5171e.tar.gz calp-8fe0499b6f3cf62e13a42fd7e12080b3b7b5171e.tar.xz |
Minor cleanup.
Diffstat (limited to 'module')
-rw-r--r-- | module/datetime.scm | 2 | ||||
-rw-r--r-- | module/vcomponent/output.scm | 9 |
2 files changed, 4 insertions, 7 deletions
diff --git a/module/datetime.scm b/module/datetime.scm index 9b0ccd47..a127b274 100644 --- a/module/datetime.scm +++ b/module/datetime.scm @@ -579,7 +579,7 @@ (car (mktime (datetime->tm start))))) (define-public (date-difference end start) - (date day: (/ (datetime-difference (datetime date: end) + (date day: (ceiling-quotient (datetime-difference (datetime date: end) (datetime date: start)) 86400))) diff --git a/module/vcomponent/output.scm b/module/vcomponent/output.scm index d142e922..e95574ac 100644 --- a/module/vcomponent/output.scm +++ b/module/vcomponent/output.scm @@ -10,6 +10,7 @@ #:export (print-vcomponent serialize-vcomponent)) +;;; TODO this is broken,2020-03-22 (define* (print-vcomponent comp #:optional (port #t) #:key (descend? #t) (depth 0)) (let ((kvs (map (lambda (key) (cons key (attr* comp key))) (attributes comp)))) @@ -68,13 +69,9 @@ Removes the X-HNH-FILENAME attribute, and sets PRODID to (case key ((DTSTART DTEND) (cond [(string? value) value] - [(date? value) (date->string value "~H~M~S")] + [(date? value) (date->string value "~Y~m~d")] [(datetime? value) - (string-append - (date->string (get-date value) "~Y~m~d") - "T" - (time->string (get-time value) "~H~M~S" ; ~z - ))])) + (datetime->string value)])) ((X-HNH-DURATION) (format #f "~s" value)) (else value))))) |