KendoUI does not have a build-in method for calculating difference between two dates. It is possible to retrieve the selected dates by the value method of the DatePicker and do the calculations via JavaScript. For example:
var startDate = $("#startDate").data("kendoDatePicker").value();
var endDate = $("#endDate").data("kendoDatePicker").value();
var diff = Math.round((endDate - startDate)/1000/60/60/24); //Difference in days
In the attachments you can find a sample page where you could see this approach in action.
Greetings,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
that does not work will when daylight savings time come into play
0
Boyan Dimitrov
Telerik team
answered on 30 Mar 2017, 02:27 PM
Hello Mosh,
I guess same result will happen if we calculate the difference between two simple JavaScript Date objects. What the value method of the DatePicker does is simply to return a JavaScript Date object.