aboutsummaryrefslogtreecommitdiff
path: root/module/vcalendar/datetime.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-04-23 17:20:40 +0200
committerHugo Hörnquist <hugo@hornquist.se>2019-04-23 17:22:09 +0200
commit13da2dcc564a81d1e4e965d3bc832da28daab4a8 (patch)
tree3b813f89ccc13bd40ae7457e68d44e83418f66ec /module/vcalendar/datetime.scm
parentReorder CSS output for event size. (diff)
downloadcalp-13da2dcc564a81d1e4e965d3bc832da28daab4a8.tar.gz
calp-13da2dcc564a81d1e4e965d3bc832da28daab4a8.tar.xz
Move event-length.
Diffstat (limited to 'module/vcalendar/datetime.scm')
-rw-r--r--module/vcalendar/datetime.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/module/vcalendar/datetime.scm b/module/vcalendar/datetime.scm
index d9813372..2715b5db 100644
--- a/module/vcalendar/datetime.scm
+++ b/module/vcalendar/datetime.scm
@@ -43,3 +43,9 @@ Event must have the DTSTART and DTEND attribute set."
(define (ev-time<? a b)
(time<? (attr a 'DTSTART)
(attr b 'DTSTART)))
+
+;; Returns length of the event @var{e}, as a time-duration object.
+(define-public (event-length e)
+ (time-difference
+ (attr e 'DTEND)
+ (attr e 'DTSTART)))