diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-05-03 16:33:02 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2019-05-03 16:34:22 +0200 |
commit | 799a2ff1e08dca4ee50b5c28927b998603ed9867 (patch) | |
tree | c0ba5631d610ea9a73a44d4b2a47fbcf6c3a8f39 /module/vcomponent/util.scm | |
parent | Change function for creating hashtables. (diff) | |
download | calp-799a2ff1e08dca4ee50b5c28927b998603ed9867.tar.gz calp-799a2ff1e08dca4ee50b5c28927b998603ed9867.tar.xz |
Create module (vcomponent base).
Diffstat (limited to 'module/vcomponent/util.scm')
-rw-r--r-- | module/vcomponent/util.scm | 11 |
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))))) |