Simple Banner Rotator Date Comparison Anomaly?

All help and support for our free scripts should be posted here

Simple Banner Rotator Date Comparison Anomaly?

Postby wthomas » Thu Jul 29, 2010 11:39 am

First, I've found the features in the Banner Rotator great for our needs. Thank you for providing it.

When entering expiration dates for August and September 2010, (months '08' & '09') the banners would not appear. I tracked the anomaly down to the statement: k.setFullYear(parseInt(j[2]),parseInt(j[1])-1,parseInt(j[0]));

parseinit() will default to octal base numbering if no radix is specified and the string begins with '0'. See: http://www.w3schools.com/jsref/jsref_parseInt.asp

I therefore modified the above statement to: k.setFullYear(parseInt(j[2]),parseInt(j[1],10)-1,parseInt(j[0],10));
to handle these two unique numbers. I did not bother to specify the radix for j[2] since it will never begin with '0'.

Are you in agreement this is the best solution?
wthomas
 
Posts: 1
Joined: Thu Jul 29, 2010 11:20 am

Re: Simple Banner Rotator Date Comparison Anomaly?

Postby Josh » Sat Jul 31, 2010 1:48 pm

If it fixes the problem then yes :D
Josh
Site Admin
 
Posts: 227
Joined: Sat Jul 11, 2009 10:52 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron