aboutsummaryrefslogtreecommitdiff
path: root/vcalendar
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-03-02 23:13:41 +0100
committerHugo Hörnquist <hugo@hornquist.se>2019-03-02 23:13:41 +0100
commit9a6586a0a33e97cdee8cb417556f033b9c6b93a0 (patch)
treeae40aca66ff9a12c785ff122f3c92168f89ddd66 /vcalendar
parentAdd print-vcomponent procedure. (diff)
downloadcalp-9a6586a0a33e97cdee8cb417556f033b9c6b93a0.tar.gz
calp-9a6586a0a33e97cdee8cb417556f033b9c6b93a0.tar.xz
Move datetime stuff to better suited files.
Diffstat (limited to 'vcalendar')
-rw-r--r--vcalendar/datetime.scm16
1 files changed, 16 insertions, 0 deletions
diff --git a/vcalendar/datetime.scm b/vcalendar/datetime.scm
new file mode 100644
index 00000000..af8382c8
--- /dev/null
+++ b/vcalendar/datetime.scm
@@ -0,0 +1,16 @@
+(define-module (vcalendar datetime)
+ #:use-module (srfi srfi-19)
+ #:use-module (srfi srfi-19 util)
+
+ #:export (parse-datetime)
+ )
+
+(define (parse-datetime dtime)
+ "Parse the given date[time] string into a date object."
+ (localize-date
+ (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")))))