I have this code snippet that displays a datepicker with the use of Jquery
$(function () {
$('#orderDate').datepicker({
dateFormat: 'dd-mm-yy'
})
})
$("#orderDate").datepicker().datepicker("setDate", new Date());
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
It shows me the datepicker and takes the value, but it puts it in "MM-DD-YY" format as shown in the image and I would like it to be in dd-mm-yy format
Thank you
Try / instead of -
If you are using jQuery UI it should work for you.
If you are using any other plugin you should check their documentation.
Here is an example with jQuery UI working: