datepicker is not getting the correct date

datepicker is not getting the correct date

Hi,

I am using the jquery datepicker. When trying to read the date from MySQL I am getting read.. at least that's what I am getting when checking the view.source but the value on the from end is not what I want. here is the code:

  1. <input type="text" id="dateClosingDate" name="dateClosingDate" value="<?php echo $closing_date; ?>" autocomplete="off" readonly required>
and this is the jquery:

  1. $(function ()
  2. {
  3.     $("#dateClosingDate").datepicker({
  4.     dateFormat: "dd-mm-yy",
  5.     numberOfMonths: 2,
  6.     changeMonth: true,
  7.     changeYear: true,
  8.     minDate: +1,
  9.     maxDate: "+90D",
  10.     defaultDate: 7,
  11.     showOn: "button",
  12.     buttonImage: "http://www.xoompage.com/images/calendar.gif",
  13.     buttonImageOnly: false }).datepicker('setDate', '90');
  14. });
this is the view.source:
  1. <input type="text" id="dateClosingDate" name="dateClosingDate" value="21-03-2014" autocomplete="off" readonly required>
21-03-2014 is the correct value to be shown on the dateClosing but at the user front end I am getting 17-04-2014 which is the +90days.

What's my mistake?