BexioApiClient.Helpers (bexio_api_client v0.1.2)

Helper Functionality used in multiple places mostly to work around different type of the api and elixir

Link to this section Summary

Functions

Convert the given string into an Elixir date.

Convert the given string into an Elixir date.

Link to this section Functions

Link to this function

string_to_array(string)

@spec string_to_array(String.t() | nil) :: [integer()]
@spec to_date(String.t() | nil) :: Date.t() | nil

Convert the given string into an Elixir date.

Examples:

iex> BexioApiClient.Helpers.to_date(nil)
nil

iex> BexioApiClient.Helpers.to_date("2013-02-22")
~D[2013-02-22]
Link to this function

to_datetime(datetime)

@spec to_datetime(String.t() | nil) :: DateTime.t() | nil

Convert the given string into an Elixir date.

Examples:

iex> BexioApiClient.Helpers.to_datetime(nil)
nil

iex> BexioApiClient.Helpers.to_datetime("2022-09-13 09:14:21")
~U[2022-09-13 07:14:21Z]