OK - almost there. I can now select a date from the big calendar
and it is input into the textbox.
This is my code now:-
<script
type="text/javascript">
$(function()
{
$.datepicker.setDefaults({ dateFormat: '<?php echo
$bsiCore->config['conf_dateformat'];?>', minDate: new Date(),
numberOfMonths: 1 });
$("#txtFromDate1").datepicker(
{ beforeShowDay: function(day)
{
var day =
day.getDay();
if (day == <?php echo
$bsiCore->config['conf_week_checkin_day'];?> )
{
return [true,
"somecssclass"]
} else
{
return [false,
"someothercssclass"]
}
}
});
$('#btn_appmt_search').click(function()
{
if($('#txtFromDate1').val()==""){
alert('Please
Select Check In Date.');
return
false;
} else
{
return
true;
}
});
var unavailableDates =
[<?php echo substr($dateRange, 0, -1);?>]; //
yyyy/MM/dd
function
unavailable(date) {
ymd = date.getFullYear() +
"-" + ("0"+(date.getMonth()+1)).slice(-2) +
"-" +
("0"+date.getDate()).slice(-2);
day =
new Date(ymd).getDay();
if ($.inArray(ymd,
unavailableDates) < 0 ) {
return
[true, "enabled",
"Available"];
} else
{
return
[false,"disabled","Booked
Out"];
}
}
$('#iDate').datepicker({
beforeShowDay: unavailable,
minDate:0
,
onSelect:
function(dateText){
$("#txtFromDate1").val(dateText);
}
});
});
</script>
I tried removing references to 'txtFromDate1' but that just makes
the big calendar disappear.
I still have to work out how to just enable 'Saturdays' as
clickable (the check-in day). The code is there - but obviously in the
wrong place.
if (day == <?php echo
$bsiCore->config['conf_week_checkin_day'];?> ) {
If you go to October 2014, only 4, 11 and 25 should be clickable.
and the calendar still pops up when I click inside the blue
'Check-in Date' box.