Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Feb 29... Javascript error


Mikey

Recommended Posts

Posted

Hi all,

 

Before I begin, I just wanted to mention that I wasn't sure what forum to post this information. Please make sure that the appropriate people get to see this.

 

I think I found an error in the General.js file located in the catalog/includes folder.

 

I verified this in TEP 18 Feb 2004 and in OSC ms2.2

 

In the function IsValidDate on line line 69 the value for February is 28.

 

var intDaysArray = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

 

This year there are 29 days in February, how will that affect oscommerce?

 

I am not a programmer anymore, so I am not capable of rewriting the function to correct it. However, from my past experience programming, I believe the correct action would be to simply change the 28 to a 29. But don't quote me on that. I have no way of testing that theory.

 

Are there any other such functions in OSC that should be corrected to deal with the February 29 issue that occurs once every 4 years?

 

 

Mikey

 

Thinking my way out of the box.

Posted
I am not a programmer anymore

 

 

Did you quit programming after Y2K?

 

Look down a few more lines.

 

  if (IsLeapYear(intYear) == true) {
   intDaysArray[1] = 29;
 }

Posted

Thanks for your reply, I must have missed that.

 

Did you quit programming after Y2K?

 

For your information, yes, I stopped prgramming several years prior to Y2K. Not that it should make any difference.

 

Mikey

 

Thinking my way out of the box.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...