MCPcopy
hub / github.com/date-fns/date-fns / addYears

Function addYears

pkgs/core/src/addYears/index.ts:33–42  ·  view source on GitHub ↗
(
  date: DateArg<DateType>,
  amount: number,
  options?: AddYearsOptions<ResultDate> | undefined,
)

Source from the content-addressed store, hash-verified

31 * //=> Sun Sep 01 2019 00:00:00
32 */
33export function addYears<
34 DateType extends Date,
35 ResultDate extends Date = DateType,
36>(
37 date: DateArg<DateType>,
38 amount: number,
39 options?: AddYearsOptions<ResultDate> | undefined,
40): ResultDate {
41 return addMonths(date, amount * 12, options);
42}

Callers 7

test.tsFile · 0.90
subYearsFunction · 0.90
fp.jsFile · 0.85
fp.tsFile · 0.85
fp.jsFile · 0.85
example.jsFile · 0.85
fp.jsFile · 0.85

Calls 1

addMonthsFunction · 0.90

Tested by

no test coverage detected