rtfeldman / elm-iso8601-date-strings

Convert between ISO-8601 date strings and Time.Posix
https://package.elm-lang.org/packages/rtfeldman/elm-iso8601-date-strings/latest
BSD 3-Clause "New" or "Revised" License
34 stars 21 forks source link

Fails with UTC offset without colon #13

Closed lazamar closed 5 years ago

lazamar commented 5 years ago

Fails to parse this valid date 2001-11-11T11:11:11+0000 because the UTC offset does not have a colon.

SSCCE: https://ellie-app.com/3p4fLfFWwD4a1

According to Wikipedia (and our php server :P) UTC offsets may or may not have the colon. screenshot_2018-09-19_13-57-58

ringvold commented 5 years ago

As far as I can tell time zone offset can be given without colon or with just the hours. +01, +0100 and +01:00 are all valid time zone notations. Just to add a source other than wikipedia, see under "Time Zone": https://www.cl.cam.ac.uk/~mgk25/iso-time.html

Edit: Adding some more sources that should validate this: https://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators https://www.ietf.org/rfc/rfc3339.txt (See definition of time-numoffset on page 12)

rtfeldman commented 5 years ago

Fixed by https://github.com/rtfeldman/elm-iso8601-date-strings/pull/20