for (i = 0; i<8; i++) { buffer[i] = blankbyte; }
return;
}
if (inValue.length() != 8)
throw new xBaseJException("Invalid length for date Field");
for (i = 0; i<8; i++) {
if (Character.isDigit(inValue.charAt(i)) == false) {
throw new xBaseJException("Invalid format for date Field, " + inValue + " non numeric at position " + i);
}
}
int yea= Integer.parseInt(inValue.substring(0, 4));
int mo = Integer.parseInt(inValue.substring(4, 6));
if (mo < 1 || mo > 12)
throw new xBaseJException("Invalid format for date Field (month) " + inValue ) ;
int da = Integer.parseInt(inValue.substring(6, 8));
if (da < 1)
throw new xBaseJException("Invalid format for date Field (day) " + inValue);
int month[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
if ( yea == 2000 ||
( ( (yea % 4) == 0) && ( (yea % 100) != 0) )
)
month[2]++;
if (da > month[mo])
throw new xBaseJException("Invalid format for date Field, number of days > days in month");
super.put(inValue);
}