jQueryUI Datepicker: Show one date format to user, use another date format in the background(I have done this bit)

jQueryUI Datepicker: Show one date format to user, use another date format in the background(I have done this bit)

  1. I need help and can't figure this out.I can get the format date i want(2017-02-13) yy-mm-dd and use it in my code
no problem but i don't want to display this to users.I want to display dd/mm/yyyy.
Not sure what i'm missing tried everything below as you can see
See my code below:-

  1. $('#dateto').datepicker({
  2.             altField: "#_dateto",
  3.             altFormat: 'dd/mm/yy',
  4.             dateFormat: 'yy-mm-dd',
  5.             showOn: 'button',
  6.             buttonText: 'Select Date',
  7.             //buttonImageOnly: true,
  8.             autoSize: true,
  9.             //showButtonPanel: true,
  10.             buttonImage: "/SiteAssets/CustomBranding/Calendar.gif",
  11.              buttonImageOnly: true,
  12.             onSelect: function (dateText, inst) {
  13.                 //$(this).parent('form').submit();
  14.                 //alert("You selected: " + dateText);
  15.                 //var hiddenDate = $("[name='altInput']").attr('value');
  16.                //$("#myDate").text(hiddenDate);
  17.                //alert('Current #OnSelectDate value: ' + $("#_dateto").val());
  18.                //$("#dateto").val($("#_dateto").val());
  19.             }
  20.         });

  1. <fieldset>
  2. <label>To Date</label><input type="text" name="date" id="dateto">
  3. <input id="_dateto" type="hidden" value="">
  4. </fieldset>

THanks in Advance