From 073b4584616c24be515f5b092ba1d095d6b168ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 23 Apr 2019 17:08:05 +0200 Subject: Add some utilitiy functions. --- module/vcalendar.scm | 5 +++++ module/vcalendar/datetime.scm | 7 +++++++ 2 files changed, 12 insertions(+) (limited to 'module') diff --git a/module/vcalendar.scm b/module/vcalendar.scm index dbab308c..6beb63f5 100644 --- a/module/vcalendar.scm +++ b/module/vcalendar.scm @@ -125,6 +125,11 @@ (eq? (as-symb k1) (as-symb k2))) +(define-public (event-length e) + (time-difference + (attr e 'DTEND) + (attr e 'DTSTART))) + (define* (make-vcomponent #:optional path) (if (not path) (%vcomponent-make) diff --git a/module/vcalendar/datetime.scm b/module/vcalendar/datetime.scm index b27ce2b0..d9813372 100644 --- a/module/vcalendar/datetime.scm +++ b/module/vcalendar/datetime.scm @@ -6,6 +6,7 @@ #:export (parse-datetime event-overlaps? + overlapping? event-in? ev-timedate time)) -- cgit v1.2.3