aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/util.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-05-03 16:33:02 +0200
committerHugo Hörnquist <hugo@hornquist.se>2019-05-03 16:34:22 +0200
commit799a2ff1e08dca4ee50b5c28927b998603ed9867 (patch)
treec0ba5631d610ea9a73a44d4b2a47fbcf6c3a8f39 /module/vcomponent/util.scm
parentChange function for creating hashtables. (diff)
downloadcalp-799a2ff1e08dca4ee50b5c28927b998603ed9867.tar.gz
calp-799a2ff1e08dca4ee50b5c28927b998603ed9867.tar.xz
Create module (vcomponent base).
Diffstat (limited to 'module/vcomponent/util.scm')
-rw-r--r--module/vcomponent/util.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/module/vcomponent/util.scm b/module/vcomponent/util.scm
new file mode 100644
index 00000000..81330c17
--- /dev/null
+++ b/module/vcomponent/util.scm
@@ -0,0 +1,11 @@
+(define-module (vcomponent util)
+ #:use-module (vcomponent util)
+ #:export (search))
+
+(define-public (search cal term)
+ (cdr (let ((events (filter (lambda (ev) (eq? 'VEVENT (type ev)))
+ (children cal))))
+ (find (lambda (ev) (string-contains-ci (car ev) term))
+ (map cons (map (extract "SUMMARY")
+ events)
+ events)))))