I am using the beforeShowDay function to highlight days that match a MySQL query of 'used' dates.
My datepicker set-up looks like this:
dp = jQuery( "#datepicker" ).datepicker(
{
minDate: +1,
maxDate: "+1M",
dateFormat: 'yyyy-mm-dd',
beforeShowDay: function(date) {
q = q_dates[date];
}
}
);
The problem is that the value of DATE looks like this: Mon May 27 2013 00:00:00 GMT+0700 (SE Asia Standard Time)
I've tried setting the dateFormat. Also tried date.toString('yyyy-mm-dd') thinking it would work like a Javascript date object.
How can I convert DATE to the format yyyy-mm-dd?