Search code examples
htmldatethymeleaf

How do add a month to a date in Thymeleaf?


I have ${{status.startDate}}, and I would like to show ${{status.startDate + 1 month}}

How could I do that with Thymeleaf, without doing it in my Controller or Translator or using any other module ?


Solution

  • In this case you can just use the defined methods of LocalDate...

    ${{status.startDate.plusMonths(1)}}