Skip to content

subtractMonths ​

Subtracts a number of months from a TheDate.

Interactive example ​

Syntax ​

Classic signature ​

typescript
function subtractMonths<
	GenericInput extends TheDate | SerializedTheDate, 
	GenericMonth extends number
>(
	input: GenericInput,
	month: GenericMonth
): TheDate

Curried signature ​

typescript
function subtractMonths<
	GenericInput extends TheDate | SerializedTheDate, 
	GenericMonth extends number
>(
	month: GenericMonth
): (input: GenericInput) => TheDate

Parameters ​

  • month: Number of months to subtract.
  • input: TheDate or SerializedTheDate.

Return value ​

A TheDate moved back by the given number of months.

See also ​

Released under the MIT license.