blob: ec92c34772ac59bb3944707ead6f75d45553233f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#!/usr/bin/guile \
-s
!#
(begin
;; Supurflous begin block here to make sourcing into geiser easier.
(setenv "LD_LIBRARY_PATH" (getcwd))
(load-extension "libguile-calendar" "init_vcomponent"))
(define root (make-vcomponent "testcal/d1-b.ics"))
(define cal (car (vcomponent-children root)))
;; TODO flatten all calendars into root
(use-modules (srfi srfi-19)
(srfi srfi-26))
(for-each (lambda (ev)
(vcomponent-set-attribute!
ev "DTSTART"
((cut string->date <> "~Y~m~dT~H~M~S")
(vcomponent-get-attribute ev "DTSTART"))))
(vcomponent-children cal))
(display (vcomponent-get-attribute (car (vcomponent-children cal))
"DTSTART"))
(newline)
(display (vcomponent-get-attribute (car (vcomponent-children cal))
"DTSTART"))
(newline)
|