Example #1
0
<!--multidatespicker-set-->
<script>
    var dates = new Array();
    var out_of_dates = <?php 
echo empty($place->out_of_dates) || $place->out_of_dates === 'null' ? '[]' : $place->out_of_dates;
?>
;
    out_of_dates.push(new Date()); //当天不可预约

    $(function () {
        var today = new Date();

        $('#custom-date-format').multiDatesPicker({
            /*addDisabledDates: [<?php 
$places = PlaceBooking::Model()->findAllByAttributes(array('place_id' => $place->id, 'status' => 1));
$dates = CHtml::listData($places, "id", "date");
array_push($dates, date('Y-m-d'));
foreach ($dates as $date) {
    echo "new Date('{$date}'),";
}
?>
],*/ //设置不能不能预约的日期
            addDisabledDates: out_of_dates,
            minDate: 0, //设置最小日期
            //addDates: out_of_dates,
            //maxDate: 30 | 设置最大日期
            adjustRangeToDisabled: true
        });
        <?php 
if ($this->_cookiesGet('userType') != 'master') {