CalendarExt (calendar_ext v0.1.2)
Link to this section 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().
Link to this section Types
Link to this type
calendar_ext()
Specs
calendar_ext() :: Date.t() | DateTime.t() | NaiveDateTime.t()
Link to this type
dateable()
Specs
dateable() :: Date.t() | DateTime.t() | NaiveDateTime.t()
Link to this section Functions
Link to this function
diff_weekdays(from_date, to_date)
Specs
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
Link to this function
max(left, right)
Specs
Returns the earliest date.
Link to this function
min(left, right)
Specs
Returns the latest date
Link to this function
outside?(date, start_date, end_date)
Specs
outside?( CalendarExt.Comparible.t(), CalendarExt.Comparible.t(), CalendarExt.Comparible.t() ) :: true | false
Link to this function
to_date(date)
Specs
Converts dateable to %Date{}. It will return nil for nil values.
Link to this function
utc_morning()
Specs
utc_morning() :: NaiveDateTime.t()
Returns the morning of NaiveDateTime.utc_now().