diff --git a/src/main/java/com/josdem/vetlog/command/PetCommand.java b/src/main/java/com/josdem/vetlog/command/PetCommand.java index 1845af03..b826619f 100644 --- a/src/main/java/com/josdem/vetlog/command/PetCommand.java +++ b/src/main/java/com/josdem/vetlog/command/PetCommand.java @@ -68,4 +68,8 @@ public class PetCommand implements Command { private transient List images = new ArrayList<>(); private transient List vaccines = new ArrayList<>(); + + public void defaultBirthDateAndTime() { + this.birthDate = birthDate + "T" + "06:00"; + } } diff --git a/src/main/java/com/josdem/vetlog/validator/PetValidator.java b/src/main/java/com/josdem/vetlog/validator/PetValidator.java index 5a2a0946..d3beb382 100644 --- a/src/main/java/com/josdem/vetlog/validator/PetValidator.java +++ b/src/main/java/com/josdem/vetlog/validator/PetValidator.java @@ -33,6 +33,7 @@ public boolean supports(Class clazz) { @Override public void validate(Object target, Errors errors) { PetCommand petCommand = (PetCommand) target; + petCommand.defaultBirthDateAndTime(); validateBirthdate(errors, petCommand); } diff --git a/src/main/resources/templates/pet/create.html b/src/main/resources/templates/pet/create.html index d9e97f1d..576e1dd6 100644 --- a/src/main/resources/templates/pet/create.html +++ b/src/main/resources/templates/pet/create.html @@ -5,6 +5,12 @@ +
@@ -29,7 +35,7 @@