diff options
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))))) |