I have an Integer
for month in the DTO
class. While displaying on thymeleaf template, I just want it to be month name in string like 'January' for integer value 0, and so on. I checked #dates
but could not find one.
Shall use java.time.Month
enumeration as below and convert case as you want. In this case I'm getting initcapped month name like January
.
th:text=${#strings.capitalize(#strings.toLowerCase(T(java.time.Month).of(dto.monthField+1).name))}