Cldr.Calendar.interval
You're seeing just the function
interval, go back to Cldr.Calendar module for more information.
Specs
interval( date_from :: Date.t(), date_to_or_count :: Date.t() | non_neg_integer(), precision() ) :: [Date.t()]
Returns an Enumerable list of dates of a given precision
of either :years, :quarters, :months, :weeks or
:days
Arguments
date_fromis a anyDate.tthat is the start of the sequencedate_to_or_countis upper bound of the sequence as aDate.tor the number of dates in the sequence to be generatedprecisionis one of:years,:quarters,:months,:weeksor:days
The sequence is generated starting with date_from until the next date
in the sequence would be after date_to.
Notes
The sequence can be in ascending or descending date order
based upon whether date_from is greater than date_to.
Returns
- A list of dates
Examples
iex> d = ~D[2019-01-31]
~D[2019-01-31]
iex> d2 = ~D[2019-05-31]
~D[2019-05-31]
iex> Cldr.Calendar.interval d, 3, :months
[~D[2019-01-31], ~D[2019-02-28], ~D[2019-03-31]]
iex> Cldr.Calendar.interval d, d2, :months
[~D[2019-01-31], ~D[2019-02-28], ~D[2019-03-31],
~D[2019-04-30], ~D[2019-05-31]]