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

Fix negative timestamps parsing incorrectly #32

Open jamesrweb opened 1 year ago

jamesrweb commented 1 year ago

Closes #31

Currently the utcOffsetMinutesFromParts helper calculates the offset incorrectly by a slim margin, but enough to be concerning, when provided with negative timestamps such as those in the tests provided as part of this PR.

To validate the changes you can paste the test case ISO-8601 strings into a converter like Dencode to see the stamps are correctly conforming as intended.

This is actually quite a surprising issue so kudos to @pd9333 for catching this one! 🎉