abadi199/dateparser/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

DateParser

Custom String to Date parser.

This library required http://package.elm-lang.org/packages/rluiten/elm-date-extra/ package.

Parsing

parse : Config -> String -> String -> Result Error Date

Parses String to a Date, and since this parsing can fail, it returns a Result with some error information.

In order to to use this function, you will need to pass Date.Extra.Config from this package: http://package.elm-lang.org/packages/rluiten/elm-date-extra/latest

Example:

parse Date.Extra.Config.Config_en_us "%d/%m/%Y" "31/12/2017" == Date.fromString "2017-12-31"