From 59f6fc205b19f0cd2253adb7c656c4eda904a52e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sat, 6 Apr 2019 19:08:59 +0200 Subject: Add earlier work on timezones. Add earlier work on timezones, with a few inline modifications. This is really to big of a commit. But we are so far from a stable release that it should be fine. The current version seems to eager, and recalculates to many times. This will soon be fixed in a future version. --- module/vcalendar/datetime.scm | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'module/vcalendar/datetime.scm') diff --git a/module/vcalendar/datetime.scm b/module/vcalendar/datetime.scm index f6df03d5..9b1cc82d 100644 --- a/module/vcalendar/datetime.scm +++ b/module/vcalendar/datetime.scm @@ -2,22 +2,24 @@ #:use-module (vcalendar) #:use-module (srfi srfi-19) #:use-module (srfi srfi-19 util) + #:use-module (util) #:export (parse-datetime event-overlaps? - event-in?) + event-in? + ev-timetime-utc - (string->date - dtime - (case (string-length dtime) - ((8) "~Y~m~d") - ((15) "~Y~m~dT~H~M~S") - ((16) "~Y~m~dT~H~M~S~z"))))) + (let* ((str type (case (string-length dtime) + ((8) (values "~Y~m~d" 'all-day)) ; All day + ((15) (values "~Y~m~dT~H~M~S" 'local)) ; "local" or TZID-param + ((16) (values "~Y~m~dT~H~M~S~z" 'utc)) ; UTC-time + )) + (date (string->date dtime str))) + (values date type))) (define (event-overlaps? event begin end) "Returns if the event overlaps the timespan. @@ -33,6 +35,6 @@ Event must have the DTSTART and DTEND attribute set." (end (add-day start))) (event-overlaps? ev start end))) -(define-public (ev-time