New to KendoReactStart a free 30-day trial

Definition

Package:@progress/kendo-date-math

Syntax:

ts
durationInYears(new Date(2016, 0, 1), new Date(2028, 0, 1)); // 12
durationInYears(new Date(2016, 0, 1), new Date(2022, 0, 1)); // 6
durationInYears(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0

A function that calculates duration in years between two Date objects.

Parameters:startDate

The start date value.

endDate

The end date value.

Returns:

number

  • The duration in years.
In this article
Definition
Not finding the help you need?
Contact Support