Here I send the movie ID and get the days available, and I want to set it to the calendar. but it does not work and disables all dates. With PHP, it returns a date string. The date string is correct, but the calendar does not work. Please, help.
Example line string
"28-02-2012","29-02-2012","01-03-2012","02-03-2012","03-03-2012","04-03-2012","05-03-2012","06-03-2012","07-03-2012","08-03-2012","09-03-2012","28-02-2012","29-02-2012","01-03-2012","02-03-2012","03-03-2012","04-03-2012","05-03-2012","06-03-2012","07-03-2012","08-03-2012","09-03-2012"
the code
jQuery.post('index.php', {
'option': 'com_movie',
'controller': 'reservation',
'task': 'datelist',
'format': 'raw',
'mid': movieid
}, function(result) {
var onlydates = result.split(',');
jQuery("#datepicker").datepicker({
dateFormat: 'yy-mm-dd',
showOn: "button",
buttonImage: "<?php echo IMAGES_LINK.'calendar.png';?>",
buttonImageOnly: true,
beforeShowDay: function(date) {
dmy = date.getDate() + "-" + (date.getMonth() + 1) + "-" + date.getFullYear();
console.log(dmy + ' : ' + (jQuery.inArray(dmy, onlydates)));
if (jQuery.inArray(dmy, onlydates) != -1) {
return [true, "", "Available"];
} else {
return [false, "", "unAvailable"];
}
}
});
return;
});