enkidatron/elm-cldr/2.0.1

NOTE: the latest version is 3.2.1

Cldr.Format.Date

Date Formatting

format : FormatType -> Locale -> Date -> String

Formats a Date using the specified FormatType and Locale.

import Cldr.Format.Length exposing (Length(..))
import Cldr.Locale exposing (en)
import Date
import Time exposing (Month(..))


let
    date = Date.fromCalendarDate 2000 Jan 1
in
format (WithLength Short) en date
--> "1/1/00"

Format Type

= WithLength Length
| WithOptions DateOptions

Dates can be formatted using a Cldr.Format.Length.Length or Cldr.Format.Options.DateOptions.