convert datepicker format into input field

I do have a form with a simple input field, using the jquery datepicker.

<input class="date" id="mydate" name="mydate" value="<?php echo $_GET['mydate']; ?>" />

When I send the form, the date format of my parameter have to be: YYYY-MM-DD.

www.mydomain.com/?mydate=2018-06-10

My javascript does look like this:

$(document).ready(function() {
        $("#mydate").datepicker({
          format: "yyyy-mm-dd"
        })

Now, if I use the datepicker to select a date, the date format inside my input field is also YYYY-MM-DD. But for the vistor,the date format should look like this: DD.MM.YYYY.

Is there a way to convert the output of the date into another format? Thank you!



jQuery datepicker provide altField option for this purpose:

Read documentation for more detail.