Hello all, Currently this code is working but not as expected:
$("#start_date").datepicker({
dateFormat: 'yy-mm-dd',
onSelect: function(_date, _datepicker)
{
var myDate = new Date(_date);
myDate.setDate(myDate.getDate()+8);
$('#estimated_hatching_date').text(myDate);
alert( myDate);
}
});
The first issue is, how the date is presented. Currently that code above alerts Fri Oct 01 2010 17:00:00 GMT-0700 (Pacific Daylight Time). I would like the output to be just the date, for example, 09/06/2010.
The second issue is, $('#estimated_hatching_date').text(myDate); does not change the text. When that code is fired nothing is changed. However if I do: $('#estimated_hatching_date').text('myDate'); myDate is placed into the #estimated_hatching_date div.
So, how do I just output the date and replace the "text" inside of #estimated_hatching_date div with just the date +7 days from when a date is selected?
Thank You, Rich