aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/util.scm
blob: 81330c17574cb0a0ad5c6cd6a52e9c9ba1f5b068 (plain)
1
2
3
4
5
6
7
8
9
10
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)))))