function process(date){
var parts = date.split("/");
return new Date(parts[2], parts[1] - 1, parts[0]);
}
$('.datechange').change(function(){
var fromdate = new Date(process($('input[name=from_date]').val()));
var todate = new Date(process($('input[name=to_date]').val()));
var timeDiff = Math.abs(todate.getTime() - fromdate.getTime());
var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
$('.total_days').html(diffDays);
});
var parts = date.split("/");
return new Date(parts[2], parts[1] - 1, parts[0]);
}
$('.datechange').change(function(){
var fromdate = new Date(process($('input[name=from_date]').val()));
var todate = new Date(process($('input[name=to_date]').val()));
var timeDiff = Math.abs(todate.getTime() - fromdate.getTime());
var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
$('.total_days').html(diffDays);
});
0 comments:
Post a Comment