module Model.Date exposing ( timeDecoder , dateDecoder ) import Date as Date exposing (Date) import Json.Decode as Decode exposing (Decoder) import Json.Decode.Extra as Decode import Time exposing (Time) timeDecoder : Decoder Time timeDecoder = Decode.map Date.toTime dateDecoder dateDecoder : Decoder Date dateDecoder = Decode.string |> Decode.andThen (Date.fromString >> Decode.fromResult)