I am trying to subtract two date fields that I thought would be very easy. I'm creating a form in Adobe Acrobat. However, I am either coming up with a blank field or the "NaN" message and I don't know why.
Both of my fields are formatted as a date field. My calculation field is formatted as a general field. I have searched the internet and am still coming up short.
Here is my code:
var b=getField("901d").value;
var e=getField("901e").value
var Begdate=new Date(b);
var Enddate=new Date(e);
var difference=(Begdate-Enddate)/86400000;
event.value=difference + " days";
Can anyone see the problem?
Thanks in advance.
Both of my fields are formatted as a date field. My calculation field is formatted as a general field. I have searched the internet and am still coming up short.
Here is my code:
var b=getField("901d").value;
var e=getField("901e").value
var Begdate=new Date(b);
var Enddate=new Date(e);
var difference=(Begdate-Enddate)/86400000;
event.value=difference + " days";
Can anyone see the problem?
Thanks in advance.