I found an issue in JA Job Board Package for J25’s components/helper/jafunctions.class related to jaCompareDate.
We were having an issue with new Employer Signups with a free trial for 1 month showing expired upon creation. The date was populating in the field (expiry date) correctly with 2013-01-06; however, it was showing (Expired!) to the right of the date.
After some digging, it appears that the jaCompareDate function is building a numeric yyyymmdd integer incorrectly. For example, an Employer User created today under the 1 month subscription should have an expiry date of 2013-01-06. Today’s date is 2012-12-06.
In jaCompareDate it was using a formula of y*100+m*10+d; which for these two dates would calculate:
2012-12-06 = 2012*100 + 12 * 10 + 06 = 201326
2013-01-06 = 2013*100 + 01 * 10 + 06 = 201316
As you can see, based on this formula, the account was showing expired because the ending date is less than the current date.
I modified the two lines in jaCompareDate to read as:
//$ts1 = $y1*100+$m1*10+$d1;
$ts1 = $y1*10000+$m1*100+$d1;
//$ts2 = $y2*100+$m2*10+$d2;
$ts2 = $y2*10000+$m2*100+$d2;
This is correctly calculating a date integer as:
2012-12-06 = 2012*10000 + 12*100 + 06 = 20121206
2013-01-06 = 2013*10000 + 01*100 + 06 = 20130106
and the accounts are no longer showing as expired.
I hope that this helps someone else out.
Best regards,
Robert A. Wayne, Jr.
Lead Technology Consultant
Virtutem, LLC
http://www.virtutem.com