elm-exts icon indicating copy to clipboard operation
elm-exts copied to clipboard

ISO UTC DateTime can have an hour of 0

Open erewok opened this issue 9 years ago • 3 comments

Hello!

Thanks for releasing this library!

I ran into a problem when trying to use it to encode an object with UTC dates, because I have an object with a date field that looks like this:

created = <Sun Sep 18 2016 00:00:00 GMT-0700 (PDT)>

When this gets encoded back into JSON, it passes through this line, and it ends up looking like this (that's a negative one, which gets rejected by the server):

{ created: '2016-09-18T-1:00:00.000Z' }

When I found the line above, I thought, okay I'll just send in a patch and handle subtracting back to the previous day, but then I stopped when I realized I didn't know why we're subtracting one from the hour there?

erewok avatar Oct 30 '16 04:10 erewok

Urk - I think we're being bitten by a variant of this bug(/weird interpretation of the spec): https://twitter.com/krisajenkins/status/785479254872039424

On 30 Oct 2016, at 04:12, Erik [email protected] wrote:

Hello!

Thanks for releasing this library!

I ran into a problem when trying to use it to encode an object with UTC dates, because I have an object with a date field that looks like this:

created = <Sun Sep 18 2016 00:00:00 GMT-0700 (PDT)> When this gets encoded back into JSON, it passes through this line, and it ends up looking like this (that's a negative one, which gets rejected by the server):

{ created: '2016-09-18T-1:00:00.000Z' } When I found the line above, I thought, okay I'll just send in a patch and handle subtracting back to the previous day, but then I stopped when I realized I didn't know why we're subtracting one from the hour there?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

krisajenkins avatar Oct 30 '16 11:10 krisajenkins

As soon as the build verifies, I'll publish this fix as 25.13.1. Thanks for the report @pellagic-puffbomb!

krisajenkins avatar Oct 31 '16 14:10 krisajenkins

Sure! Thanks for the quick turnaround!

erewok avatar Oct 31 '16 15:10 erewok