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:
- <input type="text" id="dateClosingDate" name="dateClosingDate" value="<?php echo $closing_date; ?>" autocomplete="off" readonly required>
and this is the jquery:
- $(function ()
- {
- $("#dateClosingDate").datepicker({
- dateFormat: "dd-mm-yy",
- numberOfMonths: 2,
- changeMonth: true,
- changeYear: true,
- minDate: +1,
- maxDate: "+90D",
- defaultDate: 7,
- showOn: "button",
- buttonImage: "http://www.xoompage.com/images/calendar.gif",
- buttonImageOnly: false }).datepicker('setDate', '90');
- });
this is the view.source:
- <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?