Why is not working datepicker date format, I will continue trying to show date format like dd-mm-yy but it getting dd/mm/yy. I don’t know why my format not working using jQuery datepicker() function.
Datepicker Code:
<script type="text/javascript"> $(function () { $("#qtdate").datepicker({ format: "dd-mm-yy", showOtherMonths: true, selectOtherMonths: true, autoclose: true, }); }); </script>
You need to use dateFormat to display right date format in your input field. Follow this example code and Apply it.
<script type="text/javascript"> $(function () { $("#qtdate").datepicker({ dateFormat: "dd-mm-yy" }); }); </script>
For Example:
<script type="text/javascript"> $(function () { $("#qtdate").datepicker({ dateFormat: "dd-mm-yy", showOtherMonths: true, selectOtherMonths: true, autoclose: true, changeMonth: true, changeYear: true, orientation: "top", }); }); </script>
Now look your input date field.
Date display: 01-01-2019
Question and answer is powered by AnsPress.io