Skip to content

Commit

Permalink
Encode date as ISO8601
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Apr 11, 2017
1 parent 5e4971b commit d19502c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Elm/Encoder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ instance HasEncoder ElmValue where
return $ dx <$$> comma <+> dy

instance HasEncoderRef ElmPrimitive where
renderRef EDate = pure $ parens "Json.Encode.string << toString"
renderRef EDate = do
require "Exts.Date"
return (parens "Json.Encode.string << Exts.Date.toISOString")
renderRef EUnit = pure "Json.Encode.null"
renderRef EInt = pure "Json.Encode.int"
renderRef EChar = pure "Json.Encode.char"
Expand Down

0 comments on commit d19502c

Please sign in to comment.