Cldr.Calendar.previous
You're seeing just the function
previous
, go back to Cldr.Calendar module for more information.
Returns the previous date or date range for a date period (year, quarter, month, week or day).
Arguments
date_or_date_range
is anyDate.t
orDate.Range.t
period
is:year
,:quarter
,:month
,:week
or:day
options
is a Keyword list of options that is passed toplus/4
orminus/4
Returns
When a Date.t
is passed, a Date.t
is
returned. When a Date.Range.t
is passed
a Date.Range.t
is returned.
Examples
iex> Cldr.Calendar.previous ~D[2019-01-01], :day
~D[2018-12-31]
iex> Cldr.Calendar.previous ~D[2019-01-01], :quarter
~D[2018-10-01]
iex> Cldr.Calendar.previous ~D[2019-01-01], :month
~D[2018-12-01]
iex> Cldr.Calendar.previous ~D[2019-01-01], :year
~D[2018-01-01]