I have searched high and low for a solution and have yet to find one that works for my calculation.
Here is the code I currently have in the field doing the calculation:
var oneDay = 24*60*60*1000;
var firstDate = new Date(rentalbegin.rawValue);
var secondDate = new Date(rentalend.rawValue);
Math.abs((firstDate.getTime() - secondDate.getTime())/(oneDay));
This calculates the difference between two dates to determins the total amount of rental days. The problem is, when only one variable is entered the calculation reads the empty field as 0 and calculates the difference. I need something that says 'if rentalend == 0 then event.value = "" '. I appreciate any help in this matter.
You need to check if the fields' raw values are empty, not the Date objects
you make from them.
Also, is this a LC form? If so, you should post your questions about it at
the LiveCycle Designer forum.
Ok, terribly sorry. Thanks for the help.