I read many questions here but not find a solution for problem.
I have one page which has two dates and one text box. When I click on text box the difference of two dates in days will show on text box. But when I change the dates and click on text box it doesn't work.
Code
$('#totalNoOfLeave').click(function(){
var date1 = new Date($('#leaveStartDate').getValue());
var date2 = new Date($('#leaveEndingDate').getValue());
var timeDiff = Math.abs(date2.getTime() - date1.getTime());
var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
$('#totalNoOfLeave').setValue(diffDays);
});
Please help.
focus