private void init(String field, String datePattern) throws ValidationException {
setType(Date.class);
setField(field);
if (datePattern != null) {
this.datePattern = new DatePattern(datePattern, null, true, false);
//parse the date format to ensure its legal
try {
this.datePattern.dateFormat();
}