aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-03-20 21:42:00 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-03-21 01:53:21 +0100
commitd4f88c4a043ccb976e19f16d0568627689e8d679 (patch)
treef317e7002d6e1b3c322a46d05af92fa55f834d62
parentSome cleanup. (diff)
downloadcalp-d4f88c4a043ccb976e19f16d0568627689e8d679.tar.gz
calp-d4f88c4a043ccb976e19f16d0568627689e8d679.tar.xz
Fix up fetch to use better abstractions.
-rwxr-xr-xfetch.scm16
1 files changed, 6 insertions, 10 deletions
diff --git a/fetch.scm b/fetch.scm
index f134a850..a91e4d0d 100755
--- a/fetch.scm
+++ b/fetch.scm
@@ -10,26 +10,22 @@
(add-to-load-path (dirname (current-filename)))
(use-modules (srfi srfi-1)
- (srfi srfi-26)
(srfi srfi-19)
- (srfi srfi-19 util)
+ (srfi srfi-26)
(vcalendar)
+ (vcalendar datetime)
(vcalendar output)
(util))
(begin
- (define *path* "/home/hugo/.calendars/b85ba2e9-18aa-4451-91bb-b52da930e977/")
+ ;; (define *path* "/home/hugo/.calendars/b85ba2e9-18aa-4451-91bb-b52da930e977/")
+ (define *path* "/home/hugo/.calendars/D1/")
(define cal (make-vcomponent *path*)))
(filter-children!
- (lambda (comp)
- (if (not (eq? 'VEVENT (type comp)))
- #t
- (let ((stime (date->time-utc (string->date "2019-03-12T12:00" "~Y-~m-~dT~H:~M")))
- (etime (date->time-utc (string->date "2019-03-13T11:59" "~Y-~m-~dT~H:~M"))))
- (and (time<=? stime (attr comp "DTSTART"))
- (time<=? (attr comp "DTSTART") etime)))))
+ (lambda (ev) (and (eq? 'VEVENT (type ev))
+ (event-in? ev (date->time-utc (string->date "2019-04-03" "~Y-~m-~d")))))
cal)
(serialize-vcomponent cal)