Closed ohanhi closed 6 years ago
@ohanhi ha, this is exactly why I was gonna wait until elm-test
was upgraded to publish...fuzzing would have caught this right away! That's what I get for being impatient.
At any rate, yeah - if you'd like to PR a fix, I would love that!
I think this issue has to do with the leap year calculation. It should be fixed by this PR: https://github.com/rtfeldman/elm-iso8601/pull/2 :)
@ohanhi can you try version 1.0.1
with @justinmimbs's fix, and close this issue if that fixes it for you?
I just noticed that fromTime
only pads millis to 2 digits instead of 3! So round-tripping any time with millis < 100 won't work till that's changed.
Good point! Want to make a PR for that?
Sure thing! https://github.com/rtfeldman/elm-iso8601/pull/4
Published both fixes as 1.0.2
!
The gist of it is the issue is this:
I have confirmed that the parsing phase is the source of the issue: the Posix value is incorrect when you turn it into a date with JavaScript's
new Date(value)
. Here's a full example on Ellie.Let me know if I can help with this.