Cldr.Calendar.interval_stream
You're seeing just the function
interval_stream, go back to Cldr.Calendar module for more information.
Specs
interval_stream( date_from :: Date.t(), date_to_or_count :: Date.t() | non_neg_integer(), precision() ) :: (... -> any())
Returns an a Stream function than can be lazily
enumerated.
This function has the same arguments and provides
the same functionality as interval/3 exept that
it is lazily evaluated.
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_stream(d, 3, :months) |> Enum.to_list
[~D[2019-01-31], ~D[2019-02-28], ~D[2019-03-31]]
iex> Cldr.Calendar.interval_stream(d, d2, :months) |> Enum.to_list
[~D[2019-01-31], ~D[2019-02-28], ~D[2019-03-31],
~D[2019-04-30], ~D[2019-05-31]]