diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-03-20 21:42:00 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-03-21 01:53:21 +0100 |
commit | d4f88c4a043ccb976e19f16d0568627689e8d679 (patch) | |
tree | f317e7002d6e1b3c322a46d05af92fa55f834d62 /fetch.scm | |
parent | Some cleanup. (diff) | |
download | calp-d4f88c4a043ccb976e19f16d0568627689e8d679.tar.gz calp-d4f88c4a043ccb976e19f16d0568627689e8d679.tar.xz |
Fix up fetch to use better abstractions.
Diffstat (limited to 'fetch.scm')
-rwxr-xr-x | fetch.scm | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -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) |