Skip to content

Commit

Permalink
Merge pull request #24 from danabrams/master
Browse files Browse the repository at this point in the history
added capability for yyyy-mm-ddThh:mm format and added a test
  • Loading branch information
rtfeldman authored Jun 13, 2021
2 parents 2ac1bf1 + be97d1b commit 3587ff1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Iso8601.elm
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ iso8601 =
|. symbol ":"
|= paddedInt 2
, paddedInt 2
, succeed 0
]
-- ss
|= oneOf
Expand Down
4 changes: 4 additions & 0 deletions tests/Example.elm
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ knownValues =
\_ ->
Iso8601.toTime "2012-11-12T00:00:00+0130546"
|> Expect.err
, test "toTime supports yyyy-mm-ddThh:mm format" <|
\_ ->
Iso8601.toTime "2019-05-30T06:30"
|> Expect.equal (Ok (Time.millisToPosix 1559197800000))
, test "decoder returns clearer error for dead ends" <|
\_ ->
case decodeString Iso8601.decoder "2010-09-31T14:29:25.01235Z" of
Expand Down

0 comments on commit 3587ff1

Please sign in to comment.