Closed mrozbarry closed 7 years ago
Sounds eminently reasonable. Had a look at the code the format specifier :z does put a colon out for zone.
Hmm but the default isn't using it for some reason.
isoMsecOffsetFormat = "%Y-%m-%dT%H:%M:%S.%L%z"
I'll look into this next time I am in code base.
That would be perfect - if I have some time and beat you to it, I'll do a PR as well.
@rluiten I just did a fresh install of my project, and it looks like the ":" is back in the timezone - was this fixed?
I have not updated the lib yet.
Oh, I see, I had a bug in my code, which was also affected by this missing ":".
I am about to publish this change to include : in Format.isoString
result and in exported format string Format.isoMsecOffsetFormat
in v8.2.0.
I'm building an elm app that builds a
Date.Date
from two different sources, and gets the local timezone to submit to a server in an iso8601 format. To extract the local timezone, I was originally doing:Later, I combine my date and time parts with this local timezone and do a
Date.fromString
which I'm guessing backs onto javascript's Date implementation. This works perfectly fine in Chrome and Firefox, but Safari throws an error saying the date I assembled isn't a proper 8601 format.After some fiddling, I discovered Safari would only accept a timezone if it was formatted with a
:
between the hour and minute, ie1999-01-01T12:00:00-05:00
.Would it be possible to have
isoString
output with that format, as it can be parsed on all browsers usingDate.fromString
from elm's core packages.