Summary
Functions
Calculates the week number of week days between from_date and to_date.
Returns the earliest date.
Returns the latest date
Converts dateable to %Date{}. It will return nil for nil values.
Returns the morning of NaiveDateTime.utc_now().
Types
@type calendar_ext() :: Date.t() | DateTime.t() | NaiveDateTime.t()
@type dateable() :: Date.t() | DateTime.t() | NaiveDateTime.t()
@type nillable_date() :: Date.t() | nil
Functions
Calculates the week number of week days between from_date and to_date.
Examples
iex> CalendarExt.diff_weekdays(~D[2020-10-10], ~D[2020-10-20]) 6
It will return 0 if the second date is in the past
iex> CalendarExt.diff_weekdays(~D[2020-10-10], ~D[2020-08-20]) 0
@spec max(CalendarExt.Comparible.t(), CalendarExt.Comparible.t()) :: CalendarExt.Comparible.t()
Returns the earliest date.
@spec min(CalendarExt.Comparible.t(), CalendarExt.Comparible.t()) :: CalendarExt.Comparible.t()
Returns the latest date
@spec outside?( CalendarExt.Comparible.t(), CalendarExt.Comparible.t(), CalendarExt.Comparible.t() ) :: true | false
@spec to_date(dateable()) :: nillable_date()
Converts dateable to %Date{}. It will return nil for nil values.
@spec utc_morning() :: NaiveDateTime.t()
Returns the morning of NaiveDateTime.utc_now().