0

I am using the below code to insert the date selected into 2 inputs. Works like a charm, but what I would like to know is, is there any way to change the date format it inserts into the input?

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script>
    $(function() {
    $( "#startdatepicker" ).datepicker();
    $( "#enddatepicker" ).datepicker();
    });
</script>
Marcel
  • 874
  • 1
  • 14
  • 28

1 Answers1

4

Init it this way

$('#startdatepicker').datepicker(
   { dateFormat: 'dd-mm-yy' }
);
void
  • 36,090
  • 8
  • 62
  • 107