@progress/kendo-date-math
Version:
Kendo UI typescript package exporting functions for Date manipulations
15 lines (14 loc) • 442 B
TypeScript
/**
* A function that adds and subtracts months from a `Date` object.
*
* @param date - The initial date value.
* @param offset - The number of months to add or subtract from the date.
* @returns - A new `Date` instance.
*
* @example
* ```ts-no-run
* addMonths(new Date(2016, 5, 1), 5); // 2016-11-1
* addMonths(new Date(2016, 5, 1), -5); // 2015-1-1
* ```
*/
export declare const addMonths: (date: Date, offset: number) => Date;