[英]beforeShowDate in DatePicker is always true when list is return
当我返回列表时,DatePicker中的beforeShowDate始终为true。 如果返回的是“ true”或“ false”,则说明该方法有效。 我认为它看到一个列表(不为null)。 我做错了什么? 我的目的是自定义日历中的某些天。
代码: https : //jsfiddle.net/alex09/j9co36br/34/
JS
$("#date").datepicker({
autoclose: true,
language: 'fr',
format: 'dd/mm/yyyy',
beforeShowDay: jourDispo
});
function jourDispo(date) {
console.log("I'm in jourDispo");
// This is working
// return false;
// but not with array
return [false, "red"];
}
的HTML
<table>
<tr>
<td>
<div class="input-group">
<label class="control-label requiredField" for="date">
Date *
</label>
</div>
</td>
<td>
<input class="form-control date_size" id="date" name="date" placeholder="JJ/MM/AAAA" type="text" required />
</td>
</tr>
</table>
的CSS
.red a{
background-color: #ffb3b3 !important;
background-image: none !important;
color: White !important;
font-weight: bold !important;
font-size: 12pt;
}
它可能与资源链接在一起,因此您可以找到我在页面中使用的所有资源(参见jsfiddle)。
谢谢 !
实际上,您正在使用引导日期选择器,并引用jQuery UI日期选择器文档。
所以用一个对象更新它:
function jourDispo(date) {
return { enabled : false, classes : "red" };
}
工作演示: JSFIDDLE
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.