aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-04-20 21:39:32 +0200
committerHugo Hörnquist <hugo@hornquist.se>2019-04-20 21:39:32 +0200
commitb36470814899915cf1846f15aec0098754cf06ed (patch)
treee053344c22ca78a4d9249cd04f6d4091491b0241
parentAdd catch-multiple. (diff)
downloadcalp-b36470814899915cf1846f15aec0098754cf06ed.tar.gz
calp-b36470814899915cf1846f15aec0098754cf06ed.tar.xz
Change parse-datetime back to single return.
-rw-r--r--module/vcalendar.scm2
-rw-r--r--module/vcalendar/datetime.scm12
-rw-r--r--module/vcalendar/recurrence/parse.scm4
3 files changed, 7 insertions, 11 deletions
diff --git a/module/vcalendar.scm b/module/vcalendar.scm
index ef6fbd92..433c0a19 100644
--- a/module/vcalendar.scm
+++ b/module/vcalendar.scm
@@ -17,7 +17,7 @@
;; the event DTSTART to get UTC time.
(define string->time-utc
- (compose date->time-utc (unval parse-datetime)))
+ (compose date->time-utc parse-datetime))
(define (parse-dates! cal)
"Parse all start times into scheme date objects."
diff --git a/module/vcalendar/datetime.scm b/module/vcalendar/datetime.scm
index 9b1cc82d..b27ce2b0 100644
--- a/module/vcalendar/datetime.scm
+++ b/module/vcalendar/datetime.scm
@@ -13,13 +13,11 @@
;;; date time pointer
(define (parse-datetime dtime)
"Parse the given date[time] string into a date object."
- (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)))
+ (string->date
+ dtime (case (string-length dtime)
+ ((8) "~Y~m~d") ; All day
+ ((15) "~Y~m~dT~H~M~S") ; "local" or TZID-param
+ ((16) "~Y~m~dT~H~M~S~z")))) ; UTC-time
(define (event-overlaps? event begin end)
"Returns if the event overlaps the timespan.
diff --git a/module/vcalendar/recurrence/parse.scm b/module/vcalendar/recurrence/parse.scm
index de5d7e7c..983c12b1 100644
--- a/module/vcalendar/recurrence/parse.scm
+++ b/module/vcalendar/recurrence/parse.scm
@@ -87,9 +87,7 @@
(let* (((key val) kv)
;; Lazy fields for the poor man.
(symb (lambda () (string->symbol val)))
- (date (lambda ()
- (let* ((date type (parse-datetime val)))
- (date->time-utc date))))
+ (date (lambda () (date->time-utc (parse-datetime val))))
(days (lambda () (map parse-day-spec (string-split val #\,))))
(num (lambda () (string->number val)))
(nums (lambda () (string->number-list val #\,))))