我想禁用前一个日期。例如,如果选择开始日期为 2015-04-01,则结束日期只能从 2015-04-01 开始。应禁用先前的日期。
$(document).ready(function () {
var nowdate = new Date();
var now = new Date(nowdate.getFullYear(), nowdate.getMonth(), nowdate.getDate(), 0, 0, 0, 0);
var startdate = $("#start_date").datepicker({
format: 'yyyy-mm-dd',
onRender: function (date) {
return date.valueOf() > now.valueOf() ? 'disabled' : '';
}
}).on('changeDate', function (ev) {
startdate.hide();
}).data('datepicker');
var enddate = $("#end_date").datepicker({
format: 'yyyy-mm-dd',
onRender: function (date) {
return date.valueOf() > now.valueOf() ? 'disabled' : '';
}
}).on('changeDate', function (ev) {
enddate.hide();
}).data('datepicker');
});
Run Code Online (Sandbox Code Playgroud)
谢谢
这是我的座位清单安排的例子.我必须显示一些座位对齐方式的变化.
$rows=($data['seat_type']==1)?3:4;
$cols=round($numofseats /$rows) ;
$rowCssPrefix= 'row-';
$colCssPrefix= 'col-';
$seatWidth= 35;
$seatHeight= 35;
$seatCss= 'seat';
$selectedSeatCss= 'selectedSeat';
$selectingSeatCss= 'selectingSeat';
$window_rows = ($data['seat_type']==1) ? array(0,2) :array(0,3);
for ($i = 0; $i < $rows; $i++) {
$seat_w=(in_array($i,$window_rows))?'W':'A';
for ($j = 0; $j < $cols; $j++) {
$seatNo = ($i + $j * $rows + 1);
if($seatNo <= $numofseats)
{
$className = $seatCss . ' '.$rowCssPrefix .$i.' '.$colCssPrefix .$j; if($j % $cols==0) echo '<br>';
if(!in_array($seatNo,$booked_seats)) {
echo'<li class="' . $className.'" style="top:'. ($i *$seatHeight).'px;left:'. …Run Code Online (Sandbox Code Playgroud)