我使用 jquery Datepicker [链接:http://docs.jquery.com/UI/Datepicker] 现在,如果我想设置一些日期来突出显示,而不仅仅是现在突出显示日期,我该如何设置该选项?
For example:
![enter image description here](https://i.stack.imgur.com/BO2BY.png)
我想重点强调 24/09/2011、25/09/2011 和 27/09/2011。
你必须使用beforeShowDay
option:
var dates = []; // array of the dates you want to highlight, stored as strings
$('selector').datepicker({
beforeShowDay: function(date) {
if ($.inArray(date.toString(), dates) != -1) {
return [true, 'highlight'];
}
}
});
请参阅此问题以获取更多信息:
jQuery UI 日期选择器可以禁用周六和周日(以及节假日)吗?
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)