New to Kendo UI for VueStart a free 30-day trial

durationInMonths

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

ts
durationInMonths(new Date(2016, 0, 1), new Date(2017, 0, 1)); // 12
durationInMonths(new Date(2016, 6, 1), new Date(2017, 0, 1)); // 6
durationInMonths(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0

Parameters

start

Date

The start date value.
end

Date

The end date value.

Returns

number

- The duration in months.
Not finding the help you need?
Contact Support