jweir / elm-iso8601

Elm library to parse and convert ISO8601 times and dates

Home Page:https://package.elm-lang.org/packages/jweir/elm-iso8601/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Both -00:30 and +00:30 results in the same offset (0, 30)

jinjor opened this issue · comments

SSCCE

$ elm repl
---- Elm 0.19.0 ----------------------------------------------------------------
Read <https://elm-lang.org/0.19.0/repl> to learn more: exit, help, imports, etc.
--------------------------------------------------------------------------------
> import ISO8601
> ISO8601.fromString "2019-09-12T12:00+00:30"
Ok { day = 12, hour = 12, millisecond = 0, minute = 0, month = 9, offset = (0,30), second = 0, year = 2019 }
    : Result String ISO8601.Time
> ISO8601.fromString "2019-09-12T12:00-00:30"
Ok { day = 12, hour = 12, millisecond = 0, minute = 0, month = 9, offset = (0,30), second = 0, year = 2019 }
    : Result String ISO8601.Time

Possible Solution

Use offset : Int (minutes) instead of offset : (Int, Int) (hours, minutes).

Turned out that there is no such timezone, so I believe this is practically safe!

Thanks for the bug report! A new version has been pushed up.