summaryrefslogtreecommitdiff
path: root/lib/ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2019-12-23 16:52:46 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2019-12-23 16:52:46 -0500
commit7dc460aece761171338fe61f1a6d601e3d0b6e62 (patch)
treeb25f25b6b137a693a23af4f5d84c11bab8320d50 /lib/ur
parenta837bf5d83d27c49dc8c1fdb4782a3a8b037d5ee (diff)
More lenient RFC 3339 parsing
Diffstat (limited to 'lib/ur')
-rw-r--r--lib/ur/json.ur4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ur/json.ur b/lib/ur/json.ur
index eed52fd6..1222cdbf 100644
--- a/lib/ur/json.ur
+++ b/lib/ur/json.ur
@@ -165,6 +165,10 @@ fun rfc3339_in s =
None => error <xml>Invalid RFC 3339 string "{[s]}"</xml>
| Some (time, sep, rest) =>
let
+ val time = case String.split time #"." of
+ None => time
+ | Some (time, _) => time
+
val t = case readUtc (date ^ " " ^ time) of
None => error <xml>Invalid RFC 3339 string "{[s]}"</xml>
| Some t => t