79717577

Date: 2025-07-28 15:49:36
Score: 0.5
Natty:
Report link

Lucky solution is

            <label for="look-date">Choose the year and month (yyyy-MM):</label>
            <input type="month" th:field="${datePicker.lookDate}" id="look-date"/>

but it is important to change type to java.util.Date

@Data
public class DatePickerDto implements Serializable {
    @DateTimeFormat(pattern = "yyyy-MM")
    private Date lookDate; 

    private String dateFormat = "yyyy-MM";
}

How to enable html form to handle java.time.LocalDate ? 🤔 I don't know

Reasons:
  • Whitelisted phrase (-1): solution is
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: haoz