Añadir restriccion para la edad de un empleado
This commit is contained in:
parent
cab12f7ae5
commit
c9f2e0900a
@ -184,7 +184,7 @@ public class EmployeeView extends BeanValidationForm<Employee> implements HasUrl
|
|||||||
LocalDate selectedDate = event.getValue();
|
LocalDate selectedDate = event.getValue();
|
||||||
if (selectedDate != null && ChronoUnit.YEARS.between(selectedDate, LocalDate.now()) < 18) {
|
if (selectedDate != null && ChronoUnit.YEARS.between(selectedDate, LocalDate.now()) < 18) {
|
||||||
birthday.setInvalid(true);
|
birthday.setInvalid(true);
|
||||||
birthday.setErrorMessage("El empleado debe ser mayor de 18 años");
|
birthday.setErrorMessage("El empleado debe ser mayor o tener 18 años");
|
||||||
} else {
|
} else {
|
||||||
birthday.setInvalid(false);
|
birthday.setInvalid(false);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user