aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/datetime.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/vcomponent/datetime.scm')
-rw-r--r--module/vcomponent/datetime.scm15
1 files changed, 4 insertions, 11 deletions
diff --git a/module/vcomponent/datetime.scm b/module/vcomponent/datetime.scm
index 68909809..fabe3978 100644
--- a/module/vcomponent/datetime.scm
+++ b/module/vcomponent/datetime.scm
@@ -75,22 +75,15 @@ Event must have the DTSTART and DTEND attribute set."
;; currently the secund argument is a date, but should possibly be changed
;; to a datetime to allow for more explicit TZ handling?
(define-public (event-length/day date e)
- ;; TODO date= > 2 elements
(let ((start (attr e 'DTSTART))
(end (attr e 'DTEND)))
- (cond [(and (date= (as-date start)
- (as-date end))
- (date= (as-date start)
- date))
- (time- (as-time end)
- (as-time start))]
+ (cond [(date= date (as-date start) (as-date end))
+ (time- (as-time end) (as-time start))]
;; Starts today, end in future day
- [(date= (as-date start)
- date)
+ [(date= date (as-date start))
(time- #24:00:00 (as-time start))]
;; Ends today, start earlier day
- [(date= (as-date end)
- date)
+ [(date= date (as-date end))
(as-time end)]
;; start earlier date, end later date
[else #24:00:00])))