View Source Azan.TimeComponent (AzanEx v0.1.0)

Documentation for TimeComponent.

Link to this section Summary

Functions

Create a DateTime from TimeComponent

Create a new TimeComponent from an hour with fractional part.

Convert a TimeComponent to a string in the format of "HH:MM".

Link to this section Types

@type t() :: %Azan.TimeComponent{
  hour: integer() | nil,
  minute: integer() | nil,
  second: integer() | nil
}

Link to this section Functions

Link to this function

create_utc_datetime(arg1, date)

View Source

Create a DateTime from TimeComponent

 ## Examples

  iex> TimeComponent.new(12.5) |> TimeComponent.create_utc_datetime(2015, 1, 1)
  ~U[2015-01-01 12:30:00Z]
Link to this function

create_utc_datetime(arg1, year, month, day)

View Source

Create a new TimeComponent from an hour with fractional part.

 ## Examples

  iex> TimeComponent.new(12.5)
  %TimeComponent{hour: 12, minute: 30, second: 0}
Link to this function

to_hm_string(time_component)

View Source

Convert a TimeComponent to a string in the format of "HH:MM".

 ## Examples

  iex> TimeComponent.new(12.5) |> TimeComponent.to_hm_string()
  "12:30"