I need some help – I have tried setting setSpecificDate so that the array I fetch (and have formatted) from the db will load correctly. When I print $dates_booked the format is 100% correct “yyyy-mm-dd” – any help / advice will be appreciated.
More info about the datepicker / associated code : http://www.triconsole.com/php/calendar_datepicker.php
Thanks in advance!
My Code:
$datesArray = Array();
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$datesArray[] = $row['reserved_date'];
$dates_booked=implode(",",$datesArray);
$arrtrans = array();
$arrtrans[","] = '"'.",".'"';
$dates_booked = strtr($dates_booked,$arrtrans);
$dates_booked= '"'.$dates_booked.'"';
}
$myCalendar = new tc_calendar("date5", true, false);
$myCalendar->setIcon("calendar/images/iconCalendar.gif");
$myCalendar->setDate(date('d'), date('m'), date('Y'));
$myCalendar->setPath("calendar/");
$myCalendar->setYearInterval(2012, 2020);
$myCalendar->dateAllow(date("Y-m-d"), '2020-01-01');
$myCalendar->setDateFormat('j F Y');
//$myCalendar->setHeight(350);
// $myCalendar->autoSubmit(true, "form1");
$myCalendar->setAlignment('left', 'bottom');
// Problematic Line
$myCalendar->setSpecificDate(array('.$dates_booked.'
), 0, '');
$myCalendar->writeScript();
This mess:
is totally useless. Yuo need only this: