Skip to content

Commit 9a13ae6

Browse files
committed
LRS-30 Allow whitespace instead of T per RFC 3339 I guess
1 parent dc64ea9 commit 9a13ae6

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/xapi_schema/spec/regex.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
;; Time
118118
time (str "(?:" hour ":" min ":" sec sec-frac "?" ")")
119119
date (str "(?:" year "-" month "-" day ")")]
120-
(str date "T" time)))
120+
(str date "[T\\s]" time)))
121121

122122
(def TimestampRegEx ; RFC 3339
123123
(let [;; Time

test/xapi_schema/spec/regex_test.cljc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@
140140
(is (not (re-matches TimestampRegEx "20150513T15Z")))
141141
(is (not (re-matches TimestampRegEx "20150513T15:16:00Z")))
142142
;; negative offset
143-
(is (not (re-matches TimestampRegEx "2008-09-15T15:53:00.601-00:00")))))
143+
(is (not (re-matches TimestampRegEx "2008-09-15T15:53:00.601-00:00"))))
144+
(testing "matches valid but terrible stamps in rfc3339 OUTSIDE of 8601"
145+
(is (re-matches TimestampRegEx "2015-05-13 15:16:00Z"))))
144146

145147
(deftest xapi-version-regex-test
146148
(testing "matches xAPI 1.0.X versions"

0 commit comments

Comments
 (0)