I have my datepicker set up like this
$("#scheduled_date_163").datepicker({
onSelect: function(dateText, inst) {
jQuery.get("/tasks/inplace_edit?id=scheduled_date_163&class_name=Task&value=" + dateText, function(data){
$('#scheduled_date_163').html(data);
$('#scheduled_date_163').removeClass('hasDatepicker');
})
}
});
$('#scheduled_date_163').datepicker( "option", "defaultDate", $.datepicker.parseDate("d m y", "31 8 2009") );
As you can see the date is hardcoded. It is supposed to be replaced with some code. However, the datepicker refuses to pick the date up! It always shows me the current date. Unable to figure out why. I even tried giving the date in string and +7
etc. But today's date itself is shown as the default date.
What could be causing this?
UPDATE
The element with scheduled_date_163 is not a textfield. Its a div.On click of which the above written datepicker javascript executes.
<div id="scheduled_date_163">
<p class='date'>None</p>
</div>
There is not way that the div ID repeats on the page.