CLDRex v0.0.3 CLDRex.Date
Provide date localization for common date formats.
Summary
Functions
Shortcut for localize/3
when passed the length: :full
option
Convert the given date into the corresponding CLDR format
Shortcut for localize/3
when passed the length: :long
option
Shortcut for localize/3
when passed the length: :medium
option
Shortcut for localize/3
when passed the length: :short
option
Types
Functions
Shortcut for localize/3
when passed the length: :full
option.
Examples
iex> CLDRex.Date.full({2016, 07, 11}, :de)
"Montag, 11. Juli 2016"
Convert the given date into the corresponding CLDR format.
Accepted options are:
- calendar: the calendar to use. default:
:gregorian
length: the date format to use. default:
:full
commonly available::full
:long
:medium
:short
Examples
iex> CLDRex.Date.localize({2016, 07, 11}, :en)
"Monday, July 11, 2016"
iex> CLDRex.Date.localize(Timex.Date.today, :fr)
"lundi 11 juillet 2016"
iex> CLDRex.Date.localize({2016, 07, 11}, :fr, length: :medium)
"11 juil. 2016"
Shortcut for localize/3
when passed the length: :long
option.
Examples
iex> CLDRex.Date.long({2016, 07, 11}, :fr)
"11 juillet 2016"
Shortcut for localize/3
when passed the length: :medium
option.
Examples
iex(7)> CLDRex.Date.medium({2016, 07, 11}, :es)
"11 jul. 2016"
Shortcut for localize/3
when passed the length: :short
option.
Examples
iex> CLDRex.Date.short({2016, 07, 11}, :en)
"7/11/2016"