Expand my Community achievements bar.

How to Calculate number of months between two dates

Avatar

Level 1

Hi All,

   In one of the fomr developments, I have to calculate the

  • Number of Days
  • Number of Months ( Considering Leap Year) provided by the dates, end user enters in the form,

After going thorugh some forum discussion, I have come to know about so many things which were not clear till now.

I have gone through various forums too,  some one suggets to make use of FORM CALC and some other JAVA SCRIPT. But the logic i want to build in java script.

The most interesting point is the DATE object is not getting created when i write  the below code

  var startDate = new DATE(oYear, oMonth, oDay);

I am still not clear, that really the date object gets created in Adobe form If so the why the alert box is getting populated when i write below lines

var oTemp = startDate.getFullYear();

xfa.host.messagebox(oTemp);

So, there are so many unclear things,

If any one can help me by suggesting the approach and how to build the logic in the JavaScript I would be really thankful

Regards

PavanChand

0 Replies