I'm currently utilizing Bootstrap for my web application.
I've developed a method that initializes all input fields of type date with a class called form_datetime:
function initDatepicker(){
$(".form_datetime").datepicker({
format: "dd/mm/yyyy",
weekStart: 1,
language: "it",
todayHighlight: true,
autoclose: true,
orientation:"auto"
});
}
The HTML input code:
<input name="date" class="form-control form_datetime date"
type="text"
ng-model="date"
required >
The issue arises when selecting the date field, as it clears the input box and loses the previously set value (obtained from the database).
The date is in string format "dd/mm/yyyy".
How can I have the current date populated in the calendar when selecting the input field?