aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--module/datetime.scm2
-rw-r--r--module/vcomponent/output.scm9
-rw-r--r--tests/datetime.scm3
3 files changed, 6 insertions, 8 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)))))
diff --git a/tests/datetime.scm b/tests/datetime.scm
index b678edad..f1883c36 100644
--- a/tests/datetime.scm
+++ b/tests/datetime.scm
@@ -96,7 +96,8 @@
(time- #10:20:30 #10:20:30))
(test-equal "datetime-difference self"
- #0000-00-00T00:00:00
+ ;; #0000-00-00T00:00:00
+ 0
(datetime-difference (datetime date: #2020-01-01) (datetime date: #2020-01-01)))
;; (test-assert