MyApp.Cldr.DateTime.Format.day_period_for

You're seeing just the function day_period_for, go back to MyApp.Cldr.DateTime.Format module for more information.
Link to this function

day_period_for(time, language)

View Source

Specs

Returns the time period for a given time of day.

Arguments

  • time is any Time.t or a map with at least :hour, :minute and :second keys

  • language is a binary representation of a valid and configured language in Cldr

The time period is a locale-specific key that is used to localise a time into a textual representation of "am", "pm", "noon", "midnight", "evening", "morning" and so on as defined in the CLDR day period rules.

Examples

iex> Elixir.MyApp.Cldr.DateTime.Format.day_period_for ~T[06:05:54.515228], "en"
:morning1

iex> Elixir.MyApp.Cldr.DateTime.Format.day_period_for ~T[13:05:54.515228], "en"
:afternoon1

iex> Elixir.MyApp.Cldr.DateTime.Format.day_period_for ~T[21:05:54.515228], "en"
:night1

iex> Elixir.MyApp.Cldr.DateTime.Format.day_period_for ~T[21:05:54.515228], "fr"
:evening1