Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Calculating Years and Months

$
0
0

I want to have a field that will calculate out the years and months a person has been employed at my business.  I know the calculations for getting the years is:

 

if (HasValue(dob)) then

          var currDate_ = Date2Num(currDate.formattedValue, "MM/DD/YYYY")

          var dob_ = Date2Num(dob.formattedValue, "MM/DD/YYYY")

          var diff = currDate_ - dob_

          $.rawValue = Floor(diff / 365.25)

else

          $.rawValue = null

endif

 

 

I want to  find it put out so it says 5 years 3 months if that is possible, or something close to that.


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>