how to accept a future date in a param request?

Viewed 476

I would like that in my controller the update service would only accept dates after the current one, I tried to use the future annotation but it doesn't work ... could you give me a suggestion? in particular, I would like if the user entered the date 1990-04-01T12: 08: 56Z the service would return 400 because the entered date is not later than the current one, I thought the @Future annotation worked in this sense instead I was wrong and still allows the execution of the service

@PatchMapping(path = "/{id}", produces = "application/json")
    public ResponseEntity<Employee> update(@PathVariable(value = "id") Integer id,
            @RequestParam(value = "afterdate") @Future @DateTimeFormat(pattern =" yyyy-MM-dd'T'HH:mm:ss'Z'")  Date afterdate) { .... 
0 Answers
Related