Date.new-exclamation-mark
You're seeing just the function
new-exclamation-mark
, go back to Date module for more information.
Specs
new!(Calendar.year(), Calendar.month(), Calendar.day(), Calendar.calendar()) :: t()
Builds a new ISO date.
Expects all values to be integers. Returns date
if each
entry fits its appropriate range, raises if the date is invalid.
Examples
iex> Date.new!(2000, 1, 1)
~D[2000-01-01]
iex> Date.new!(2000, 13, 1)
** (ArgumentError) cannot build date, reason: :invalid_date
iex> Date.new!(2000, 2, 29)
~D[2000-02-29]