Skip to content

Commit 3587ff1

Browse files
authored
Merge pull request #24 from danabrams/master
added capability for yyyy-mm-ddThh:mm format and added a test
2 parents 2ac1bf1 + be97d1b commit 3587ff1

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Iso8601.elm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ iso8601 =
318318
|. symbol ":"
319319
|= paddedInt 2
320320
, paddedInt 2
321+
, succeed 0
321322
]
322323
-- ss
323324
|= oneOf

tests/Example.elm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ knownValues =
9595
\_ ->
9696
Iso8601.toTime "2012-11-12T00:00:00+0130546"
9797
|> Expect.err
98+
, test "toTime supports yyyy-mm-ddThh:mm format" <|
99+
\_ ->
100+
Iso8601.toTime "2019-05-30T06:30"
101+
|> Expect.equal (Ok (Time.millisToPosix 1559197800000))
98102
, test "decoder returns clearer error for dead ends" <|
99103
\_ ->
100104
case decodeString Iso8601.decoder "2010-09-31T14:29:25.01235Z" of

0 commit comments

Comments
 (0)