Description
Have the ability to pass a date format string to the validator so that the dates will format how the developer desires when a validation error is hit. I have included an example of how I worked around the problem. Feel free to use this as a starting point.
Example:
public class CustomMinimumDateValidator extends AbstractValidator<Date> {
private final Date minimum;
private final String format;
public CustomMinimumDateValidator(Date minimum, String format)
{ this.minimum = minimum; this.format = format; } @Override
protected void onValidate(IValidatable<Date> validatable) {
Date value = validatable.getValue();
if (value.before(minimum))
}
@Override
protected Map<String, Object> variablesMap(IValidatable<Date> validatable)
@Override
protected String resourceKey()
}