From 60d51e5700a55bc3ae17e34f9f3da1d4653a3026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 3 Oct 2019 23:56:59 +0200 Subject: Everything seems to parse now. --- module/vcomponent/base.scm | 2 +- module/vcomponent/recurrence/generate.scm | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'module/vcomponent') diff --git a/module/vcomponent/base.scm b/module/vcomponent/base.scm index 986037f5..38034a81 100644 --- a/module/vcomponent/base.scm +++ b/module/vcomponent/base.scm @@ -41,7 +41,7 @@ (format #t "map = ~a~%" (struct-ref component 3)) (let ((return (hash-set! (struct-ref component 3) (as-string attr) - value))) + (make-vline value)))) (format #t "Return = ~a~%" return) return diff --git a/module/vcomponent/recurrence/generate.scm b/module/vcomponent/recurrence/generate.scm index 435d3009..a274ecfa 100644 --- a/module/vcomponent/recurrence/generate.scm +++ b/module/vcomponent/recurrence/generate.scm @@ -73,6 +73,8 @@ (date->time-utc d)) (when (attr e 'DTEND) + (format #t "file = ~a~%dtstart = ~a~%duration = ~a~%" + (attr e 'X-HNH-FILENAME) (attr e 'DTSTART) (attr e 'DURATION)) (set! (attr e 'DTEND) (add-duration (attr e 'DTSTART) (attr e 'DURATION)))) @@ -124,12 +126,21 @@ (if (not (attr event 'RRULE)) (stream event) (begin + (format #t "!!! DURATION = ~a~%" (attr event 'DURATION)) (when (and (attr event 'DTEND) (not (attr event 'DURATION))) - (set! (attr event "DURATION") - (time-difference - (attr event "DTEND") - (attr event "DTSTART")))) + (let ((dt (time-difference (attr event "DTEND") (attr event "DTSTART") ))) + (format #t "duration = ~a~%start = ~a, end = ~a~%diff = ~a~%" + (attr event "DURATION") + (attr event "DTSTART") (attr event "DTEND") + dt) + (set! (attr event "DURATION") + dt + #; + (time-difference + (attr event "DTEND") + (attr event "DTSTART"))))) + (format #t "||| DURATION = ~a~%" (attr* event "DURATION")) (if (attr event "RRULE") (recur-event-stream event (parse-recurrence-rule (attr event "RRULE"))) ;; TODO some events STANDARD and DAYLIGT doesn't have RRULE's, but rather -- cgit v1.2.3