I have this, I need to be able to autocomplete the box with the date without the need to select anything. How could I do that?
jQuery('#start_date2').datepicker({
format: '{{ $global->date_picker_format }}',
autoclose: true,
todayHighlight: true
}).on('changeDate', function (selected) {
$('#due_date2').datepicker({
format: '{{ $global->date_picker_format }}',
autoclose: true,
todayHighlight: true
});
var minDate = new Date(selected.date.valueOf());
$('#due_date2').datepicker("update", minDate);
$('#due_date2').datepicker('setStartDate', minDate);
});
$(".select2").select2({
formatNoMatches: function () {
return "{{ __('messages.noRecordFound') }}";
}
});
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.4.1.min.js"></script>
<script src="//code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<link href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet"/>
<input type="text" name="start_date" id="start_date2" class="form-control" autocomplete="off">