Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • viradmin Friend
    #182882

    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

    HeR0 Friend
    #475437

    Hi Viradmin,

    Thank you for reporting us. I have checked and confirmed that it is our bug.

    I have notified to Dev team at http://pm.joomlart.com/browse/JAJBJ25-246 for further checking.

    Regards

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  HeR0 11 years, 11 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum