我希望我的本地化日期选择器不允许某些日期选择.
本土化:
$("#datepicker").datepicker($.datepicker.regional["fr"]);
没有周末:
$("#datepicker").datepicker({ beforeShowDay: $.datepicker.noWeekends })
我无法弄清楚如何将两者结合起来?
解决方法@H_404_14@
$.datepicker.regional属性属性包含一组本地化;它们本身就是
datepicker options的“预设”.要附加你的选项(必要时覆盖):
// use $.extend to merge preset options plus your options
$("#datepicker1")
.datepicker($.extend({},$.datepicker.regional.fr,{
beforeShowDay: $.datepicker.noWeekends
}));
// initialize the datepicker,then use .datepicker("option",options) method twice
$("#datepicker2")
.datepicker()
.datepicker("option",$.datepicker.regional.fr)
.datepicker("option","beforeShowDay",$.datepicker.noWeekends);
// use $.extend to merge preset options plus your options $("#datepicker1") .datepicker($.extend({},$.datepicker.regional.fr,{ beforeShowDay: $.datepicker.noWeekends })); // initialize the datepicker,then use .datepicker("option",options) method twice $("#datepicker2") .datepicker() .datepicker("option",$.datepicker.regional.fr) .datepicker("option","beforeShowDay",$.datepicker.noWeekends);