Commit daf4fce
committed
Allow space separator in
[RFC 3339][0] is not very clear about what separator characters are
allowed. It just lists "space" as an example:
> NOTE: ISO 8601 defines date and time separated by "T".
> Applications using this syntax may choose, for the sake of
> readability, to specify a full-date and full-time separated by
> (say) a space character.
Ruby's [`DateTime.rfc3339`][1] allows `T`, `t`, and `\s`, so I'm going
with that. This should only affect the edge case tests since everything
else is delegated to `DateTime.rfc3339`.
There are a bunch of tests that were generated here: https://ijmacd.github.io/rfc3339-iso8601/
Thanks to @pboling for pointing me to it in: #153
The RFC 3339 examples include some that use an underscore as the
date-time separator, which I decided to ignore because it seems
arbitrary to allow random characters and Ruby doesn't support it.
[0]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6
[1]: https://github.com/ruby/ruby/blob/d3ea9070bbbf04749e5fcd8339d71a9e73a86cfb/ext/date/date_parse.c#L2613date-time regexes1 parent 69fe7a8 commit daf4fce
2 files changed
+631
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
0 commit comments