HI Guys,
I have 2 asp.net texboxes with calendar extender. i want to find out the number of days between both dates when one of the date control is changed. how can i achieve this using jquery or javascript ?
HI Guys,
I have 2 asp.net texboxes with calendar extender. i want to find out the number of days between both dates when one of the date control is changed. how can i achieve this using jquery or javascript ?
var start = $('#start_date').val();
var end = $('#end_date').val();
// end - start returns difference in milliseconds
var diff = new Date(end - start);
// get days
var days = diff/1000/60/60/24;
var start = new Date("2010-04-01");
var end = new Date();
var diff = new Date(end - start);
var days = diff/1000/60/60/24
days //=> 8.525845775462964