Swap part6 and part7

This commit is contained in:
Richard Feldman
2018-08-13 07:36:10 -04:00
parent bc62d92609
commit 59ad6c4c0a
4 changed files with 28 additions and 28 deletions

View File

@@ -24,18 +24,17 @@ view timeZone timestamp =
-}
iso8601Decoder : Decoder Time.Posix
iso8601Decoder =
Decode.string
|> Decode.andThen fromString
{- 👉 TODO: Use the following function to decode this Time.Posix value:
fromString : String -> Decoder Time.Posix
fromString str =
case Iso8601.toTime str of
Ok successValue ->
succeed successValue
Iso8601.toTime : String -> Result (List DeadEnd) Time.Posix
Err _ ->
fail ("Invalid date: " ++ str)
NOTE: You can disregard the (List DeadEnd) here. No need to use it to complete this exercise!
💡 HINT: Decode.andThen will be useful here.
-}
"..."