Using 1.1.1959 I was not able to client-side validate any dates that had a leading zero in the month field (UK format dd/MM/yyyy). Server side was ok. Had a look at the validation code and the following doesn't make much sense:
BDPLite.prototype.getInt = function(str,i,minlength,maxlength) {
for (var x=maxlength; x>=minlength; x--){
var valuePart = str.substring(i, i + x);
if (valuePart.length < minlength) {
return null;
}
if (this.isInteger(valuePart)) {
for (var y = 0; y < valuePart.length; y++) {
if (valuePart.charAt(y) != "0")
return valuePart;
else
break;
}
}
}
return null;
};
When processing a month field eg, it gets called with the following params: geInt("25/04/2006", 3, 2, 2)
Which returns null for any month-value passed in with a leading zero. The second for loop will only ever execute once and either return a non-leading zero value or break out if there is a leading zero causing the "return null" at the end to get executed. I changed the function to return immediately if valuePart is an integer and it works fine. Am I missing something??