Datepicker Widget wiki
code
<script>
// $( "#datepicker" ).datepicker();
$("#datepicker").datepicker({
// The hidden field to receive the date
altField: "#dateHidden",
// The format you want
altFormat: "yy/mm/dd",
// The format the user actually sees
dateFormat: "yy/mm/dd",
onSelect: function (date) {
$("#check_day").val(date);
updatePreferentialScheme();
}<?php
$executeStr="";
if(count($disableDateList["disableWeekDayList"])>0){
foreach($disableDateList["disableWeekDayList"] as $key=>$value)
{
if($executeStr=="")
{
$executeStr="date.getDay() != $value";
}
else
{
$executeStr.=" && date.getDay() != $value";
}
}
}
if(count($disableDateList["disableDateRangeList"])>0){
foreach($disableDateList["disableDateRangeList"] as $item)
{
if($executeStr=="")
{
$executeStr="!(date.Format(\"yyyy-MM-dd\")>='".date("Y-m-d",$item[0])."' && date.Format(\"yyyy-MM-dd\")<='".date("Y-m-d",$item[1])."') ";
}
else
{
$executeStr.=" && !(date.Format(\"yyyy-MM-dd\")>='".date("Y-m-d",$item[0])."' && date.Format(\"yyyy-MM-dd\")<='".date("Y-m-d",$item[1])."') ";
}
}
}
if($executeStr!=""){
?>,beforeShowDay: function(date){
return [<?php echo $executeStr;?>,""];}
<?php }
if(count($disableDateList["ableDateRangeList"])>0){
echo ",";
$configStr="";
foreach($disableDateList["ableDateRangeList"] as $item)
{
$time1=strtotime(date("Y-m-d",strtotime(date("Y-m-d",$item[0])." -1 month")));
$time2=strtotime(date("Y-m-d",strtotime(date("Y-m-d",$item[1])." -1 month")));
$item[0]=$time1;
$item[1]=$time2;
?>
minDate: new Date(<?php echo date("Y",$item[0])?>, <?php echo date("m",$item[0])?>, <?php echo date("d",$item[0])?>),
maxDate:new Date(<?php echo date("Y",$item[1])?>, <?php echo date("m",$item[1])?>, <?php echo date("d",$item[1])?>)
<?php
}
}?>
});
</script>