From ae47899079a448b2d71101d4b21c8e9409d82e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 23 Mar 2020 00:34:28 +0100 Subject: Remove deprecated get-time. --- module/output/ical.scm | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'module/output/ical.scm') diff --git a/module/output/ical.scm b/module/output/ical.scm index c18a203a..0252320b 100644 --- a/module/output/ical.scm +++ b/module/output/ical.scm @@ -16,30 +16,31 @@ (define (value-format key vline) (with-throw-handler 'wrong-type-arg (lambda () - (case key - ((DTSTART DTEND RECURRENCE-ID) - (with-output-to-string - (lambda () - (display (date->string (as-date (value vline)) - "~Y~m~d")) - (when (eq? 'DATE-TIME (and=> (prop vline 'VALUE) car)) - (display (time->string (get-time (value vline)) - "T~H~M~S")) - (let ((tz (and=> (prop vline 'TZID) car))) - (when (and tz (string= tz "UTC")) - (display #\Z)))))) - ) - ((DURATION X-HNH-DURATION) - #; (time->string value "~H~M~S") - (let ((s (second (value vline)))) - (format #f "~a~a~a" - (floor/ s 3600) - (floor/ (modulo s 3600) 60) - (modulo s 60)) - )) - ((RRULE) (value vline)) - - (else (escape-chars (value vline))))) + (case key + ((DTSTART DTEND RECURRENCE-ID) + (with-output-to-string + (lambda () + (case (and=> (prop vline 'VALUE) car) + [(DATE) (display (date->string (as-date (value vline)) + "~Y~m~d"))] + [(DATE-TIME) + (display (datetime->string (value vline) "~Y~m~dT~H~M~S")) + (let ((tz (and=> (prop vline 'TZID) car))) + (when (and tz (string= tz "UTC")) + (display #\Z)))] + [else + (error "Unknown VALUE type")])))) + ((DURATION X-HNH-DURATION) + #; (time->string value "~H~M~S") + (let ((s (second (value vline)))) + (format #f "~a~a~a" + (floor/ s 3600) + (floor/ (modulo s 3600) 60) + (modulo s 60)) + )) + ((RRULE) (value vline)) + + (else (escape-chars (value vline))))) (lambda (err caller fmt args call-args) (format (current-error-port) "WARNING: key = ~a, caller = ~s, call-args = ~s~%~k~%" key caller call-args fmt args) -- cgit v1.2.3