I am trying to send back a date that the user put into the format dd/MM/yyyy
. However, since my back end is in Java, when I create the object in the page (via Thymeleaf) where the date format is MM/dd/yyyy
, it messes up the date.
<form th:action="@{/addDate}" th:object="${date}" method="POST" class="bd-example">
<input type="text" class="form-control" id="dateInput" placeholder="DD/MM/YYYY" th:field="*{date}" required />
Is there any way to change this value in the page without modifying the method of the object in the back end?