Azan.TimeComponent (AzanEx v0.3.0)

View Source

Documentation for TimeComponent.

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".

Types

t()

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

Functions

create_utc_datetime(arg1, date)

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]

create_utc_datetime(arg1, year, month, day)

new(num)

Create a new TimeComponent from an hour with fractional part.

 ## Examples

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

to_hm_string(time_component)

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

 ## Examples

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