Skip to content

subtractMonths

Subtracts a positive number of months from a TheDate.

Interactive example

Syntax

Classic signature

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

Curried signature

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

Parameters

  • month: Number of months to subtract.
  • input: Source date.

Return value

A TheDate moved back by the given number of months.

See also

Released under the MIT license.