From 7c2adefaee82dbf2843dc6bf5364c4b664b4b366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 25 Mar 2019 13:56:15 +0100 Subject: Minor cleanups. --- module/vcalendar/datetime.scm | 3 ++- module/vcalendar/output.scm | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'module/vcalendar') diff --git a/module/vcalendar/datetime.scm b/module/vcalendar/datetime.scm index 360b8348..d28096c6 100644 --- a/module/vcalendar/datetime.scm +++ b/module/vcalendar/datetime.scm @@ -30,5 +30,6 @@ Event must have the DTSTART and DTEND attribute set." "Does event overlap the date that contains time." (let* ((date (time-utc->date time)) (start (date->time-utc (drop-time date))) - (end (add-duration start (make-duration (* 60 60 24))))) + (end (add-day start))) (event-overlaps? ev start end))) + diff --git a/module/vcalendar/output.scm b/module/vcalendar/output.scm index 5baa293a..48197cb4 100644 --- a/module/vcalendar/output.scm +++ b/module/vcalendar/output.scm @@ -74,15 +74,16 @@ Removes the X-HNH-FILENAME attribute, and sets PRODID to (lambda () (format port "~a:~a~%" key (string->ics-safe-string - (case key - ((DTSTART DTEND) - (if (string? value) - value - (time->string value "~Y~m~dT~H~M~S"))) + (or (case key + ((DTSTART DTEND) + (if (string? value) + value + (time->string value "~Y~m~dT~H~M~S"))) - ((RRULE DURATION) "Just forget it") + ((DURATION) "Just forget it") - (else value))))) + (else value)) + "")))) ;; Catch (lambda (type proc fmt . args) -- cgit v1.2.3