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