我希望我的本地化日期选择器不允许某些日期选择.
@H_403_2@本土化:
$("#datepicker").datepicker($.datepicker.regional["fr"]);@H_403_2@没有周末:
$("#datepicker").datepicker({ beforeShowDay: $.datepicker.noWeekends })@H_403_2@我无法弄清楚如何将两者结合起来?
解决方法
$.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);@H_403_2@Demo (see example 5)