Loading src/main/java/com/example/demo/validator/HelpPropositionValidator.java +9 −0 Original line number Diff line number Diff line Loading @@ -25,7 +25,16 @@ public class HelpPropositionValidator implements Validator { } ValidationUtils.rejectIfEmptyOrWhitespace(errors, "timeBegin", "timeBegin.empty", "You must enter a time begin!"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "timeEnd", "timeEnd.empty", "You must enter a time end!"); if(helpProposition.getDateBegin().after(helpProposition.getDateEnd())){ System.out.println(helpProposition.getDateBegin()); System.out.println(helpProposition.getDateEnd()); errors.rejectValue("dateBegin", "dateBegin.size", "The begin date must be set before the end date!"); }else{ System.out.println("nop"); } } } No newline at end of file src/main/java/com/example/demo/validator/HelpRequestValidator.java +5 −0 Original line number Diff line number Diff line Loading @@ -26,7 +26,12 @@ public class HelpRequestValidator implements Validator { } ValidationUtils.rejectIfEmptyOrWhitespace(errors, "timeBegin", "timeBegin.empty", "You must enter a time begin!"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "timeEnd", "timeEnd.empty", "You must enter a time end!"); if(helpRequest.getDateBegin().after(helpRequest.getDateEnd())){ errors.rejectValue("dateBegin", "dateBegin.size", "The begin date must be set before the end date!"); } } } No newline at end of file Loading
src/main/java/com/example/demo/validator/HelpPropositionValidator.java +9 −0 Original line number Diff line number Diff line Loading @@ -25,7 +25,16 @@ public class HelpPropositionValidator implements Validator { } ValidationUtils.rejectIfEmptyOrWhitespace(errors, "timeBegin", "timeBegin.empty", "You must enter a time begin!"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "timeEnd", "timeEnd.empty", "You must enter a time end!"); if(helpProposition.getDateBegin().after(helpProposition.getDateEnd())){ System.out.println(helpProposition.getDateBegin()); System.out.println(helpProposition.getDateEnd()); errors.rejectValue("dateBegin", "dateBegin.size", "The begin date must be set before the end date!"); }else{ System.out.println("nop"); } } } No newline at end of file
src/main/java/com/example/demo/validator/HelpRequestValidator.java +5 −0 Original line number Diff line number Diff line Loading @@ -26,7 +26,12 @@ public class HelpRequestValidator implements Validator { } ValidationUtils.rejectIfEmptyOrWhitespace(errors, "timeBegin", "timeBegin.empty", "You must enter a time begin!"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "timeEnd", "timeEnd.empty", "You must enter a time end!"); if(helpRequest.getDateBegin().after(helpRequest.getDateEnd())){ errors.rejectValue("dateBegin", "dateBegin.size", "The begin date must be set before the end date!"); } } } No newline at end of file