1,6 → 1,7 |
package ak.kickup.util; |
|
import java.math.BigDecimal; |
import java.util.Date; |
import java.text.NumberFormat; |
import java.text.ParseException; |
|
55,4 → 56,24 |
return null; |
} |
} |
|
public static Date validateDateTime(Object bean, ValidatorAction va, Field field, |
ActionErrors errors, HttpServletRequest request) |
{ |
String value = null; |
if((bean == null) || (bean instanceof String)) |
value = (String)bean; |
else |
value = ValidatorUtil.getValueAsString(bean, field.getProperty()); |
|
if(value == null || "".equals(value)) return null; |
|
try { |
return StringConverter.DATE_TIME_FORMAT.parse(value); |
} |
catch(ParseException ex) { |
errors.add(field.getKey(), Resources.getActionError(request, va, field)); |
return null; |
} |
} |
} |