View Source EDTF (EDTF v1.3.0)
Parse, validate, and humanize EDTF date strings
Summary
Functions
Humanize an EDTF date string
Example:
iex> humanize("1999-06-10")
"June 10, 1999"
iex> humanize("bad date!")
{:error, :invalid_format}
Parse an EDTF date string
Example:
iex> parse("1999-06-10")
{:ok, %EDTF.Date{level: 0, type: :date, values: [1999, 5, 10]}}
iex> parse("bad date!")
{:error, :invalid_format}
Validate an EDTF date string
Example:
iex> validate("1999-06-10")
{:ok, "1999-06-10"}
iex> validate("bad date!")
{:error, :invalid_format}