diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-10-06 22:56:35 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2019-10-06 22:56:35 +0200 |
commit | 86ae614050a1aba19a2d14e12ff7b62cc47b778c (patch) | |
tree | 3eddf301a5a98e90d94a8addb713a02eb32c739b | |
parent | Fix property access. (diff) | |
download | calp-86ae614050a1aba19a2d14e12ff7b62cc47b778c.tar.gz calp-86ae614050a1aba19a2d14e12ff7b62cc47b778c.tar.xz |
Slight impromevents to parse-offset.
Diffstat (limited to '')
-rw-r--r-- | module/vcomponent/timezone.scm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/module/vcomponent/timezone.scm b/module/vcomponent/timezone.scm index dde32cc2..f6112ebc 100644 --- a/module/vcomponent/timezone.scm +++ b/module/vcomponent/timezone.scm @@ -58,11 +58,13 @@ [else (stream-zip strm (stream-cdr strm))]))) +;; str ::= ±[0-9]{4} +;; str → int seconds (define (parse-offset str) - (let* (((pm h1 h0 m1 m0) (string->list str))) - ((primitive-eval (symbol pm)) - (+ (* 60 (string->number (list->string (list m1 m0)))) - (* 60 60 (string->number (list->string (list h1 h0)))))))) + (let* (((± h1 h0 m1 m0) (string->list str))) + ((primitive-eval (symbol ±)) + (+ (* 60 (string->number (string m1 m0))) + (* 60 60 (string->number (string h1 h0))))))) ;; Finds the VTIMEZONE with id @var{tzid} in calendar. ;; Crashes on error. |